Yup and it's as simple as ... $('little language toothed wheel thing').on('click', function() { mw.loader.using( 'modulename', function() { // do thing with modulename } ); } );
On Fri, Oct 11, 2013 at 1:28 PM, Dan Andreescu <dandree...@wikimedia.org> wrote: >> > >> > Sorry to pick on this example in particular but I was surprised to see >> > > so much code for the Universal Language selector (ULS) - especially as >> > > a single language speaker I don't ever use any of them - and I am thus >> > > being penalised. >> > >> > >> > אנחנו במיעוט הקטן בקרב האנושות של דוברי שפות אחרות מצטערים על אי >> > הנוחות ומבטיחים ללמוד אנגלית בהקדם >> > >> Hah. But I hope comedy aside my point holds. We should be all getting into >> the habit of loading things as and when needed rather than all at the >> beginning. > > > I know close to nothing about this, but I'm kind of interested in finding > out. Would it be possible to $('little language toothed wheel > thing').on('click', load something like jquery.uls.data)? That would > already be 37.13KB. > _______________________________________________ > Wikitech-l mailing list > Wikitech-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikitech-l -- Jon Robson http://jonrobson.me.uk @rakugojon _______________________________________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l