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. */
// Create the "dev" namespace if it doesn't exist already:
window.dev = window.dev || {};
// Create the sub-namespace for this addon and set some options:
window.dev.editSummaries = {
css: '#stdSummaries { ... }',
select: [
'(click to browse)',
'1. Content', [
'Page created',
'Updated with new information',
'Expanded/Rewrote',
'Revised',
'Added sources/appearances',
'Updated links',
'Updated references',
'Added/removed image(s)',
'Modified image(s)',
'Replaced duplicate image(s)'
],
'2. Refactoring', [
'Fixed typo',
'Cleanup',
'Corrected spelling/grammar',
'Corrected tense',
'Factual correction',
'Formatting',
'HTML tidying',
'Corrected template usage',
'Restored design from the previous edit'
],
'3. Removal/Reversion', [
'Reverted vandalism',
'Reverted test edit',
'Reverted vanity edit',
'Removed fanon',
'Removed libel/slander',
'Removed copyvio'
],
'4. Templates', [
'Added template(s)',
'Added infobox',
'Updated infobox',
'Added disambig template',
'Added quote',
'Modified quotes'
],
'5. Categories', [
'Added category',
'Modified category',
'Alphabetized categories'
]
]
};
importArticles({ type: 'script', articles: [
'u:dev:Standard_Edit_Summary/code.js',
'u:dev:MediaWiki:FloatingTableHeader/Code.js',
]
});
window.ajaxSpecialPages = ['WikiActivity', 'Recentchanges'];
/* negative and positive values get colored accordingly */
$(function() {
$('.ProdTable td').each(function(index) {
switch (($(this).text() || '').trim().slice(0,1)) {
case '+':
$(this).css('color','lime');
break;
case '-':
$(this).css('color','red');
break;
}
});
});
/* Auto background coloring according to age */
$(function() {
$('.AgeTable td:first-child').each(function(index) {
switch (($(this).text() || '').trim()) {
case 'NA':
case 'No Age':
$(this).addClass("ColorNA");
break;
case 'SA':
case 'Stone Age':
$(this).addClass("ColorSA");
break;
case 'BA':
case 'Bronze Age':
$(this).addClass("ColorBA");
break;
case 'IA':
case 'Iron Age':
$(this).addClass("ColorIA");
break;
case 'EMA':
case 'Early Middle Ages':
$(this).addClass("ColorEMA");
break;
case 'HMA':
case 'High Middle Ages':
$(this).addClass("ColorHMA");
break;
case 'LMA':
case 'Late Middle Ages':
$(this).addClass("ColorLMA");
break;
case 'CA':
case 'Colonial Age':
$(this).addClass("ColorCA");
break;
case 'INA':
case 'Industrial Age':
$(this).addClass("ColorINA");
break;
case 'PE':
case 'Progressive Era':
$(this).addClass("ColorPE");
break;
case 'ME':
case 'Modern Era':
$(this).addClass("ColorME");
break;
case 'PME':
case 'Postmodern Era':
$(this).addClass("ColorPME");
break;
case 'CE':
case 'Contemporary Era':
$(this).addClass("ColorCE");
break;
case 'TE':
case 'Tomorrow Era':
$(this).addClass("ColorTE");
break;
case 'FE':
case 'Future Era':
$(this).addClass("ColorFE");
break;
case 'AF':
case 'Arctic Future':
$(this).addClass("ColorAF");
break;
case 'OF':
case 'Oceanic Future':
$(this).addClass("ColorOF");
break;
case 'VF':
case 'Virtual Future':
$(this).addClass("ColorVF");
break;
case 'SAM':
case 'Space Age Mars':
$(this).addClass("ColorSAM");
break;
case 'SAC':
case 'Space Age Ceres':
$(this).addClass("ColorSAC");
break;
}
});
});
$(function() {
$('.AgeTable th').each(function(index) {
switch (($(this).text() || '').trim()) {
case 'NA':
case 'No Age':
$(this).addClass("ColorNA");
break;
case 'SA':
case 'Stone Age':
$(this).addClass("ColorSA");
break;
case 'BA':
case 'Bronze Age':
$(this).addClass("ColorBA");
break;
case 'IA':
case 'Iron Age':
$(this).addClass("ColorIA");
break;
case 'EMA':
case 'Early Middle Ages':
$(this).addClass("ColorEMA");
break;
case 'HMA':
case 'High Middle Ages':
$(this).addClass("ColorHMA");
break;
case 'LMA':
case 'Late Middle Ages':
$(this).addClass("ColorLMA");
break;
case 'CA':
case 'Colonial Age':
$(this).addClass("ColorCA");
break;
case 'INA':
case 'Industrial Age':
$(this).addClass("ColorINA");
break;
case 'PE':
case 'Progressive Era':
$(this).addClass("ColorPE");
break;
case 'ME':
case 'Modern Era':
$(this).addClass("ColorME");
break;
case 'PME':
case 'Postmodern Era':
$(this).addClass("ColorPME");
break;
case 'CE':
case 'Contemporary Era':
$(this).addClass("ColorCE");
break;
case 'TE':
case 'Tomorrow Era':
$(this).addClass("ColorTE");
break;
case 'FE':
case 'Future Era':
$(this).addClass("ColorFE");
break;
case 'AF':
case 'Arctic Future':
$(this).addClass("ColorAF");
break;
case 'OF':
case 'Oceanic Future':
$(this).addClass("ColorOF");
break;
case 'VF':
case 'Virtual Future':
$(this).addClass("ColorVF");
break;
case 'SAM':
case 'Space Age Mars':
$(this).addClass("ColorSAM");
break;
case 'SAC':
case 'Space Age Ceres':
$(this).addClass("ColorSAC");
break;
}
});
});
/*Table wrapping*/
var myTables = document.getElementsByClassName("WrapTable");
for(var j=0;j<myTables.length;j++)
{
var myTable = myTables[j];
var myDiv = myTable.parentElement;
var newTable = document.createElement("table");
newTable.setAttribute("class", myTable.className.replace(/\bWrapTable\b/g, ""));
newTable.innerHTML = myTable.innerHTML;
myTable.style.width = "49.5%";
newTable.style.cssText = myTable.style.cssText;
myTable.style.float = "left";
newTable.style.float = "rigth";
myTable.parentNode.insertBefore(newTable, myTable.nextSibling);
var rows = myTable.getElementsByTagName("tr");
var rowsCopy = newTable.getElementsByTagName("tr");
//start from 1 instead of 0 because first row are the headers
for(var i=1;i<rows.length;i++)
{
if(i>(rows.length/2))
{
rows[i].style.display = "none";
}else
{
rowsCopy[i].style.display = "none";
}
}
}