אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Common.js"

ק
הגהה, נאר פון וויקי
(משהו אפטימיזאציע)
ק (הגהה, נאר פון וויקי)
 
(23 מיטלסטע ווערסיעס פון 2 באַניצער נישט געוויזן.)
שורה 1: שורה 1:
/* אלע סקריפטן פון JavaScript דא געשריבן וועלן געלאדן ווערן פאר אלע באניצער ווען זיי לאדירן דעם בלאט */
/* אלע סקריפטן פון JavaScript דא געשריבן וועלן געלאדן ווערן פאר אלע באניצער ווען זיי לאדירן דעם בלאט */
// אין דרעפט און באניצער געביטן, טויש "פובליצירט" קנעפלעך צו "היט", צו פארמיידן מיספארשטענדענישן
var ns = mw.config.get('wgNamespaceNumber');
if (ns === 2 || ns === 3000) {
    var saveButton = document.getElementById("wpSave");
    if (saveButton) {
        saveButton.value = saveButton.value.replace("פובליצירט", "היט");
    }
}


// פונקציה לסקריפטים דו-לשוניים
// פונקציה לסקריפטים דו-לשוניים
שורה 16: שורה 7:
         return lang === 'he' ? he || yi : yi;
         return lang === 'he' ? he || yi : yi;
}
}


var element = document.getElementById('pt-anontalk');
var element = document.getElementById('pt-anontalk');
שורה 32: שורה 21:
}
}


//מכאן סקריפט תיקון התמונות בזרימה
// אין פנים, שריי נישט הויך ווען א הערה פירט צו א "דארט"
if (mw.config.get("wgPageContentModel") === "flow-board") {
$('.mw-parser-output sup a').each(function() {
   var images = $("[src^='//localhost:8080']");
   var text = $(this).text();
  for (var i = 0; i < images.length; i++) {
    var img = images[i];


    img.setAttribute(
  // Check if the text follows the format '[1.2]'
      "src",
  if (/^\[\d+\.\d+\]$/.test(text)) {
      img.getAttribute("src").replace("//localhost:8080", "//yi.hamichlol.org.il")
  // לאז עס נאר אין דרוקבארע ווערסיע
     );
    var modifiedText = text.replace(/(\.\d+)/, '<span id="printOnly">$1</span>');
    images[i] = img;
     $(this).html(modifiedText);
   }
   }
  images = $("[src^='http://localhost:8080']");
});
  for (var i = 0; i < images.length; i++) {
    var img = images[i];


    img.setAttribute(
var ns = mw.config.get('wgNamespaceNumber');
      "src",
      img.getAttribute("src").replace("//localhost:8080", "//yi.hamichlol.org.il")
    );
    images[i] = img;
  }
  images = $("[src^='http://localhost']");
  for (var i = 0; i < images.length; i++) {
    var img = images[i];
 
    img.setAttribute(
      "src",
      img.getAttribute("src").replace("//localhost", "//yi.hamichlol.org.il")
    );
    images[i] = img;
  }
  images = $("[src^='//localhost']");
  for (var i = 0; i < images.length; i++) {
    var img = images[i];
 
    img.setAttribute(
      "src",
      img.getAttribute("src").replace("//localhost", "//yi.hamichlol.org.il")
    );
    images[i] = img;
  }
  images = $("img");
  for (var i = 0; i < images.length; i++) {
    var img = images[i];
 
    img.setAttribute(
      "src",
      img
        .getAttribute("src")
        .replace("//mediawiki/w/upload/michlol", "/w/upload/michlol")
    );
    images[i] = img;
  }
}
//עד כאן סקריפט תיקון התמונות בזרימה
 
