r96239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96238‎ | r96239 | r96240 >
Date:17:11, 4 September 2011
Author:krinkle
Status:deferred
Tags:
Comment:
Revert r96238, commit fail
Modified paths:
  • /trunk/extensions/CodeReview/modules/ext.codereview.overview.js (modified) (history)
  • /trunk/extensions/MobileFrontend/views/layout/application.html.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/modules/ext.codereview.overview.js
@@ -1,36 +1,31 @@
2 -/**
3 - * Revision overview widget for the MediaWiki CodeReview extension
4 - * Based on http://www.mediawiki.org/wiki/User:Splarka/scapmap.js
 2+/* Scap roadmap viewer, version [0.0.7]
 3+ * Originally from: http://www.mediawiki.org/wiki/User:Splarka/scapmap.js
54 *
6 - * Adds an "Overview" portlet link on pages with a revision table on SpecialCode.
7 - * When triggered the overview slides out with boxes, each representing a revision.
8 - * The boxes links take you to that relevant row in the table, and a backlink is created
9 - * in the id column.
105 *
11 - * Hovering over a colored box shows a tooltip containg info from the table row.
 6+ * Loads on, for example: http://www.mediawiki.org/wiki/Special:Code/MediaWiki
 7+ * Click [overview] to generate map.
 8+ * Text in the "path" input box is stripped from the path line in the summary.
 9+ * Clicking a colored box takes you to that relevant line, and a backlink is created in the id column on focus.
 10+ * Hovering over a colored box pops up a little info packet box.
1211 */
1312 jQuery( function( $ ) {
14 -
15 - // Return early if this page doesn't qualify
16 - if ( !$( '#path' ).length || !$( 'table.TablePager' ).length ) {
17 - return;
 13+ // check if we're on a page with a useful list of revisions
 14+ if( $( '#path' ).size() && $('table.TablePager').size() ) {
 15+ var portlet = $( '#p-namespaces' ).size() ? 'p-namespaces' : 'p-cactions';
 16+ mw.util.addPortletLink(
 17+ portlet,
 18+ '#',
 19+ mw.msg( 'codereview-overview-title' ),
 20+ 'ca-scapmap',
 21+ mw.msg( 'codereview-overview-desc' )
 22+ );
1823 }
1924
20 - var portletLink = mw.util.addPortletLink(
21 - $( '#p-namespaces' ).length ? 'p-namespaces' : 'p-cactions',
22 - '#',
23 - mw.msg( 'codereview-overview-title' ),
24 - 'ca-scapmap',
25 - mw.msg( 'codereview-overview-desc' )
26 - ),
27 - // Cache since we'll be using this a few times
28 - $portletLink = $( portletLink );
29 -
30 - $portletLink.click( function() {
 25+ $('#ca-scapmap').click( function () {
3126 var $tr = $('table.TablePager tr');
32 - if ( $tr.length < 2 ){
 27+ if( $tr.size() < 2 ){
3328 return;
34 - } else if ( $('#overviewmap').length ) {
 29+ } else if( $('#overviewmap').size() ) {
3530 // We've already created it; maybe they just want to toggle it on and off
3631 $('#overviewmap').slideToggle();
3732 return;
@@ -47,13 +42,13 @@
4843 var status = false;
4944
5045 var trc = $(this).attr( 'class' );
51 - if ( !trc || !trc.length ) {
 46+ if( !trc || !trc.length ) {
5247 return;
5348 } else {
5449 trc = trc.split( ' ' );
5550 }
56 - for ( var j = 0; j < trc.length; j++ ) {
57 - if ( trc[j].substring( 0, 21 ) == 'mw-codereview-status-' ) {
 51+ for( var j = 0; j < trc.length; j++ ) {
 52+ if( trc[j].substring( 0, 21 ) == 'mw-codereview-status-' ) {
5853 status = trc[j].substring( 21 );
5954 }
6055 }
@@ -61,7 +56,7 @@
6257
6358 var statusname = $td.filter( '.TablePager_col_cr_status' ).text();
6459
65 - if ( !statusname || !status ) {
 60+ if( !statusname || !status ) {
6661 return;
6762 }
6863
@@ -75,12 +70,12 @@
7671 };
7772
7873 var path = $td.filter( '.TablePager_col_cr_path' ).text();
79 - if ( path && path.indexOf( vpath ) == 0 && path != vpath && vpath != '' ) {
 74+ if( path && path.indexOf( vpath ) == 0 && path != vpath && vpath != '' ) {
8075 path = '\u2026' + path.substring( vpath.length );
8176 }
8277 overviewPopupData[i]['path'] = path;
8378
84 - if ( !totals[statusname] ) {
 79+ if( !totals[statusname] ) {
8580 totals[statusname] = 0;
8681 }
8782 totals[statusname]++;
@@ -95,24 +90,24 @@
9691 });
9792
9893 var sumtext = [];
99 - for ( var i in totals ) {
100 - if ( typeof i != 'string' || typeof totals[i] != 'number' ) {
 94+ for( var i in totals ) {
 95+ if( typeof i != 'string' || typeof totals[i] != 'number' ) {
10196 continue;
10297 }
10398 sumtext.push( i + ': ' + totals[i] );
10499 }
105100 sumtext.sort();
106101 var $summary = $( '<div class="summary">' )
107 - .text( 'Total revisions: ' + ( $tr.length - 1 ) + '. [' + sumtext.join(', ') + ']' );
 102+ .text( 'Total revisions: ' + ( $tr.size() - 1 ) + '. [' + sumtext.join(', ') + ']' );
108103
109104 $( '#overviewmap' )
110105 .append( $summary )
111 - .css( 'max-width', Math.floor( Math.sqrt( $tr.length ) ) * 30 )
 106+ .css( 'max-width', Math.floor( Math.sqrt( $tr.size() ) ) * 30 )
112107 .slideDown();
113108
114109 // Add the hover popup
115110 $( '#overviewmap > a' )
116 - .mouseenter( function() {
 111+ .mouseenter( function () {
117112
118113 var $el = $( this );
119114 if ( $el.data('overviewPopup') ) {
Index: trunk/extensions/MobileFrontend/views/layout/application.html.php
@@ -1,5 +1,5 @@
22 <?php
3 -global $wgScriptPath, $wgExtensionAssetsPath, $wgAppleTouchIcon;
 3+global $wgExtensionAssetsPath, $wgAppleTouchIcon;
44
55 $dir = self::$dir;
66 $code = self::$code;
@@ -12,31 +12,19 @@
1313
1414 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
1515
16 -if ( @$_GET['patch'] == '1' ) {
17 -
18 - $script = '';
19 -
20 -
21 -} else {
22 -
23 - $script = '<script type="text/javascript" language="javascript" src="'.$wgExtensionAssetsPath.'/MobileFrontend/javascripts/application.js"></script>';
24 -
25 -}
26 -
27 -
2816 $applicationHtml = <<<EOT
2917 <!DOCTYPE html PUBLIC
3018 "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
3119 "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
32 -<html lang="{$code}" dir="{$dir}" xml:lang="{$code}" xmlns="http://www.w3.org/1999/xhtml">
 20+<html lang='{$code}' dir='{$dir}' xml:lang='{$code}' xmlns='http://www.w3.org/1999/xhtml'>
3321 <head>
3422 <title>{$htmlTitle}</title>
3523 <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
36 - <link href="{$wgExtensionAssetsPath}/MobileFrontend/stylesheets/{$cssFileName}.css" media="all" rel="Stylesheet" type="text/css" />
 24+ <link href='{$wgExtensionAssetsPath}/MobileFrontend/stylesheets/{$cssFileName}.css' media='all' rel='Stylesheet' type='text/css' />
3725 <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
38 - <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
 26+ <meta name = "viewport" content = "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
3927 ${appleTouchIconTag}
40 - <script type="text/javascript">
 28+ <script type='text/javascript'>
4129 //<![CDATA[
4230 var title = "{$htmlTitle}";
4331 function shouldCache() {
@@ -44,12 +32,12 @@
4533 }
4634 //]]>
4735 </script>
48 - <script type="text/javascript" language="javascript" src="{$wgScriptPath}/resources/jquery/jquery.js"></script>
49 - {$script}
 36+ <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/jquery.js"></script>
 37+ <script type="text/javascript" language="javascript" src="{$wgExtensionAssetsPath}/MobileFrontend/javascripts/application.js"></script>
5038 </head>
5139 <body>
5240 {$searchWebkitHtml}
53 - <div class="show" id="content_wrapper">
 41+ <div class='show' id='content_wrapper'>
5442 {$contentHtml}
5543 </div>
5644 {$footerHtml}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96238Add new directory for extensionkrinkle17:06, 4 September 2011

Status & tagging log