SpecialPageLanguage: Use title input (enable suggestions) and autofocus
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Sat, 19 Dec 2015 23:02:04 +0000 (00:02 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Sun, 20 Dec 2015 18:59:32 +0000 (18:59 +0000)
The title input field requires a valid title, so suggestions make sense
to suggest possible existing pages to the user.

Autofocus the input field, if the title is empty allows the user to type
the title with less clicks.

Bug: T120577
Change-Id: I8a75fdeccbe2be2144fcc15439ffefae1e89c6a9

includes/specials/SpecialPageLanguage.php

index 02fca3a..9323551 100644 (file)
@@ -48,9 +48,11 @@ class SpecialPageLanguage extends FormSpecialPage {
 
                $page = array();
                $page['pagename'] = array(
-                       'type' => 'text',
+                       'type' => 'title',
                        'label-message' => 'pagelang-name',
                        'default' => $defaultName,
+                       'autofocus' => $defaultName === null,
+                       'exists' => true,
                );
 
                // Options for whether to use the default language or select language