//דאס רוקט אראפ א מעלדונג אונטער די קאטעגאריעס, באנוצט אין מוסטער:קרד/ויקי/יידיש
$(function(){
$(function(){
if (ns === 8000 && document.getElementById("wiki-message")) {
if (ns === 8000) {
  $("#wiki-message").detach().insertAfter("#catlinks");
// דאס טוישט בעקגראונד קאליר פון דרעפטס אין רוי
var txt = document.getElementById("wpTextbox1");
if (document.getElementById("mbox-draft") || (txt && txt.value.includes("{" + "{דרעפט"))) {
var contentElement = document.querySelector("#content");
contentElement.style.backgroundColor = "#F9F7F8";
} else if (document.getElementById("yiwiki")) {
        // לייג צו דעם ווארענונג
        addEditIntro( 'מוסטער:וויקי editintro' );
}
}
}


שורה 98: שורה 50:




//כל ההוספות המקומיות במכלול עברית
/*if (mw.config.get("wgAction") === "history") {
 
/*נif (mw.config.get("wgAction") === "history") {
   importScript("MediaWiki:FixHistPage.js"); // הסתרת קישורים ותיבות checkbox בדף ההיסטוריה והוספת אפשרות להפעלתם באמצעות כפתור מתאים.
   importScript("MediaWiki:FixHistPage.js"); // הסתרת קישורים ותיבות checkbox בדף ההיסטוריה והוספת אפשרות להפעלתם באמצעות כפתור מתאים.
}*/
}*/
שורה 159: שורה 109:
mw.loader.using("mediawiki.util", function () {
mw.loader.using("mediawiki.util", function () {
   "use strict";
   "use strict";
  if (ns === 6) {
    mw.loader.load("ext.gadget.ime");
  }
  // סקריפטים לדפי עריכה
  if (
    $.inArray(mw.config.get("wgAction"), ["edit", "submit"]) + 1 &&
    !$("#wpTextbox1").prop("readonly")
  ) {
    importScript("MediaWiki:Templateslist.js"); // הצגת רשימת תבניות
    importScript("MediaWiki:Ref2template.js"); //ref סקריפט שמשנה את התנהגות כפתור "הערה": הוספת תבנית הערה. במקום להוסיף תג
  }


   // סקריפטים לעמודים ספציפיים
   // סקריפטים לעמודים ספציפיים
שורה 206: שורה 143:
     });
     });
   }
   }
/** WikiMiniAtlas *******************************************************
*
*  Description: WikiMiniAtlas is a popup click and drag world map.
*              This script causes all of our coordinate links to display the WikiMiniAtlas popup button.
*              The script itself is located on meta because it is used by many projects.
*              See [[Meta:WikiMiniAtlas]] for more information.
*  Maintainers: [[User:Dschwen]]
( function () {
if ( $( 'a.external.text[href*=geohack], div.kmldata' ).length ) {
mw.loader.load( '//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript' );
}
} )(); */
/*
* Description: Redirects from /User:UserName/skin.js or .css to the user's actual skin page. Used (also) in {{תב|דף אישי}}.
* Originally created by [[:en:User:Cacycle]]
*/
$( function () {
if ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgUserName' ) ) {
            var pageName = mw.config.get( 'wgPageName' );
var slash = pageName.indexOf( '/' );
var norm = pageName.substr( 0, slash ) + mw.config.get( 'wgPageName' ).substr( slash ).toLowerCase();
var test = 'באַניצער:' + mw.config.get( 'wgUserName' ).replace( / /g, '_' ) + '/skin.';
var ext = null;
if ( norm === test + 'js' ) {
ext = 'js';
} else if (norm === test + 'css') {
ext = 'css';
}
if ( ext !== null ) {
window.location.href = window.location.href.replace(
/\/skin.(css|js)/i,
'/' + mw.config.get( 'skin' ) + '.' + ext
);
}
}
// create an event when util.addPortletLink() is called, so scripts that manipulate menus ca readjust.
var oldFunc = mw.util.addPortletLink;
if ( typeof oldFunc === 'function' ) {
mw.util.addPortletLink = function () {
var res = oldFunc.apply( this, arguments );
$( document ).trigger( 'new-portlet-link' );
return res;
};
}
} );


   if (
   if (
שורה 310: שורה 299:
} );
} );
} );
} );
/* נישט דא. וועט דארפן גיין אלס הרחבה בעפאר שאפן דעם HTML
// Add structured website data
if (mw.config.get('wgArticleId') === 1) { // הויפט בלאט
    const structuredDataText = JSON.stringify({
        "@context": "https://schema.org",
        "@type": "WebSite",
        "name": "אידיש המכלול",
        "alternateName": ["המכלול אידיש", "המכלול"],
        "url": "https://yi.hamichlol.org.il/"
    });
    const script = document.createElement('script');
    script.setAttribute('type', 'application/ld+json');
    script.textContent = structuredDataText;
    document.head.appendChild(script);
}
*/