Changes

m
no edit summary
Line 27: Line 27:  
}
 
}
   −
-- * Definitions for parser/formatter.
+
-- * Definitions for formatter.
 
  −
local args_grammar = {
  −
node              = '^%s*(%a)%s*$',
  −
comma_list        = '[^,]+',
  −
ship_and_nodes    = '^%s*(.-)%s*:%s*(.-)%s*$',
  −
just_node        = '^%s*(%a)%s*$',
  −
node_and_diff    = '^%s*(%a)%s*/%s*(%S-)%s*$',
  −
node_diff_tooltip = '^%s*(%a)%s*/%s*(%S-)%s*{(.-)}%s*$',
  −
-- TODO:
  −
-- * just_node_tooltip
  −
-- * Add battle ranks:
  −
-- node_diff_rank = '^%s*(%a)%s*/%s*(%S-)%s*/%s*(%a)%s*$',
  −
-- * Hide difficulty:
  −
-- node_rank = '^%s*(%a)%s*//%s*(%a)%s*$',
  −
-- * Tooltips with extra info?
  −
}
      
local diff_colors = {
 
local diff_colors = {
Line 72: Line 56:  
}
 
}
   −
-- * parser/formatter.
+
local table_format = {
 +
header          = '{| class="article-table sortable ${classes}" align="center" width="100%" style="text-align:center;"\n!Type\n!<span style="border-bottom:1px dotted;">Ship<sup>[[Template:DropList/doc|?]]</sup></span>\n',
 +
header_node      = '!${node}\n',
 +
header_boss_node = '!style="background-color:#FFCDD2;color:red;"|\'\'\'${node}\'\'\'\n',
 +
row              = '|- class="toggle-target-droplist-non-rare-ship" style="display:none;"\n',
 +
rare_row        = '|-\n',
 +
type_cell        = '|${type}\n',
 +
-- TODO: japanese tooltips
 +
ship_cell        = '|[[${ship}|<span style="color:${color};">${ship}</span>]]\n',
 +
node_cell        = '|style="background-color:#${color};"|${diff}\n',
 +
empty_cell      = '|\n',
 +
footer          = '|}\n',
 +
debugger        = [[{| style="width:100%;" align="center" cellspacing="0" class="article-table mw-collapsible mw-collapsed"
 +
!Script warnings
 +
|-
 +
|<pre>${debug}</pre>
 +
|}]]
 +
}
 +
 
 +
-- * Definitions for parser.
 +
 
 +
local args_grammar = {
 +
node              = '^%s*(%a)%s*$',
 +
comma_list        = '[^,]+',
 +
ship_and_nodes    = '^%s*(.-)%s*:%s*(.-)%s*$',
 +
just_node        = '^%s*(%a)%s*$',
 +
node_and_diff    = '^%s*(%a)%s*/%s*(%S-)%s*$',
 +
node_diff_tooltip = '^%s*(%a)%s*/%s*(%S-)%s*{(.-)}%s*$',
 +
-- TODO:
 +
-- * just_node_tooltip
 +
-- * Add battle ranks:
 +
-- node_diff_rank = '^%s*(%a)%s*/%s*(%S-)%s*/%s*(%a)%s*$',
 +
-- * Hide difficulty:
 +
-- node_rank = '^%s*(%a)%s*//%s*(%a)%s*$',
 +
-- * Tooltips with extra info?
 +
}
 +
 
 +
-- * Parser.
    
function parseArgs(args)
 
function parseArgs(args)
Line 192: Line 213:  
end
 
end
   −
local table_format = {
+
-- * Formatter.
header          = '{| class="article-table sortable ${classes}" align="center" width="100%" style="text-align:center;"\n!Type\n!<span style="border-bottom:1px dotted;">Ship<sup>[[Template:DropList/doc|?]]</sup></span>\n',
  −
header_node      = '!${node}\n',
  −
header_boss_node = '!style="background-color:#FFCDD2;color:red;"|\'\'\'${node}\'\'\'\n',
  −
row              = '|- class="toggle-target-droplist-non-rare-ship" style="display:none;"\n',
  −
rare_row        = '|-\n',
  −
type_cell        = '|${type}\n',
  −
-- TODO: japanese tooltips
  −
ship_cell        = '|[[${ship}|<span style="color:${color};">${ship}</span>]]\n',
  −
node_cell        = '|style="background-color:#${color};"|${diff}\n',
  −
empty_cell      = '|\n',
  −
footer          = '|}\n',
  −
debugger        = [[{| style="width:100%;" align="center" cellspacing="0" class="article-table mw-collapsible mw-collapsed"
  −
!Script warnings
  −
|-
  −
|<pre>${debug}</pre>
  −
|}]]
  −
}
      
function showTable(tbl)
 
function showTable(tbl)
cssedit, gkautomate
7,064

edits