I'm not sure if it will work in your case, but you might try inserting this
between your first and second lines:
$(document).ready( function() {
$('#wpTextbox1').on('wikiEditor-toolbar-doneInitialSections', function() {
Reference:
https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization#Determining_when_toolbar_load_is_done
Good luck!
Tom
>
> On Mar 19, 2018, at 9:24 PM, Huji Lee <[email protected]> wrote:
>
> I would like the signature button in the enhanced editing toolbar to add
> the signature as "~~~~" and not as "--~~~~". So I have a script in my
> person JS which is shown below. But it does not actually work, i.e. the
> signature button still adds the --. I think it is because the JS below is
> not run *after* the button is set up, but rather before it is set up. What
> dependency should I add so that this script is executed after the buttons
> in the enhanced editing toolbar are loaded?
>
> Thanks in advance,
> Huji
>
> // no -- prefix for signature
> buttonmw.loader.using(['mediawiki.util'], function() {
> $("a[rel=signature]").unbind("click").click(function()
> {insertTags('~~' + '~~')});});
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Wenlin Institute, Inc. SPC (a Social Purpose Corporation)
文林研究所社会目的公司
Software for Learning Chinese
E-mail: [email protected] Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)
☯
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l