User:Hoof Hearted/monobook.js: Difference between revisions

fix red links to EnWp
(remove sections relying on red-link templates found on Wikimedia Commons - will hopefully make HotCat slightly faster)
(fix red links to EnWp)
Line 1: Line 1:
window.hotcat_translations_from_commons = true;
window.hotcat_translations_from_commons = true;
 
/*
/*
  This imports the latest version of HotCat from Commons.
  This imports the latest version of HotCat from Commons.
  HotCat is a gadget to make changes to categories much easier.
  HotCat is a gadget to make changes to categories much easier.
  Full documentation can be found at http://commons.wikimedia.org/wiki/Help:Gadget-HotCat
  Full documentation can be found at https://commons.Wikimedia.org/wiki/Help:Gadget-HotCat
*/
*/
mw.loader.load( '//commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//commons.Wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );
   
   
// See http://en.wikipedia.org/wiki/User:Cameltrader/Advisor.js/Description
// See https://en.Wikipedia.org/wiki/User:Cameltrader/Advisor.js/Description
// for details and installation instructions.
// for details and installation instructions.
//
//
Line 21: Line 21:
var ct = ct || {};
var ct = ct || {};
   
   
// == Helpers ==
// ==Helpers==
   
   
// === DOM manipulation ===
// ===DOM manipulation===
   
   
// Browsers offer means to highlight text between two given offsets (``start''
// Browsers offer means to highlight text between two given offsets (``start''
Line 129: Line 129:
// It is convenient to embed in a help popup.
// It is convenient to embed in a help popup.
ct.hlink = function (toWhat, text) {
ct.hlink = function (toWhat, text) {
var wgServer = window.wgServer || 'http://en.wikipedia.org';
var wgServer = window.wgServer || 'https://en.Wikipedia.org';
var wgArticlePath = window.wgArticlePath || '/wiki/$1';
var wgArticlePath = window.wgArticlePath || '/wiki/$1';
var url = (wgServer + wgArticlePath).replace('$1', toWhat);
var url = (wgServer + wgArticlePath).replace('$1', toWhat);
Line 177: Line 177:
+ 'January|February|March|April|June|July|August|September|'
+ 'January|February|March|April|June|July|August|September|'
+ 'October|November|December)',
+ 'October|November|December)',
'{year}':
'{year}':
'[12][0-9]{3}'
'[12][0-9]{3}'
};
};
Line 295: Line 295:
// === Editor compatibility layer ===
// === Editor compatibility layer ===
// Controlling access to wpTextbox1 helps abstract out compatibility
// Controlling access to wpTextbox1 helps abstract out compatibility
// with editors like wikEd (http://en.wikipedia.org/wiki/User:Cacycle/wikEd)
// with editors like wikEd (https://en.Wikipedia.org/wiki/User:Cacycle/wikEd)
   
   
ct.getWikiText = function () {
ct.getWikiText = function () {
Line 560: Line 560:
// Cut off the leading ``, '' and add ``formatting: '' and ``using Advisor.js''
// Cut off the leading ``, '' and add ``formatting: '' and ``using Advisor.js''
s = ct._(
s = ct._(
'formatting: $1 (using [[User:Cameltrader#Advisor.js|Advisor.js]])',
'formatting: $1 (using [[wp:User:Cameltrader#Advisor.js|Advisor.js]])',
s.substring(2)
s.substring(2)
);
);
Line 953: Line 953:
if (m[1] == 'nbsp') {
if (m[1] == 'nbsp') {
// Opera incorrectly replaces nbsp-s with regular spaces:
// Opera incorrectly replaces nbsp-s with regular spaces:
// http://en.wikipedia.org/w/index.php?title=User_talk%3ACameltrader&diff=179233698&oldid=175946199
// https://en.Wikipedia.org/w/index.php?title=User_talk%3ACameltrader&diff=179233698&oldid=175946199
continue;
continue;
}
}
Line 1,275: Line 1,275:
   
   
// Search box for Mediawiki
// Search box for Mediawiki
// (c) 2006 [[User:Zocky]], released under GPL
// (c) 2006 [[Wikipedia:User:Zocky]], released under GPL
//<pre><nowiki>
//<pre><nowiki>
   
   
importStylesheetURI('http://en.wikipedia.org/w/index.php?title=User:Zocky/SearchBox.css&action=raw&ctype=text/css');
importStylesheetURI('https://en.Wikipedia.org/w/index.php?title=User:Zocky/SearchBox.css&action=raw&ctype=text/css');
   
   
var sr$t;
var sr$t;