אונטערשייד צווישן ווערסיעס פון "באַניצער:גאון הירדן/ייבוא ועדכון.js"

p
(+)
 
(p)
 
(19 מיטלסטע ווערסיעס פון 5 באַניצער נישט געוויזן.)
שורה 1: שורה 1:
$(function () {
$(function () {
   mw.messages.set({
   mw.messages.set({
     "": "הערות לבדיקה:",
     "": "הערות פאר בדיקה:",
     "checkty-whait-title": "ממתין לתוצאות הבדיקה...",
     "checkty-whait-title": "ווארט פאר בדיקה רעזולטאטן...",
     "update-success": "העדכון או הייבוא הסתיים בהצלחה! ",
     "update-success": "אפּדעיט סוקסעספול געענדיגט! ",
     images: "לא לשכוח לבדוק תמונות!",
     images: "נישט פארגעסן צו באקוקן בילדער!",
     "no-images": "אין תמונות בערך זה.",
     "no-images": "נישטא קיין בילדער אין דעם ארטיקל.",
     "No-Words": "הבדיקה הסתיימה בהצלחה",
     "No-Words": "די בדיקה איז סוקסעספול געענדיגט",
     "checkty-page-doesnt-exist": " (הדף אינו קיים)",
     "checkty-page-doesnt-exist": " (דער בלאט עקזיסטירט נישט)",
     "checkty-search": "חיפוש",
     "checkty-search": "זוכט",
     "checkty-language-check": 'בערך זה מופיע הביטוי "$1" פעם אחת או יותר. ',
     "checkty-language-check": 'אינעם ארטיקל ערשיינט דעם אויסדרוק "$1" איין אדער מער מאל. ',
     aspaklaria: "הערך עבר סינון! , העדכון מוגבל לעורכי אספקלריה בלבד.",
     aspaklaria: "הערך עבר סינון! , העדכון מוגבל לעורכי אספקלריה בלבד.",
     block: "הייבוא או העדכון נחסם על ידי ספק הרשת",
     block: "הייבוא או העדכון נחסם על ידי ספק הרשת",
שורה 59: שורה 59:
   var PageName = mw.config
   var PageName = mw.config
     .get("wgPageName")
     .get("wgPageName")
     .replace(/^רבי/, "")
     .replace("מעדיעװיקי:" , "מדיה_ויקי:")
     .replace(/^הרב\_/, "")
    .replace("מעדיעװיקי_שמועס:" , "שיחת_מדיה_ויקי:")
     .replace("_", " ")
     .replace("הילף:", "עזרה:")
     .replace(/ה\"קדושה\"/g, "הקדושה")
     .replace("מוסטער:", "תבנית:")
     .replace(/ה\"קדוש\"/g, "הקדוש")
     .replace("קאַטעגאָריע:","קטגוריה:")
     .replace(/ה\"קדושים\"/g, "הקדושים")
     .replace("באַניצער:","משתמש:")
     .replace(/א\-ל/g, "אל");
     .replace("פארטל:","פורטל:")
     .replace("סקריפטס","סקריפטים");
 
/*
   if (
   if (
     document.getElementById("wpTextbox1") &&
     document.getElementById("wpTextbox1") &&
שורה 73: שורה 76:
     PageName = Template.exec($("#wpTextbox1").val())[2];
     PageName = Template.exec($("#wpTextbox1").val())[2];
   }
   }
   var apiEndpoint = "https://he.wikipedia.org/w/api.php?";
*/
   var apiEndpoint = "https://www.hamichlol.org.il/w/api.php?";
   const dataToWiki = {
   const dataToWiki = {
     action: "parse",
     action: "parse",
שורה 104: שורה 108:
     dataToWiki.section = section;
     dataToWiki.section = section;
   }
   }
  if (level > 19) {
/*  if (level > 19) {
     apiEndpoint = "/import/get_wik1i.php?";
     apiEndpoint = "/import/get_wik1i.php?";
   }
   }
 
*/
   function checkifexist() {
   function checkifexist() {
     var apiToCheck =
     var apiToCheck =
       "https://he.wikipedia.org/w/api.php?action=parse&page=" +
       "https://www.hamichlol.org.il/w/api.php?action=parse&page=" +
       encodeURIComponent(PageName) +
       encodeURIComponent(PageName) +
       "&format=json&prop=revid&origin=*";
       "&format=json&prop=revid&origin=*";
שורה 118: שורה 122:
       .then( (result)=> {
       .then( (result)=> {
         if (result && result.error && result.error.code == "missingtitle") {
         if (result && result.error && result.error.code == "missingtitle") {
           console.log("הדף לא קיים בוויקיפדיה העברית");
           console.log("הדף לא קיים במכלול");
         } else if (result && result.parse) {
         } else if (result && result.parse) {
           if (!isUpdate) {
           if (!isUpdate) {
שורה 130: שורה 134:
               if (level > 15 && mw.config.get("wgAction") === "edit") {
               if (level > 15 && mw.config.get("wgAction") === "edit") {
                 apiToCheck =
                 apiToCheck =
                   "https://he.wikipedia.org/w/api.php?action=parse&page=" +
                   "https://www.hamichlol.org.il/w/api.php?action=parse&page=" +
                   encodeURIComponent(PageName) +
                   encodeURIComponent(PageName) +
                   "&format=json&prop=text&section=0&origin=*";
                   "&format=json&prop=text&section=0&origin=*";
שורה 187: שורה 191:
           var parit = getProperties(result);
           var parit = getProperties(result);
           var summary = isUpdate
           var summary = isUpdate
             ? "עדכון מוויקיפדיה גרסה " + girsa
             ? "עדכון מהמכלול גרסה " + girsa
             : "ייבוא מוויקיפדיה העברית, ראה רשימת התורמים";
             : "אימפארטירט פון די העברעאישע המכלול, זע ביישטייערער ליסטע";
           var added = "";
           var added = "";
           if (isShort) summary +=  ', בוט ' + select;
           if (isShort) summary +=  ', בוט ' + select;
שורה 767: שורה 771:
   }
   }
   function blockSave(open) {
   function blockSave(open) {
     var saveButton = document.getElementById("wpSave");
     let saveButton = document.getElementById("wpSave");
     if (!saveButton) return;
     if (!saveButton) return;
     if (open != "פתח") {
     if (open != "פתח") {
שורה 778: שורה 782:
       if (saveButton.value != "שמירת השינויים")
       if (saveButton.value != "שמירת השינויים")
         saveButton.value = "אשריך שבדקת!";
         saveButton.value = "אשריך שבדקת!";
       saveButton.style.fontWeight = "normal";
       saveButton.style.fontWeight = "bold";
       document.getElementById("wpPreview").style.fontWeight = "bold";
       document.getElementById("wpPreview").style.fontWeight = "bold";
     }
     }
שורה 825: שורה 829:
           var parit = getProperties(result);
           var parit = getProperties(result);
           var summary = isUpdate
           var summary = isUpdate
             ? "עדכון מוויקיפדיה גרסה " + girsa
             ? "עדכון מהמכלול גרסה " + girsa
             : "ייבוא מוויקיפדיה העברית, ראה רשימת התורמים";
             : "אימפארטירט פון די העברעאישע המכלול, זע ביישטייערער ליסטע";
           var added = "";
           var added = "";


שורה 852: שורה 856:
           var $form = $("<form>");
           var $form = $("<form>");


           var actionUrl =
           var actionUrl = "/w/index.php?title=" +
            "https://www.hamichlol.org.il/w/index.php?title=" +
             encodeURIComponent(mw.config.get("wgPageName")) +
             encodeURIComponent(mw.config.get("wgPageName")) +
             "&action=submit";
             "&action=submit";
שורה 936: שורה 939:
   if ($.inArray(mw.config.get("wgAction"), ["edit", "submit"]) + 1)
   if ($.inArray(mw.config.get("wgAction"), ["edit", "submit"]) + 1)
     $(document).ready(function () {
     $(document).ready(function () {
      if (
/*    if (
         $.inArray(mw.config.get("wgNamespaceNumber"), ["2", "3", "4", "6"]) + 1
         $.inArray(mw.config.get("wgNamespaceNumber"), ["2", "3", "4", "6"]) + 1
       )
       )
         return;
         return;
  if (location.href.indexOf("&submit") === -1) checkifexist();
*/  if (location.href.indexOf("&submit") === -1) checkifexist();
       var open;
       var open;
       var diffbut = document.getElementById("wpDiff");
       var diffbut = document.getElementById("wpDiff");
שורה 965: שורה 968:
     mw.config.get("wgPageName") != "עמוד_ראשי" &&
     mw.config.get("wgPageName") != "עמוד_ראשי" &&
     mw.config.get("wgPageContentModel") != "flow-board" &&
     mw.config.get("wgPageContentModel") != "flow-board" &&
    mw.config.get("wgNamespaceNumber") !==-1
    /* &&
     (mw.config.get("wgNamespaceNumber") === 0 ||
     (mw.config.get("wgNamespaceNumber") === 0 ||
       mw.config.get("wgNamespaceNumber") === 10) &&
       mw.config.get("wgNamespaceNumber") === 10) &&
     level > 13 &&
     level > 13 &&
     mw.config.get("wgAction") === "view"
     mw.config.get("wgAction") === "view"
   ) {
   */) {
     var btnUpDate = mw.util.addPortletLink(
     var btnUpDate = mw.util.addPortletLink(
       "p-views",
       "p-views",