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

פארברייטערט
(רעדאגירונג)
(פארברייטערט)
שורה 103: שורה 103:
});
});
importScript('באַניצער:צמא_לדעת/צאל-באקוקט.js');
importScript('באַניצער:צמא_לדעת/צאל-באקוקט.js');
$('a[href="/"').attr("id","gadget-aspaklaryacheck-link");
$("#gadget-aspaklaryacheck-link").attr("href","#");
if (document.location.href.indexOf("action")>-1){
}else{
$('#gadget-aspaklaryacheck-link').click(function(){
             
var URL = 'https://yi.hamichlol.org.il/w/index.php?title='+ encodeURI("המכלול:בדיקת מילים חשודות") + '&action=raw';
$.get(URL ,function(data, status){
            var theWords=data.split("<!--  -->")           
            //אדום כהה
            lula(theWords[1], "#ff5555");
            //אדום בהיר
            lula(theWords[3], "#ffcccc");
            //ירוק
            lula(theWords[5], "#99ff99");
            //כחול
            lula(theWords[7], "#ccccff");
            //צהוב
            lula(theWords[9], "#eeee99");
            function lula (A, Scolor){
                wrapText('.mw-parser-output', 'background-Color:' + Scolor, A);
            };
            function wrapText(selector, style, theWords) {
                theWords = theWords.trim();
                var regex = new RegExp("("+theWords+")", 'g');
                var allTextNodes = $(selector).find('*').contents().filter(function () {
                    return this.nodeType === 3;
                });
                allTextNodes.each(function () {
                    var ele = $(this);
                    var oldText = ele.text();
                    var newText = oldText.replace(regex, function (m) {
                        return '<span style="' + style + '">' + m + '</span>';
                    });
                    ele.replaceWith(newText);
                });
            }
        });
    })
}
אספקלריה רעדאקטארן
3,079

רעדאגירונגען