User:Richwales/global.js

From Meta, a Wikimedia project coordination wiki

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.
/* copied from en:User:Richwales/common.js -- 03:50, 19 January 2015 (UTC) */
 
// different background colours if using HTTP vs. HTTPS
document.body.style.background = "none";
if (document.URL.match(/^https:/))
     document.body.style.backgroundColor = "#eeffff";
else document.body.style.backgroundColor = "#ffcccc";
 
// bad-image blocking doesn't work properly -- don't use it
// /* block display of "bad" images */
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Mr.Z-man/badimages.js'&action=raw&ctype=text/javascript);
 
// SPI helper wizard
//mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Tim Song/spihelper.js&action=raw&ctype=text/javascript');
 
/* disable Wikipedia access keys/keyboard shortcuts */
ta = false;
 
// [[user:js/watchlist]]
// if (wgCanonicalSpecialPageName == 'Watchlist') 
//   importScript('user:js/watchlist.js');
 
/* options for "Syntax Highlighter" */
syntaxHighlighterConfig = {
        timeout: 1000
};
 

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Smith609/toolbox.js&action=raw&ctype=text/javascript')
 
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Richwales/live-edit-counter.js&action=raw&ctype=text/javascript');
 
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Dr_pda/prosesize.js&action=raw&ctype=text/javascript');

/* copied here from m:User:Richwales/common.js -- 03:56, 19 January 2015 (UTC) */
function addForceSummary()
{
    if(!/&action=edit/.test(window.location.href) && !/&action=submit/.test(window.location.href)) return;
    if(/&section=new/.test(window.location.href)) return;
    if(!document.forms.editform) return;
    document.forms.editform.wpSave.onclick = forceSummary;
    // The second invocation of this will cause extra annoyance if there is no edit summary present. If there *is* an edit summary, the dialog box will not appear.
    document.forms.editform.wpSave.onfocus = forceSummary;
}
function forceSummary()
{
    if(!document.forms.editform.wpSummary.value.replace(/^(?:\/\\*.*\\*\/)? *(.*) *$/,'$1'))
    {
        var r = prompt('Are you sure you want to submit without adding a summary?\nTo add a summary, type it in the box below:',document.forms.editform.wpSummary.value);
        if (r === null) { return false; }
        document.forms.editform.wpSummary.value = r;
    }
    return true;
}
$(addForceSummary);

/* Force preview */
/* by Marc Mongenet, 2006, fr.wikipedia. Modified to work for non-anons by Soxred93 */
/* [[User:Soxred93/forcepreview.js]] */
function forcePreview() {
  if (wgAction == "edit")
  {
    document.getElementById("wpSave").disabled=true;
    document.getElementById("wpSave").value = "Save (preview first)";
    document.getElementById("wpSave").style.fontWeight = "normal";
    document.getElementById("wpPreview").style.fontWeight = "bold";
  }
}
$(forcePreview);
 
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Dl2000/DateFix.js&action=raw&ctype=text/javascript');
 
mw.loader.load("//en.wikipedia.org/w/index.php?title=User:GregU/dashes.js&action=raw&ctype=text/javascript");
 
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Shubinator/DYKcheck.js&action=raw&ctype=text/javascript'); //DYKcheck tool
// fixedSidebar = "never";
 
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Writ Keeper/Scripts/orangeBar.js&action=raw&ctype=text/javascript');  // old orange notification bar
 
/* "Comments in Local Time" */
LocalComments = {
	dateDifference: false,
	dateFormat: 'dmy',
	timeFirst: true,
	twentyFourHours: true,
        dayOfWeek: false,
        dropDays: 93,
        dropMonths: 24
};
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Gary King/comments in local time.js&action=raw&ctype=text/javascript'); // invoke here, instead of via gadget, to be sure the option settings are seen
 
// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Richwales/markusers2.js&action=raw&ctype=text/javascript');