Last modified: 2014-09-23 23:19:46 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.
Copy/paste fail. I mean r110209.
What if I actually want a page [[Wikipedia:Wikipedia:Foo]]?
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.
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.
(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
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]].
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
Bergi: ping re submitting this into Git.
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.
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