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

Change subject: Add tour parameter
......................................................................


Add tour parameter

Add an optional tour parameter with adds `&tour=[x]` to the local 
Special:Search URL
Remove whitespace error
Add test
Modify test HTML (x3)

Bug: T174077
Change-Id: Iaaf1d04e1939bd555cacd4ea3ac4390d7e43b19d
---
M InputBox.classes.php
M tests/inputBoxParserTests.txt
2 files changed, 23 insertions(+), 1 deletion(-)

Approvals:
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/InputBox.classes.php b/InputBox.classes.php
index ffa21dd..5b80928 100644
--- a/InputBox.classes.php
+++ b/InputBox.classes.php
@@ -37,6 +37,7 @@
        private $mPrefix = '';
        private $mDir = '';
        private $mSearchFilter = '';
+       private $mTour = '';
 
        /* Functions */
 
@@ -172,6 +173,10 @@
 
                if ( $this->mSearchFilter != '' ) {
                        $htmlOut .= Html::hidden( 'searchfilter', 
$this->mSearchFilter );
+               }
+
+               if ( $this->mTour != '' ) {
+                       $htmlOut .= Html::hidden( 'tour', $this->mTour );
                }
 
                $htmlOut .= $this->mBR;
@@ -624,7 +629,8 @@
                        'inline' => 'mInline',
                        'prefix' => 'mPrefix',
                        'dir' => 'mDir',
-                       'searchfilter' => 'mSearchFilter'
+                       'searchfilter' => 'mSearchFilter',
+                       'tour' => 'mTour'
                ];
                foreach ( $options as $name => $var ) {
                        if ( isset( $values[$name] ) ) {
diff --git a/tests/inputBoxParserTests.txt b/tests/inputBoxParserTests.txt
index d71fdf6..63e0d62 100644
--- a/tests/inputBoxParserTests.txt
+++ b/tests/inputBoxParserTests.txt
@@ -313,3 +313,19 @@
 </form>
 </div>
 !! end
+
+!! test
+InputBox type=search with tour
+!! wikitext
+<inputbox>
+type=search
+tour=test
+</inputbox>
+!! html+tidy
+<div class="mw-inputbox-centered" style="">
+<form name="searchbox" class="searchbox" action="/wiki/Special:Search" 
id="searchbox">
+<p><input class="mw-inputbox-input searchboxInput mw-ui-input 
mw-ui-input-inline" name="search" type="text" value="" placeholder="" size="50" 
dir="ltr" /><input type="hidden" value="test" name="tour" /><br />
+<input type="submit" name="go" class="mw-ui-button" value="Try exact match" 
/>&#160;<input type="submit" name="fulltext" class="mw-ui-button" value="Search 
full text" /></p>
+</form>
+</div>
+!! end
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaaf1d04e1939bd555cacd4ea3ac4390d7e43b19d
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/InputBox
Gerrit-Branch: master
Gerrit-Owner: Samtar <s...@tntnet.uk>
Gerrit-Reviewer: Eloquence <eloque...@gmail.com>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Samtar <s...@tntnet.uk>
Gerrit-Reviewer: Urbanecm <martin.urba...@wikimedia.cz>
Gerrit-Reviewer: Zppix <megadev44s.m...@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