Merge "HTMLForm: Support 'url' type"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 12 Mar 2014 19:33:07 +0000 (19:33 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 12 Mar 2014 19:33:07 +0000 (19:33 +0000)
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLTextField.php

index 3e2a09e..f4b16cc 100644 (file)
@@ -118,10 +118,11 @@ class HTMLForm extends ContextSource {
                'edittools' => 'HTMLEditTools',
                'checkmatrix' => 'HTMLCheckMatrix',
                // HTMLTextField will output the correct type="" attribute automagically.
-               // There are about four zillion other HTML5 input types, like url, but
+               // There are about four zillion other HTML5 input types, like range, but
                // we don't use those at the moment, so no point in adding all of them.
                'email' => 'HTMLTextField',
                'password' => 'HTMLTextField',
+               'url' => 'HTMLTextField',
        );
 
        public $mFieldData;
index 57f0a72..e584d88 100644 (file)
@@ -43,9 +43,6 @@ class HTMLTextField extends HTMLFormField {
                # is essentially just a clone of this one.
                if ( isset( $this->mParams['type'] ) ) {
                        switch ( $this->mParams['type'] ) {
-                               case 'email':
-                                       $attribs['type'] = 'email';
-                                       break;
                                case 'int':
                                        $attribs['type'] = 'number';
                                        break;
@@ -54,8 +51,10 @@ class HTMLTextField extends HTMLFormField {
                                        $attribs['step'] = 'any';
                                        break;
                                # Pass through
+                               case 'email':
                                case 'password':
                                case 'file':
+                               case 'url':
                                        $attribs['type'] = $this->mParams['type'];
                                        break;
                        }