Toscead betweox fadungum "Brūcend:DaveZ122/spellingstyle.js"

Content deleted Content added
No edit summary
No edit summary
 
Líne 164:
*
* @param inputhtml input text or jQuery node
* @param inputstyle possible values: "gw漢字", "ȝƿ",Pha̍k-fa-sṳ "runes"
* @param outputstyle possible values:"gw漢字", "ȝƿ",Pha̍k-fa-sṳ "runes"
* @returns converted version of inputhtml
*/
Líne 171:
var temp = inputhtml;
if (inputstyle == outputstyle) return inputhtml;
if (inputstyle == "gw漢字" && outputstyle == "ȝƿPha̍k-fa-sṳ ") {
temp = myReplace(temp, /G/g, 'Ȝ');
temp = myReplace(temp, /g/g, 'ȝ');
temp = myReplace(temp, /W/g, 'Ƿ');
temp = myReplace(temp, /w/g, 'ƿ');
} else if (inputstyle == "ȝƿPha̍k-fa-sṳ" && outputstyle == "gwPha̍k-fa-sṳ") {
temp = myReplace(temp, /Ȝ/g, "G");
temp = myReplace(temp, /ȝ/g, "g");
Líne 237:
/*
* This is code to be executed when the document is ready
* Basically, add [ gw漢字 ] [ ȝƿPha̍k-fa-sṳ ] [ ᚱᚢᚾ ].
* Clicking each link converts the document to that style.
* (see doConv)
Líne 243:
$(function() {
$ = jQuery;
$("#mw-content-text").prepend($("<center class=\"nochange\"><small>[ <a href=\"javascript:void(0);\" class=\"click-gw\">gw漢字</a> ] [ <a href=\"javascript:void(0);\" class=\"click-yoghwynn\">ȝƿPha̍k-fa-sṳ </a> ] [ <a href=\"javascript:void(0);\" class=\"click-runes\">ᚱᚢᚾ</a> ]</small></center>"));
$(".click-gw").click({"outputstyle": "gw漢字"}, doConv);
$(".click-yoghwynn").click({"outputstyle": "ȝƿPha̍k-fa-sṳ"}, doConv);
$(".click-runes").click({"outputstyle": "runes"}, doConv);
});