Page MenuHomePhabricator

Proofread doesn't add buttons to wikiEditor toolbar, only to legacy one.
Closed, ResolvedPublic

Description

With the default implementation of the enhanced toolbar as the default it is causing some issues at English Wikisource, and presumably other Wikisource languages.

In the Page: namespace at Wikisource, we implement part of the ProofreadPage extension. Part of the implementation is an addition of five buttons to the toolbar. Functions are

  • toogle header/footer
  • zoom in
  • reset zoom
  • zoom out
  • toggle vertical/horizontal layout

these do not appear with the enhanced toolbar and I cannot fathom how <s>either, where they are added and</s> how to implement them into enhanced toolbar.

Reedy has shown to me that they are called in proofread.js [1] and I either need to know whether the modifications should be made to that script so that the buttons show up in enhanced and standard toolbar. Alternatively whether there is the means to add them to the enhanced toolbar outside of the extension. The former would be preferred as that would then apply across all the WS wikis, the latter will suffice and each wiki would need to undertake

On similar note, there is an OCR tool button that can also be added to the standard toolbar [2] that has similar issues.

If this is about guidance about how we fix locally, then we give it a go, just not either my comfort zone or knowledge base.

Thanks.

[1] http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ProofreadPage/proofread.js?view=markup
[2] https://secure.wikimedia.org/wikipedia/sources/wiki/MediaWiki:OCR.js


Version: unspecified
Severity: major

Details

Reference
bz28574

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:29 PM
bzimport added a project: ProofreadPage.
bzimport set Reference to bz28574.

(In reply to comment #1)

See http://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization
for a guide how to add stuff to the toolbar

You can use that guide to fix OCR locally. ProofreadPage needs to be fixed in SVN.

Created attachment 8778
Code of a user script to add the buttons

(In reply to comment #2)

(In reply to comment #1)

See http://www.mediawiki.org/wiki/Extension:WikiEditor/Toolbar_customization
for a guide how to add stuff to the toolbar

You can use that guide to fix OCR locally. ProofreadPage needs to be fixed in
SVN.

Not really. Although we can add the buttons to the toolbar using a code like the one attached to this bug, the functions "pr_toggle_visibility" and "pr_toggle_layout" are not available for use on gadgets and user scripts, raising errors on error console.

Attached:

Created attachment 8779
Screenshot of error console on Google Chrome

(In reply to comment #3)

Not really. Although we can add the buttons to the toolbar using a code like
the one attached to this bug, the functions "pr_toggle_visibility" and
"pr_toggle_layout" are not available for use on gadgets and user scripts,
raising errors on error console.

See the screenshot. I think if you define those functions by means of e.g.

self.pr_toggle_visibility = function()

instead of

function pr_toggle_visibility()

then users could fix the bug locally without having to copy the whole proofread.js file.

Attached:

Screenshot_of_error_console_on_Google_Chrome.PNG (520×1 px, 198 KB)

Changing importance because this affects all users of all Wikisources since the "enhanced" toolbar is the default on all projects.

Assigning to myself, doing some related cleanup.

r92311 & r92314 fix up ProofreadPage on trunk to do the toolbar buttons in a WikiEditor-compatible way (based on the script patch above), also switching the classic-toolbar path to use the labels/icons/actions as already made from the structure for that, so we don't have to define them twice.

The separate OCR button script I think shouldn't actually depend on anything else internally (?) but I'm not totally sure. Haven't attempted anything with that.

Revs above need merge to 1.18 and 1.17/1.17wmf1; I'll take a peek and make sure it's not a tricky merge.

Merged to REL1_17 r92319 - tested locally.

Merged to 1.17wmf1 r92321.

Merged to REL1_18 r92323.

Fix should go live shortly.

Brion, I'm not sure this is was caused by the recent changes, but a user reported the following on English Wikisource:

I may be wrong, but I assume that it is this fix that may have introduced a minor glitch into Proofread Page: until a few days ago, when in "zoom" mode, the mouse cursor changed to crosshairs, while "scroll" mode was the normal arrow. Now it is the arrow in both modes, which is an inconvenience.

https://secure.wikimedia.org/wikisource/en/w/index.php?title=Wikisource%3AScriptorium&action=historysubmit&diff=3176709&oldid=3176578

And when I go to the page
http://de.wikisource.org/w/index.php?title=Seite:Arthur_Schnitzler_%E2%80%93_Flucht_in_die_Finsternis_%E2%80%93_141.jpg&action=edit&debug=1

using Chromium 12.0.742.112 (90304) Ubuntu 11.04, and click on the image, I get the following error:

Uncaught TypeError: Cannot set property 'cssText' of undefined

pr_dropproofread.js:435

On Firefox 5.0 the error is

pr_rect.style is undefined
http://bits.wikimedia.org/w/extensions-1.17/ProofreadPage/proofread.js
Line 435

pr_rect.style.cssText = "display:none";