МедияУики:Common.js/Core.js: Разлика между версии
Изтрито е съдържание Добавено е съдържание
м „МедияУики:Common.js/Core“ преместена като „МедияУики:Common.js/Core.js“: за да се разпознава като джаваскрипт от парсера |
абе, основите от Уикипедия са полезни |
||
Ред 1: | Ред 1: | ||
document.write('<script type="text/javascript" src="http://bg.wikipedia.org/w/index.php?title=%D0%9C%D0%B5%D0%B4%D0%B8%D1%8F%D0%A3%D0%B8%D0%BA%D0%B8:Common.js/CoreO.js&action=raw&ctype=text/javascript"><\/scr'+'ipt>'); |
|||
function applyFuncToTheTextarea(func) { |
function applyFuncToTheTextarea(func) { |
||
applyFuncToTextarea("wpTextbox1", func); |
applyFuncToTextarea("wpTextbox1", func); |
Версия от 06:33, 4 юни 2008
document.write('<script type="text/javascript" src="http://bg.wikipedia.org/w/index.php?title=%D0%9C%D0%B5%D0%B4%D0%B8%D1%8F%D0%A3%D0%B8%D0%BA%D0%B8:Common.js/CoreO.js&action=raw&ctype=text/javascript"><\/scr'+'ipt>');
function applyFuncToTheTextarea(func) {
applyFuncToTextarea("wpTextbox1", func);
}
function applyFuncToTextarea(tid, func) {
var ta = document.getElementById(tid);
if ( typeof(ta.selectionStart) != "undefined"
&& ta.selectionStart != ta.selectionEnd ) {
ta.value = String.concat(
ta.value.substring(0, ta.selectionStart),
func.call(null, ta.value.substring(ta.selectionStart, ta.selectionEnd)),
ta.value.substring(ta.selectionEnd, ta.value.length) );
} else if (document.selection && document.selection.createRange().text != "") {
document.selection.createRange().text = func.call(
null, document.selection.createRange().text);
} else {
ta.value = func.call(null, ta.value);
}
ta.focus();
}
function sortlines(text) {
return text.split('\n').sort().join('\n');
}