אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Gadget-wikibugs-patrol-clone.js"

קודם?
(עטוואס ווייטער צופאסונג)
(קודם?)
 
(6 צווישנדיגע ווערסיעס פונעם זעלבן באַניצער נישט געוויזן)
שורה 88: שורה 88:
                 token: mw.user.tokens.get('csrfToken'),
                 token: mw.user.tokens.get('csrfToken'),
                 text: content,
                 text: content,
                 // tags: 'תקלדה-בקליק'
                 tags: 'תיקון סופרים'
             }).done(function (d) {
             }).done(function (d) {
                 reloadNotify($('<a>', { href: 'https://yi.hamichlol.org.il/w/index.php?title=' + articleName + '&diff=curr&oldid=prev', target: '_blank' }).text('תוקן! לחץ להשוואת גרסאות'));
                 reloadNotify($('<a>', { href: 'https://yi.hamichlol.org.il/w/index.php?title=' + articleName + '&diff=curr&oldid=prev', target: '_blank' }).text('פארראכטן! לחץ להשוואת גרסאות'));
             });
             });
         }
         }
שורה 101: שורה 101:
                 token: mw.user.tokens.get('csrfToken'),
                 token: mw.user.tokens.get('csrfToken'),
                 text: content,
                 text: content,
                 // tags: 'תקלדה-בקליק'
                 tags: 'תיקון סופרים'
             }).done(function (d) {
             }).done(function (d) {
                 mw.notify($('<a>', { href: 'https://yi.hamichlol.org.il/w/index.php?title=' + articleName + '&diff=curr&oldid=prev', target: '_blank' }).text('תוקן! לחץ להשוואת גרסאות'));
                 mw.notify($('<a>', { href: 'https://yi.hamichlol.org.il/w/index.php?title=' + articleName + '&diff=curr&oldid=prev', target: '_blank' }).text('פארראכטן! לחץ להשוואת גרסאות'));
             });
             });
         }
         }
שורה 127: שורה 127:
                             newcontext = oldcontext.replace(suspect, correction);
                             newcontext = oldcontext.replace(suspect, correction);
                             if (newcontext === oldcontext) { alert('המילה לא נמצאה בהקשר'); return; }
                             if (newcontext === oldcontext) { alert('המילה לא נמצאה בהקשר'); return; }
                             approvedCorrection = prompt('ההקשר:\n' + oldcontext + '\n' + suspect + ' יוחלף ב:', suspect);
                             approvedCorrection = prompt('דער קאנטעקסט:\n' + oldcontext + '\n' + suspect + ' וועט ווערן געטוישט צו:', suspect);
                             if (approvedCorrection === null || approvedCorrection === suspect) return;
                             if (approvedCorrection === null || approvedCorrection === suspect) return;
                             newcontext = oldcontext.replace(suspect, approvedCorrection);
                             newcontext = oldcontext.replace(suspect, approvedCorrection);
שורה 138: שורה 138:
                                     newArticleText = articleText.replace(oldcontext, newcontext);
                                     newArticleText = articleText.replace(oldcontext, newcontext);
                                     if (newArticleText === articleText) {
                                     if (newArticleText === articleText) {
                                         alert('ההקשר לא נמצא בערך');
                                         alert('דער קאנטעקסט לא נמצא בערך');
                                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא נמצא')
                                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא נמצא')
                                         return;
                                         return;
                                     }
                                     }
                                     saveChangenoreload(articleName, newArticleText, suspect, approvedCorrection)
                                     saveChangenoreload(articleName, newArticleText, suspect, approvedCorrection)
                                     if (newArticleText != articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + approvedCorrection + ' תוקן!');
                                     if (newArticleText != articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + approvedCorrection + ' פארראכטן!');
                                     if (newArticleText === articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + approvedCorrection + ' לא תוקן!');
                                     if (newArticleText === articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + approvedCorrection + ' נישט פארראכטן!');
                                 }
                                 }
                             })
                             })
שורה 184: שורה 184:
                                     newArticleText = articleText.replace(oldcontext, newcontext);
                                     newArticleText = articleText.replace(oldcontext, newcontext);
                                     if (newArticleText === articleText) {
                                     if (newArticleText === articleText) {
                                         alert('ההקשר לא נמצא בערך');
                                         alert('דער קאנטעקסט לא נמצא בערך');
                                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא נמצא')
                                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא נמצא')
                                         return;
                                         return;
                                     }
                                     }
                                     saveChangereload(articleName, newArticleText, suspect, correction)
                                     saveChangereload(articleName, newArticleText, suspect, correction)
                                     if (newArticleText != articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' תוקן!');
                                     if (newArticleText != articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' פארראכטן!');
                                     if (newArticleText === articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' לא תוקן!');
                                     if (newArticleText === articleText) removeSectionAfterCorrection(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' נישט פארראכטן!');
                                 }
                                 }
                             })
                             })
