НАРОЧИТО: По съхранѥнии можєши обити своѥго съмотрила съхранъ да видѣлъ би мѣнꙑ

  • Mozilla ли Firefox ли Safari' ли жьмꙑи Shift а мꙑшиѭ жьми Reload или жьми Ctrl-F5 ꙗко жє Ctrl-R (⌘-R вън Apple Mac)
  • Google Chrome: ли жьмꙑи Ctrl-Shift-R (⌘-Shift-R въ Mac)
  • Internet Explorer ли жьмꙑи Ctrl а мꙑшиѭ жьми Refresh или жьми Ctrl-F5
  • Опєрꙑ польꙃєватєльмъ можєть бꙑти ноужда пльнѣ поничьжити ихъ съмотрила съхранъ въ Tools → Preferences (Opera → Preferences вън Apple Mac) ⁙
/**
Old Church Slavic Wikipedia transliterator            
Early Cyrillic to Glagolitic convertion
Based on Old English Wikipedia transliterator by PiRSquared17
(https://ang.wikipedia.org/wiki/User:PiRSquared17/spellingstyle.js GFDL / CC-BY-SA 3.0)
**/
/**
 * Actually clone content, and transliterate
 *
 * @param event The event: event.data.outputstyle (see convertStyle args 2,3)
 * @returns nothing (undefined)
 */
function doConv(event) {
    var $ = jQuery;
    if ($("#mw-content-text-clone").length)
        $("#mw-content-text-clone").remove();
    //console.log("Entered doConv, (possibly removed old clone)");
    // get target style
    var targetstyle = event.data.outputstyle;
    var contentClone;
    $("#mw-content-text").show();
    contentClone = $("#mw-content-text").clone();
    contentClone.attr("id", "mw-content-text-clone");
    convertStyle(contentClone, "cyrs", targetstyle);
    convertStyle(contentClone, "cyrl", targetstyle);
    convertStyle(contentClone, "glag", targetstyle);
    $("#mw-content-text").hide();
    if (targetstyle == "cyrl")
        contentClone.addClass("content-cyrl");
    else
        contentClone.addClass("content-" + targetstyle);
    contentClone.insertAfter("#mw-content-text");
    $(".click-cyrs").click({"outputstyle": "cyrs"}, doConv);
    $(".click-cyrl").click({"outputstyle": "cyrl"}, doConv);
    $(".click-glag").click({"outputstyle": "glag"}, doConv);
}

// any errors? Fix them
var glag = { // glagolitic to cyrillic substitutions
    "ⰰ": "а",
    "ⰱ": "б",
    "ⰲ": "в",
    "ⰳ": "г",
    "ⰴ": "д",
    "ⰵ": "є",
    "ⰶ": "ж",
    "ⰷ": "ꙃ",
    "ⰸ": "ꙁ",
    "ⰺ": "ї",
    "ⰻ": "и",
    "ⰽ": "к",
    "ⰾ": "л",
    "ⰿ": "м",
    "ⱀ": "н",
    "ⱁ": "о",
    "ⱂ": "п",
    "ⱃ": "р",
    "ⱄ": "с",
    "ⱅ": "т",
    "ⱆ": "оу",
    "ⱇ": "ф",
    "ⱈ": "х",
    "ⱉ": "ѡ",
    "ⱌ": "ц",
    "ⱍ": "ч",
    "ⱎ": "ш",
    "ⱋ": "щ",
    "ⱏ": "ъ",
    "ⱐ": "ь",
    "ⱑ": "ѣ",
    "ⱓ": "ю",
    "ⱔ": "ѧ",
    "ⱗ": "ѩ",
    "ⱘ": "ѫ",
    "ⱙ": "ѭ",
    "ⱚ": "ѳ",
    "ⱛ": "ѵ",
};

// again, please report any errors, please include replacement for this
var glag2 = { // cyrillic -> glagolitic
    "а": "ⰰ",
    "б": "ⰱ",
    "в": "ⰲ",
    "г": "ⰳ",
    "д": "ⰴ",
    "є": "ⰵ",
    "ж": "ⰶ",
    "ꙃ": "ⰷ",
    "ꙁ": "ⰸ",
    "ї": "ⰺ",
    "и": "ⰻ",
    "к": "ⰽ",
    "л": "ⰾ",
    "м": "ⰿ",
    "н": "ⱀ",
    "о": "ⱁ",
    "п": "ⱂ",
    "р": "ⱃ",
    "с": "ⱄ",
    "т": "ⱅ",
    "ф": "ⱇ",
    "х": "ⱈ",
    "ѡ": "ⱉ",
    "ц": "ⱌ",
    "ч": "ⱍ",
    "ш": "ⱎ",
    "щ": "ⱋ",
    "ъ": "ⱏ", 
    "ꙑ": "ⱏⰻ",
    "ь": "ⱐ",
    "ѣ": "ⱑ",
    "ю": "ⱓ",
    "ꙗ": "ⱑ",
    "ѥ": "ⰵ",
    "ѧ": "ⱔ",
    "ѩ": "ⱗ",
    "ѫ": "ⱘ",
    "ѭ": "ⱙ",
    "ѯ": "ⰽⱄ",
    "ѱ": "ⱂⱄ",
    "ѳ": "ⱚ",
    "ѵ": "ⱛ",
    "ѷ": "ⱛ"
};

