http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99140

Revision: 99140
Author:   preilly
Date:     2011-10-06 20:53:17 +0000 (Thu, 06 Oct 2011)
Log Message:
-----------
mft r99053

Modified Paths:
--------------
    branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
    branches/wmf/1.17wmf1/extensions/MobileFrontend/javascripts/application.js

Modified: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php  
2011-10-06 20:49:03 UTC (rev 99139)
+++ branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php  
2011-10-06 20:53:17 UTC (rev 99140)
@@ -164,6 +164,7 @@
                'mobile-frontend-leave-feedback',
                'mobile-frontend-feedback-page',
                'mobile-frontend-leave-feedback-thanks',
+               'mobile-frontend-search-submit',
        );
 
        public $itemsToRemove = array(
@@ -907,7 +908,7 @@
        }
 
        public function DOMParse( $html ) {
-               global $wgSitename;
+               global $wgSitename, $wgScript;
                wfProfileIn( __METHOD__ );
                $html = mb_convert_encoding( $html, 'HTML-ENTITIES', "UTF-8" );
                libxml_use_internal_errors( true );
@@ -1017,7 +1018,7 @@
                } elseif ( $this->contentFormat == 'WML' ) {
                        $homeButton = 
self::$messages['mobile-frontend-home-button'];
                        $randomButton = 
self::$messages['mobile-frontend-random-button'];
-                       // header( 'Content-Type: text/vnd.wap.wml' );
+                       header( 'Content-Type: text/vnd.wap.wml' );
 
                        // TODO: Content transformations required
                        // WML Validator:
@@ -1036,7 +1037,12 @@
                        foreach ( $elements as $element ) {
                                $contentHtml = preg_replace( '#</?' . $element 
. '[^>]*>#is', '', $contentHtml );
                        }
-
+                       
+                       //Wml for searching
+                       $searchWml = '<p><input emptyok="true" format="*M" 
type="text" name="search" value="" size="16" />' .
+                               '<do type="accept" label="' . 
self::$messages['mobile-frontend-search-submit'] . '">' .
+                               '<go href="' . $wgScript . 
'?title=Special%3ASearch&amp;search=$(search)"></go></do></p>';
+                       $contentHtml = $searchWml . $contentHtml;
                        // Content wrapping
                        $contentHtml = $this->createWMLCard( $contentHtml );
                        require( 'views/layout/application.wml.php' );

Modified: 
branches/wmf/1.17wmf1/extensions/MobileFrontend/javascripts/application.js
===================================================================
--- branches/wmf/1.17wmf1/extensions/MobileFrontend/javascripts/application.js  
2011-10-06 20:49:03 UTC (rev 99139)
+++ branches/wmf/1.17wmf1/extensions/MobileFrontend/javascripts/application.js  
2011-10-06 20:53:17 UTC (rev 99140)
@@ -63,12 +63,6 @@
 // Try to scroll and hide URL bar
 window.scrollTo( 0, 1 );
 
-// This is a global. I don't know why.
-decode = document.getElementById( 'search' );
-decode.value = unescape( decode.value );
-decode = document.getElementsByTagName( 'title' )[0];
-decode.innerHTML = unescape( decode.innerHTML );
-
 /**
  * updateOrientation checks the current orientation, sets the body's class
  * attribute to portrait, landscapeLeft, or landscapeRight,


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

Reply via email to