[MediaWiki-commits] [Gerrit] Remove tables from alpha - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/85223 Change subject: Remove tables from alpha .. Remove tables from alpha They have been there since December 2012 with no movement so let's just remove them. We can always reconsider this code at a later time but in the mean time it is something else to maintain Change-Id: I2d62a8d296354c85ed938ab0b2f0003ab4d5920f --- M includes/Resources.php D javascripts/modules/mf-tables.js 2 files changed, 0 insertions(+), 71 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/23/85223/1 diff --git a/includes/Resources.php b/includes/Resources.php index d86f3c3..bc3c19c 100644 --- a/includes/Resources.php +++ b/includes/Resources.php @@ -383,7 +383,6 @@ 'javascripts/externals/micro.tap.js', 'javascripts/externals/epoch.js', 'javascripts/common/history-alpha.js', - 'javascripts/modules/mf-tables.js', 'javascripts/modules/mf-translator.js', 'javascripts/modules/lazyload.js', 'javascripts/modules/nearbypages.js', diff --git a/javascripts/modules/mf-tables.js b/javascripts/modules/mf-tables.js deleted file mode 100644 index 22503a7..000 --- a/javascripts/modules/mf-tables.js +++ /dev/null @@ -1,70 +0,0 @@ -( function( M, $ ) { - var Overlay = M.require( 'Overlay' ), STEP_SIZE = 150; - - function isBlacklisted( $table ) { - return $table.hasClass( 'metadata' ) || $table.hasClass( 'navbox' ); - } - - function collapseTables( $container ) { - var - $tables = $container ? $container.find( 'table' ) : $( 'table' ); - - $tables.each( function( i ) { - var $t = $( this ), - $tc = $t.find( 'tbody' ), - $block, tableNo = i + 1, - sectionNo, tableId, - colspan, $tr, maxHeight, $td, - $container = $( 'div class=tableContent' ); - - if ( $t.parents( 'table' ).length === 0 $tc.length 0 !isBlacklisted( $t ) ) { - $block = $t.parents( '.content_block' ); - if ( $block ) { - $t.addClass( 'expando' ).css( { height: STEP_SIZE } ); - maxHeight = $tc.height(); - - sectionNo = parseInt( $block.attr( 'id' ).split( '_' )[ 1 ], 10 ) + 1; - tableId = sectionNo + '.' + tableNo; - $container.append( $t.clone() ); - $td = $t.find( 'tr' ).find( 'td' ); - colspan = $td.eq( 0 ).attr( 'colspan' ) || $td.length; - - $tr = $( 'tr class=overlayZoomer' ).prependTo( $tc ); - $( 'td' ).attr( 'colspan', colspan ).click( function() { - var overlay = new Overlay( { - heading: 'h2' + $( this ).text() + '/h2', - content: $( 'div').append( $container ).html() - } ); - overlay.show(); - } ).text( mw.msg( 'mobile-frontend-table', tableId ) ).appendTo( $tr ); - - // make the vertical expando - $tr = $( 'tr class=expandoVertical' ).appendTo( $tc ); - $( 'tdnbsp;/td' ).attr( 'colspan', colspan ).appendTo( $tr ); - $tr.on( 'click', function() { - var height, - expand = $tr.hasClass( 'expanded' ) ? true : false; - height = expand ? STEP_SIZE : ''; - $t.css( 'height', height ); - $tr.toggleClass( 'expanded' ); - window.scrollTo( 0, $tr.offset().top ); - } ); - - } - } - } ); - } - - function initTables( $container ) { - if ( !mw.config.get( 'wgIsMainPage' ) ) { - collapseTables( $container ); - } - } - - M. -
[MediaWiki-commits] [Gerrit] Remove tables from alpha - change (mediawiki...MobileFrontend)
jenkins-bot has submitted this change and it was merged. Change subject: Remove tables from alpha .. Remove tables from alpha They have been there since December 2012 with no movement so let's just remove them. We can always reconsider this code at a later time but in the mean time it is something else to maintain Change-Id: I2d62a8d296354c85ed938ab0b2f0003ab4d5920f --- M includes/Resources.php D javascripts/modules/mf-tables.js D less/modules/tables.less D stylesheets/modules/tables.css 4 files changed, 0 insertions(+), 190 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Resources.php b/includes/Resources.php index d86f3c3..abc5215 100644 --- a/includes/Resources.php +++ b/includes/Resources.php @@ -375,7 +375,6 @@ 'mobile-frontend-media-details', ), 'styles' = array( - 'stylesheets/modules/tables.css', 'stylesheets/modules/nearbypages.css', 'stylesheets/modules/mediaViewer.css', ), @@ -383,7 +382,6 @@ 'javascripts/externals/micro.tap.js', 'javascripts/externals/epoch.js', 'javascripts/common/history-alpha.js', - 'javascripts/modules/mf-tables.js', 'javascripts/modules/mf-translator.js', 'javascripts/modules/lazyload.js', 'javascripts/modules/nearbypages.js', diff --git a/javascripts/modules/mf-tables.js b/javascripts/modules/mf-tables.js deleted file mode 100644 index 22503a7..000 --- a/javascripts/modules/mf-tables.js +++ /dev/null @@ -1,70 +0,0 @@ -( function( M, $ ) { - var Overlay = M.require( 'Overlay' ), STEP_SIZE = 150; - - function isBlacklisted( $table ) { - return $table.hasClass( 'metadata' ) || $table.hasClass( 'navbox' ); - } - - function collapseTables( $container ) { - var - $tables = $container ? $container.find( 'table' ) : $( 'table' ); - - $tables.each( function( i ) { - var $t = $( this ), - $tc = $t.find( 'tbody' ), - $block, tableNo = i + 1, - sectionNo, tableId, - colspan, $tr, maxHeight, $td, - $container = $( 'div class=tableContent' ); - - if ( $t.parents( 'table' ).length === 0 $tc.length 0 !isBlacklisted( $t ) ) { - $block = $t.parents( '.content_block' ); - if ( $block ) { - $t.addClass( 'expando' ).css( { height: STEP_SIZE } ); - maxHeight = $tc.height(); - - sectionNo = parseInt( $block.attr( 'id' ).split( '_' )[ 1 ], 10 ) + 1; - tableId = sectionNo + '.' + tableNo; - $container.append( $t.clone() ); - $td = $t.find( 'tr' ).find( 'td' ); - colspan = $td.eq( 0 ).attr( 'colspan' ) || $td.length; - - $tr = $( 'tr class=overlayZoomer' ).prependTo( $tc ); - $( 'td' ).attr( 'colspan', colspan ).click( function() { - var overlay = new Overlay( { - heading: 'h2' + $( this ).text() + '/h2', - content: $( 'div').append( $container ).html() - } ); - overlay.show(); - } ).text( mw.msg( 'mobile-frontend-table', tableId ) ).appendTo( $tr ); - - // make the vertical expando - $tr = $( 'tr class=expandoVertical' ).appendTo( $tc ); - $( 'tdnbsp;/td' ).attr( 'colspan', colspan ).appendTo( $tr ); - $tr.on( 'click', function() { - var height, - expand = $tr.hasClass( 'expanded' ) ? true : false; - height = expand ? STEP_SIZE : ''; - $t.css( 'height', height ); - $tr.toggleClass( 'expanded' ); - window.scrollTo( 0, $tr.offset().top ); -