/**
 * Two or more characters -> a single rune or a pattern of glag
 * Put here anything that should be converted from two or more cyrs characters to one or more rune.
 */
glag2_exceptions = [
   ["оу", "ⱆ"],
   ["дꙁ", "ⰷ"]
];

/**
 * Replace occurrences of regex, possibly normalize
 *
 * For nodes (not text) input, modifies object
 * @param input the input text or jQuery object
 * @param regex the regular expression
 * @param replacement replacement
 * @param norm Normalize input? (also converts to lowercase)
 * @returns the converted version of input (as text/DOM node)
 */
var myReplace = function(input, regex, replacement, norm) {
    var $ = jQuery;
    if(typeof normalizeString === 'undefined') return;
    if (typeof regex == "string")
        regex = new RegExp(regex, "g");
    if (typeof input == "string")
        return norm?normalizeString(input).toLowerCase():input.replace(regex,replacement);
    if (typeof input == "undefined") return;
    var node = input[0];
    if (typeof node == "undefined") node = input;
    if (!("nodeType" in node)) return node;
    if (node.nodeType == 3) {
        if (norm) node.nodeValue = normalizeString(node.nodeValue).toLowerCase();
        node.nodeValue = node.nodeValue.replace(regex, replacement);
    } else {
            if ($(node).hasClass("nochange")) return node;
        if (!("childNodes" in node)) return node;
        for (var i = 0, len = node.childNodes.length; i < len; i++)
            myReplace($(node.childNodes[i]), regex, replacement, norm);
    }
    return node;
};

/**
 * Convert style of text/jQuery node from one spelling style to another
 *
 * @param inputhtml input text or jQuery node
 * @param inputstyle possible values: "cyrs", "cyrl", "glag"
 * @param outputstyle possible values:"cyrs", "cyrl", "glag"
 * @returns converted version of inputhtml
 */
function convertStyle(inputhtml, inputstyle, outputstyle) {
    var temp = inputhtml;
    if (inputstyle == outputstyle) return inputhtml;
    if (inputstyle == "cyrs" && outputstyle == "cyrl") {
    	temp = myReplace(temp, /Ꙁ/g, "З");
        temp = myReplace(temp, /ꙁ/g, "з");
        temp = myReplace(temp, /Ꙃ/g, "Ѕ");
        temp = myReplace(temp, /ꙃ/g, "ѕ");
        temp = myReplace(temp, /Ꙑ/g, 'Ы');
        temp = myReplace(temp, /ꙑ/g, 'ы');
    } else if (inputstyle == "cyrl" && outputstyle == "cyrs") {
        temp = myReplace(temp, /З/g, 'Ꙁ');
        temp = myReplace(temp, /з/g, 'ꙁ');
        temp = myReplace(temp, /Ѕ/g, 'Ꙃ');
        temp = myReplace(temp, /ѕ/g, 'ꙃ');
        temp = myReplace(temp, /Ы/g, 'Ꙑ');
        temp = myReplace(temp, /ы/g, 'ꙑ');
    } else if (inputstyle == "glag") {
        for (var glagolitic in glag) {
            temp = myReplace(temp, glagolitic, glag[glagolitic]);
        }
        return convertStyle(temp, "cyrs", outputstyle);
    } else if (outputstyle == "glag") {
        temp = convertStyle(myReplace(temp,"","",1), inputstyle, "cyrs");
        for (var i = 0; i < glag2_exceptions.length; i++) {
            temp = myReplace(temp,glag2_exceptions[i][0],glag2_exceptions[i][1]);
        }
        for (var cyrillic in glag2) {
            temp = myReplace(temp, cyrillic, glag2[cyrillic]);
        }
    }
    return temp;
}

/*
 * This is code to be executed when the document is ready
 * Basically, add [ cyrs ] [ cyrl ] [ glag ].
 * Clicking each link converts the document to that style.
 * (see doConv)
 */
$(function() {
    $ = jQuery;
    $("#mw-content-text").prepend($("<div class=\"center\"><small>[ <a href=\"javascript:void(0);\" class=\"click-cyrs\">cyrs</a> ] [ <a href=\"javascript:void(0);\" class=\"click-cyrl\">cyrl</a> ] [ <a href=\"javascript:void(0);\" class=\"click-glag\">glag</a> ]<sup><a href=\"/wiki/Wikipedia:Stylistic_and_font_options\" title=\"Style and font help\">?</a></sup></small></div>"));
    $(".click-cyrs").click({"outputstyle": "cyrs"}, doConv);
    $(".click-cyrl").click({"outputstyle": "cyrl"}, doConv);
    $(".click-glag").click({"outputstyle": "glag"}, doConv);
    if (typeof enableNoDots !== "undefined" && enableNoDots) $(function(){$("<span> [ <a id='tempthing'>no dots</a> ]</span>").click({"outputstyle": "nodots"}, doConv).appendTo($(".click-glag").parent());});
    if (typeof enableMacrons !== "undefined" && enableMacrons) $(function(){$("<span> [ <a id='tempthing2'>āēīōū</a> ]</span>").click({"outputstyle": "macronsrule"}, doConv).appendTo($(".click-glag").parent());});
});