ಸದಸ್ಯ:ChiK/linkEdit.js
ಗೋಚರ
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
//@Author: M G Harish
/*function linkEdit()
{
e = document.createElement ("input");
e.setAttribute ("type", "button");
e.setAttribute ("value", "ಕೊಂಡಿ ಸರಿಪಡಿಸು");
e.setAttribute ("onclick", "oc();");
b = document.getElementById ('wpDiff');
b.parentNode.insertBefore (e, b.nextSibling);
}
function oc()
{
tb = document.getElementById ("wpTextbox1");
tb.value = tb.value.replace (/\[\[ *([^|\]]*?) *\| *\1 *\]\]/g, "[[$1]]");
tb.value = tb.value.replace (/\[\[ *([^|\]]*?)\u0ccd *\]\]([\u0c80-\u0cff]+)/g, "[[$1\u0ccd|$1\u0ccd\u200c$2]]");
tb.value = tb.value.replace (/\[\[ *([^|\]]*?) *\]\]([\u0c80-\u0cff]+)/g, "[[$1|$1$2]]");
s = document.getElementById ("wpSummary");
if(null == s.value.match("LinkEdit"))
{
s.value += "[[ಸದಸ್ಯ: ChidanandaKampa/linkEdit.js|LinkEdit]] ಉಪಯೋಗಿಸಿ ಕೊಂಡಿಗಳನ್ನು ಸರಿಪಡಿಸಲಾಗಿದೆ";
}
}
linkEdit();
void (0);
*/
/* Using ResourceLoader mechanism */
( function ( mw, $ ) {
var linkedit = window.linkedit = $.extend({
setup : function() {
$('<input type="button" id="linkEdit" class="oo-ui-inputWidget-input oo-ui-buttonElement-button" onclick="window.linkedit.oc();" />').val($("#wpDiff").val() != "ಬದಲಾವಣೆಗಳನ್ನು ತೋರಿಸು" ? "Correct Link" : "ಕೊಂಡಿ ಸರಿಪಡಿಸು").insertAfter($("#wpDiff"));
/*
b = document.getElementById ('wpDiff');
if(b !== null)
{
e = document.createElement ("input");
e.setAttribute ("type", "button");
e.setAttribute ("value", "ಕೊಂಡಿ ಸರಿಪಡಿಸು");
e.setAttribute ("onclick", "window.linkedit.oc();");
b.parentNode.insertBefore (e, b.nextSibling);
} */
},
oc : function ()
{
var tb = document.getElementById ("wpTextbox1");
tb.value = tb.value.replace (/\[\[ *([^|\]]*?) *\| *\1 *\]\]/g, "[[$1]]");
tb.value = tb.value.replace (/\[\[ *([^|\]]*?)\u0ccd *\]\]([\u0c80-\u0cff]+)/g, "[[$1\u0ccd|$1\u0ccd\u200c$2]]");
tb.value = tb.value.replace (/\[\[ *([^|\]]*?) *\]\]([\u0c80-\u0cff]+)/g, "[[$1|$1$2]]");
var s = document.getElementById ("wpSummary");
if(null === s.value.match("LinkEdit"))
{
s.value += "[[ಸದಸ್ಯ: ChidanandaKampa/linkEdit.js|LinkEdit]] ಉಪಯೋಗಿಸಿ ಕೊಂಡಿಗಳನ್ನು ಸರಿಪಡಿಸಲಾಗಿದೆ";
}
},
}, window.linkedit);
linkedit.setup();
}( mediaWiki, jQuery ) );