Qeyd: Dəyişiklikləri yayımladıqdan sonra etdiyiniz dəyişikliklərin görünməsi üçün brauzerinizin keşinin təmizlənməsi lazım ola bilər.

  • Firefox / Safari: Reload düyməsinə basılı tutarkən Shift düyməsinə basın, və ya Ctrl+F5 və ya Ctrl+R (Mac üçün ⌘-R )
  • Google Chrome: Ctrl-Shift-R (Mac üçün ⌘-Shift-R)
  • Internet Explorer / Edge: Ctrl düyməsini basılı tutarkən Refresh düyməsinə basın, və ya sadəcə Ctrl+F5
  • Opera: Ctrl+F5.
/* Latın qrafikalı mətndə kiril qrafikalı hərflərin ayırd edilməsi üçün qadcet
	CC-BY-SA 4.0 RLuts, DonRumata, Vort 
	Подсветка слов со смесью кириллицы и латиницы.
*/
function highlight($content) {
    let latPattern = '[Ѐ-҄҇-ԯᲀ-ᲈᴫᵸⷠ-ⷿꙀ-ꚟ︮-︯]'; 
    let cyrPattern = '[A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞿꟂ-ꟊꟵ-ꟿꬰ-ꭚꭜ-ꭤꭦ-ꭩff-stA-Za-z]';
    var cyrLat = new RegExp('(' + latPattern + '+(?=' + cyrPattern + '))', 'g'); 
    var latCyr = new RegExp('(' + cyrPattern + '+)(' + latPattern + '+)', 'g');

    jQuery.fn.extend({
        lightLay: function () {
            return $(this).each(function () {
                function wrapRangeInTextNode(node, pos, len) {
                    let startNode = node.splitText(pos),
                        ret = startNode.splitText(len);
                    $(startNode).wrapAll('<span style="background-color: #ADFF2F"; title="Bu hərf kiril qrafikasındadır";></span>');
                    return ret;
                }
                function wrapMatches(node, regex, group) {
                    let match;
                    regex.lastIndex = 0;
                    while ((match = regex.exec(node.textContent)) !== null && match[group] !== '') {
                        let pos = match.index;
                        for (let i = 1; i < group; i++)
                            pos += match[i].length;
                        node = wrapRangeInTextNode(node, pos, match[group].length);
                    }
                    return node;
                }
                let node = this;
                wrapMatches(node, cyrLat, 1);
                while (node !== null) {
                    wrapMatches(node, latCyr, 2);
                    node = node.nextSibling;
                    while (node !== null && node.nodeType !== 3) {
                        node = node.nextSibling;
                    }
                }
            });
        }
    });

    function onlyTextNode() {
        return this.nodeType == 3;
    }
    switch (mw.config.get('wgAction')) {
        case 'view':
            $content.find('#firstHeading span:nth-child(2)').contents().filter(onlyTextNode).lightLay();
            $content.find('#mw-pages').contents().filter(onlyTextNode).lightLay();
        case 'submit': // предпросмотр с перезагрузкой
        case 'edit': // предпросмотр без перезагрузки страницы
            $content.parent().find('.mw-parser-output').find('*').contents().filter(onlyTextNode).lightLay();
            break;
    }
}

if ($.inArray(mw.config.get('wgAction'), ['view', 'edit', 'submit']) !== -1 && mw.config.get('wgNamespaceNumber') >= 0) {
    mw.loader.using('mediawiki.util').done(function () {
        mw.hook('wikipage.content').add(highlight);
    });
}
Mənbə — ""

Informasiya Melumat Axtar

Anarim.Az

Sayt Rehberliyi ile Elaqe

Saytdan Istifade Qaydalari

Anarim.Az 2004-2023