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 1: Qator 1:
/* <pre><nowiki> */
/* <pre><nowiki> */
function choiceSymbol() {
function choiceSymbol() {
addSpecialButton('ʻ&nbsp;', 'insertSymbol("ʻ")', 'sButtonsStyle',
addSpecialButton('ʻ ', 'insertSymbol("ʻ")', 'sButtonsStyle',
'Turned Comma');
'Turned Comma');
addSpecialButton('ʼ&nbsp;', 'insertSymbol("ʼ")', 'sButtonsStyle',
addSpecialButton('ʼ ', 'insertSymbol("ʼ")', 'sButtonsStyle',
'Apostrophe');
'Apostrophe');
}
}

23-Iyul 2006, 19:34 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' ) {
//            document.selection.createRange().text = s;

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

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