Jump to content

MediaWiki:Common.js/edit.js: Difference between revisions

adjusting URLs to our wiki and restoring our old custom default toolbar layout
(dropping in "dev" version from 2012 which apparently was supposed to fix problems caused by MW update)
(adjusting URLs to our wiki and restoring our old custom default toolbar layout)
Line 16: Line 16:
  */
  */


mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:MarkS/XEB/live.css&action=raw&ctype=text/css', 'text/css' );
mw.loader.load( '//wiki.oni2.net/MediaWiki:live.css&action=raw&ctype=text/css', 'text/css' );


if (typeof XEBPopups === 'undefined') {
if (typeof XEBPopups === 'undefined') {
Line 34: Line 34:
}
}


var Isrc = '//upload.wikimedia.org/wikipedia/commons/';
var Isrc = '//wiki.oni2.net/w/images/';


var BDict = {
var BDict = {
'A': ['e/e9/Button_headline2.png', 'Secondary headline', '\n===', '===', 'Secondary headline'],
'A':['e/e9/Button_headline2.png','Third-level headline','\n===','===','Secondary headline'],
'B': ['1/13/Button_enter.png', 'Line break', '<br />', '', ''],
'B':['1/13/Button_enter.png','Line break','<br />','',''],
'C': ['5/5f/Button_center.png', 'Center', '<div style="text-align: center;">\n', '\n<\/div>', 'Centred text'],
'C':['f/f7/Button_align_center.png','Center-aligned text','<div style="text-align: center;">\n','\n<\/div>','Centered text'],
'D': ['e/ea/Button_align_left.png', 'Left-Align', '<div style="text-align: left; direction: ltr; margin-left: 1em;">\n', '\n<\/div>', 'Left-aligned text'],
'D':['e/ea/Button_align_left.png','Left-aligned text','<div style="text-align: left; direction: ltr; margin-left: 1em;">\n','\n<\/div>','Left-aligned text'],
'D1': ['a/a5/Button_align_right.png', 'Right-Align', '<div style="text-align: right; direction: ltr; margin-left: 1em;">\n', '\n<\/div>', 'Right-aligned text'],
'D1':['a/a5/Button_align_right.png','Right-aligned text','<div style="text-align: right; direction: ltr; margin-left: 1em;">\n','\n<\/div>','Right-aligned text'],
'E': ['0/04/Button_array.png', 'Table', '\n{| class="wikitable" \n|- \n| 1 || 2\n|- \n| 3 || 4', '\n|}\n', ''],
'E':['7/79/Button_cmpl_table.png','Smart Table','\n{| class="wikitable" \n|- \n| 1 || 2\n|- \n| 3 || 4','\n|}\n',''],
'F': ['1/1e/Button_font_color.png', 'Insert coloured text', '<span style="color: ', '">Coloured text<\/span>', 'ColourName'],
'F':['1/1e/Button_font_color.png','Colored text','<span style="color: ','">Colored text<\/span>','ColorName'],
'FS': ['1/1b/Button_miss_signature.png', 'Unsigned post', '<small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:', '|', ']] ([[User talk:', '|talk]] • [[Special:Contributions/', '|contribs]]) date</span></small><!-- Template:Unsigned -->', 'user name or IP'],
'FS':['6/6d/Button_unsigned.png','Unsigned post','{{subst:unsigned|','|date}}','user name or IP'],
'G': ['9/9e/Btn_toolbar_gallery.png', 'Picture gallery', "\n<gallery>\nImage:", "|[[M63]]\nImage:Mona Lisa.jpg|[[Mona Lisa]]\nImage:Truite arc-en-ciel.jpg|Eine [[Forelle ]]\n<\/gallery>", 'M63.jpg'],
'G':['1/12/Button_gallery.png','Image gallery',"\n<gallery>\nImage:","|[[M63]]\nImage:Mona Lisa.jpg|[[Mona Lisa]]\nImage:Truite arc-en-ciel.jpg|Eine [[Forelle ]]\n<\/gallery>",'M63.jpg'],
'H': ['7/74/Button_comment.png', 'Comment', "<!--", "-->", 'Comment'],
'H':['7/74/Button_comment.png','Comment',"<!--","-->",'Comment'],
'I1': ['6/6a/Button_sup_letter.png', 'Superscript', '<sup>', '<\/sup>', 'Superscript text'],
'I1':['d/d6/Button_superscript.png','Superscript','<sup>','<\/sup>','Superscript text'],
'I2': ['a/aa/Button_sub_letter.png', 'Subscript', '<sub>', '<\/sub>', 'Subscript text'],
'I2':['b/bf/Button_subscript.png','Subscript','<sub>','<\/sub>','Subscript text'],
'J1': ['5/58/Button_small.png', 'Small', '<small>', '<\/small>', 'Small Text'],
'J1':['d/d5/Button_small_text.png','Small text','<small>','<\/small>','Small Text'],
'J2': ['5/56/Button_big.png', 'Big text', '<big>', '<\/big>', 'Big text'],
'J2':['9/99/Button_big_text.png','Big text','<big>','<\/big>','Big text'],
'K': ['b/b4/Button_category03.png', 'Category', "[[Category:", "]]", 'Category name'],
'K':['1/11/Button_category.png','Category',"[[Category:","]]",'Category name'],
'L': ['8/8e/Button_shifting.png', 'Insert tab(s)', ':', '', ':'],
'L':['e/e2/Button_tab_in.png','Insert tab',':','',':'],
'M': ['f/fd/Button_blockquote.png', 'Insert block of quoted text', '<blockquote style="border: 1px solid blue; padding: 2em;">\n', '\n<\/blockquote>', 'Block quote'],
'M':['f/fd/Button_blockquote.png','Quoted text block','<blockquote style="border: 1px solid blue; padding: 2em;">\n','\n<\/blockquote>','Block quote'],
'N': ['4/4b/Button_nbsp.png', 'nonbreaking space', '&nbsp;', '', ''],
'N':['4/4b/Button_nbsp.png','Insert non-breaking space','&nbsp;','',''],
'O': ['2/23/Button_code.png', 'Insert code', '<code>', '<\/code>', 'Code'],
'O':['2/23/Button_code.png','Code block','<code>','<\/code>','Code'],
'P': ['3/3c/Button_pre.png', 'Pre formatted Text', '<pre>', '<\/pre>', 'Pre formatted text'],
'P':['3/3c/Button_pre.png','Pre-formatted text block','<pre>','<\/pre>','Pre-formatted text'],
'P1': ['9/93/Button_sub_link.png', 'Insert link to sub-page', '[[', '/Sub_Page]]', 'Page'],
'P1':['2/2e/Button_subpage.png','Link to sub-page','[[','/Sub_Page]]','Page'],
'Q': ['d/d3/Button_definition_list.png', 'Insert definition list', '\n; ', '\n: Item 1\n: Item 2', 'Definition'],
'Q':['1/1f/Button_list_tab.png','Definition (tabbed) list','\n; ','\n: Item 1\n: Item 2','Definition'],
'R': ['7/79/Button_reflink.png', 'Insert a reference', '<ref>', '<\/ref>', 'Insert reference material'],
'R':['e/ef/Button_reflink_start.png','Insert a reference','<ref>','<\/ref>','Insert reference material'],
'R1': ['7/79/Button_reflink.png', 'Start a reference', '<ref name="', '', 'Reference name'],
'R1':['5/5f/Button_reflink_smart.png','Reference Wizard','<ref name="','','Reference name'],
'R2': ['9/99/Button_reflink_advanced_2.png', 'Insert reference material', '">', '</ref>', 'Reference material'],
'R2':['c/cb/Button_reflink_footer.png','Insert reference footer',"<references/>",'',''],
'R3': ['1/1a/Button_reflink_advanced_3.png', 'No reference material', '', '"/>', ''],
'R3': ['1/1a/Button_reflink_advanced_3.png', 'No reference material', '', '"/>', ''],
'R4': ['9/9a/Button_references.png', 'Reference footer', "\n==Notes==\n<!--See http://en.wikipedia.org/wiki/Wikipedia:Footnotes for an explanation of how to generate footnotes using the <ref(erences/)> tags-->\n<div class=\'references-small\'>\n<references/>\n</div>", '', ''],
'R4': ['9/9a/Button_references.png', 'Reference footer', "\n==Notes==\n<!--See http://en.wikipedia.org/wiki/Wikipedia:Footnotes for an explanation of how to generate footnotes using the <ref(erences/)> tags-->\n<div class=\'references-small\'>\n<references/>\n</div>", '', ''],
'S': ['c/c9/Button_strike.png', 'Strikeout', '<s>', '<\/s>', 'Struck out text'],
'S':['c/c9/Button_strike.png','Strikeout text','<s>','<\/s>','Struck-out text'],
'T': ['e/eb/Button_plantilla.png', 'Template', '{{', '}}', 'Template name'],
'T':['5/59/Button_template.png','Template','{{','}}','Template name'],
'TS': ['a/a4/TableStart.png', 'Start a table', '{|', '', ''],
'TS':['a/a1/Button_table_start.png','Start a table','{|','',''],
'TC': ['7/71/TableCell.png', 'Table cell', '|', '', ''],
'TC':['5/59/Button_table_cell.png','Table cell','|','',''],
'TE': ['0/06/TableEnd.png', 'End a table', '', '|}', ''],
'TE':['f/f0/Button_table_end.png','End a table','','|}',''],
'TR': ['4/4c/TableRow.png', 'Start a table row', '|-', '', ''],
'TR':['7/70/Button_table_row.png','Start a table row','|-','',''],
'T1': ['3/30/Tt_icon.png', 'Teletype text', '<tt>', '<\/tt>', 'Teletype Text'],
'T1':['8/82/Button_teletype.png','Teletype text','<tt>','<\/tt>','Teletype Text'],
'TL': ['3/37/Button_tl_template.png', 'Template link', "{{subst:" + "tl|", '}}', 'Template name'],
'TL':['d/d3/Button_subst_tmpl.png','Template (substituted)',"{{subst:"+"tl|",'}}','Template name'],
'U': ['f/fd/Button_underline.png', 'Underlined', "<u>", "<\/u>", 'Underlined text'],
'U':['f/fd/Button_underline.png','Underlined text',"<u>","<\/u>",'Underlined text'],
'V': ['c/c8/Button_redirect.png', 'Redirect', "#REDIRECT [[", "]]", 'Article Name'],
'V':['c/c8/Button_redirect.png','Redirect',"#REDIRECT [[","]]",'Article Name'],
'W': ['8/88/Btn_toolbar_enum.png', 'Numbering', "\n# ", "\n# Element 2\n# Element 3", 'Element 1'],
'W':['5/50/Button_list_num.png','Numbered list',"\n# ","\n# Element 2\n# Element 3",'Element 1'],
'X': ['1/11/Btn_toolbar_liste.png', 'List', "\n* ", "\n* Element B\n* Element C", 'Element A'],
'X':['f/fa/Button_list_bull.png','Bulleted list',"\n* ","\n* Element B\n* Element C",'Element A'],
'Y1': ['c/ce/Button_no_include.png', 'No Include', "<noinclude>", "<\/noinclude>", 'Text'],
'Y1':['d/d5/Button_noinclude.png','No include',"<noinclude>","<\/noinclude>",'Text'],
'Y2': ['7/79/Button_include.png', 'Include only', "<includeonly>", "<\/includeonly>", 'Text'],
'Y2':['6/63/Button_includeonly.png','Include only',"<includeonly>","<\/includeonly>",'Text'],
'Z': ['3/35/Button_substitute.png', 'Substitute', "{{subst:", "}}", 'Template'],
'Z':['3/35/Button_substitute.png','Substituted page link',"{{subst:","}}",'Template'],
'AI': ['1/1c/Button_advanced_image.png', 'Advanaced Image', "[[Image:", "|thumb|right|px|Caption]]", 'FileName.jpg'],
'AI':['c/cc/Button_adv_image.png','Advanced image',"[[Image:","|thumb|right|px|Caption]]",'FileName.jpg']
'GEO': ['b/b8/Button_Globe.png', 'Geo location', "", "", ""],
'GEO': ['b/b8/Button_Globe.png', 'Geo location', "", "", ""],
'TALK': ['4/49/Button_talk.png', 'Add talk template', "", "", ""]
'TALK': ['4/49/Button_talk.png', 'Add talk template', "", "", ""]
};
};


Line 103: Line 103:
if (typeof XEBOrder !== 'string') {
if (typeof XEBOrder !== 'string') {
// can be modified
// can be modified
XEBOrder2 = 'A,D,C,D1,F,U,J1,E,G,Q,W,X,K,L,H,O,R,T'.split(',');
XEBOrder2 = '0,1,U,F,D,C,D1,4,A,2,3,E,G,8,H,9'.split(',');
} else if (XEBOrder.toLowerCase() === 'all') {
} else if (XEBOrder.toLowerCase() === 'all') {
$.each(BDict, function( b, value ){
$.each(BDict, function( b, value ){