Page MenuHomePhabricator

Personal edit toolbar lost (LiquidThreads)
Closed, InvalidPublic

Description

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.

See Also:
T25580: Implement JavaScript mw.hooks framework

Details

Reference
bz21692

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:55 PM
bzimport set Reference to bz21692.
bzimport added a subscriber: Unknown Object (MLST).

This *may* be a problem with your scripts. If you give me a link to the scripts, I'll take a look.

(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

He7d3r added a comment.Jun 1 2013, 3:02 PM

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?

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

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.

Mattflaschen-WMF renamed this task from personal edit toolbar lost to Personal edit toolbar lost (LiquidThreads).Feb 6 2015, 9:56 PM
Mattflaschen-WMF set Security to None.
He7d3r updated the task description. (Show Details)Feb 7 2015, 12:24 AM
Jdforrester-WMF lowered the priority of this task from Low to Lowest.Aug 4 2016, 11:35 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

LiquidThreads has been replaced by StructuredDiscussions on all Wikimedia production wikis (except one, which will be done soon). It is no longer under active development or maintenance, so I'm re-classifying all open LQT tasks as "Lowest" priority.

Meno25 removed a subscriber: Meno25.Aug 31 2016, 5:39 AM
Jdforrester-WMF closed this task as Invalid.Nov 6 2018, 4:29 PM

The 2006 wikitext editor, to which this refers, has been removed from MediaWiki and Wikimedia servers, and so this task is no longer valid.