Page MenuHomePhabricator

[Regression] broke Edittools for Special:Upload
Closed, InvalidPublic

Description

Author: alexsm333

Description:
MediaWiki:Editools stopped working on Special:Upload
since MW 1.18 changed textarea Id

I guess the easiest way to fix this is
to add #wpUploadDescription to the list of these inputs:
$('...').focus( function() { currentFocused = $(this); }

See http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/mediawiki.action/mediawiki.action.edit.js?view=markup


Version: 1.18.x
Severity: normal

Details

Reference
bz31682
TitleReferenceAuthorSource BranchDest Branch
Serialize and deserialize Z9/References.repos/abstract-wiki/wikifunctions/function-evaluator!13apineapine-serialize-referencesmain
Add jupiter folderrepos/wikisp/wikisp-infrastructure!9galahadprototypemaster
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:57 PM
bzimport set Reference to bz31682.
bzimport added a subscriber: Unknown Object (MLST).

we changed textarea id ???

Who did that ? changing id's is bad, there better be a good reason.

Where did the textarea id change? who changed it?

(In reply to comment #1)

we changed textarea id ???

Who did that ? changing id's is bad, there better be a good reason.

No, we haven't.

Possibly talking about the old upload wizard on Commons, it's a gadget now, and activates when you visit Special:Upload there.

In that case, related to bug 31566

alexsm333 wrote:

Sorry for the wrong assumption about textarea Id but the bug is still valid. Try to use edittools e.g. at http://meta.wikimedia.org/wiki/Special:Upload (many other projects have some local JS modifications).

New explanation: prior to MW1.18 insertTags() would take document.getElementsByTagName('textarea')[0]
in the absense of default editform.

See http://svn.wikimedia.org/viewvc/mediawiki/branches/REL1_17/phase3/skins/common/edit.js?view=markup

Right.

So inserttags doesnt work for wpUploadDescription anymore now, because we don't have the fallback for textarea[0] anymore.

So either we need to do as i suggested in 31566, or just bind focus to all texteareas and input fields within the content areas.

Any comments on where to go with this ?

Shall I go:

.focus( '#wpTextbox1, .wpEdittoolsText') and then add wpEdittoolsText class to all elements we would like the edittools to work for (upload field, editsummary fields, proofread fields) ? Or shall i just do it like .focus( 'textarea, input[type=text]') ???

Which way would be preferred ?

My resources/mediawiki.action/mediawiki.action.edit.js reads

var currentFocused = $( '#wpTextbox1' );

This only works on normal page editing.

The textarea on Special:Upload is #wpUploadDescription and only works if you click into it first.

Perhaps because it locally overwrites stuff with MediaWiki:Edittools.js ?

Oh, wait it seems this was never ported to 1.18 of WMF.

alexsm333 wrote:

TheDJ, your r103074 fixed only .focus() handler but not the initial currentFocused=$( '#wpTextbox1' ), please re-read comment 11.

(mass change)

  • 1.18.0 and 1.19.0 have been released already.
  • Moving open bugs targeted for 1.18.0 or 1.19.0 to Mysterious future.
  • Please re-target them to 1.19.x or 1.20.0 if needed.

(In reply to comment #14)

TheDJ, your r103074 fixed only .focus() handler but not the initial
currentFocused=$( '#wpTextbox1' ), please re-read comment 11.

Can you test it again? The focus event handler sets currentFocused. So when you focus that area on the upload page, it works, right ?

http://www.mediawiki.org/wiki/Special:Upload

Still only works after you clicked into it. That itself is evry user unfriendly plus the behaviour differs from the normal edit page.

I have abandoned this change, because I saw no reliable/consistent way of determining what the 'current focused' initial value should be.

Aklapper lowered the priority of this task from Medium to Lowest.Feb 11 2015, 9:17 PM
Aklapper subscribed.
Jdforrester-WMF subscribed.

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