Page MenuHomePhabricator

Editing of collapsible quotations doesn't work on English Wiktionary
Open, Needs TriagePublicBUG REPORT

Description

Steps to Reproduce:

  • On the English Wiktionary, I wanted to edit the quotation of an entry (let's say Rabenmutter)
  • I open the page, the quotations are hidden by default. I click on "quotations" to make them visible
  • I click on "Edit" to edit the page

Actual Results:

  • The quotations are gone

Expected Results:

  • The quotations are displayed and I can edit them

What is needed to make them editable in VE? The other collapsible elements (synonyms etc.) are visible in edit mode, I'm not sure what's different there.

Event Timeline

The quotes are hidden by the following rule in https://en.wiktionary.org/wiki/MediaWiki:Common.css:

/* Hidden quotes */
.client-js .ns-0 ol>li>ul {
	display: none;
}

I found when and why that was added:

I would recommend the following approach, inspired by the solution we used for mw-collapsible elements (T42812):

  • The gadget https://en.wiktionary.org/wiki/MediaWiki:Gadget-defaultVisibilityToggles.js is extended to add a CSS class to the <body> node, e.g. wikt-defaultVisibilityToggles-done
  • The CSS selectors are changed to only apply when that class is not added, i.e. .client-js body:not(.wikt-defaultVisibilityToggles-done) .NavContent, .client-js body:not(.wikt-defaultVisibilityToggles-done).ns-0 ol>li>ul

This should allow the quotations/boxes to be collapsed before the JS loads, but it will not collapse unprocessed onces inside VE.

thanks for the research and recommendation. I'm a bit unclear on what exactly happens when the VE is loaded. If there's is logic inside the gadget which hides quotes or other content, won't that get applied in VE as well?

When VE opens, it replaces the existing content on the page with a fresh copy (without any changes gadgets might have made to it). The gadget doesn't run after VE opens, it only runs after the page is loaded.

Ok, but the Gadget's change to the body tag must still be kept, otherwise the display: none would be active again? So VE just replaces the content inside div#content I suppose?