שורה 213: שורה 213:
                     } else {
                     } else {
                         if (sectionText.indexOf('{{#lst:') != -1) {
                         if (sectionText.indexOf('{{#lst:') != -1) {
                             removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא תוקן');
                             removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' נישט פארראכטן');
                         } else {
                         } else {
                             var articleText = 'undefined', newArticleText = 'undefined', suspect = 'undefined', correction = 'wow', oldcontext = 'wwowo', newcontext = 'undefined';
                             var articleText = 'undefined', newArticleText = 'undefined', suspect = 'undefined', correction = 'wow', oldcontext = 'wwowo', newcontext = 'undefined';
שורה 229: שורה 229:
                                     newArticleText = articleText.replace(oldcontext, newcontext);
                                     newArticleText = articleText.replace(oldcontext, newcontext);
                                     if (newArticleText === articleText) {
                                     if (newArticleText === articleText) {
                                         alert('ההקשר לא נמצא בערך');
                                         alert('דער קאנטעקסט לא נמצא בערך');
                                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא נמצא')
                                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא נמצא')
                                         return;
                                         return;
                                     }
                                     }
                                     saveChangenoreload(articleName, newArticleText, suspect, correction)
                                     saveChangenoreload(articleName, newArticleText, suspect, correction)
                                     if (newArticleText != articleText) removeSectionAfterCorrection2(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' תוקן!');
                                     if (newArticleText != articleText) removeSectionAfterCorrection2(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' פארראכטן!');
                                     if (newArticleText === articleText) removeSectionAfterCorrection2(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' לא תוקן!');
                                     if (newArticleText === articleText) removeSectionAfterCorrection2(sectionNum, basetimestamp, data.curtimestamp, suspect + '->' + correction + ' נישט פארראכטן!');
                                 }
                                 }
                             })
                             })
שורה 260: שורה 260:
                     } else {
                     } else {
                         if (sectionText.indexOf('{{#lst:') != -1) {
                         if (sectionText.indexOf('{{#lst:') != -1) {
                             removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא תוקן');
                             removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' נישט פארראכטן');
                         } else {
                         } else {
                             archiveToTalk(articleName, summ, sectionText).done(function () { removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא תוקן'); });
                             archiveToTalk(articleName, summ, sectionText).done(function () { removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' נישט פארראכטן'); });
                         }
                         }
                     }
                     }
שורה 283: שורה 283:
                     } else {
                     } else {
                         var suspect = sectionText.replace(/.*\n.*?(.*)?\->.*\n.*\n.*/, "$1");
                         var suspect = sectionText.replace(/.*\n.*?(.*)?\->.*\n.*\n.*/, "$1");
                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא תוקן');
                         removeSection(sectionNum, basetimestamp, data.curtimestamp, suspect + ' נישט פארראכטן');
                     }
                     }
                 }
                 }
שורה 302: שורה 302:
                     } else {
                     } else {
                         var suspect = sectionText.replace(/.*\n.*?(.*)?\->.*\n.*\n.*/, "$1");
                         var suspect = sectionText.replace(/.*\n.*?(.*)?\->.*\n.*\n.*/, "$1");
                         removeSection2(sectionNum, basetimestamp, data.curtimestamp, suspect + ' לא תוקן');
                         removeSection2(sectionNum, basetimestamp, data.curtimestamp, suspect + ' נישט פארראכטן');
                     }
                     }
                 }
                 }
שורה 311: שורה 311:


         $('h2').each(function () {
         $('h2').each(function () {
             var archive = $('<a>לבדיקה</a>').attr({ href: '#' }).css({ 'font-size': 'large', 'margin-right': '20px' }).click(archiveReport),
             var archive = $('<a>לבדיקה</a>').attr({ href: '#' }).css({ 'margin-right': '20px' }).click(archiveReport),
                 removeReportBtn = $('<a>הסר-</a>').attr({ href: '#' }).css({ 'font-size': 'large', 'margin-right': '20px' }).click(removeReport),
                 removeReportBtn = $('<a>אראפנעמען-</a>').attr({ href: '#' }).css({ 'margin-right': '20px' }).click(removeReport),
                 removeReportBtn2 = $('<a>הסר</a>').attr({ href: '#' }).css({ 'font-size': 'large', 'margin-right': '20px' }).click(removeReport2),
                 removeReportBtn2 = $('<a>אראפנעמען</a>').attr({ href: '#' }).css({ 'margin-right': '20px' }).click(removeReport2),
                 saveChangeBtn = $('<a>טפל<a>').attr({ href: '#' }).css({ 'font-size': 'large', 'margin-right': '20px' }).click(saveChange),
                 saveChangeBtn = $('<a>באהאנדלט<a>').attr({ href: '#' }).css({ 'margin-right': '20px' }).click(saveChange),
                 saveChangeBtn2 = $('<a>החלף<a>').attr({ href: '#' }).css({ 'font-size': 'large' }).click(saveChange2),
                 saveChangeBtn2 = $('<a>טוישט<a>').attr({ href: '#' }).click(saveChange2),
                 saveChangeBtn3 = $('<a>החלף-<a>').attr({ href: '#' }).css({ 'font-size': 'large', 'margin-right': '20px' }).click(saveChange3);
                 saveChangeBtn3 = $('<a>טוישט-<a>').attr({ href: '#' }).css({ 'margin-right': '20px' }).click(saveChange3);
             $(this).find('.mw-editsection').append(['<br><br>', removeReportBtn, saveChangeBtn, saveChangeBtn3, saveChangeBtn2, removeReportBtn2, archive]);
             $(this).find('.mw-editsection').append([removeReportBtn, saveChangeBtn, saveChangeBtn3, saveChangeBtn2, removeReportBtn2, archive]);
         });
         });
     });
     });
}
}