Last modified: 2014-09-11 22:08:15 UTC
When the page http://translatewiki.net/wiki/Support has been altered from a normal talk page, my personal edit toolbar extension has been automatically removed. I used it a lot so as to safe typing time. It is still available on normal edit pages, only missing from the support page. I want it back. Having to type everything by hand is very time consuming and error prone, likewise is writing everything on another page, and then copying it to the Support page before saving. My user page is User:Purodha, and each appropriate subpage for each skins exists, and defines the personal edit toolbar extension.
This *may* be a problem with your scripts. If you give me a link to the scripts, I'll take a look.
I also have this problem at pt.wikibooks using this script: http://pt.wikibooks.org/w/index.php?oldid=182839&uselang=en http://pt.wikibooks.org/w/index.php?oldid=182841&uselang=en
(In reply to comment #1) > This *may* be a problem with your scripts. If you give me a link to the > scripts, I'll take a look. FYI: I suppose this was the script: https://translatewiki.net/w/i.php?oldid=1700660
Krinkle, do you think this is something which can be fixed by adding some mw.hook calls to LQT code and then using callbacks in the appropriate user scripts?
(In reply to comment #4) > the appropriate user scripts? e.g. https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization#Basic_setup
We could add mw.hook( 'ext.lqt.textareaCreated' ).fire( $( container ).find( '#wpTextbox1' ) ); to injectEditForm's finishSetup (in lqt.js). Then http://pt.wikibooks.org/w/index.php?oldid=182841&uselang=en would almost work - you just have to change it to run when that hook is called instead of $( document ).ready. This wouldn't fix the original reporter's script, but would mean it could possibly be re-filed in the WikiEditor component (convert mwCustomEditButtons info into toolbar actions).
Using mw.hook would be good enough to me.
Change 77052 had a related patch set uploaded by Alex Monk: Add JS hook for user scripts to add buttons to all LQT textareas as they are created https://gerrit.wikimedia.org/r/77052
Thinking about this again, I was wondering if isn't possible to have a single hook which is fired both by core/WikiEditor and by LQT, when the toolbar is "ready to be customized", so the users just have to attach their customizeToolbar's[1] only once? Right now, it seems we would need both the $(document).ready( customizeToolbar ); and the mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar ); [1] https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization#Basic_setup
I just remembered this thread (from January 2013): http://www.gossamer-threads.com/lists/wiki/wikitech/331135 (http://lists.wikimedia.org/pipermail/wikitech-l/2013-January/066060.html) Matthew Flaschen added the line context.$textarea.trigger( 'wikiEditor-toolbar-doneInitialSections' ); to WikiEditor's code on https://gerrit.wikimedia.org/r/#/c/46490/ While googling about this event, I also found a more recent (and now abandoned) patch by Ori.livneh: https://gerrit.wikimedia.org/r/#/c/73144/ I wonder if some of these hooks would be also executed by LQT so we wouldn't need to add a new one to its code?
(In reply to comment #10) > I wonder if some of these hooks would be also executed by LQT so we wouldn't > need to add a new one to its code? I mean, taking into account that LQT duplicates a lot of code from WikiEditor... (bug 28761)
Change 77052 merged by jenkins-bot: Add JS hook for user scripts to add buttons to all LQT textareas as they are created https://gerrit.wikimedia.org/r/77052
(In reply to comment #12) > Change 77052 merged by jenkins-bot: > Add JS hook for user scripts to add buttons to all LQT textareas as they are > created > > https://gerrit.wikimedia.org/r/77052 Patch got merged - can this bug report be closed as RESOLVED FIXED or is more work required?
(In reply to comment #13) > Patch got merged - can this bug report be closed as RESOLVED FIXED or is more > work required? I just would like if someone could confirm that this is the way it is supposed to be used: https://www.mediawiki.org/w/index.php?diff=790337 More specifically: does it need any extra check to find out if we are in a "lqt-edit-mode"?
Shouldn't we keep this bug until the method documented at https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization?diff=639169 also works with LQT? Or maybe that method should be deprecated? As far as I know, it is only used by the GuidedTour extension: https://github.com/wikimedia/mediawiki-extensions-GuidedTour/blob/127888bf108379dcea5d7ee60272f431f889aa7e/modules/ext.guidedTour.lib.js#L765
Ping
Specific questions and addressees are often more successful than contentless pings. In this case repeating comment 15: Shouldn't we keep this bug until the method documented at https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization?diff=639169 also works with LQT? Or maybe that method should be deprecated? As far as I know, it is only used by the GuidedTour extension: https://github.com/wikimedia/mediawiki-extensions-GuidedTour/blob/127888bf108379dcea5d7ee60272f431f889aa7e/modules/ext.guidedTour.lib.js#L765
(In reply to Helder from comment #15) > Shouldn't we keep this bug until the method documented at > https://www.mediawiki.org/wiki/Extension:WikiEditor/ > Toolbar_customization?diff=639169 > also works with LQT? > > Or maybe that method should be deprecated? > As far as I know, it is only used by the GuidedTour extension: > https://github.com/wikimedia/mediawiki-extensions-GuidedTour/blob/ > 127888bf108379dcea5d7ee60272f431f889aa7e/modules/ext.guidedTour.lib.js#L765 The bug is that LQT does not support user toolbar customization, or at least not in the same way as WikiEditor. That hook (wikiEditor-toolbar-doneInitialSections) is a way of knowing when the initial WikiEditor toolbar buttons are done loading. GuidedTour needs this because the toolbar load causes (or at least did back then) a reflow. I don't support deprecating it until there's an adequate replacement, or it's established that the current version of WikiEditor never causes reflows when the toolbar loads. I haven't tested it, but it looks like there is now a way to know when LQT is ready for customization, or at least when the textarea is ready (ext.lqt.textareaCreated). Thus, the only reason to keep this open would be if it doesn't work or you believe that it should use the same hook as WikiEditor. I don't know enough about the architecture of either WikiEditor or LQT to know if they should use the same hook.