https://bugzilla.wikimedia.org/show_bug.cgi?id=27561

✓ <andbe...@web.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andbe...@web.de

--- Comment #1 from ✓ <andbe...@web.de> 2011-02-19 16:56:19 UTC ---
I don't think the registering of myUserScript is useful like that. A user
should just need to write

mw.loader.load("user.w:de.<username>.<userscriptmodulename>");

into his mypage/<skin>.js. The one call should register the module and load a
script which comes with all its parts (script, style, messages, dependencies).
When the parts change (e.g. another message) not every user should have to
update his userscript, just the module's creator would need to change the
definition of the used parts.

This definition may be an additional page (like a Gadget definition), a comment
at the top of the script or an entry of a special page. Also a version could be
specified, but we cant initialize RL with a whole list of user-module-versions.
For that you'd need to activate a few modules at a (long) list in the
preferences, then the few versions could be delivered.

The returned script my look like the following:

bla = {...} // initialising some variables: content of the requested scripts
//auto-generated:
mw.loader.implementuserscript("modulename",
 [dependencies], //as specified
 [css], //embedded from specified
 [messages], //expanded as specified
 function(){bla.do();} // a function to call when dependencies are met, must
also be specified somewhere.
);

Also we could embed the script pages into the module.script function, so we
don't need to specify the function to call.

Another implementation, like the mw.user.options, would be 

mw.loader.implementuserscript("modulename",
 [css], //embedded from specified
 [messages], //expanded as specified
); //autogenerated, does not execute anything, sets state to "loaded"
//all the following is the content of the requested scripts:
mw.loader.using( [dependencies], // inline-spzified
 function(){
  //do something
  mw.loader.state("modulename", "ready"); //must be set from userscript
});

-- 
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
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to