MediaWiki:Common.js
From MCS
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
/* Any JavaScript here will be loaded for all users on every page load. */
mwCustomEditButtons.push({
"imageFile": "images/Button_enter.png",
"speedTip": "Line break",
"tagOpen": "<br />",
"tagClose": "",
"sampleText": ""
});
mwCustomEditButtons.push({
"imageFile": "images/Button_upper_letter.png",
"speedTip": "Superscript",
"tagOpen": "<sup>",
"tagClose": "</sup>",
"sampleText": "Superscript text"
});
mwCustomEditButtons.push({
"imageFile": "images/Button_small.png",
"speedTip": "Small",
"tagOpen": "<small>",
"tagClose": "</small>",
"sampleText": "Small Text"
});
mwCustomEditButtons.push({
"imageFile": "images/Button_gallery.png",
"speedTip": "Insert a picture gallery",
"tagOpen": "\n<gallery widths=200px heights=320px perrow=3>\n",
"tagClose": "\n</gallery>",
"sampleText": "Image:MCS_Example1.png|''Caption1''\nImage:MCS_Example2.png|''Caption2''"
});
var today = new Date();
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
var stndrdth = ["th","st","nd","rd","th","th","th","th","th","th"];
var dayth = today.getDate() % 10;
mwCustomEditButtons.push({
"imageFile": "images/Button_insert_table.png",
"speedTip": "Insert a table",
"tagOpen": '{| class="wikitable" border="1"\n|- bgcolor="silver"\n',
"tagClose": "\n|}\n",
"sampleText": "! header1 !! header2 !! header3\n|-\n| cell1 || cell2 || cell3"
});
mwCustomEditButtons.push({
"imageFile": "images/Button_comment.png",
"speedTip": "Insert a comment",
"tagOpen": '{{comment|text=',
"tagClose": "\n|sign=[[User:"+wgUserName+"]]|date="+today.getDate()+"/"+(today.getMonth()+1)+"/"+today.getFullYear()+" "+today.getHours()+":"+today.getMinutes()+":"+today.getSeconds()+"}}\n",
"sampleText": "Your Comment Here"
});