MediaWiki:Common.js: Difference between revisions

attempting to replace deprecated addHandler()
(replacing importScript() with mw.loader.load())
(attempting to replace deprecated addHandler())
Line 140: Line 140:
             if (hasClass(Cells[j], "hovercell"))
             if (hasClass(Cells[j], "hovercell"))
             {
             {
                 addHandler(Cells[j], "mouseover", new Function("evt", "showDescrip(this.id, true);"));
                 $(Cells[j]).mouseover(showDescrip(this.id, true));
                 addHandler(Cells[j], "mouseout", new Function("evt", "showDescrip(this.id, false);"));
                 $(Cells[j]).mouseout(showDescrip(this.id, false));
             }
             }
         }
         }
Line 180: Line 180:
     for (var i = 0; i < gifs.length; i++)
     for (var i = 0; i < gifs.length; i++)
     {
     {
         addHandler(gifs[i], "mouseover", new Function("evt", "swapImage(this.id, true);"));
         $(gifs[i]).mouseover(swapImage(this.id, true));
         addHandler(gifs[i], "mouseout", new Function("evt", "swapImage(this.id, false);"));
         $(gifs[i]).mouseout(swapImage(this.id, false));
     }
     }
}
}
Line 257: Line 257:
             ButtonLink.setAttribute("id", "collapseButton" + tableIndex);
             ButtonLink.setAttribute("id", "collapseButton" + tableIndex);
             ButtonLink.setAttribute("href", "#");
             ButtonLink.setAttribute("href", "#");
             addHandler(ButtonLink, "click", new Function("evt", "collapseTable(" + tableIndex + " ); return killEvt(evt);"));
             $(ButtonLink).click(new Function("evt", "collapseTable(" + tableIndex + " ); return killEvt(evt);"));
             ButtonLink.appendChild(ButtonText);
             ButtonLink.appendChild(ButtonText);


Line 269: Line 269:
     }
     }


     for (var i = 0; i < tableIndex; i++)
     for (var i = 0; i < tableIndex; i++)
     {
     {
         if (hasClass(NavigationBoxes[i], "collapsed") || (tableIndex >= autoCollapse && hasClass(NavigationBoxes[i], "autocollapse")))
         if (hasClass(NavigationBoxes[i], "collapsed") || (tableIndex >= autoCollapse && hasClass(NavigationBoxes[i], "autocollapse")))
Line 282: Line 282:
                 if (hasClass(element, "outercollapse"))
                 if (hasClass(element, "outercollapse"))
                 {
                 {
                     collapseTable (i);
                     collapseTable(i);
                     break;
                     break;
                 }
                 }