jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/360159 )

Change subject: Get rid of the hardcoded string "Search..." in the search box
......................................................................


Get rid of the hardcoded string "Search..." in the search box

BaseTemplate#makeSearchInput can generate the placeholder attribute
appropriately. Thus the JS isn't needed either.

The only difference is that WebPlatform used the string "Search..."
whereas the core method uses the string "Search {{SITENAME}}", which can
look a tad bit ugly with longer site names, but that's the end-user's
problem.

Change-Id: I9aea0dd74980390c04af038e73251b3688758e3c
---
M WebPlatformTemplate.class.php
M webplatform/webplatform.js
2 files changed, 1 insertion(+), 19 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  SamanthaNguyen: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/WebPlatformTemplate.class.php b/WebPlatformTemplate.class.php
index 782f000..6d7ec52 100644
--- a/WebPlatformTemplate.class.php
+++ b/WebPlatformTemplate.class.php
@@ -442,7 +442,7 @@
                        <form action="<?php $this->text( 'wgScript' ) ?>" 
id="searchform">
                                <div id="search">
                                        <?php
-                                               echo $this->makeSearchInput( 
array( 'id' => 'searchInput', 'type' => 'input', 'value' => 'Search...' ) );
+                                               echo $this->makeSearchInput( 
array( 'id' => 'searchInput', 'type' => 'input' ) );
                                                echo $this->makeSearchButton( 
'fulltext', array( 'id' => 'mw-searchButton', 'class' => 'searchButton', 
'value' => ' ' ) );
                                        ?>
                                        <input type="hidden" name="title" 
value="<?php $this->text( 'searchtitle' ) ?>"/>
diff --git a/webplatform/webplatform.js b/webplatform/webplatform.js
index 3c8e569..bc23e09 100644
--- a/webplatform/webplatform.js
+++ b/webplatform/webplatform.js
@@ -1,21 +1,4 @@
 ( function ( mw, $ ) {
-       function setupSearchField() {
-               var searchInput = $( '#searchInput' ),
-                       defaultValue = 'Search...';
-
-               searchInput.focus( function () {
-                       if ( searchInput.val() == defaultValue ) {
-                               searchInput.val( '' );
-                       }
-               } );
-
-               searchInput.blur( function () {
-                       if ( searchInput.val() === '' ) {
-                               searchInput.val( defaultValue );
-                       }
-               } );
-       }
-
        function setupDropdown() {
                $( '#p-personal' ).bind( 'mouseover', function () {
                        $( '#p-personal .user-dropdown' ).show();
@@ -29,7 +12,6 @@
        function init() {
                var i, dropdown;
 
-               setupSearchField();
                setupDropdown();
 
                if ( document.querySelectorAll && 
document.body.addEventListener ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/360159
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9aea0dd74980390c04af038e73251b3688758e3c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/webplatform
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: SamanthaNguyen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to