Reply to Can't tell what is a module name and what not
New page
Thank you very much for the nice answer. After fighting every possible problem while maintaining my user script (which is also used by many other users) I think I understand most parts [[Extension talk:WikiEditor/Toolbar customization#Unpredictable behavior due to the broken resource loader design|of that crazy nesting hell]]. (Except for the <code>ready()</code> stuff. I would really like to understand that.) Everything there is required for some reason: Make sure the options are loaded. Check one of the options. If it's enabled make sure an other module is loaded. Wait for it (I think that's what the <code>ready()</code> does but I don't understand how). Apply the button.
However, to make this usable for an average user there ''needs'' to be a simplified way to write it like this without loosing any functionality:
<pre>
import('user.options');
if (mw.user.options.get('usebetatoolbar'))
{
import('ext.wikiEditor.toolbar');
$('#wpTextbox1').wikiEditor('addToToolbar', /* … */);
}
</pre>
However, to make this usable for an average user there ''needs'' to be a simplified way to write it like this without loosing any functionality:
<pre>
import('user.options');
if (mw.user.options.get('usebetatoolbar'))
{
import('ext.wikiEditor.toolbar');
$('#wpTextbox1').wikiEditor('addToToolbar', /* … */);
}
</pre>
No comments:
Post a Comment