Jump to content

User:SoledadKabocha/common-rewrite.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SoledadKabocha (talk | contribs) at 06:08, 19 December 2018 (part 1: "Initialize constants that do not depend on properties of mw"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// What is this? See talk

//
// Initialize constants that do not depend on properties of mw
//
var dt   = new Date( );
var dtH  = dt.getHours( );
var dtM  = dt.getMinutes( );
var dtUDm = dt.getUTCDate( );
var dtUDw = dt.getUTCDay( );

// toggle uncat display (potentially) every 20 minutes,
// with the boundary of the 20-min intervals shifted by +/- 1 min
// based on something slowly varying (i.e. my edit count)
var dtUnitMapping = [
  Math.min( dtH + dtUDw, dtUDm ),
  dtH,
  Math.max( dtH + dtUDw, dtUDm )
];
// rest of this logic needs mw.config.get; see below

//using gadget
LocalComments = {
	dateDifference: true,
	dateFormat: 'dmy',
	timeFirst: true,
	twentyFourHours: true,
	dayOfWeek: true,
	dropDays: 121,
	dropMonths: 30
};