User:Mike Dillon/Scripts/ancientGreekSortKey.js

Hello, you have come here looking for the meaning of the word User:Mike Dillon/Scripts/ancientGreekSortKey.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Mike Dillon/Scripts/ancientGreekSortKey.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:Mike Dillon/Scripts/ancientGreekSortKey.js in singular and plural. Everything you need to know about the word User:Mike Dillon/Scripts/ancientGreekSortKey.js you have here. The definition of the word User:Mike Dillon/Scripts/ancientGreekSortKey.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Mike Dillon/Scripts/ancientGreekSortKey.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
function createAncientGreekSortKey(input, maintainCase) {
    if (!input) return input;

    var map = {
        'α': //g,
        'Α': //g,
        'ε': //g,
        'Ε': //g,
        'η': //g,
        'Η': //g,
        'ι': //g,
        'Ι': //g,
        'ο': //g,
        'Ο': //g,
        'υ': //g,
        'Υ': //g,
        'ω': //g,
        'Ω': //g,
        'ρ': //g,
        'Ρ': //g,
        /* 'σ': /ς/g, */
        'αι': //g,
        'Αι': //g,
        'ηι': //g,
        'Ηι': //g,
        'ωι': //g,
        'Ωι': //g,
        '': /´῾`΅῭῟῞῝῏῎῍῁῀᾿᾽/g
    };

    var output = input;
    if (!maintainCase) output = output.toLowerCase();
    for (var k in map) {
        output = output.replace(map, k);
    }
    return output;
}

// Only add onload hook if the page name contains at least one Greek character
if ((wgAction == "edit" || wgAction == "submit")
    && wgPageName.match(//)) {

    addOnloadHook(function () {
        // Case sensitive
        var li = mw.util.addPortletLink('p-tb', '#',
            'Greek sort key',
            't-grc-sort',
            'Create Ancient Greek sort key from page title');
        li.getElementsByTagName("a").onclick = function () {
            insertTags(createAncientGreekSortKey(wgPageName), '', '');
            return false;
        };

        // Case sensitive
        var li = mw.util.addPortletLink('p-tb', '#',
            'Greek sort key (case-sensitive)',
            't-grc-sort-nofold',
            'Create Ancient Greek sort key from page title (maintain case)');
        li.getElementsByTagName("a").onclick = function () {
            insertTags(createAncientGreekSortKey(wgPageName, true), '', '');
            return false;
        };
    });
}