https://bugzilla.wikimedia.org/show_bug.cgi?id=27561
Summary: Register modules client side
Product: MediaWiki
Version: 1.18-svn
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: Normal
Component: Resource Loader
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Depends on: 27535
See also bug 27535.
Being able to register modules on the client side will make it easier for users
to write custom scripts, for example:
register( 'myUserScript', {
'wikiscripts': ['User:Krinkle/Calender.js',
'User:Krinkle/toolboxlinks.js'],
'wikistyles': 'User:Krinkle/Calender.css',
'dependencies': ['jquery.ui.datepicker'],
'messages': ['hist', 'talkpage', 'recentchanges', 'nstab-main']
});
mw.loader.load( 'myUserScript' );
.. would make 1 http request for all of that. Although this will make existing
things easier it also opens up good possibilities regarding the localization of
scripts. Right now it is either solved by keeping objects inside the scripts
like:
'msg-clickhere' : {
'nl' : 'Klik hier',
'en': Click here'
//etc.
}
Or an additional request to the API is made to action=query&meta=allmessages,
which brings in the extra complexity if having to wait for that to finish
(callback, fallback, errors).
--
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