משתמש:Mikimik/js/shared.js
מראה
הערה: לאחר הפרסום, ייתכן שיהיה צורך לנקות את זיכרון המטמון (cache) של הדפדפן כדי להבחין בשינויים.
- פיירפוקס / ספארי: להחזיק את המקש Shift בעת לחיצה על טעינה מחדש (Reload) או ללחוץ על צירוף המקשים Ctrl-F5 או Ctrl-R (במחשב מק: ⌘-R).
- גוגל כרום: ללחוץ על צירוף המקשים Ctrl-Shift-R (במחשב מק: ⌘-Shift-R).
- אדג': להחזיק את המקש Ctrl בעת לחיצה על רענן (Refresh) או ללחוץ על צירוף המקשים Ctrl-F5.
function getParamValue ( paramName )
{
if ( !location.search ) return null;
var m = RegExp("[&?]" + paramName + "=([^&]*)").exec( location.search );
if ( m ) {
try {
return decodeURIComponent( m[1] ); // decodeURIComponent cannot handle Windows-1255 encoded hebrew
} catch( err ) {
try {
return decodeURIComponent( unescape( m[1] ) ); // unescape only handles ASCII %00-%FF (this will corrupt unicode chars)
} catch( err ) {}
}
}
return null;
}
function encodeTextToWikiURL ( text )
{
return encodeURIComponent(text).replace(/%2F/g,"/").replace(/%24/g,"$").replace(/%2C/g,",").replace(/%3A/g,":").replace(/%40/g,"@");
}
// ------------------------- run only once -------------------------
function runOnlyOnceCheck() // check if any function was loaded twice and remove the earlier instance
{
try {
var functsOnlyOnce = [];
for ( var i = onloadFuncts.length-1 ; i >= 1 ; i-- ) // check all onload functions from end to beginning,
{ // not including the current function
var name = /function *([^ (]*)/.exec(onloadFuncts[i].toString())[1]; // get function name
if ( !name ) name = onloadFuncts[i].toString(); // if it doesn't have a name - use the function's text
if ( functsOnlyOnce[name] ) // if a function with the same name already exists,
onloadFuncts[i] = function emptyFunctDummy() { return; }; // replace it with an empty function
else functsOnlyOnce[name] = true;
}
}
catch ( e )
{
return;
}
}
if ( !doneOnloadHook ) onloadFuncts.splice ( 0, 0, runOnlyOnceCheck ); // if the window "load" event hasn't fired yet -
// insert runOnlyOnceCheck as the first function to be executed
// ---------------------------- import scripts ------------------------
mImportScript( "User:Mikimik/js/displayRemoteInfoInline.js", "http://he.wikipedia.org" ); // display remote page info in an iframe
if ( !getParamValue("createRemoteInfoFrame") )
{
importStylesheetURI ("http://he.wikipedia.org/w/index.php?action=raw&ctype=text/css&title=User:Mikimik/js/shared.css"); // shared CSS
mImportScript ("User:נתנאל בר-אור ל/popups-strings-he.js", "http://he.wikipedia.org"); // hebrew skin for the Pop-Up
mImportScript ("User:Lupin/popups.js", "http://en.wikipedia.org"); // Pop-Up
mImportScript ("User:Mikimik/js/partolStatusInEditList.js", "http://he.wikipedia.org"); // patrol status in history page and contributions page
mImportScript ("User:Mikimik/js/autoStandardContent.js", "http://he.wikipedia.org"); // auto standardize page in edit mode
// mImportScript ("User:Mikimik/js/externalLinkAutoFix.js", "http://he.wikipedia.org"); // replace links with templates in edit mode
mImportScript ("User:Mikimik/js/customizeBars.js", "http://he.wikipedia.org"); // customize the sidebar and the personal toolbar
mImportScript ("User:Mikimik/js/customizeTabs.js", "http://he.wikipedia.org"); // customize page tabs
mImportScript ("User:Mikimik/js/customizeContent.js", "http://he.wikipedia.org"); // customize content area
mImportScript ("MediaWiki:SubPagesLink.js", "http://he.wikipedia.org"); // adds a link to the page's subpages
mImportScript ("User:Mikimik/js/sisterwikis.js", "http://he.wikipedia.org"); // create sister wikis box
mImportScript ("User:Mikimik/js/ShortNSSearch.js", "http://he.wikipedia.org"); // search using short name spaces
mImportScript ("User:Mikimik/js/displayLocalInfoInline.js", "http://he.wikipedia.org"); // show local information below a page headline
mImportScript ("User:Cacycle/wikEd.js", "http://en.wikipedia.org"); // wikEd in-browser text editor
mImportScript ("MediaWiki:EditSummaryLengthLimit.js", "http://he.wikipedia.org"); // make sure edit summary does not exceed byte limit
mImportScript ("MediaWiki:Gadget-EditReplace.js", "http://he.wikipedia.org"); // adds a replace option to toolbar in edit mode
// add warnings to user talk page and next to user name in diff view and after rollback
if ( wgContentLanguage == "he" ) mImportScript ("User:Mikimik/js/autoUserWarnings.js", "http://he.wikipedia.org");
mImportScript ("MediaWiki:Gadget-DiffBytes.js", "http://he.wikipedia.org"); // shows byte size difference in history page
mImportScript ("User:Mikimik/js/customizeWLRC.js", "http://he.wikipedia.org"); // customize Recent Changes and Watch List
mImportScript ("User:Mikimik/js/patrol.js", "http://he.wikipedia.org"); // patrol mode
mImportScript ("MediaWiki:Gadget-ExpandedSubcategoryDetails.js", "http://he.wikiquote.org"); // shows the number of subcategories, pages and files in each category in category pages
importScriptURI ("http://localhost/wiki-js/local_he.js"); // *** local_he.js on the local machine ***
}