Foydalanuvchi:AlefZet/monobook.js: Versiyalar orasidagi farq

Vikipediya, ochiq ensiklopediya
Kontent oʻchirildi Kontent qoʻshildi
AlefZet (munozara | hissa)
Tahrir izohi yoʻq
AlefZet (munozara | hissa)
Tahrir izohi yoʻq
Qator 41: Qator 41:
// IE
// IE
if (navigator.appName == 'Microsoft Internet Explorer' ) {
if (navigator.appName == 'Microsoft Internet Explorer' ) {
obj.value = obj.value + s;
sInput.onchange = setValue(this);


// Mozilla
// Mozilla
Qator 48: Qator 48:
}
}
sInput.focus();
sInput.focus();
}

function SetValue(id) {
var control = document.getElementById(id);
control.value += control.value;
}
}



24-Iyul 2006, 11:40 dagi koʻrinishi

/* <pre><nowiki> */
function choiceSymbol() {
        addSpecialButton(' ʻ ', 'insertSymbol("ʻ")', 'sButtonsStyle',
              'Turned Comma');
        addSpecialButton(' ʼ ', 'insertSymbol("ʼ")', 'sButtonsStyle',
              'Apostrophe');
}

var searchForm, newSpan, newCaption, newOnClick, newClass;
function addSpecialButton(pCaption, pAction, pClass, pTitle) {
     searchForm = document.getElementById('searchform');
        if (searchForm) {
                newSpan = document.createElement('span');

                newCaption = document.createTextNode(pCaption);
                newSpan.appendChild(newCaption);

                newOnClick = document.createAttribute('onclick');
                newOnClick.nodeValue = pAction;
                newSpan.setAttributeNode(newOnClick);

                newSpan.title = pTitle;

                newClass = document.createAttribute('class');
                newClass.nodeValue = pClass;
                newSpan.setAttributeNode(newClass);

                searchForm.appendChild(document.createTextNode(' '));
                searchForm.appendChild(newSpan);
        }
}

function insertSymbol(s) {
	if (document.searchform)
		var sInput = document.searchform.searchInput;
	else {
		// some alternate form? take the first (or second) one we can find
		var Inputs = document.getElementsByName('search');
		var sInput = Inputs[0]; //[0] - upper field, [1] - lower field
	}
	// IE
	if (navigator.appName == 'Microsoft Internet Explorer' ) {
            sInput.onchange = setValue(this);

	// Mozilla
	} else {
            sInput.value = sInput.value + s;
        }
        sInput.focus();
}

function SetValue(id) {
     var control = document.getElementById(id);
     control.value += control.value;
}

hookEvent("load", choiceSymbol);
/* </nowiki></pre> */