אונטערשייד צווישן ווערסיעס פון "מעדיעוויקי:Gadget-ShortNSSearch.js"

קפיצה לניווט קפיצה לחיפוש
קיין רעדאגירונג באמערקונג
אין תקציר עריכה
אין תקציר עריכה
 
(איין צווישנדיגע ווערסיע פונעם זעלבן באַניצער נישט געוויזן)
שורה 50: שורה 50:


     text = document.getElementById('searchInput');
     text = document.getElementById('searchInput');
    console.log('Input value:', text.value);
     for (i = 0; i < shortcuts.length; i++) {
     for (i = 0; i < shortcuts.length; i++) {
         var rxEdit = new RegExp('^ר' + shortcuts[i][0]);
         var rxEdit = new RegExp('^ר' + shortcuts[i][0]);
         if (rxEdit.test(text.value)) {
         if (rxEdit.test(text.value)) {
        console.log('Editing:', shortcuts[i][1]);
             text.value = text.value.replace(rxEdit, shortcuts[i][1]);
             text.value = text.value.replace(rxEdit, shortcuts[i][1]);
             document.location = '//yi.hamichlol.org.il/w/index.php?title=' + text.value + '&action=edit';
             document.location = '//yi.hamichlol.org.il/w/index.php?title=' + text.value + '&action=edit';
שורה 67: שורה 65:
         var rxPI = new RegExp('^/');
         var rxPI = new RegExp('^/');
         if (rxPI.test(text.value)) {
         if (rxPI.test(text.value)) {
        console.log('PI:', "באַזונדער:הדף_שלי" + text.value);
             document.location = '//yi.hamichlol.org.il/w/index.php?title=' + "באַזונדער:הדף_שלי" + text.value;
             document.location = '//yi.hamichlol.org.il/w/index.php?title=' + "באַזונדער:הדף_שלי" + text.value;
             return false;
             return false;
שורה 80: שורה 77:


function addCheckSearchInput() {
function addCheckSearchInput() {
    console.time('ShortNSSearch');
     var form = document.getElementById('searchform');
     var form = document.getElementById('searchform');
    console.log('Form:', form);


     if (!form) {
     if (!form) {
        console.log('form not found');
         return;
         return;
     }
     }


     form.onsubmit = function () { return checkSearchInput(); }
     form.onsubmit = function () { return checkSearchInput(); }
    console.timeEnd('ShortNSSearch');
}
}
$(addCheckSearchInput);
$(addCheckSearchInput);

נאוויגאציע מעניו