User:L3X1/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:L3X1/common.css. |
importScript('User:Lourdes/PageCuration.js'); // Linkback: [[User:Lourdes/PageCuration.js]]
importScript('User:Ucucha/duplinks.js'); // [[User:Ucucha/duplinks]]
importScript( 'User:Technical_13/Scripts/OneClickArchiver.js' ); // Backlink: [[User:Technical_13/Scripts/OneClickArchiver]]
importScript( 'User:MusikAnimal/responseHelper.js' ); // Backlink: [[User:MusikAnimal/responseHelper.js]]
importScript('User:Numbermaniac/goToTop.js'); // [[User:Numbermaniac/goToTop.js]]
importStylesheet('User:Rezonansowy/FloatHead.css');
importScript( 'User:Enterprisey/delsort.js' ); // Backlink: [[User:Enterprisey/delsort.js]]
importScript("User:Ocaasi/WikiLoveinstallscript.js");
// Provides several useful functions for rollback (custom edit summary, mark as bot edits and mass revert)
// by [[m:user:Hoo man]] <http://meta.wikimedia.org/wiki/User:Hoo_man/Scripts/Smart_rollback>
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Hoo_man/smart_rollback.js&action=raw&ctype=text/javascript');
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Blankpage' ) {
mw.loader.load( '/w/index.php?title=User:Murph9000/pagetriagestats-topreviewers.js&action=raw&content-type=text/javascript' );
}
importScript('User:Jackmcbarn/editProtectedHelper.js'); // Linkback: [[User:Jackmcbarn/editProtectedHelper.js]]
importScript('User:Primefac/revdel.js'); // [[User:Primefac/revdel]]
importScript('User:Dr_pda/prosesize.js'); // User:Dr pda/prosesize
importScript('User:Evad37/rater.js'); // [[User:Evad37/rater]]
mw.loader.load( 'https://wiki.riteme.site/w/index.php?title=User:Samwilson/TemplateWizard.js&action=raw&ctype=text/javascript' );
importScript( 'User:Enterprisey/reply-link.js' ); // Backlink: [[User:Enterprisey/reply-link.js]]
// <!--
/* Reverses the order of months and individual pages at [[User:L3X1/CSD log]]. Change the wgPageName check to use it on a different page.
* Known defects:
* * The table of contents is left where it is, in the collapsed table for 2017 (which is now near the bottom of the page).
* * The order on the table of contents isn't updated.
* Honestly, you're better off reordering the sections manually, except for the current month's one at the bottom, and maybe putting in javascript to make that one display at the top.
*/
function reverse_sections(context, tags)
{
var subspec = context + ' > ';
var spec = '';
for (var i = 0; i < tags.length; ++i)
{
spec += subspec + tags[i];
if (i == 0)
subspec = ', ' + subspec;
}
var l = $(spec).get();
var rev = [];
for (var i = 1; i < l.length; ++i)
if (l[i].tagName == 'H3')
{
rev = l.splice(0, i).concat(rev);
i = 0;
}
rev = l.concat(rev);
$(context).append(rev);
}
$(function()
{
if (mw.config.get('wgPageName') == 'User:L3X1/CSD_log')
{
// Reverse top-level sections. The table is for the {{hat}}/{{hab}} collapsers for each year; the div for the {{cot}}/{{cob}} collapsers for each month.
reverse_sections('#mw-content-text > .mw-parser-output', ['table', 'div', 'h3', 'ol']);
// Reverse sections within the year-level collapsed tables.
var num_tables = $('#mw-content-text > .mw-parser-output > table').length;
for (var i = 0; i < num_tables; ++i)
reverse_sections('#mw-content-text > .mw-parser-output > table:nth-of-type(' + (i+1) + ') > tbody > tr:nth-of-type(3) > td', ['div', 'h3', 'ol']);
// Reverse each list of pages.
$('#mw-content-text > .mw-parser-output ol').each(function(){ this.reversed='reversed'; var ol = $(this); ol.append(ol.children().get().reverse()); });
}
});
// -->