r97680 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97679‎ | r97680 | r97681 >
Date:23:14, 20 September 2011
Author:reedy
Status:ok
Tags:
Comment:
1.18wmf1 Merge r97533, r97556, r97563, r97592, r97654
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/DeviceDetection.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/application.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/MobileFrontend/views/layout/application.html.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/DeviceDetection.php
@@ -154,7 +154,7 @@
155155 'footmenu' => 'default',
156156 'with_layout' => 'application',
157157 'css_file_name' => 'blackberry',
158 - 'supports_javascript' => true,
 158+ 'supports_javascript' => false,
159159 'disable_zoom' => true,
160160 'parser' => 'html',
161161 'disable_links' => true,
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/javascripts/application.js
@@ -1,49 +1,45 @@
2 -// Ideally, this would be loaded in the head and activated by a script at the bottom,
3 -// I think, rather than attached to an onload...
4 -window.onload = function() {
5 - // I don't think this makes sense. Loading this here means that this button
6 - // won't function until the page is loaded. It would probably be an
7 - // improvement to just attach an onclick straight into the html.
8 - document.getElementById( 'logo' ).onclick = function() {
9 - var n = document.getElementById( 'nav' ).style;
10 - n.display = n.display == 'block' ? 'none' : 'block';
11 - };
 2+// I don't think this makes sense. Loading this here means that this button
 3+// won't function until the page is loaded. It would probably be an
 4+// improvement to just attach an onclick straight into the html.
 5+document.getElementById( 'logo' ).onclick = function() {
 6+ var n = document.getElementById( 'nav' ).style;
 7+ n.display = n.display == 'block' ? 'none' : 'block';
 8+};
129
13 - // Also problematic, not working until the page loads...
14 - for( var h = document.getElementsByTagName( 'h2' ), i = 0; i < h.length; i++ ) {
15 - if ( h[i].className == 'section_heading' ) {
16 - h[i].onclick = function() {
17 - var section_idx = parseInt( this.id.replace( /section_(\d+)/, '$1' ) );
18 - wm_toggle_section( section_idx );
19 - }
 10+// Also problematic, not working until the page loads...
 11+for( var h = document.getElementsByTagName( 'h2' ), i = 0; i < h.length; i++ ) {
 12+ if ( h[i].className == 'section_heading' ) {
 13+ h[i].onclick = function() {
 14+ var section_idx = parseInt( this.id.replace( /section_(\d+)/, '$1' ) );
 15+ wm_toggle_section( section_idx );
2016 }
21 - };
 17+ }
 18+};
2219
23 - // And this...
24 - for ( var a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) {
25 - a[i].onclick = function() {
26 - if ( this.hash.indexOf( '#' ) == 0 ) {
27 - wm_reveal_for_hash( this.hash );
28 - }
 20+// And this...
 21+for ( var a = document.getElementsByTagName( 'a' ), i = 0; i < a.length; i++ ) {
 22+ a[i].onclick = function() {
 23+ if ( this.hash.indexOf( '#' ) == 0 ) {
 24+ wm_reveal_for_hash( this.hash );
2925 }
30 - };
31 -
32 - if ( document.location.hash.indexOf( '#' ) == 0 ) {
33 - wm_reveal_for_hash( document.location.hash );
3426 }
 27+};
3528
36 - updateOrientation();
 29+if ( document.location.hash.indexOf( '#' ) == 0 ) {
 30+ wm_reveal_for_hash( document.location.hash );
 31+}
3732
38 - // Try to scroll and hide URL bar
39 - window.scrollTo( 0, 1 );
 33+updateOrientation();
4034
41 - // This is a global. I don't know why.
42 - decode = document.getElementById( 'searchField' );
43 - decode.value = unescape( decode.value );
44 - decode = document.getElementsByTagName( 'title' )[0];
45 - decode.innerHTML = unescape( decode.innerHTML );
46 -};
 35+// Try to scroll and hide URL bar
 36+window.scrollTo( 0, 1 );
4737
 38+// This is a global. I don't know why.
 39+decode = document.getElementById( 'searchField' );
 40+decode.value = unescape( decode.value );
 41+decode = document.getElementsByTagName( 'title' )[0];
 42+decode.innerHTML = unescape( decode.innerHTML );
 43+
4844 /**
4945 * updateOrientation checks the current orientation, sets the body's class
5046 * attribute to portrait, landscapeLeft, or landscapeRight,
@@ -87,4 +83,4 @@
8884 var s = document.getElementById( d[i] + section_id ).style;
8985 s.display = s.display == 'block' ? 'none' : 'block';
9086 }
91 -}
\ No newline at end of file
 87+}
Property changes on: branches/wmf/1.18wmf1/extensions/MobileFrontend/MobileFrontend.php
___________________________________________________________________
Modified: svn:mergeinfo
9288 Merged /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php:r97563,97592
9389 Merged /trunk/extensions/MobileFrontend/MobileFrontend.php:r97556
Index: branches/wmf/1.18wmf1/extensions/MobileFrontend/views/layout/application.html.php
@@ -34,7 +34,6 @@
3535 }
3636 //]]>
3737 </script>
38 - <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/application.js?version=20110912T172820Z"></script>
3938 </head>
4039 <body>
4140 {$searchWebkitHtml}
@@ -43,6 +42,7 @@
4443 {$contentHtml}
4544 </div>
4645 {$footerHtml}
 46+ <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/application.js?version=20110919T172820Z"></script>
4747 </body>
4848 </html>
4949 EOT;
Property changes on: branches/wmf/1.18wmf1/extensions/MobileFrontend
___________________________________________________________________
Modified: svn:mergeinfo
5050 Merged /branches/wmf/1.17wmf1/extensions/MobileFrontend:r97563,97592
5151 Merged /trunk/extensions/MobileFrontend:r97556

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97533remove show/hide from blackberry for nowpreilly18:38, 19 September 2011
r97556fix for Bug 30985 - Mobile header expanding and menu do not work until page l...preilly20:58, 19 September 2011
r97563remove search based functionspreilly21:49, 19 September 2011
r97592fix javascript error on productionpreilly01:39, 20 September 2011
r97654bump version numberpreilly19:30, 20 September 2011

Status & tagging log