Last modified: 2014-09-23 23:19:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T36848, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 34848 - Improve mediawiki.special.movePage.js to remove the namespace name when the user paste the full target name in the field
Improve mediawiki.special.movePage.js to remove the namespace name when the u...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.19
All All
: Normal enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: javascript, patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-01 13:03 UTC by Helder
Modified: 2014-09-23 23:19 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Example (737 bytes, text/plain)
2012-03-04 16:12 UTC, Helder
Details
proposed patch (913 bytes, patch)
2012-03-11 02:44 UTC, Bergi
Details

Description Helder 2012-03-01 13:03:53 UTC
Previous to r10209, a user could
1) Copy/paste the full name of the target page to the field
2) Move the page

Now, this requires two extra steps:
1) Copy/paste the full name of the target page to the field
2) Select the namespace part
3) Delete it
4) Move the page

E.g.:
On [[Special:MovePage/Help:Moving]] we could paste "Help:Moving articles" and it would work. Currently we need to split the title parts like this:
https://en.wikipedia.org/wiki/Special:MovePage/Help:Moving?wpNewTitle=Help:Moving_articles
and then move.

I believe a small JS code could split the name when the user paste it in that field, and automatically select the appropriated namespace.
Comment 1 Helder 2012-03-01 13:05:38 UTC
Copy/paste fail. I mean r110209.
Comment 2 Liangent 2012-03-04 14:34:26 UTC
What if I actually want a page [[Wikipedia:Wikipedia:Foo]]?
Comment 3 Helder 2012-03-04 16:12:55 UTC
Created attachment 10171 [details]
Example

(In reply to comment #2)
> What if I actually want a page [[Wikipedia:Wikipedia:Foo]]?

Take a look in the attached example. It will select the "Wikipedia" namespace and change the text to "Wikipedia:Foo". I've tested on Google Chrome's console.
Comment 4 Krinkle 2012-03-05 06:49:47 UTC
How can you tell that's what the user wants ?

I know some wikis have pages like "Category:Wikipedia:Foobar" or "Wikipedia:Category:Foo".

When on "Wikipedia:Foo" and wanting to move it to "Wikipedia:Category:Foo" and you'd paste "Category:Foo" in the title field, then it shouldn't change the namespace selector.

Also to parse titles, use mw.Title.
Comment 5 Helder 2012-03-05 19:01:37 UTC
(In reply to comment #4)
> How can you tell that's what the user wants ?
> 
> I know some wikis have pages like "Category:Wikipedia:Foobar" or
> "Wikipedia:Category:Foo".
> 
> When on "Wikipedia:Foo" and wanting to move it to "Wikipedia:Category:Foo" and
> you'd paste "Category:Foo" in the title field, then it shouldn't change the
> namespace selector.

Ok. So, maybe it would be better to ask the user?
In your example, after the text "Category:Foo" is pasted in the title field,
the script would aks something like this:
----
Do you want to move the page to which of these names?
[x] Category:Foo
[ ] Wikipedia:Category:Foo
----

> Also to parse titles, use mw.Title.

I didn't read its code yet, but I'll do for next time =)
PS: this needs to be documented on
https://www.mediawiki.org/wiki/ResourceLoader/Default_modules
Comment 6 Bergi 2012-03-11 02:44:38 UTC
Created attachment 10214 [details]
proposed patch

Use of regexp and setTimeout is horrible. However, I'm not quite sure whether a wikiUrlencode for the namespace is useful or not.

My patch comes from my solution at [[de:WP:TSW#Seiten verschieben]].
Comment 7 Sumana Harihareswara 2012-05-25 02:58:56 UTC
Bergi, thank you for your patch.  Can I ask you to use developer access to directly suggest it into our Git source control system?

https://www.mediawiki.org/wiki/Developer_access

https://www.mediawiki.org/wiki/Git/Workflow#How_to_submit_a_patch
Comment 8 Sumana Harihareswara 2012-07-20 19:33:55 UTC
Bergi: ping re submitting this into Git.
Comment 9 Krinkle 2012-07-20 19:46:34 UTC
You're free to submit through git review, but note that at the moment I think implementation details are still to be discussed first - or at least the implementation proposed so far should be implemented.

Notes:
* Asking the user sounds good (this was your idea), however the patch applied does not do that (yet).
* It being a minor convenience feature, it is important that it certainly does not introduce new bugs. So I think we should either implement this by asking the user in case of ambiguity or not implement it at all.
* And, again, to parse titles use mw.Title.
* To bind an event for one trigger only .one() may be useful, see also http://api.jquery.com/one. At least unbind it instead of having the function execute still on every change when it is no longer needed. That removes the need of this boolean state keeper.
Comment 10 Helder 2012-07-20 23:33:09 UTC
In reply to comment #9)
> * It being a minor convenience feature, it is important that it certainly does
> not introduce new bugs. So I think we should either implement this by asking
> the user in case of ambiguity or not implement it at all.

I would say its absence is actually an inconvenient bug, because from time to time I see people doing this:
https://pt.wikipedia.org/wiki/Wikipedia:Projetos/Música/Bandas/matriz?action=history&uselang=en

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links