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

פעלט שויניש אויס
(אפדעיט און צופאסונג)
(פעלט שויניש אויס)
 
(23 מיטלסטע ווערסיעס פון 3 באַניצער נישט געוויזן.)
שורה 1: שורה 1:
// הוספת כפתור "בדיקה" שמבצע החלפות נפוצות של בוט ההחלפות וכן מתריע על בעיות סגנון ועיצוב שונות
// הוספת כפתור "בדיקה" שמבצע החלפות נפוצות של בוט ההחלפות וכן מתריע על בעיות סגנון ועיצוב שונות
// נכתב על ידי [[משתמש:ערן]] ו[[משתמש:קיפודנחש]]
// לעזרה ראו [[mediawiki:Gadget-Checkty.js/הוראות]]
// לעזרה ראו [[mediawiki:Gadget-Checkty.js/הוראות]]
mw.messages.set({
mw.messages.set({
שורה 15: שורה 14:
     'checkty-disambig-success': 'לינקס צו באדייטן - די בדיקה איז סוקסעספול פארענדיגט.',
     'checkty-disambig-success': 'לינקס צו באדייטן - די בדיקה איז סוקסעספול פארענדיגט.',
     'checkty-disambig-links-title': 'די לעצטע אפגעהיטענע ווערסיע פארבינדט צו באדייטן בלעטער. ביטע פאררעכט די לינקס צו די בלעטער: ',
     'checkty-disambig-links-title': 'די לעצטע אפגעהיטענע ווערסיע פארבינדט צו באדייטן בלעטער. ביטע פאררעכט די לינקס צו די בלעטער: ',
     'checkty-page-doesnt-exist': ' (דער בלאט עקזיסטירט נישט)',
     'checkty-page-doesnt-exist': ' (בלאַט עקזיסטירט נאכנישט)',
     'checkty-dismabig-dialog-title': 'באדייטן פאררעכטונג',
     'checkty-dismabig-dialog-title': 'באדייטן פאררעכטונג',
     'checkty-remove-link': 'הסרת קישור',
     'checkty-remove-link': 'הסרת קישור',
שורה 35: שורה 34:
     'checkty-ref-dir-fix': 'תיקון כיווניות להערת שוליים',
     'checkty-ref-dir-fix': 'תיקון כיווניות להערת שוליים',
     'checkty-ref-merge': 'צונויפגיסן רעפערענצן',
     'checkty-ref-merge': 'צונויפגיסן רעפערענצן',
     'checkty-naked-link-found': 'געטראפן נאקעטע דרויסנדע לינק: $1',
     'checkty-naked-link-found': 'געטראפן נאקעטע דרויסנדיגע לינק: $1',
     'checkty-naked-link-fix': 'פארריכטן',
     'checkty-naked-link-fix': 'פארריכטן',
     'checkty-broken-link': 'חשש פון א צעבראכן לינק: ',
     'checkty-broken-link': 'חשש פון א צעבראכן לינק: ',
שורה 147: שורה 146:
     {
     {
         // notes: at least 2 numbers  - avoid chess notation replacement, English links - full link to avoid |
         // notes: at least 2 numbers  - avoid chess notation replacement, English links - full link to avoid |
        from: /( [בלמהוכ])(?:- |)(\[\[[A-Za-z0-9 ]*\]\]|[A-Za-z]|(?:\[\[)?[0-9]{2,})/g,
from: /( [בלמהוכש])(?:- |)(\[\[[A-Za-z0-9 ]*\]\]|[A-Za-z]|[0-9]{2,}|\[\[[^\[\]]*?\|[A-Za-z0-9])/g,
         to: '$1־$2',
         to: '$1־$2',
         comment: 'מיקוף למספרים ולעז'
         comment: 'מיקוף למספרים ולעז'
שורה 169: שורה 168:
         var self = this, runExcute = true,
         var self = this, runExcute = true,
             inUseTemplatesRgx = /\{\{אינמיטן ארבעט[ \}\|]/;
             inUseTemplatesRgx = /\{\{אינמיטן ארבעט[ \}\|]/;
        if (!this.textbox || this.textbox.value.length === 0) return;
if (!this.textbox || this.textbox.value.length === 0) return;


         // this tool is not indented to be used in discussion pages
         // this tool is not indented to be used in discussion pages
        if (mw.config.get('wgNamespaceNumber') % 2 == 1 || (mw.config.get('wgNamespaceNumber') != 0 && /\(IST\)/.exec(this.textbox.value))) {
if ( mw.config.get('wgNamespaceNumber') % 2 == 1 || ( mw.config.get('wgNamespaceNumber') != 0 && /\(IST\)/.exec(this.textbox.value ) )) {
             runExcute = false;
             runExcute = false;
             OO.ui.confirm(mw.msg('checkty-wrong-use-discussion')).done(function (confirmed) { if (confirmed) self.execute(); });
             OO.ui.confirm(mw.msg('checkty-wrong-use-discussion')).done(function (confirmed) { if (confirmed) self.execute(); });
שורה 178: שורה 177:


         // this tool is not intended to be used while other people are working on the same page
         // this tool is not intended to be used while other people are working on the same page
        if (inUseTemplatesRgx.exec(this.textbox.value)) {
if( inUseTemplatesRgx.exec(this.textbox.value) ) {
             runExcute = false;
             runExcute = false;
             OO.ui.confirm(mw.msg('checkty-inuse-warning')).done(function (confirmed) { if (confirmed) self.execute(); });
             OO.ui.confirm(mw.msg('checkty-inuse-warning')).done(function (confirmed) { if (confirmed) self.execute(); });
שורה 193: שורה 192:


         this.verifyRun();
         this.verifyRun();
    },
},
updateText: function( val, manual ) {
// for non manual changes - update origText
if (!manual && (this.textbox.value === chectTyTool.origText)) {
chectTyTool.origText = val;
}
$(this.textbox).textSelection( 'setContents', val );
},
getContents: function( ) {
return $(this.textbox).textSelection( 'getContents' );
},
     execute: function () {
     execute: function () {
         // indication that skippable replacements should be ignored in the page
         // indication that skippable replacements should be ignored in the page
        this.skipCheckty = this.textbox.value.match(/{{ללא[_ ]בוט\|\s*צ'קטי\s*}}/g);
this.skipCheckty = this.textbox.value.match(/{{ללא[_ ]בוט\|\s*צ'קטי\s*}}/g);
         if (!($('#checktyResults').length)) $('.editButtons').after('<div id="checktyResults"><div class="checktyResultsTitle">' + mw.msg('checkty-warnings-title') + '</div></div>');
         if (!($('#checktyResults').length)) $('.editButtons').after('<div id="checktyResults"><div class="checktyResultsTitle">' + mw.msg('checkty-warnings-title') + '</div></div>');
         //first call to remote functions than to local
         //first call to remote functions than to local
        if ((chectTyTool.textbox.value === chectTyTool.origText) && (mw.config.get('wgAction') === 'edit'))
if ( ( chectTyTool.textbox.value === chectTyTool.origText ) && ( mw.config.get('wgAction') === 'edit') )  
             this.onSaveProtection();
             this.onSaveProtection();


שורה 209: שורה 218:
         }
         }
         this.languageCheck();
         this.languageCheck();
         //this.nikudCheck();
         if (window.checkNikud) {
            this.nikudCheck();
        }
         this.vavCheck();
         this.vavCheck();
         this.expandWikidata();
         this.expandWikidata();
שורה 245: שורה 256:
},
},
     decodeExternalLinks: function () {
     decodeExternalLinks: function () {
        var t = this.textbox.value, newTxt = t,
var t = this.textbox.value, newTxt = t,  
             externalLinkRgx = /http[^ \]|]+/g,
             externalLinkRgx = /http[^ \]|]+/g,
             decodeRgx = /(?:%[0-9a-z]{2}){2,}/ig,
             decodeRgx = /(?:%[0-9a-z]{2}){2,}/ig,
שורה 277: שורה 288:
     },
     },
     defaultSortSuggest: function (execute) {
     defaultSortSuggest: function (execute) {
        var txt = this.textbox.value,
var txt = this.textbox.value,
             isPerson = false,
             isPerson = false,
             firstFamilyRgx = /^([^ ]+) ([^ ]+)$/,
             firstFamilyRgx = /^([^ ]+) ([^ ]+)$/,
שורה 297: שורה 308:
             txt = txt.replace(/\[\[(קאַטעגאָריע|קאטעגאריע)/, '{{DEFAULTSORT:' + name[2] + ', ' + name[1] + '}}\n[[קאַטעגאָריע');
             txt = txt.replace(/\[\[(קאַטעגאָריע|קאטעגאריע)/, '{{DEFAULTSORT:' + name[2] + ', ' + name[1] + '}}\n[[קאַטעגאָריע');
             this.addSummary('DEFAULTSORT');
             this.addSummary('DEFAULTSORT');
            this.updateText(txt);
this.updateText(txt, true);
         }
         }
     },
     },
     categoryOrder: function (execute) {
     categoryOrder: function (execute) {
        var txt = this.textbox.value,
var txt = this.textbox.value,
             newTxt = txt,
             newTxt = txt,
             self = this,
             self = this,
שורה 337: שורה 348:
     },
     },
     duplicatedCategory: function (execute) {
     duplicatedCategory: function (execute) {
        var txt = this.textbox.value,
var txt = this.textbox.value,
             newTxt = txt,
             newTxt = txt,
             categoryRE = /(\[\[(קאַטעגאָריע|קאטעגאריע):.+\]\])(?:$|\n)/g,
             categoryRE = /(\[\[(קאַטעגאָריע|קאטעגאריע):.+\]\])(?:$|\n)/g,
שורה 375: שורה 386:
     },
     },
     createSearchLink: function (v) {
     createSearchLink: function (v) {
        var highlightStr = this.highlightString,
return searchLink = $('<a href="#">'+mw.msg( 'checkty-search' )+'</a>').data({'search': v}).click(function(e){  
            searchLink = $('<a href="#">' + mw.msg('checkty-search') + '</a>').data({ 'search': v }).click(function (e) {
chectTyTool.highlightString($(this).data('search')); e.preventDefault();
                highlightStr($(this).data('search')); e.preventDefault();
             });
             });
         return searchLink;
         return searchLink;
שורה 383: שורה 393:
     onSaveProtection: function () {
     onSaveProtection: function () {
         $('#wpSave').click(function (e) {
         $('#wpSave').click(function (e) {
            if (chectTyTool.textbox.value === chectTyTool.origText) {
if (chectTyTool.textbox.value === chectTyTool.origText) {
                 OO.ui.confirm(mw.msg('checkty-nonsense-edit')).done(function (confirmed) {
                 OO.ui.confirm(mw.msg('checkty-nonsense-edit')).done(function (confirmed) {
                     if (confirmed) {
                     if (confirmed) {
שורה 395: שורה 405:
             }
             }
         });
         });
    },
    updateText: function (val) {
        if (this.textbox.value === chectTyTool.origText) {
            chectTyTool.origText = val;
        }
        this.textbox.value = val;
     },
     },
     nakedLinks: function () {
     nakedLinks: function () {
        var t = this.textbox.value,
var t = this.textbox.value,
             nakeRegex = /\[(http[^ ]+?)\]|\{\{הערה *\| *(?:1 *= *)?(https?:\/\/[^ }|]+)\}\}|<ref(?: [^/>]*)?>(https?:\/\/[^ }|]+?)<\/ref>/g,
             nakeRegex = /\[(http[^ ]+?)\]|\{\{הערה *\| *(?:1 *= *)?(https?:\/\/[^ }|]+)\}\}|<ref(?: [^/>]*)?>(https?:\/\/[^ }|]+?)<\/ref>/g,
             nakeErrors = [], m, self = this;
             nakeErrors = [], m, self = this;
שורה 458: שורה 462:
                                     }
                                     }
                                     var template = '{{' + CiteTemplates[d[0].itemType] + '|' + params.join('|') + '}}',
                                     var template = '{{' + CiteTemplates[d[0].itemType] + '|' + params.join('|') + '}}',
                                        wikitext = self.textbox.value;
wikitext = self.textbox.value;
                                     if (inRefTemplate) {
                                     if (inRefTemplate) {
                                         wikitext = wikitext.replace(new RegExp('\\{\\{הערה *\\| *(?:1 *= *)?' + mw.util.escapeRegExp(searchUrl) + '\\}\\}', 'g'), '{{הערה|' + template + '}}');
                                         wikitext = wikitext.replace(new RegExp('\\{\\{הערה *\\| *(?:1 *= *)?' + mw.util.escapeRegExp(searchUrl) + '\\}\\}', 'g'), '{{הערה|' + template + '}}');
שורה 467: שורה 471:
                                         wikitext = wikitext.replace(new RegExp('\\[' + mw.util.escapeRegExp(searchUrl) + '\\]', 'g'), template);
                                         wikitext = wikitext.replace(new RegExp('\\[' + mw.util.escapeRegExp(searchUrl) + '\\]', 'g'), template);
                                     }
                                     }
                                    self.textbox.value = wikitext;
self.updateText(wikitext, true);
                                     self.writeMsg($('<div>').append(mw.msg('checkty-naked-link-fixed', searchUrl, template)).append(self.createSearchLink(template)));
                                     self.writeMsg($('<div>').append(mw.msg('checkty-naked-link-fixed', searchUrl, template)).append(self.createSearchLink(template)));
                                     chectTyTool.addSummary('הלבשת קישורים עירומים');
                                     chectTyTool.addSummary('הלבשת קישורים עירומים');
שורה 482: שורה 486:
     },
     },
     checkExternalLinks: function () {
     checkExternalLinks: function () {
        var t = this.textbox.value,
var t = this.textbox.value,
             externalLinksRgx = /== *קישורים חיצוניים *==(?:\n\{\{.+)*((?:\n\*.+|\n\{\{.+\}\})+)/mg,
             externalLinksRgx = /== *קישורים חיצוניים *==(?:\n\{\{.+)*((?:\n\*.+|\n\{\{.+\}\})+)/mg,
             tplCounterRgx = /\n\* *\{\{([^|]+)/g,
             tplCounterRgx = /\n\* *\{\{([^|]+)/g,
שורה 529: שורה 533:
     },
     },
     build_regexes: function (data, protect) {
     build_regexes: function (data, protect) {
        if (/\{\{\s*ללא[_ ]בוט\s*\}\}/.test(this.textbox.value)) {
if (/\{\{\s*ללא[_ ]בוט\s*\}\}/.test(this.textbox.value)) {
             this.writeMsg('<div>' + mw.msg('checkty-no-replacements') + '</div>', 'info');
             this.writeMsg('<div>' + mw.msg('checkty-no-replacements') + '</div>', 'info');
             return;
             return;
שורה 578: שורה 582:
     },
     },
     process_page: function () {
     process_page: function () {
        var t = this.textbox.value,
var t = this.textbox.value,
             skip_ar = [],
             skip_ar = [],
             actual_replaced = [], // list of actual replcements for summary
             actual_replaced = [], // list of actual replcements for summary
שורה 603: שורה 607:
             }
             }
         while (true) { //extract inner links, inner templates and inner params - we don't want to sptit those.
         while (true) { //extract inner links, inner templates and inner params - we don't want to sptit those.
             match = t.match(/(\{\{[^\{\}]*\}\}|(\n|\[\[)(?:File|קובץ|תמונה|Image):.*?[\|\n]|[^\[\0]\[[^\{\}\[]*\])/);
             match = t.match(/(\{\{[^\{\}]*\}\}|(\n|\[\[)(?:File|קובץ|תמונה|בילד|טעקע):.*?[\|\n]|\[\[[a-z]{2,3}:[^\[\]]+\]\]|[^\[\0]\[[^\{\}\[]*\])/);
             if ((!match || !match.length) && this.ignoreRegexes.length) match = t.match(ignoreRegex);
             if ((!match || !match.length) && this.ignoreRegexes.length) match = t.match(ignoreRegex);
             if (!match || !match.length) break;
             if (!match || !match.length) break;
שורה 632: שורה 636:
             match = t.match(/\0(\d+)\0/);
             match = t.match(/\0(\d+)\0/);
             if (!match || !match.length) break;
             if (!match || !match.length) break;
            t = t.replace(match[0], specials[parseInt(match[1], 10) - 1]);
t = t.replace(match[0], specials[parseInt(match[1], 10) - 1].replace('$','$$$$'));
         }
         }
         this.updateText(t);
         this.updateText(t);
שורה 677: שורה 681:
                     isDisambigPage = p.pageprops && p.title != mw.config.get('wgTitle') + mw.msg('checkty-disambig-suffix');
                     isDisambigPage = p.pageprops && p.title != mw.config.get('wgTitle') + mw.msg('checkty-disambig-suffix');
                 //list only real disambig links
                 //list only real disambig links
                if (isDisambigPage && (chectTyTool.getLinkRegex(p.title).exec(chectTyTool.textbox.value) || (redirects[p.title] && chectTyTool.getLinkRegex(redirects[p.title]).exec(chectTyTool.textbox.value)))) {
if (isDisambigPage && (chectTyTool.getLinkRegex(p.title).exec(chectTyTool.textbox.value) || (redirects[p.title] && chectTyTool.getLinkRegex(redirects[p.title]).exec(chectTyTool.textbox.value)))) {
                     disambigs.push(redirects[p.title] || p.title);
                     disambigs.push(redirects[p.title] || p.title);
                 }
                 }
שורה 693: שורה 697:
     },
     },
     mainArticlesMerge: function () {
     mainArticlesMerge: function () {
        var origTxt = this.textbox.value, txt = this.textbox.value, m;
var origTxt = this.textbox.value, txt = origTxt, m;


         while (m = /(\{\{(?:הפניה לערך מורחב|ערך מורחב)\|[^=\n]+?\}\}\n){2,}/g.exec(txt)) {
         while (m = /(\{\{(?:הפניה לערך מורחב|הויפט ארטיקל)\|[^=\n]+?\}\}\n){2,}/g.exec(txt)) {
             var articles = [], expArticleRE = /\{\{(?:הפניה לערך מורחב|ערך מורחב)\|([^=\n]+?)\}\}/g;
             var articles = [], expArticleRE = /\{\{(?:הפניה לערך מורחב|הויפט ארטיקל)\|([^=\n]+?)\}\}/g;
             while (ma = expArticleRE.exec(m[0])) articles.push(ma[1]);
             while (ma = expArticleRE.exec(m[0])) articles.push(ma[1]);
             txt = txt.replace(m[0], '{{הפניה לערך מורחב|ערכים=[[' + articles.join(']], [[') + ']]}}\n');
             txt = txt.replace(m[0], '{{הויפט ארטיקל|ערכים=[[' + articles.join(']], [[') + ']]}}\n');
         }
         }
        this.textbox.value = txt;
this.updateText(txt, true);
         if (origTxt != txt) chectTyTool.addSummary(mw.msg('checkty-main-articles-merge-summary'));
         if (origTxt != txt) chectTyTool.addSummary(mw.msg('checkty-main-articles-merge-summary'));
     },
     },
     formatReplace: function () {
     formatReplace: function () {
        var txt = this.textbox.value, newTxt;
var txt = this.textbox.value, newTxt;
         // Format autofix
         // Format autofix
         var specials = [], match;
         var specials = [], match;
שורה 737: שורה 741:
             match = txt.match(/\0(\d+)\0/);
             match = txt.match(/\0(\d+)\0/);
             if (!match || !match.length) break;
             if (!match || !match.length) break;
            txt = txt.replace(match[0], specials[parseInt(match[1], 10) - 1]);
txt = txt.replace(match[0], specials[parseInt(match[1], 10) - 1].replace('$','$$$$'));
         }
         }
         this.updateText(txt);
         this.updateText(txt);
        // if (!emptyParametersRgx.test(txt)) return;
        // emptyParametersMsg = $('<div>', { text: mw.msg('checkty-empty-parameters') }).addClass('checkty-empty-params-warning').append($('<a>', {
        // href: '#',
        // text: 'ניקוי'
        // }).click(function(){ $('#wpTextbox1').val($('#wpTextbox1').val().replace(emptyParametersRgx, '')); chectTyTool.addSummary( mw.msg( 'checkty-empty-parameters-summary' ) ); return false; }));
        // this.writeMsg(emptyParametersMsg, 'info');
     },
     },
     nikudCheck: function () {
     nikudCheck: function () {
שורה 763: שורה 761:
     },
     },
     vavCheck: function () {
     vavCheck: function () {
        var text = this.textbox.value,
var text = this.textbox.value,
             vavRegex = /[כלבמשה]\[\[ו[^ו][א-ת ]+\]\]/g, self = this;
             vavRegex = /[כלבמשה]\[\[ו[^ו][א-ת ]+\]\]/g, self = this;
         if (!vavRegex.exec(text)) return;
         if (!vavRegex.exec(text)) return;
שורה 828: שורה 826:
                     h = a.href;
                     h = a.href;
                 if (h.indexOf('#') + 1) anchor = decodeURI(h.substr(h.indexOf('#')).replace(/\./g, '%').replace(/_/g, ' '));
                 if (h.indexOf('#') + 1) anchor = decodeURI(h.substr(h.indexOf('#')).replace(/\./g, '%').replace(/_/g, ' '));
                 $(a).text(a.title.replace(mw.msg('checkty-page-doesnt-exist'), "") + anchor);
                 $(a).text(a.title.replace(" (רוי)", "").replace(mw.msg('checkty-page-doesnt-exist'), "") + anchor);
                 a.title = storeTitle;
                 a.title = storeTitle;
             }
             }
שורה 844: שורה 842:
         findSentence();
         findSentence();
         function findSentence() {
         function findSentence() {
            var text = textbox.value.substr(offset),
var text = chectTyTool.textbox.value.substr(offset),
                 m = text.match(linkRgx);
                 m = text.match(linkRgx);
             if (!m) {
             if (!m) {
שורה 857: שורה 855:
         function resolve() {
         function resolve() {
             var answer = $(this).text(),
             var answer = $(this).text(),
                text = textbox.value,
text = chectTyTool.textbox.value,
                 startLink = text.indexOf('[[' + name, offset);
                 startLink = text.indexOf('[[' + name, offset);
             if (text.charAt(startLink + 2 + name.length) != '|') answer += '|' + name;
             if (text.charAt(startLink + 2 + name.length) != '|') answer += '|' + name;
             offset += answer.length + 2;
             offset += answer.length + 2;
             text = text.substr(0, startLink + 2) + answer + text.substr(startLink + 2 + name.length);
             text = text.substr(0, startLink + 2) + answer + text.substr(startLink + 2 + name.length);
            textbox.value = text;
chectTyTool.updateText(text, true);
             findSentence();
             findSentence();
             chectTyTool.addSummary(mw.msg('checkty-dismabig-fix-summary'));
             chectTyTool.addSummary(mw.msg('checkty-dismabig-fix-summary'));
שורה 868: שורה 866:
         }
         }
         function removeLink() {
         function removeLink() {
            var text = textbox.value,
var text = chectTyTool.textbox.value,
                 startLink = text.indexOf('[[' + name, offset),
                 startLink = text.indexOf('[[' + name, offset),
                 endLink = text.indexOf(']]', startLink),
                 endLink = text.indexOf(']]', startLink),
שורה 875: שורה 873:
             offset += (endLink - startLink) + linkText.length;
             offset += (endLink - startLink) + linkText.length;
             text = text.substr(0, startLink) + linkText + text.substr(endLink + 2);
             text = text.substr(0, startLink) + linkText + text.substr(endLink + 2);
            textbox.value = text;
chectTyTool.updateText(text, true);
             findSentence();
             findSentence();
             return false;
             return false;
שורה 889: שורה 887:
     },
     },
     checkGallery: function () {
     checkGallery: function () {
        var text = this.textbox.value,
var text = this.textbox.value,
             longGalleryThreshold = 16,
             longGalleryThreshold = 16,
             galleryRgx = /<gallery.+?\n(\n|.)+?<\/gallery>/mg,
             galleryRgx = /<gallery.+?\n(\n|.)+?<\/gallery>/mg,
שורה 901: שורה 899:
         var fairUsageTemplates = ['מוסטער:שימוש הוגן', 'מוסטער:תמונת חבר כנסת'];
         var fairUsageTemplates = ['מוסטער:שימוש הוגן', 'מוסטער:תמונת חבר כנסת'];
         if (!data) {
         if (!data) {
            if (!(/\{\{(ויקישיתוף בשורה|מיזמים)/.test(this.textbox.value))) {
if (!(/\{\{(ויקישיתוף בשורה|מיזמים)/.test(this.textbox.value))) {
                 $.getJSON('//www.wikidata.org/w/api.php?callback=?', {
                 $.getJSON('//www.wikidata.org/w/api.php?callback=?', {
                     languages: 'yi',
                     languages: 'yi',
שורה 934: שורה 932:
             }
             }
             //in case there are no images in page
             //in case there are no images in page
            if (!(/\[\[(תמונה|קובץ|File|Image):/i.test(this.textbox.value)) && !(/\| ?תמונה *= *.+jpg/i.test(this.textbox.value))) {
if (!(/\[\[(תמונה|קובץ|File|Image):/i.test(this.textbox.value)) && !(/\| ?תמונה *= *.+jpg/i.test(this.textbox.value)) ) {
                 var articleName = mw.config.get('wgPageName');
                 var articleName = mw.config.get('wgPageName');
                 var that = this; // we want to use "this" in the done method of the api call.
                 var that = this; // we want to use "this" in the done method of the api call.
שורה 940: שורה 938:
                     action: 'parse',
                     action: 'parse',
                     title: articleName,
                     title: articleName,
                    text: this.textbox.value
text: this.textbox.value
                 }).done(function (data) {
                 }).done(function (data) {
                     if (data && data.parse && data.parse.text && $(data.parse.text['*']).find('a.image  img').filter(function () {
                     if (data && data.parse && data.parse.text && $(data.parse.text['*']).find('a.image  img').filter(function () {
שורה 1,032: שורה 1,030:
                             var isInInfobox = new RegExp('=\s*\\[\\[(?:file|image|קובץ|תמונה):' + imgName.replace(' ', '[ _]') + '[^\\]]*?\]\]', 'i');
                             var isInInfobox = new RegExp('=\s*\\[\\[(?:file|image|קובץ|תמונה):' + imgName.replace(' ', '[ _]') + '[^\\]]*?\]\]', 'i');
                             if (isInInfobox.test(t.val())) {
                             if (isInInfobox.test(t.val())) {
                                t.val(t.val().replace(matches[0], matches[0] + '{{' + mw.msg('checkty-fairuse-img-replace-template') + '}}'));
chectTyTool.updateText(t.val().replace(matches[0], matches[0] + '{{'+mw.msg('checkty-fairuse-img-replace-template')+'}}'), true);
                                 chectTyTool.addSummary('{{' + mw.msg('checkty-fairuse-img-replace-template') + '}}');
                                 chectTyTool.addSummary('{{' + mw.msg('checkty-fairuse-img-replace-template') + '}}');
                             }
                             }
שורה 1,050: שורה 1,048:
     },
     },
     languageCheck: function (checks) { //style and language check
     languageCheck: function (checks) { //style and language check
        var txt = this.textbox.value;
var txt = this.textbox.value;
         if (txt.length === 0) return; // nothing to do
         if (txt.length === 0) return; // nothing to do
         if (checks) {
         if (checks) {
שורה 1,090: שורה 1,088:
             }).done(function (data) {
             }).done(function (data) {
                 if (!(data && data.parse && data.parse.wikitext)) return;
                 if (!(data && data.parse && data.parse.wikitext)) return;
                 var DictionaryText = data.parse.wikitext['*'].split('-----')[1]
                 var DictionaryText = data.parse.wikitext['*'].split('-----')[1];
                 var genrealWarningWords = DictionaryText.split('\n*');
                 var genrealWarningWords = DictionaryText.split('\n*');
                 var checks = [];
                 var checks = [];
שורה 1,129: שורה 1,127:
     refsConsistencyCheck: function () {
     refsConsistencyCheck: function () {
         function safeRegexFix(fixRegex, fixReplace, check) {
         function safeRegexFix(fixRegex, fixReplace, check) {
            var txt = $('#wpTextbox1').val(),
var txt = chectTyTool.textbox.value,  
                 m;
                 m;
             //remove templates within templates
             //remove templates within templates
שורה 1,146: שורה 1,144:
                 txt = txt.replace(fixRegex, fixReplace);
                 txt = txt.replace(fixRegex, fixReplace);
                 while (m = specials.pop()) txt = txt.replace('\0' + specials.length + '\0', m);
                 while (m = specials.pop()) txt = txt.replace('\0' + specials.length + '\0', m);
                $('#wpTextbox1').val(txt);
chectTyTool.updateText(txt, true);
             }
             }
         }
         }
שורה 1,172: שורה 1,170:
     ibidWarning: function () {
     ibidWarning: function () {
         var refRE = /\{\{הערה\|(?! *שם *=)(?:1=)?((?:[^\{\}]|\{\{.*?\}\})+)(?!\|=שם=)\}\}/g,
         var refRE = /\{\{הערה\|(?! *שם *=)(?:1=)?((?:[^\{\}]|\{\{.*?\}\})+)(?!\|=שם=)\}\}/g,
            wikitext = this.textbox.value, self = this, m;
wikitext = this.textbox.value, self=this, m;
         var checkWarnings = $('<div></div>');
         var checkWarnings = $('<div></div>');
         while (m = refRE.exec(wikitext)) {
         while (m = refRE.exec(wikitext)) {
             if (/^שם[ .,]|^שם$/.test(m[1]) || /\bibid(?![^a-z])/i.test(m[1])) {
             if (/^שם[ .,]|^שם$/.test(m[1]) || /\bibid(?![^a-z])/i.test(m[1]) || /^דארט[ .,]|^דארט$/.test(m[1])) {
                 checkWarnings.append(this.createSearchLink(m[0]));
                 checkWarnings.append(this.createSearchLink(m[0]));
                 checkWarnings.append('&nbsp;-&nbsp;נמצאה הערת שוליים המפנה להערה הקודמת בצורה של שם. יש להחליף לציון מקור מדויק. ראו עוד: <a href="' + mw.util.getUrl('המכלול:רעפערענצן') + '">המכלול:רעפערענצן</a><br/>');
                 checkWarnings.append('&nbsp;-&nbsp;נמצאה הערת שוליים המפנה להערה הקודמת בצורה של שם. יש להחליף לציון מקור מדויק. ראו עוד: <a href="' + mw.util.getUrl('המכלול:רעפערענצן') + '">המכלול:רעפערענצן</a><br/>');
שורה 1,190: שורה 1,188:
             refsContent = {},// a dictionary where key is the ref name and value is the content
             refsContent = {},// a dictionary where key is the ref name and value is the content
             refReEn = /<ref name="([^"]+?)">(.+?)<\/ref>/g,
             refReEn = /<ref name="([^"]+?)">(.+?)<\/ref>/g,
            wikitext = this.textbox.value, mergedRefs = [], mergedRefsNames = [], m, k, i;
wikitext = this.textbox.value, mergedRefs = [], mergedRefsNames = [], m, k, i;
         while (m = refReEn.exec(wikitext)) {
         while (m = refReEn.exec(wikitext)) {
             references[m[1]] = (references[m[1]] || 0) + 1;
             references[m[1]] = (references[m[1]] || 0) + 1;
שורה 1,225: שורה 1,223:
             if (mergedRefsNames.length) this.writeMsg($('<div>').text('מיזוג הערות עם שמות שונים: ' + mergedRefsNames.join(', ')));
             if (mergedRefsNames.length) this.writeMsg($('<div>').text('מיזוג הערות עם שמות שונים: ' + mergedRefsNames.join(', ')));
             this.addSummary('מיזוג הערות אוטומטי');
             this.addSummary('מיזוג הערות אוטומטי');
            this.textbox.value = wikitext;
this.updateText(wikitext);
         }
         }
     },
     },
שורה 1,232: שורה 1,230:
             refTemplateRE = /\{\{הערה\|(?! *שם *=)(?:1=)?((?:[^\{\}]|\{\{.*?\}\})+)(?!\|=שם=)\}\}/g,
             refTemplateRE = /\{\{הערה\|(?! *שם *=)(?:1=)?((?:[^\{\}]|\{\{.*?\}\})+)(?!\|=שם=)\}\}/g,
             refTagRE = /<ref>(.+?)<\/ref>/g,
             refTagRE = /<ref>(.+?)<\/ref>/g,
            wikitext = this.textbox.value, m;
wikitext = this.textbox.value, m;
         while (m = refTemplateRE.exec(wikitext)) {
         while (m = refTemplateRE.exec(wikitext)) {
             references[m[1]] = references[m[1]] || [];
             references[m[1]] = references[m[1]] || [];
שורה 1,258: שורה 1,256:
                 this.addSummary(mw.msg('checkty-ref-merge')); // addSummary will only add it once
                 this.addSummary(mw.msg('checkty-ref-merge')); // addSummary will only add it once
             }
             }
            this.textbox.value = wikitext;
this.updateText(wikitext);
         }
         }
     },
     },
שורה 1,302: שורה 1,300:
     titleOrderCheck: function () {
     titleOrderCheck: function () {
         // validates the titles order is consistent
         // validates the titles order is consistent
         var orderedTitles = ['זעט אויך', 'ליינט מער', 'דרויסנדע לינקס', 'רעפערענצן'],
         var orderedTitles = ['זעט אויך', 'ליינט מער', 'דרויסנדיגע לינקס', 'רעפערענצן'],
             isSorted = 1,
             isSorted = 1,
             titles = $('#wpTextbox1').val().match('==\\s*' + orderedTitles.join('|') + '\\s*==', 'g'), i, indexes;
             titles = $('#wpTextbox1').val().match('==\\s*' + orderedTitles.join('|') + '\\s*==', 'g'), i, indexes;
שורה 1,313: שורה 1,311:
     },
     },
     refDirSuggest: function () { // suggest adding direction for refs
     refDirSuggest: function () { // suggest adding direction for refs
        var wikitext = this.textbox.value,
var wikitext = this.textbox.value,
             defaultDir = (/{{רעפערענצן *\| *יישור *= *שמאל}}/.exec(wikitext)) ? 'ltr' : 'rtl',
             defaultDir = (/{{רעפערענצן *\| *יישור *= *שמאל}}/.exec(wikitext)) ? 'ltr' : 'rtl',
             ltrRefRegex = /\{\{הערה\|(?:שם ?=[^|]*\|)?(?:1= *)?(?! *\[?https?:\/\/[^ ]+\]? *\}\})( *\[?[a-z][^א-ת\u0600-\u06FF{|]+?)\}\}/ig,
             ltrRefRegex = /\{\{הערה\|(?:שם ?=[^|]*\|)?(?:1= *)?(?! *\[?https?:\/\/[^ ]+\]? *\}\})( *\[?[a-z][^א-ת\u0600-\u06FF{|]+?)\}\}/ig,
שורה 1,324: שורה 1,322:
             var fixRefDirLink = $('<a href="#">' + mw.msg('checkty-ref-dir-fix') + '</a>').data({ 'search': m[0] }).click(function (e) {
             var fixRefDirLink = $('<a href="#">' + mw.msg('checkty-ref-dir-fix') + '</a>').data({ 'search': m[0] }).click(function (e) {
                 var specificRefRgx = new RegExp('\\[\\[(' + mw.util.escapeRegExp($(this).data('search')) + ')(\\]\\]|\\|).+\\[\\[\\1(\\]\\]|\\|.+?\\]\\])', 'g'),
                 var specificRefRgx = new RegExp('\\[\\[(' + mw.util.escapeRegExp($(this).data('search')) + ')(\\]\\]|\\|).+\\[\\[\\1(\\]\\]|\\|.+?\\]\\])', 'g'),
                    wikitext = $('#wpTextbox1').val();
wikitext = chectTyTool.textbox.value;
                 wikitext = wikitext.replace($(this).data('search'), $(this).data('search').replace('}}', '|כיוון=' + uncommonDir + '}}'));
                 wikitext = wikitext.replace($(this).data('search'), $(this).data('search').replace('}}', '|כיוון=' + uncommonDir + '}}'));
                $('#wpTextbox1').val(wikitext);
chectTyTool.updateText(wikitext, true);
                 chectTyTool.addSummary(mw.msg('checkty-ref-dir-fix'));
                 chectTyTool.addSummary(mw.msg('checkty-ref-dir-fix'));
                 e.preventDefault();
                 e.preventDefault();
             });
             });


             var searchRef = this.createSearchLink(m[1]);
             //var searchRef = this.createSearchLink(m[1]);
             this.writeMsg($('<div>').append(['נמצאה הערת שוליים ללא הגדרת כיווניות "' + m[1] + '" [', searchRef, '&nbsp;-&nbsp;', fixRefDirLink, ']']), 'alert');
             //this.writeMsg($('<div>').append(['נמצאה הערת שוליים ללא הגדרת כיווניות "' + m[1] + '" [', searchRef, '&nbsp;-&nbsp;', fixRefDirLink, ']']), 'alert');
         }
         }
     },
     },
     refSection: function (fix) {
     refSection: function (fix) {
        var wikitext = this.textbox.value, newText = wikitext, self = this,
var wikitext = this.textbox.value, newText = wikitext, self = this,
             refRE = /<ref>|\{\{הערה\|/g,
             refRE = /<ref>|\{\{הערה\|/g,
             refSectionRE = /\{\{רעפערענצן|\{\{הערות[ _]שוליים|<references[ >]/g,
             refSectionRE = /\{\{רעפערענצן|\{\{הערות[ _]שוליים|<references[ >]/g,
שורה 1,348: שורה 1,346:
             for (var i = 0; (i < lastItems.length) && (wikitext == newText); i++) newText = wikitext.replace(lastItems[i], autoRefSection + '$1');
             for (var i = 0; (i < lastItems.length) && (wikitext == newText); i++) newText = wikitext.replace(lastItems[i], autoRefSection + '$1');
             if (wikitext === newText) newText = wikitext + autoRefSection;
             if (wikitext === newText) newText = wikitext + autoRefSection;
            this.textbox.value = newText;
this.updateText(newText, true);
             this.addSummary('רעפערענצן אפטיילונג');
             this.addSummary('רעפערענצן אפטיילונג');
             this.writeMsg($('<div>' + mw.msg('checkty-missing-ref-section-added') + '</div>'), 'info');
             this.writeMsg($('<div>' + mw.msg('checkty-missing-ref-section-added') + '</div>'), 'info');
שורה 1,359: שורה 1,357:
         var wikitext = this.textbox.value.replace(/\[\[רוי:/g, '[[');
         var wikitext = this.textbox.value.replace(/\[\[רוי:/g, '[[');
         if (wikitext != this.textbox.value) {
         if (wikitext != this.textbox.value) {
            this.textbox.value = wikitext;
this.updateText(wikitext);
             chectTyTool.addSummary('אראפגענומען דירעקטע רוי לינקס');
             chectTyTool.addSummary('אראפגענומען דירעקטע רוי לינקס');
         }
         }
שורה 1,389: שורה 1,387:
         var wikitext = this.textbox.value.replace(pattern, replaceMatch);
         var wikitext = this.textbox.value.replace(pattern, replaceMatch);
         if (wikitext != this.textbox.value) {
         if (wikitext != this.textbox.value) {
            this.textbox.value = wikitext;
this.updateText(wikitext);
             chectTyTool.addSummary('פארראכטן רבי לינקס');
             chectTyTool.addSummary('פארראכטן רבי לינקס');
         }
         }
שורה 1,404: שורה 1,402:
         }
         }
         // using [^{}\n] as a quick hack to counting links within templates
         // using [^{}\n] as a quick hack to counting links within templates
        var wikitext = this.textbox.value,
var wikitext = this.textbox.value,
             overlinkingRgx = /\[\[([^\[\]\|]+?)(?:\]\]|\|)[^{}\n]*(?:\{\{[^{]+\}\})?(?:[^{}\n]*)(?:\n\*[^{}\n]*)?\[\[\1(?:\]\]|\|.+?\]\])/g,
             overlinkingRgx = /\[\[([^\[\]\|]+?)(?:\]\]|\|)[^{}\n]*(?:\{\{[^{]+\}\})?(?:[^{}\n]*)(?:\n\*[^{}\n]*)?\[\[\1(?:\]\]|\|.+?\]\])/g,
             m;
             m;
שורה 1,414: שורה 1,412:
             var removeLink = $('<a href="#">' + mw.msg('checkty-remove-link') + '</a>').data({ 'search': m[1] }).click(function (e) {
             var removeLink = $('<a href="#">' + mw.msg('checkty-remove-link') + '</a>').data({ 'search': m[1] }).click(function (e) {
                 var specificOverlinkingRgx = new RegExp('\\[\\[(' + $(this).data('search') + ')(\\]\\]|\\|)[^{}\n]*(?:\{\{[^{]+\}\})?(?:[^{}\n]*)(?:\n\*[^{}\n]*)?\\[\\[\\1(\\]\\]|\\|.+?\\]\\])', 'g');
                 var specificOverlinkingRgx = new RegExp('\\[\\[(' + $(this).data('search') + ')(\\]\\]|\\|)[^{}\n]*(?:\{\{[^{]+\}\})?(?:[^{}\n]*)(?:\n\*[^{}\n]*)?\\[\\[\\1(\\]\\]|\\|.+?\\]\\])', 'g');
                var wikitext = $('#wpTextbox1').val(), m;
var wikitext = chectTyTool.textbox.value, m;
                 while (m = specificOverlinkingRgx.exec(wikitext)) {
                 while (m = specificOverlinkingRgx.exec(wikitext)) {
                     wikitext = wikitext.replace(m[0], removeOverlink(m[0], m[1]));
                     wikitext = wikitext.replace(m[0], removeOverlink(m[0], m[1]));
                 }
                 }
                $('#wpTextbox1').val(wikitext);
chectTyTool.updateText(wikitext);
                 chectTyTool.addSummary('אראפגענומען איבריגע לינקס');
                 chectTyTool.addSummary('אראפגענומען איבריגע לינקס');
                 e.preventDefault();
                 e.preventDefault();
שורה 1,432: שורה 1,430:
     extractWikidataLabelsSuggestions: function () {
     extractWikidataLabelsSuggestions: function () {
         var suggestLabelsREen = /(?:\[\[|\|)([א-ת' \-]+?)\]\](?: \('*([a-z][^א-ת]+?)'*\)| *\{\{אנג?\|(.+?)\}\})/gi,
         var suggestLabelsREen = /(?:\[\[|\|)([א-ת' \-]+?)\]\](?: \('*([a-z][^א-ת]+?)'*\)| *\{\{אנג?\|(.+?)\}\})/gi,
suggestLabelsREfr =  /(?:\[\[|\|)([א-ת' \-]+?)\]\]( *\{\{צרפ?\|(.+?)\}\})/gi,
suggestLabelsREfr =  /(?:\[\[|\|)([א-ת' \-]+?)\]\](?: *\{\{צרפ?\|(.+?)\}\})/gi,
             langLink = /\{\{קישור שפה\|(?:([א-ת]*)\|)?(?: *2=)? *([^|]+?)\|(?: *3=)? *([א-ת '\-]+?)\}\}/gi,
             langLink = /\{\{קישור שפה\|(?:([א-ת]*)\|)?(?: *2=)? *([^|]+?)\|(?: *3=)? *([א-ת '\-]+?)\}\}/gi,
langTable = { 'שפאניש': 'es', 'ענגליש': 'en', 'פראנצויזיש': 'fr', 'דייטש': 'de' },
langTable = { 'שפאניש': 'es', 'ענגליש': 'en', 'פראנצויזיש': 'fr', 'דייטש': 'de' },
             self = this,
             self = this,
            text = this.textbox.value,
text = this.textbox.value,
             suggestionsByLang = {}, // lang -> { foreign title -> hebrew label }
             suggestionsByLang = {}, // lang -> { foreign title -> hebrew label }
             foreignTitles = [],
             foreignTitles = [],
             m, lang, suggestions;
             m, lang, suggestions;


        suggestionsByLang['en'] = {};
suggestionsByLang = { 'en' : {}, 'fr': {} };
         // populate suggestions
         // populate suggestions
         while (m = suggestLabelsREen.exec(text)) suggestionsByLang['en'][m[2] || m[3]] = (m[1] || 'ענגליש');
         while (m = suggestLabelsREen.exec(text)) suggestionsByLang['en'][m[2] || m[3]] = (m[1] || 'ענגליש');
שורה 1,573: שורה 1,571:
         // replace minus => dash foreach x-y s.t x<y and swap y and x otherwise. prefix/suffix requirement in regex to make sure it is within sentence
         // replace minus => dash foreach x-y s.t x<y and swap y and x otherwise. prefix/suffix requirement in regex to make sure it is within sentence
         var numberRangeReNoMinus = /([^|\n]*[א-ת]+'?[-\ ]*)((?:\[\[|\()?[0-9]+(?:\]\])?)-((?:\[\[)?[0-9]+)((?:\]\]|\))?[.:,]?(?:[ \|]|\n)(?!לפנה"ס))/g,
         var numberRangeReNoMinus = /([^|\n]*[א-ת]+'?[-\ ]*)((?:\[\[|\()?[0-9]+(?:\]\])?)-((?:\[\[)?[0-9]+)((?:\]\]|\))?[.:,]?(?:[ \|]|\n)(?!לפנה"ס))/g,
            wikitext = this.textbox.value, replacements = [], m, i;
wikitext = this.textbox.value, replacements = [], m, i;
         while (m = numberRangeReNoMinus.exec(wikitext)) {
         while (m = numberRangeReNoMinus.exec(wikitext)) {
             if (/^קובץ:|בואינג [0-9]|^טעקע:|^file:/.exec(m[1])) continue; // skip wrong suggestion
             if (/^קובץ:|בואינג [0-9]|^טעקע:|^file:/.exec(m[1])) continue; // skip wrong suggestion
שורה 1,590: שורה 1,588:
                 wikitext = wikitext.replace(new RegExp(mw.util.escapeRegExp(replacements[i][0]), 'g'), replacements[i][1]);
                 wikitext = wikitext.replace(new RegExp(mw.util.escapeRegExp(replacements[i][0]), 'g'), replacements[i][1]);
             }
             }
            this.textbox.value = wikitext;
this.updateText(wikitext);
             this.addSummary('קו מפריד בטווח מספרים');
             this.addSummary('קו מפריד בטווח מספרים');
         } else {
         } else {
שורה 1,598: שורה 1,596:
     //original version from http://code.google.com/p/proveit-js/source/browse/ProveIt_Wikipedia.js#384
     //original version from http://code.google.com/p/proveit-js/source/browse/ProveIt_Wikipedia.js#384
     //thanks to Georgia Tech Research Corporation. Atlanta, GA 30332-0415
     //thanks to Georgia Tech Research Corporation. Atlanta, GA 30332-0415
    highlightString: function (toFind) {
highlightString: function (toFind) {
        var txtArea = $('#wpTextbox1');
var content = this.textbox.value, txtArea = $(this.textbox);
         // cast to string if this is regex
         // cast to string if this is regex
         if (RegExp.prototype.isPrototypeOf(toFind)) {
         if (RegExp.prototype.isPrototypeOf(toFind)) {
            toFind = toFind.exec(txtArea.val());
toFind = toFind.exec(content);
             if (!toFind) return;
             if (!toFind) return;
             toFind = toFind[0];
             toFind = toFind[0];
         }
         }
        var nextPlace = txtArea.val().indexOf(toFind, txtArea.textSelection('getCaretPosition') + 1);
var nextPlace = content.indexOf(toFind, txtArea.textSelection('getCaretPosition') + 1);
        if (nextPlace === -1) nextPlace = txtArea.val().indexOf(toFind); //start from begining
if (nextPlace === -1) nextPlace = content.indexOf(toFind); //start from begining
         if (nextPlace === -1) return; //not found... nothing to do
         if (nextPlace === -1) return; //not found... nothing to do
        var origText = txtArea.val();
var origText = content;
         txtArea.val(origText.substring(0, nextPlace));
         txtArea.val(origText.substring(0, nextPlace));
         txtArea.focus();
         txtArea.focus();
שורה 1,623: שורה 1,621:
             end: nextPlace + toFind.length
             end: nextPlace + toFind.length
         });
         });
txtArea.textSelection('scrollToCaretPosition');
     },
     },
     addAuthorityControl: function (v) {
     addAuthorityControl: function (v) {
        var t = this.textbox.value,
var t = this.textbox.value,
             acTemplate = /\{\{בקרת זהויות[\}|]/g,
             acTemplate = /\{\{בקרת זהויות[\}|]/g,
            artsTitle = /== *(?:מ?ספרי[הו]|מ?יצירותי[הו]|מ?חיבורי[הו]|(פרסומים|מאמרים) נבחרים|פילמוגרפיה.*|(?:מבחר)? (?:כתבי)|דיסקוגרפיה|יצירות) *==/, //cheap hint for art occuption in text
artsTitle = /== *(?:מ?ספרי[הו]|מ?יצירותי[הו]|מ?חיבורי[הו]|(פרסומים|מאמרים) נבחרים|מ?פרסומי[הו]|פילמוגרפיה.*|(?:מבחר)? (?:כתבי)|דיסקוגרפיה|יצירות) *==/, //cheap hint for art occuption in text
             artsCategory = /\[\[קאטעגאריע:(מוזיקאיות|מוזיקאנטן|זמרות|זינגערס|שרייבערס|סופרות|משוררים|משוררות|מתרגמים|ציירות|ציירים|במאי|רבנים|רבניות)(?!.+\*)/; //cheap hint for art occuption in category
             artsCategory = /\[\[קאטעגאריע:(מוזיקאיות|מוזיקאנטן|זמרות|זינגערס|שרייבערס|סופרות|משוררים|משוררות|מתרגמים|ציירות|ציירים|במאי|רבנים|רבניות)(?!.+\*)/; //cheap hint for art occuption in category
         if (acTemplate.exec(t)) return; // AC already exist
         if (acTemplate.exec(t)) return; // AC already exist
שורה 1,703: שורה 1,702:
     },
     },
     addAuthorityControlTemplate: function () {
     addAuthorityControlTemplate: function () {
        var t = this.textbox.value,
var t = this.textbox.value,
             viafTemplate = /\{\{בקרת זהויות[\}|]/g,
             viafTemplate = /\{\{בקרת זהויות[\}|]/g,
             acTemplate = '{{' + 'בקרת זהויות}}',
             acTemplate = '{{' + 'בקרת זהויות}}',
שורה 1,712: שורה 1,711:
         if (newText == t) newText = t.replace(/\[\[קאטעגאריע:/, acTemplate + '\n[[קאטעגאריע:'); // before categories
         if (newText == t) newText = t.replace(/\[\[קאטעגאריע:/, acTemplate + '\n[[קאטעגאריע:'); // before categories
         if (newText == t) newText = t + '\n' + acTemplate;
         if (newText == t) newText = t + '\n' + acTemplate;
        this.textbox.value = newText;
this.updateText(newText, true);
         this.addSummary('בקרת זהויות');
         this.addSummary('בקרת זהויות');
     }
     }