r100854 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100853‎ | r100854 | r100855 >
Date:19:33, 26 October 2011
Author:preilly
Status:ok (Comments)
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/opensearch.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/stylesheets/common.css (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/opensearch.js
@@ -67,11 +67,13 @@
6868 if ( !sections || sections.length < 1 ) {
6969 results.innerHTML = "No results";
7070 } else {
71 - var html = '';
 71+ var html = '<div class="suggestions-results">';
7272 for ( i = 0; i < sections.length; i++ ) {
7373 var section = sections[i];
74 - html = html + "<a href='" + section.value + "'>" + section.label + "</a><br/>";
 74+ var rel = i + 1;
 75+ html = html + "<div class=\"suggestions-result\" rel=\"" + rel + "\" title=\"" + section.label + "\"><a href='" + section.value + "'>" + section.label + "</a></div>";
7576 }
 77+ html = html + '</div>';
7678 results.innerHTML = html;
7779 }
7880 }
\ No newline at end of file
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/stylesheets/common.css
@@ -15,6 +15,41 @@
1616 display: none;
1717 }
1818
 19+.suggestions-results {
 20+ font-size: 0.8em;
 21+ cursor: pointer;
 22+}
 23+
 24+.suggestions-result {
 25+ color: black;
 26+ color: WindowText;
 27+ margin: 0;
 28+ line-height: 1.5em;
 29+ padding: 0.01em 0.25em;
 30+ text-align: left;
 31+}
 32+
 33+.suggestions-result a {
 34+ text-decoration: none;
 35+ color: #000000;
 36+}
 37+.suggestions-result a:link {
 38+ text-decoration: none;
 39+ color:#000000;
 40+}
 41+.suggestions-result a:visited {
 42+ text-decoration: none;
 43+ color:#000000;
 44+}
 45+.suggestions-result a:hover {
 46+ text-decoration: none;
 47+ color:#000000;
 48+}
 49+.suggestions-result a:active {
 50+ text-decoration: none;
 51+ color:#000000;
 52+}
 53+
1954 #results {
2055 display: none;
2156 background-color: #ffffff;
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -82,8 +82,8 @@
8383 * @return bool
8484 */
8585 function efExtMobileFrontendUnitTests( &$files ) {
86 - $files[] = dirname( __FILE__ ) . '/tests/MobileFrontendTest.php';
87 - return true;
 86+ $files[] = dirname( __FILE__ ) . '/tests/MobileFrontendTest.php';
 87+ return true;
8888 }
8989
9090 class ExtMobileFrontend {
@@ -291,10 +291,10 @@
292292 * @param $field string
293293 * @return string
294294 */
295 - private function removeQueryStringParameter( $url, $field ) {
296 - $url = preg_replace( '/(.*)(\?|&)' . $field . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&' );
297 - $url = substr( $url, 0, -1 );
298 - return $url;
 295+ private function removeQueryStringParameter( $url, $field ) {
 296+ $url = preg_replace( '/(.*)(\?|&)' . $field . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&' );
 297+ $url = substr( $url, 0, -1 );
 298+ return $url;
299299 }
300300
301301 public function getMsg() {
@@ -313,7 +313,7 @@
314314 if ( stristr( $copyright, '<li class="noprint">' ) !== false ) {
315315 $copyright = '<ul><li>' . $copyright . '</li></ul>';
316316 }
317 -
 317+
318318 // Need to stash the results of the "wfMsg" call before the Output Buffering handler
319319 // because at this point the database connection is shut down, etc.
320320
@@ -597,17 +597,17 @@
598598 wfProfileOut( __METHOD__ );
599599 return true;
600600 }
601 -
 601+
602602 private function checkUserStatus() {
603603 wfProfileIn( __METHOD__ );
604 -
605 - if ( !empty( $_SERVER['HTTP_APPLICATION_VERSION'] ) &&
 604+
 605+ if ( !empty( $_SERVER['HTTP_APPLICATION_VERSION'] ) &&
606606 strpos( $_SERVER['HTTP_APPLICATION_VERSION'], 'Wikipedia Mobile' ) !== false ) {
607607 self::$hideSearchBox = true;
608608 }
609 -
 609+
610610 $optInCookie = $this->getOptInOutCookie();
611 - if ( !empty( $optInCookie ) &&
 611+ if ( !empty( $optInCookie ) &&
612612 $optInCookie == 1 ) {
613613 self::$isBetaGroupMember = true;
614614 }
@@ -626,13 +626,13 @@
627627 $wgCookieDomain = $tempWgCookieDomain;
628628 wfProfileOut( __METHOD__ );
629629 }
630 -
 630+
631631 private function getOptInOutCookie() {
632632 global $wgRequest;
633633 wfProfileIn( __METHOD__ );
634634 $optInCookie = $wgRequest->getCookie( 'optin' );
635635 wfProfileOut( __METHOD__ );
636 - return $optInCookie;
 636+ return $optInCookie;
637637 }
638638
639639 /**
@@ -692,7 +692,7 @@
693693 $wgOut->addVaryHeader( 'Cookie' );
694694 wfProfileOut( __METHOD__ );
695695 }
696 -
 696+
697697 private function sendApplicationVersionVaryHeader() {
698698 global $wgOut, $wgRequest;
699699 wfProfileIn( __METHOD__ );
@@ -1153,7 +1153,7 @@
11541154 if ( self::$isMainPage ) {
11551155 $contentHtml = $this->DOMParseMainPage( $contentHtml );
11561156 }
1157 -
 1157+
11581158 $title = htmlspecialchars( self::$title->getText() );
11591159 $htmlTitle = htmlspecialchars( self::$htmlTitle );
11601160
@@ -1178,12 +1178,12 @@
11791179 // Add segmentation markers
11801180 $contentHtml = $this->headingTransform( $contentHtml );
11811181
1182 - // Content removal for WML rendering
 1182+ // Content removal for WML rendering
11831183 $elements = array( 'span', 'div', 'sup', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'sup', 'sub' );
11841184 foreach ( $elements as $element ) {
11851185 $contentHtml = preg_replace( '#</?' . $element . '[^>]*>#is', '', $contentHtml );
11861186 }
1187 -
 1187+
11881188 //Wml for searching
11891189 $searchWml = '<p><input emptyok="true" format="*M" type="text" name="search" value="" size="16" />' .
11901190 '<do type="accept" label="' . self::$messages['mobile-frontend-search-submit'] . '">' .

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100851search suggestionspreilly19:28, 26 October 2011

Comments

#Comment by 😂 (talk | contribs)   22:31, 7 November 2011

Why is a deployment merge tagged as 1.18?

#Comment by Preilly (talk | contribs)   22:32, 7 November 2011

It isn't now... that was a mistake.

Status & tagging log