jenkins-bot has submitted this change and it was merged.

Change subject: Search: Change dataLocation default value and add docs
......................................................................


Search: Change dataLocation default value and add docs

Implemented Krinkle's comments of the followed up commit.

Follow up I2480149

Change-Id: I8e51c0d3a3ca1690ea3ea08469a1cd52d9c151f3
---
M includes/specials/SpecialSearch.php
M includes/widget/SearchInputWidget.php
M resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
3 files changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialSearch.php 
b/includes/specials/SpecialSearch.php
index 15bf39b..d474ba5 100644
--- a/includes/specials/SpecialSearch.php
+++ b/includes/specials/SpecialSearch.php
@@ -1238,6 +1238,7 @@
                        'name' => 'search',
                        'autofocus' => trim( $term ) === '',
                        'value' => $term,
+                       'dataLocation' => 'content',
                ] );
 
                $out =
diff --git a/includes/widget/SearchInputWidget.php 
b/includes/widget/SearchInputWidget.php
old mode 100644
new mode 100755
index 5ff411d..6baaff0
--- a/includes/widget/SearchInputWidget.php
+++ b/includes/widget/SearchInputWidget.php
@@ -16,6 +16,7 @@
        protected $performSearchOnClick = true;
        protected $validateTitle = false;
        protected $highlightFirst = false;
+       protected $dataLocation = 'header';
 
        /**
         * @param array $config Configuration options
@@ -24,6 +25,8 @@
         * @param boolean|null $config['performSearchOnClick'] If true, the 
script will start a search
         *  whenever a user hits a suggestion. If false, the text of the 
suggestion is inserted into the
         *  text field only (default: true)
+        * @param string $config['dataLocation'] Where the search input field 
will be
+        *  used (header or content, default: header)
         */
        public function __construct( array $config = [] ) {
                $config = array_merge( [
@@ -31,7 +34,6 @@
                        'maxLength' => null,
                        'type' => 'search',
                        'icon' => 'search',
-                       'dataLocation' => 'content',
                ], $config );
 
                // Parent constructor
diff --git a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js 
b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
old mode 100644
new mode 100755
index 8c2b53a..df03679
--- a/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
+++ b/resources/src/mediawiki.widgets/mw.widgets.SearchInputWidget.js
@@ -18,13 +18,16 @@
         * @cfg {boolean} [performSearchOnClick=true] If true, the script will 
start a search when-
         *  ever a user hits a suggestion. If false, the text of the suggestion 
is inserted into the
         *  text field only.
+        *  @cfg {string} [dataLocation='header'] Where the search input field 
will be
+        *  used (header or content).
         */
        mw.widgets.SearchInputWidget = function MwWidgetsSearchInputWidget( 
config ) {
                config = $.extend( {
                        type: 'search',
                        icon: 'search',
                        maxLength: undefined,
-                       performSearchOnClick: true
+                       performSearchOnClick: true,
+                       dataLocation: 'header'
                }, config );
 
                // Parent constructor

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e51c0d3a3ca1690ea3ea08469a1cd52d9c151f3
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com>
Gerrit-Reviewer: Edokter <er...@darcoury.nl>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to