https://bugzilla.wikimedia.org/show_bug.cgi?id=30713
--- Comment #3 from [email protected] 2012-04-08 11:43:44 UTC --- Here's some test code which would accomplish what was described above. Probably it needs many changes, it already received some changes via IRC. There would be events for various page actions. Some of them could be: pageready, article.load, history.load, edit.load, special.load. 'pageready' would be equivalent to $(document).ready (so probably it's not necessary). The others would fire on load, but also other scripts could fire them whenever they need it (for example, a script which loads into mw.util.$content pages). It would require to many changes internally, I tested some of the changes and it does work. Many scripts which use $(document).load should be changed appropiately (some needn't). Also, scripts on Wikipedias would have to adapt. Overall, maybe too drastic changes, but the benefeits would also be great: - Wikis could be ajaxified completely, making pages much faster. I'm already working on this, and I found basically that problem. - When Wikipedias have to change, everything would keep working as usual. There aren't many lines so I'm posting it inline. hooks: ( function () { var callbacks = {}; function getCb( key ) { if ( callbacks[key] === undefined ) { callbacks[key] = $.Callbacks( "memory" ); } return callbacks[key]; } function getArray( obj ) { return Array.prototype.slice.call(obj); } return { add: function (hook) { getCb(hook).add( getArray ( arguments ).splice(1) ); }, run: function (hook) { getCb(hook).fire.apply( window, getArray( arguments ).splice(1) ); } }; }() ) It would be part of the mediawiki object. -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
