Last modified: 2014-09-11 22:08:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23692, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21692 - personal edit toolbar lost
personal edit toolbar lost
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
LiquidThreads (Other open bugs)
unspecified
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
https://translatewiki.net/w/i.php?tit...
: javascript
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-30 03:00 UTC by Purodha Blissenbach
Modified: 2014-09-11 22:08 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Purodha Blissenbach 2009-11-30 03:00:59 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.
Comment 1 Andrew Garrett 2009-11-30 16:29:06 UTC
This *may* be a problem with your scripts. If you give me a link to the scripts, I'll take a look.
Comment 2 Helder 2010-08-18 13:17:36 UTC
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
Comment 3 Helder 2013-02-23 20:13:00 UTC
(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
Comment 4 Helder 2013-06-01 15:02:36 UTC
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?
Comment 5 Helder 2013-06-01 15:03:54 UTC
(In reply to comment #4)
> the appropriate user scripts?
e.g.
https://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization#Basic_setup
Comment 6 Alex Monk 2013-06-01 16:29:37 UTC
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).
Comment 7 Helder 2013-07-31 12:59:45 UTC
Using mw.hook would be good enough to me.
Comment 8 Gerrit Notification Bot 2013-07-31 21:34:22 UTC
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
Comment 9 Helder 2013-07-31 22:08:11 UTC
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
Comment 10 Helder 2013-08-01 11:37:03 UTC
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?
Comment 11 Helder 2013-08-01 11:39:46 UTC
(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)
Comment 12 Gerrit Notification Bot 2013-09-03 13:39:29 UTC
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
Comment 13 Andre Klapper 2013-09-25 09:48:46 UTC
(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?
Comment 14 Helder 2013-09-25 12:11:31 UTC
(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"?
Comment 15 Helder 2013-09-25 12:47:39 UTC
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
Comment 16 Helder 2014-09-10 14:23:54 UTC
Ping
Comment 17 Andre Klapper 2014-09-11 19:28:42 UTC
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
Comment 18 Matthew Flaschen 2014-09-11 22:08:15 UTC
(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.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links