Page MenuHomePhabricator

Unable to remove certain defer-loaded booklet class of index/page components from the WikiEditor toolbar
Open, Stalled, Needs TriagePublic

Description

In an attempt to whittle down the number of language-specific character-sets listed under the 'Special characters' tab of WikiEditor, I've come to the conclusion the only way to modify the default is remove the entire booklet and rebuild it with only the desired language-specific sets [Ughhh... ]

Using 'greek' as an example for removal from the toolbar, I've tried various combinations of parameter(s) and their value(s) to try and achieve this using, among many others...

  • { 'section': 'characters', 'group': 'greek', 'tool': 'greek' }
  • { 'section': 'characters', 'group': 'greek', 'page': 'greek' }
  • { 'section': 'characters', 'group': 'greek', 'pages': 'greek' }
  • { 'section': 'characters', 'index': 'greek', 'tool': 'greek' }
  • { 'section': 'characters', 'index': 'greek', 'page': 'greek' }
  • { 'section': 'characters', 'index': 'greek', 'pages': 'greek' }
  • { 'section': 'characters', 'group': 'index', 'tool': 'greek' }
  • { 'section': 'characters', 'group': 'index', 'page': 'greek' }
  • { 'section': 'characters', 'group': 'index', 'pages': 'greek' }
  • { 'section': 'characters', 'page': 'greek' }
  • { 'section': 'characters', 'pages': 'greek' }
  • ... and anything else I could think of along those lines or based on proven examples of manipulating non-booklet toolbar types...

... with no luck. I can remove the entire booklet and "rebuild" it with only the wanted sets, but that doesn't seem right, does it?

In short, is there a current inability to remove single language-sets that are built on 'index' & 'page' -like parameters from an exisiting booklet even possible (i.e. this is a real Bug),

			or

... is it just a matter of exactly how-to-do-it being undocumented (well 'undocumented' to the best of my searching around that is)?


Version: master
Severity: major

related: T126138

Details

Reference
bz68791

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:31 AM
bzimport added a project: WikiEditor.
bzimport set Reference to bz68791.
bzimport added a subscriber: Unknown Object (MLST).
GOIII created this task.Jul 29 2014, 7:47 AM
happy5214 added a comment.EditedNov 29 2014, 5:13 PM

I got it to work in my master checkout (with Firefox web developer tools) with ($textarea was the name I gave to the textbox jQuery object):

$textarea.wikiEditor("removeFromToolbar", {"section": "characters", "page": "greek"});

The API documentation for WikiEditor is definitely a mess. The only reason I knew how to do it was that I just wrote a QUnit test for the toolbar.

Odd; I had tried that particular variant before (listed above) and again just now with no such luck -- the Greek character set is still being generated here.

Curious; I'm wondering if 'deferLoad': true, line -- found in the part that builds the character booklet in jquery.wikiEditor.toolbar.config.js -- is somehow screwing-up or superseding my local User: common.js' load order maybe?

... And as an aside to your poor documentation comment -- there has got to be a better way to customizing the WikiEditor toolbar in general than allowing it to completely build itself using all the defaults first only to remove/manipulate those defaults afterwards locally. Developers need to realize the ease of such abilities is key to projects other than Wikipedia -- where the fundamental mission & tasks are frequently completely the opposite of theirs.

deferLoad, from what I can tell, defers the generation of the controls until they are needed on the page. There's no page to delete!

PS I neglected to mention that I got it to work with Firefox's developer tools after loading the page. The user-script method fails for me as well.

GOIII added a comment.Apr 8 2015, 3:58 AM

Now that the language-character sets no longer "reside" in the WikiEditor extension (see T91608), any chance that it is somehow now possible to prevent the loading of unwanted or specific [booklet]sets or is deferLoad=true still the crux of the problem here?

Change 226676 had a related patch set uploaded (by Gerrit Patch Uploader):
Wikieditor: Rework deferred building of toolbar

https://gerrit.wikimedia.org/r/226676

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 24 2015, 7:25 AM

Change 226676 merged by jenkins-bot:
Wikieditor: Rework deferred building of toolbar

https://gerrit.wikimedia.org/r/226676

TheDJ closed this task as Resolved.Oct 31 2015, 3:10 PM
TheDJ assigned this task to Schnark.
TheDJ removed a project: Patch-For-Review.
TheDJ set Security to None.
GOIII added a subscriber: TheDJ.Oct 31 2015, 9:31 PM

@TheDJ , have you tried to remove a booklet page or prevent one from loading successfully? I'm still not able to pull this off.

If you can, please share with us how to remove the Greek character set as an example per the task description.

If you can't, please re-open this task.

GOIII renamed this task from Unable to remove individual booklet-pages from loading to the toolbar to Unable to remove certain defer-loaded booklet class of index/page components from the WikiEditor toolbar.Apr 3 2016, 8:37 AM
GOIII reopened this task as Stalled.
GOIII updated the task description. (Show Details)
GOIII added a subscriber: Krinkle.

Change 268968 had a related patch set uploaded (by GOIII):
Remove deferred loading of the toolbar

https://gerrit.wikimedia.org/r/268968

GOIII moved this task from Backlog to Next-up on the WikiEditor board.Apr 3 2016, 9:59 AM
Krinkle removed a subscriber: Krinkle.Apr 3 2016, 9:48 PM