[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: No need for background color on the outside of thumbnails

2017-11-29 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394204 )

Change subject: No need for background color on the outside of thumbnails
..

No need for background color on the outside of thumbnails

Change-Id: Id7e38e3653ad0c53a41444926b7ba3157e13c2d2
---
M resources/screen-common.less
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless 
refs/changes/04/394204/1

diff --git a/resources/screen-common.less b/resources/screen-common.less
index 6cf9c6f..1eb1eff 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -409,12 +409,10 @@
 .tright {
margin: 0 0 0.5em 0.5em;
padding: 0 0 1em 1.5em;
-   background: #fff;
 }
 .tleft {
margin: 0 0.5em 0.5em 0;
padding: 0 1.5em 1em 0;
-   background: #fff;
 
 }
 .thumbinner {

-- 
To view, visit https://gerrit.wikimedia.org/r/394204
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7e38e3653ad0c53a41444926b7ba3157e13c2d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: Only add border to the primary thumb image

2017-11-25 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393370 )

Change subject: Only add border to the primary thumb image
..

Only add border to the primary thumb image

Bug: T181211
Change-Id: Idf3d2fa88d5bf6c7244cf2bd1c32813b141fb845
---
M resources/screen-common.less
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless 
refs/changes/70/393370/1

diff --git a/resources/screen-common.less b/resources/screen-common.less
index 9b9b900..58a8a42 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -422,7 +422,7 @@
font-size: 95%;
padding: 0.5em 1em;
 }
-.thumbinner img {
+.thumbinner .thumbimage {
border: solid 1px @grey-bright;
 }
 #mw-content li.gallerybox div.thumb {

-- 
To view, visit https://gerrit.wikimedia.org/r/393370
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf3d2fa88d5bf6c7244cf2bd1c32813b141fb845
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: Allow viewport zooming

2017-11-25 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393368 )

Change subject: Allow viewport zooming
..

Allow viewport zooming

Bug: T181131
Change-Id: Ifce77610100591222464c576adc0dd0f3f1505ec
---
M Timeless.skin.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless 
refs/changes/68/393368/1

diff --git a/Timeless.skin.php b/Timeless.skin.php
index f76e670..d806f81 100644
--- a/Timeless.skin.php
+++ b/Timeless.skin.php
@@ -14,7 +14,7 @@
public function initPage( OutputPage $out ) {
parent::initPage( $out );
 
-   $out->addMeta( 'viewport', 'width=device-width, 
initial-scale=1, maximum-scale=1' );
+   $out->addMeta( 'viewport', 'width=device-width, 
initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0' );
 
$out->addModuleStyles( [
'mediawiki.skinning.content.externallinks',

-- 
To view, visit https://gerrit.wikimedia.org/r/393368
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifce77610100591222464c576adc0dd0f3f1505ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Timeless[master]: Allow multiple mw-indicator side by side

2017-11-24 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393287 )

Change subject: Allow multiple mw-indicator side by side
..

Allow multiple mw-indicator side by side

Change-Id: I6ca0b1739ba8364ef64c92a6e05569a1da2c9c76
---
M resources/screen-common.less
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Timeless 
refs/changes/87/393287/1

diff --git a/resources/screen-common.less b/resources/screen-common.less
index 9b9b900..6cf9c6f 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -287,6 +287,9 @@
float: right;
margin: 0.75em 0 0 1em;
 }
+.mw-indicator {
+   display: inline-block;
+}
 /* Subtitle area
  * @see https://phabricator.wikimedia.org/T173951
  */

-- 
To view, visit https://gerrit.wikimedia.org/r/393287
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ca0b1739ba8364ef64c92a6e05569a1da2c9c76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Timeless
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] tablesorter: User Intl.Collator for string sorting

2017-10-27 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/386858 )

Change subject: [WIP] tablesorter: User Intl.Collator for string sorting
..

[WIP] tablesorter: User Intl.Collator for string sorting

Requires testcases and verification on various browsers.

Bug: T72157
Change-Id: I271fcccdbd19c1fe1db39d442d934a6b4382514d
---
M resources/src/jquery/jquery.tablesorter.js
1 file changed, 23 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/58/386858/1

diff --git a/resources/src/jquery/jquery.tablesorter.js 
b/resources/src/jquery/jquery.tablesorter.js
index cac103e..a22c20d 100644
--- a/resources/src/jquery/jquery.tablesorter.js
+++ b/resources/src/jquery/jquery.tablesorter.js
@@ -465,11 +465,11 @@
}
}
 
-   function sortText( a, b ) {
+   function sortAsc( a, b ) {
return ( ( a < b ) ? -1 : ( ( a > b ) ? 1 : 0 ) );
}
 
-   function sortTextDesc( a, b ) {
+   function sortDesc( a, b ) {
return ( ( b < a ) ? -1 : ( ( b > a ) ? 1 : 0 ) );
}
 
@@ -478,19 +478,29 @@
sortFn = [];
 
for ( i = 0; i < sortList.length; i++ ) {
-   sortFn[ i ] = ( sortList[ i ][ 1 ] ) ? sortTextDesc : 
sortText;
+   sortFn[ i ] = ( sortList[ i ][ 1 ] ) ? sortDesc : 
sortAsc;
}
cache.normalized.sort( function ( array1, array2 ) {
var i, col, ret;
for ( i = 0; i < sortList.length; i++ ) {
col = sortList[ i ][ 0 ];
-   ret = sortFn[ i ].call( this, array1[ col ], 
array2[ col ] );
+
+   if ( ts.collator && 'string' === typeof array1[ 
col ] && 'string' === typeof array2[ col ] ) {
+   if ( sortList[ i ][ 1 ] ) {
+   // Desc
+   ret = ts.collator.compare( 
array2[ col ], array1[ col ] );
+   } else {
+   ret = ts.collator.compare( 
array1[ col ], array2[ col ] );
+   }
+   } else {
+   ret = sortFn[ i ].call( this, array1[ 
col ], array2[ col ] );
+   }
if ( ret !== 0 ) {
return ret;
}
}
// Fall back to index number column to ensure stable 
sort
-   return sortText.call( this, array1[ array1.length - 1 
], array2[ array2.length - 1 ] );
+   return sortAsc.call( this, array1[ array1.length - 1 ], 
array2[ array2.length - 1 ] );
} );
return cache;
}
@@ -860,6 +870,11 @@
// scripts may call .tablesorter() 
before they have done the
// tableSorterCollation customizations.
buildCollationTable();
+   if( typeof Intl !== 'undefined' ){
+   if ( 
Intl.Collator.supportedLocalesOf( mw.config.get( 'wgContentLanguage' ), { 
numeric: true } ).length > 0 ) {
+   ts.collator = new 
Intl.Collator( mw.config.get( 'wgContentLanguage' ), { numeric: true } );
+   }
+   }
 
// Legacy fix of .sortbottoms
// Wrap them inside a tfoot (because 
that's what they actually want to be)
@@ -1091,10 +1106,10 @@
},
format: function ( s ) {
var tsc;
-   s = $.trim( s.toLowerCase() );
-   if ( ts.collationRegex ) {
+   s = $.trim( s );
+   if ( !ts.collator && ts.collationRegex ) {
tsc = ts.collationTable;
-   s = s.replace( ts.collationRegex, function ( 
match ) {
+   s = s.toLowerCase().replace( ts.collationRegex, 
function ( match ) {
var r = tsc[ match ] ? tsc[ match ] : 
tsc[ match.toUpperCase() ];
return r.toLowerCase();
} );

-- 
To view, visit https://gerrit.wikimedia.org/r/386858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Fix margin of #jump-to-nav

2017-10-13 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384129 )

Change subject: Fix margin of #jump-to-nav
..

Fix margin of #jump-to-nav

The top margin is a correction for the bottom margin.

Follow-up to: Id58972b
Bug: T176444

Change-Id: Icfedfa1ede49de96210b8662a1886ab52c78b006
---
M resources/src/mediawiki.skinning/interface.css
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/29/384129/1

diff --git a/resources/src/mediawiki.skinning/interface.css 
b/resources/src/mediawiki.skinning/interface.css
index 916c463..bf92086 100644
--- a/resources/src/mediawiki.skinning/interface.css
+++ b/resources/src/mediawiki.skinning/interface.css
@@ -84,6 +84,7 @@
 #contentSub:empty ~ #jump-to-nav,
 #contentSub2:empty ~ #jump-to-nav {
margin-top: 0;
+   margin-bottom: 0;
 }
 
 span.subpages {

-- 
To view, visit https://gerrit.wikimedia.org/r/384129
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icfedfa1ede49de96210b8662a1886ab52c78b006
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[master]: Kartographer: Capture geohack variant

2017-09-17 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378522 )

Change subject: Kartographer: Capture geohack variant
..

Kartographer: Capture geohack variant

Bug: T173049
Change-Id: Idcfb01ebc2274820c975de5891e51ed120490f4a
---
M modules/ext.wikimediaEvents.kartographer.js
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/22/378522/1

diff --git a/modules/ext.wikimediaEvents.kartographer.js 
b/modules/ext.wikimediaEvents.kartographer.js
index 2971a94..16cf309 100644
--- a/modules/ext.wikimediaEvents.kartographer.js
+++ b/modules/ext.wikimediaEvents.kartographer.js
@@ -228,6 +228,12 @@
if ( data.options && data.options.extra && 
data.action.endsWith( 'layer' ) ) {
options.extra.layer = data.options.extra.layer;
}
+   if ( data.options && data.options.extra && 
data.options.extra.variant ) {
+   options.extra.variant = 
data.options.extra.variant;
+   if ( data.options.extra.open_trigger ) {
+   options.extra.open_trigger = 
data.options.extra.open_trigger;
+   }
+   }
 
logEvent( data.feature.featureType, data.action, 
data.isFullScreen, isFirstInteraction( isInteraction ), options );
} );

-- 
To view, visit https://gerrit.wikimedia.org/r/378522
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idcfb01ebc2274820c975de5891e51ed120490f4a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikimediaEvents[master]: Kartographer: Protect against undefined data.options

2017-09-17 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/378516 )

Change subject: Kartographer: Protect against undefined data.options
..

Kartographer: Protect against undefined data.options

Bug: T174249
Change-Id: I5b0623452a017a2f23ddeb57aaa118da7af564ea
---
M modules/ext.wikimediaEvents.kartographer.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaEvents 
refs/changes/16/378516/1

diff --git a/modules/ext.wikimediaEvents.kartographer.js 
b/modules/ext.wikimediaEvents.kartographer.js
index 9996062..8042130 100644
--- a/modules/ext.wikimediaEvents.kartographer.js
+++ b/modules/ext.wikimediaEvents.kartographer.js
@@ -225,7 +225,7 @@
break;
}
 
-   if ( data.action.endsWith( 'layer' ) ) {
+   if ( data.options && data.action.endsWith( 'layer' ) ) {
options.extra.layer = data.options.extra.layer;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/378516
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b0623452a017a2f23ddeb57aaa118da7af564ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaEvents
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: TableSorter: Sort unrecognized dates as -Infinity

2017-09-02 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375514 )

Change subject: TableSorter: Sort unrecognized dates as -Infinity
..

TableSorter: Sort unrecognized dates as -Infinity

Follow-up to: I664b4cc
Bug: T174814

Change-Id: I028681172be7a30e51cab42847c4fc35e9358aca
---
M resources/src/jquery/jquery.tablesorter.js
M tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
2 files changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/14/375514/1

diff --git a/resources/src/jquery/jquery.tablesorter.js 
b/resources/src/jquery/jquery.tablesorter.js
index 922da31..ecd376a 100644
--- a/resources/src/jquery/jquery.tablesorter.js
+++ b/resources/src/jquery/jquery.tablesorter.js
@@ -1163,7 +1163,7 @@
match = s.match( ts.rgx.isoDate[ 1 ] );
}
if ( !match ) {
-   return 0;
+   return -Infinity;
}
// Month and day
for ( i = 2; i <= 4; i += 2 ) {
diff --git 
a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js 
b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
index 257699a..01589c3 100644
--- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
@@ -174,7 +174,8 @@
parserTest( 'Y Dates', 'date', YDates );
 
ISODates = [
-   [ '2000',   false,  94668480, 'Plain 4-digit 
year' ],
+   [ '',   false,  -Infinity, 'Not a date' ],
+   [ '2000',   false,  94668480, 'Plain 4-digit year' ],
[ '2000-01',true,   94668480, 'Year with month' ],
[ '2000-01-01', true,   94668480, 'Year with month and day' 
],
[ '2000-13-01', false,  97830720, 'Non existant month' ],

-- 
To view, visit https://gerrit.wikimedia.org/r/375514
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I028681172be7a30e51cab42847c4fc35e9358aca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: update.php: Check for outdated composer deps of extensions

2017-08-14 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371965 )

Change subject: update.php: Check for outdated composer deps of extensions
..

update.php: Check for outdated composer deps of extensions

Bug: T119711
Change-Id: I6d4f427eb255b6638ac51ae5537d62d2fe54d37d
---
M maintenance/checkComposerLockUpToDate.php
1 file changed, 46 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/371965/1

diff --git a/maintenance/checkComposerLockUpToDate.php 
b/maintenance/checkComposerLockUpToDate.php
index b504bde..afbcc15 100644
--- a/maintenance/checkComposerLockUpToDate.php
+++ b/maintenance/checkComposerLockUpToDate.php
@@ -10,24 +10,51 @@
  * the composer.json file to see if dependencies are up to date.
  */
 class CheckComposerLockUpToDate extends Maintenance {
+
public function __construct() {
parent::__construct();
$this->addDescription(
'Checks whether your composer.lock file is up to date 
with the current composer.json' );
+   $this->addOption( 'without-extensions', 'Also recurse the 
extensions folder' );
}
 
public function execute() {
global $IP;
-   $lockLocation = "$IP/composer.lock";
-   $jsonLocation = "$IP/composer.json";
+
+   $this->updateComposerDirectory( "$IP", true );
+
+   if ( $this->hasOption( 'without-extensions' ) ) {
+   return;
+   }
+
+   $installedExtensions = 
ExtensionRegistry::getInstance()->getAllThings();
+
+   foreach ( $installedExtensions as $extensionName => 
$extensionInfo ) {
+   $directory = dirname( $extensionInfo[ 'path' ] );
+   if ( !$this->isSuitablePath( $directory ) ) {
+   continue;
+   }
+   $this->output( "Checking composer dependencies for: 
$extensionName\n" );
+   $this->updateComposerDirectory( dirname( 
$extensionInfo[ 'path' ] ) );
+   }
+   }
+
+   public function updateComposerDirectory( $directory, $root = false ) {
+   global $IP;
+   $lockLocation = "$directory/composer.lock";
+   $jsonLocation = "$directory/composer.json";
+   $workingDir = $root ? '' : " -d \"{$directory}\"";
+
if ( !file_exists( $lockLocation ) ) {
// Maybe they're using mediawiki/vendor?
$lockLocation = "$IP/vendor/composer.lock";
if ( !file_exists( $lockLocation ) ) {
$this->error(
-   'Could not find composer.lock file. 
Have you run "composer install"?',
-   1
+   "Could not find composer.lock file.\n" .
+   "Have you run 'composer 
install{$workingDir}' ?\n",
+   $root ? true : false
);
+   return;
}
}
 
@@ -53,7 +80,7 @@
if ( $found ) {
$this->error(
'Error: your composer.lock file is not up to 
date. ' .
-   'Run "composer update" to install newer 
dependencies',
+   "Run 'composer update{$workingDir}' to 
install newer dependencies",
1
);
} else {
@@ -61,6 +88,20 @@
$this->output( "Your composer.lock file is up to date 
with current dependencies!\n" );
}
}
+
+   /**
+* Returns true if $directory is of a type we can check
+* @param string $directory
+* @return bool
+*/
+   private function isSuitablePath( $directory ) {
+   $directory = str_replace( '\\', '/', $directory );
+   if ( file_exists( "$directory/composer.json" ) ) {
+   return true;
+   }
+
+   return false;
+   }
 }
 
 $maintClass = 'CheckComposerLockUpToDate';

-- 
To view, visit https://gerrit.wikimedia.org/r/371965
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d4f427eb255b6638ac51ae5537d62d2fe54d37d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Wrap the coordinates on the map when we retrieve them

2017-08-13 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371740 )

Change subject: Wrap the coordinates on the map when we retrieve them
..

Wrap the coordinates on the map when we retrieve them

Bug: T171399
Change-Id: I4d48852e66f4039b6e140441fadda3841e69931d
---
M modules/box/Map.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/40/371740/1

diff --git a/modules/box/Map.js b/modules/box/Map.js
index b89e0da..e84f7f1 100644
--- a/modules/box/Map.js
+++ b/modules/box/Map.js
@@ -557,7 +557,7 @@
 * @return {number} return.zoom
 */
getMapPosition: function ( options ) {
-   var center = this.getCenter(),
+   var center = this.getCenter().wrap(),
zoom = this.getZoom();
 
options = options || {};

-- 
To view, visit https://gerrit.wikimedia.org/r/371740
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d48852e66f4039b6e140441fadda3841e69931d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Reset margin as well as float

2017-08-12 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371662 )

Change subject: Reset margin as well as float
..

Reset margin as well as float

This margin is not correct in the tablet layout. While not
currently visible, it becomes visible if you add another button there

Change-Id: I09aef61bf1448ce1f47e9f83adb38472f51fdb7b
---
M resources/skins.minerva.base.styles/pageactions.less
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/62/371662/1

diff --git a/resources/skins.minerva.base.styles/pageactions.less 
b/resources/skins.minerva.base.styles/pageactions.less
index f1c304b..c8c1696 100644
--- a/resources/skins.minerva.base.styles/pageactions.less
+++ b/resources/skins.minerva.base.styles/pageactions.less
@@ -140,6 +140,7 @@
 
.language-selector {
float: inherit;
+   margin-left: inherit;
}
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/371662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09aef61bf1448ce1f47e9f83adb38472f51fdb7b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Add Timeless skin to test and mediawiki

2017-08-11 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371519 )

Change subject: Add Timeless skin to test and mediawiki
..

Add Timeless skin to test and mediawiki

Bug: T154371
Change-Id: Id4d5a831185420391aa0f8092271dd5c866296ef
---
M wmf-config/CommonSettings.php
M wmf-config/InitialiseSettings.php
M wmf-config/extension-list
3 files changed, 12 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/19/371519/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 77593a9..bc395ae 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -650,6 +650,10 @@
 
 wfLoadSkins( [ 'Vector', 'MonoBook', 'Modern', 'CologneBlue' ] );
 
+if ( $wmgUseTimeless ) {
+   wfLoadSkin( 'Timeless' ); // T154371
+}
+
 // Grants and rights
 // Note these have to be visible on all wikis, not just the ones the
 // extension is enabled on, for proper display in OAuth pages and such.
diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 0fab1d3..e73c4f0 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -19399,6 +19399,13 @@
'default' => true,
 ],
 
+'wmgUseTimeless' => [
+   'default' => false,
+   'testwiki' => true,
+   'test2wiki' => true,
+   'mediawikiwiki' => 'true',
+],
+
 ];
 
 ### WMF Labs override #
diff --git a/wmf-config/extension-list b/wmf-config/extension-list
index 5c4d8d9..3fe8707 100644
--- a/wmf-config/extension-list
+++ b/wmf-config/extension-list
@@ -157,6 +157,7 @@
 $IP/extensions/ZeroBanner/extension.json
 $IP/extensions/ZeroPortal/extension.json
 $IP/skins/CologneBlue/skin.json
+$IP/skins/Timeless/skin.json
 $IP/skins/MinervaNeue/skin.json
 $IP/skins/Modern/skin.json
 $IP/skins/MonoBook/skin.json

-- 
To view, visit https://gerrit.wikimedia.org/r/371519
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4d5a831185420391aa0f8092271dd5c866296ef
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MinervaNeue[master]: Make sure that all buttons in the actions area have pointer

2017-08-10 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371028 )

Change subject: Make sure that all buttons in the actions area have pointer
..

Make sure that all buttons in the actions area have pointer

Also include a elements here, as a elements without href, as is used
in some places in Minerva, does not have a pointer by default.

Bug: T145493
Change-Id: I08d9176e55ec298c9d423d391b6fb4ed5e9df5e7
---
M resources/skins.minerva.base.styles/pageactions.less
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/MinervaNeue 
refs/changes/28/371028/1

diff --git a/resources/skins.minerva.base.styles/pageactions.less 
b/resources/skins.minerva.base.styles/pageactions.less
index bcbf124..f1c304b 100644
--- a/resources/skins.minerva.base.styles/pageactions.less
+++ b/resources/skins.minerva.base.styles/pageactions.less
@@ -92,6 +92,10 @@
text-indent: inherit;
outline: 0;
}
+   a,
+   button {
+   cursor: pointer;
+   }
 
&:first-child {
margin-top: 0;

-- 
To view, visit https://gerrit.wikimedia.org/r/371028
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08d9176e55ec298c9d423d391b6fb4ed5e9df5e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/MinervaNeue
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Partially undo I88c70fa

2017-08-10 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371025 )

Change subject: Partially undo I88c70fa
..

Partially undo I88c70fa

Moving this into Minerva part

Bug: T145493
Change-Id: I15a47acf26eed87100c6e2de7bad0f930c3da353
---
M resources/mobile.watchstar/watchstar.less
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/25/371025/1

diff --git a/resources/mobile.watchstar/watchstar.less 
b/resources/mobile.watchstar/watchstar.less
index 2d4e2d3..c837b7f 100644
--- a/resources/mobile.watchstar/watchstar.less
+++ b/resources/mobile.watchstar/watchstar.less
@@ -2,7 +2,6 @@
 
 .animations {
.watch-this-article {
-   cursor: pointer;
.transition-transform( 0.5s );
&.watched {
.transform( rotate( 72deg ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/371025
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I15a47acf26eed87100c6e2de7bad0f930c3da353
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: mw-collapsible: Add print styles to uncollapse content

2017-08-09 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370945 )

Change subject: mw-collapsible: Add print styles to uncollapse content
..

mw-collapsible: Add print styles to uncollapse content

Bug: T152330
Change-Id: I74ee6ad9f426f2fccd84b9190bc1afe0be4cc06d
---
M resources/src/jquery/jquery.makeCollapsible.css
1 file changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/45/370945/1

diff --git a/resources/src/jquery/jquery.makeCollapsible.css 
b/resources/src/jquery/jquery.makeCollapsible.css
index 2e5efba..a72b5a3 100644
--- a/resources/src/jquery/jquery.makeCollapsible.css
+++ b/resources/src/jquery/jquery.makeCollapsible.css
@@ -45,3 +45,19 @@
 .mw-collapsible-toggle-li {
list-style: none;
 }
+
+@media print {
+   .mw-collapsible-toggle {
+   display: none;
+   }
+   .mw-collapsed .mw-collapsible-content {
+   display: block !important;
+   }
+   .mw-collapsed > * > tr {
+   display: table-row !important;
+   }
+   .mw-collapsed > li,
+   .mw-collapsed > li {
+   display: list-item !important;
+   }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/370945
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I74ee6ad9f426f2fccd84b9190bc1afe0be4cc06d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Make sure watchlist and overlay buttons have pointer cursor

2017-08-09 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370849 )

Change subject: Make sure watchlist and overlay buttons have pointer cursor
..

Make sure watchlist and overlay buttons have pointer cursor

Bug: T145493
Change-Id: I88c70fa9729bd6a5088bf2a1d5eb11355b2b7c71
---
M resources/mobile.startup/Overlay.less
M resources/mobile.watchstar/watchstar.less
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/49/370849/1

diff --git a/resources/mobile.startup/Overlay.less 
b/resources/mobile.startup/Overlay.less
index 3cd1831..07a0a51 100644
--- a/resources/mobile.startup/Overlay.less
+++ b/resources/mobile.startup/Overlay.less
@@ -213,6 +213,10 @@
}
}
 
+   button {
+   cursor: pointer;
+   }
+
.continue {
background-color: @colorProgressive;
color: #fff;
diff --git a/resources/mobile.watchstar/watchstar.less 
b/resources/mobile.watchstar/watchstar.less
index c837b7f..2d4e2d3 100644
--- a/resources/mobile.watchstar/watchstar.less
+++ b/resources/mobile.watchstar/watchstar.less
@@ -2,6 +2,7 @@
 
 .animations {
.watch-this-article {
+   cursor: pointer;
.transition-transform( 0.5s );
&.watched {
.transform( rotate( 72deg ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/370849
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I88c70fa9729bd6a5088bf2a1d5eb11355b2b7c71
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make sure that mw-ui checkboxes have pointer cursor

2017-08-09 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/370837 )

Change subject: Make sure that mw-ui checkboxes have pointer cursor
..

Make sure that mw-ui checkboxes have pointer cursor

T145493

Change-Id: I7700ee57969fa34b569bc1349156460f7248a9e6
---
M resources/src/mediawiki.ui/components/checkbox.less
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/370837/1

diff --git a/resources/src/mediawiki.ui/components/checkbox.less 
b/resources/src/mediawiki.ui/components/checkbox.less
index 2ca20a5..6412da5 100644
--- a/resources/src/mediawiki.ui/components/checkbox.less
+++ b/resources/src/mediawiki.ui/components/checkbox.less
@@ -61,10 +61,12 @@
// This is needed for Firefox mobile (See T73750 to workaround 
default Firefox stylesheet)
max-width: none;
margin: 0 0.4em 0 0;
+   cursor: pointer;
display: table-cell;
 
& + label {
display: table-cell;
+   cursor: pointer;
}
 
// the pseudo before element of the label after the checkbox 
now looks like a checkbox

-- 
To view, visit https://gerrit.wikimedia.org/r/370837
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7700ee57969fa34b569bc1349156460f7248a9e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: StaticMap: fix error on multiple wikipage.content

2017-07-22 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/367109 )

Change subject: StaticMap: fix error on multiple wikipage.content
..

StaticMap: fix error on multiple wikipage.content

The cleanup routine here was copied from mapframe, but this is
actually similar to maplink. .remove() would throw a TypeError,
because we are storing Link objects here not Maps and only Maps have
the remove() function.

Bug: T159295
Change-Id: I73cd6415813a74129dbd2595da4a9b2bf61012b1
---
M modules/staticframe/staticframe.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/09/367109/1

diff --git a/modules/staticframe/staticframe.js 
b/modules/staticframe/staticframe.js
index d22621f..32cff03 100644
--- a/modules/staticframe/staticframe.js
+++ b/modules/staticframe/staticframe.js
@@ -69,7 +69,7 @@
 
// `wikipage.content` may be fired more than once.
$.each( maps, function () {
-   maps.pop().remove();
+   maps.pop().$container.off( 'click.kartographer' );
} );
 
$content.find( '.mw-kartographer-map' ).each( function ( index 
) {

-- 
To view, visit https://gerrit.wikimedia.org/r/367109
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73cd6415813a74129dbd2595da4a9b2bf61012b1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...WikiEditor[master]: WikiEditor: ->

2017-06-04 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357129 )

Change subject: WikiEditor:  -> 
..

WikiEditor:  -> 

Bug: T150172
Change-Id: I645cd627a8f66144fdbbdecf15b24af0528746a8
---
M modules/jquery.wikiEditor.toolbar.config.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor 
refs/changes/29/357129/1

diff --git a/modules/jquery.wikiEditor.toolbar.config.js 
b/modules/jquery.wikiEditor.toolbar.config.js
index 10c8ade..51ab111 100644
--- a/modules/jquery.wikiEditor.toolbar.config.js
+++ b/modules/jquery.wikiEditor.toolbar.config.js
@@ -347,7 +347,7 @@

action: {

type: 'encapsulate',

options: {
-   
pre: '\n'
+   
pre: '\n'

}

}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/357129
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I645cd627a8f66144fdbbdecf15b24af0528746a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Graph[wmf/1.30.0-wmf.2]: Fix fatal error on graph api

2017-06-02 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356807 )

Change subject: Fix fatal error on graph api
..

Fix fatal error on graph api

Constant was renamed, but the usage of the constant in ApiGraph was
not.

Follow-up to: Id4314f3a2021a0d5c2f35fed5314882ec0f8e8b0

Bug: T166713
Change-Id: Idde94f1c9e1a3549dc44d00522e9f5cd860600b4
(cherry picked from commit f7efbe538ecb842c5e67b080e54939583c30cb92)
---
M includes/ApiGraph.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph 
refs/changes/07/356807/1

diff --git a/includes/ApiGraph.php b/includes/ApiGraph.php
index fa88d34..26027a2 100644
--- a/includes/ApiGraph.php
+++ b/includes/ApiGraph.php
@@ -76,7 +76,7 @@
 */
private function preprocess( $text ) {
global $wgParser;
-   $title = Title::makeTitle( NS_SPECIAL, Sandbox::PageName 
)->fixSpecialName();
+   $title = Title::makeTitle( NS_SPECIAL, Sandbox::PAGENAME 
)->fixSpecialName();
$text = $wgParser->getFreshParser()->preprocess( $text, $title, 
new ParserOptions() );
$st = FormatJson::parse( $text );
if ( !$st->isOK() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/356807
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idde94f1c9e1a3549dc44d00522e9f5cd860600b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: wmf/1.30.0-wmf.2
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: Fix fatal error on graph api

2017-05-31 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/356490 )

Change subject: Fix fatal error on graph api
..

Fix fatal error on graph api

Constant was renamed, but the usage of the constant in ApiGraph was
not.

Follow-up to: Id4314f3a2021a0d5c2f35fed5314882ec0f8e8b0

Bug: T166713
Change-Id: Idde94f1c9e1a3549dc44d00522e9f5cd860600b4
---
M includes/ApiGraph.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph 
refs/changes/90/356490/1

diff --git a/includes/ApiGraph.php b/includes/ApiGraph.php
index fa88d34..26027a2 100644
--- a/includes/ApiGraph.php
+++ b/includes/ApiGraph.php
@@ -76,7 +76,7 @@
 */
private function preprocess( $text ) {
global $wgParser;
-   $title = Title::makeTitle( NS_SPECIAL, Sandbox::PageName 
)->fixSpecialName();
+   $title = Title::makeTitle( NS_SPECIAL, Sandbox::PAGENAME 
)->fixSpecialName();
$text = $wgParser->getFreshParser()->preprocess( $text, $title, 
new ParserOptions() );
$st = FormatJson::parse( $text );
if ( !$st->isOK() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/356490
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idde94f1c9e1a3549dc44d00522e9f5cd860600b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: PHP7: Use intval to baseconvert instead of string casting

2017-05-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354964 )

Change subject: PHP7: Use intval to baseconvert instead of string casting
..

PHP7: Use intval to baseconvert instead of string casting

PHP7 and later no longer automatically casts strings
containing hexadecimal numbers to actual numbers when trying to do
math on them. Use intval with base 16 instead.

Bug: T160536
Change-Id: Idc8e030847d80275df22877df09234b4e248cded
---
M handlers/OggHandler/File_Ogg/File/Ogg/Flac.php
M handlers/OggHandler/File_Ogg/File/Ogg/Opus.php
M handlers/OggHandler/File_Ogg/File/Ogg/Speex.php
M handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php
4 files changed, 10 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/64/354964/1

diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php 
b/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php
index bf98d60..d19fd01 100644
--- a/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php
+++ b/handlers/OggHandler/File_Ogg/File/Ogg/Flac.php
@@ -65,8 +65,8 @@
 }
 
 function getSecondsFromGranulePos( $granulePos ){
-return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32)
-  + ( '0x' . substr( $granulePos, 8, 8 ) ))
+return (intval(substr( $granulePos, 0, 8 ), 16 ) * pow(2, 32)
+  + intval(substr( $granulePos, 8, 8 ), 16 ))
   / $this->_streamInfo['sample_rate'];
 }
 
diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php 
b/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php
index 2c23d92..9066f0b 100644
--- a/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php
+++ b/handlers/OggHandler/File_Ogg/File/Ogg/Opus.php
@@ -57,8 +57,8 @@
 }
 
 function getSecondsFromGranulePos( $granulePos ){
-return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32)
-+ ( '0x' . substr( $granulePos, 8, 8 ) )
+return (intval(substr( $granulePos, 0, 8 ), 16 ) * pow(2, 32)
++ intval(substr( $granulePos, 8, 8 ), 16 )
 - $this->_header['pre_skip'])
 / 48000;
 }
diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php 
b/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php
index 42f9b0e..6398ed9 100644
--- a/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php
+++ b/handlers/OggHandler/File_Ogg/File/Ogg/Speex.php
@@ -43,13 +43,13 @@
 $this->_decodeHeader();
 $this->_decodeCommentsHeader();
 $endSec =
-(( '0x' . substr( $this->_lastGranulePos, 0, 8 ) ) * pow(2, 32)
-+ ( '0x' . substr( $this->_lastGranulePos, 8, 8 ) ))
+(intval(substr( $this->_lastGranulePos, 0, 8 ), 16 ) * pow(2, 32)
++ intval(substr( $this->_lastGranulePos, 8, 8 ), 16 ))
 / $this->_header['rate'];
 
  $startSec  =
-(( '0x' . substr( $this->_firstGranulePos, 0, 8 ) ) * pow(2, 32)
-+ ( '0x' . substr( $this->_firstGranulePos, 8, 8 ) ))
+(intval(substr( $this->_firstGranulePos, 0, 8 ), 16 ) * pow(2, 32)
++ intval(substr( $this->_firstGranulePos, 8, 8 ), 16 ))
 / $this->_header['rate'];
 
  //make sure the offset is worth taking into account oggz_chop related 
hack
diff --git a/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php 
b/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php
index 06c2c18..8d4510c 100644
--- a/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php
+++ b/handlers/OggHandler/File_Ogg/File/Ogg/Vorbis.php
@@ -185,8 +185,8 @@
 $this->_avgBitrate  = $this->_streamLength ? ($this->_streamSize * 
8) / $this->_streamLength : 0;
 }
function getSecondsFromGranulePos( $granulePos ){
-   return (( '0x' . substr( $granulePos, 0, 8 ) ) * pow(2, 32)
-+ ( '0x' . substr( $granulePos, 8, 8 ) ))
+   return (intval(substr( $granulePos, 0, 8 ), 16) * pow(2, 32)
++ intval( substr( $granulePos, 8, 8 ), 16 ))
 / $this->_idHeader['audio_sample_rate'];
}
 /**

-- 
To view, visit https://gerrit.wikimedia.org/r/354964
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc8e030847d80275df22877df09234b4e248cded
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Only add the resolution switcher to video files

2017-05-20 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354736 )

Change subject: Only add the resolution switcher to video files
..

Only add the resolution switcher to video files

Adding this button is problematic, since we don't really need it in
audio players, and the module also wasn't compatible with audio only
files.

Change-Id: Ie90a16187d7c7fc5181a9b5a2963c3939f97668b
---
M resources/ext.tmh.player.js
1 file changed, 23 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/36/354736/1

diff --git a/resources/ext.tmh.player.js b/resources/ext.tmh.player.js
index 8e6f054..77ab011 100755
--- a/resources/ext.tmh.player.js
+++ b/resources/ext.tmh.player.js
@@ -1,6 +1,6 @@
 /* global videojs */
 ( function ( $, mw, videojs ) {
-   var globalConfig, audioConfig, playerConfig;
+   var globalConfig, videoConfig, audioConfig, playerConfig;
 
globalConfig = {
language: mw.config.get( 'wgUserLanguage' ),
@@ -13,17 +13,6 @@
},
techOrder: [ 'html5' ],
plugins: {
-   videoJsResolutionSwitcher: {
-   sourceOrder: true,
-   customSourcePicker: function ( player, 
sources/* , label */ ) {
-   // Resolution switcher gets confused by 
preload=none on ogv.js
-   if ( player.preload() === 'none' ) {
-   player.preload( 'metadata' );
-   }
-   player.src( sources );
-   return player;
-   }
-   },
responsiveLayout: {
layoutMap: [
{ layoutClassName: 'vjs-layout-tiny', 
width: 3 },
@@ -34,6 +23,22 @@
},
replayButton: {},
infoButton: {}
+   }
+   };
+
+   videoConfig = {
+   plugins: {
+   videoJsResolutionSwitcher: {
+   sourceOrder: true,
+   customSourcePicker: function ( player, 
sources/* , label */ ) {
+   // Resolution switcher gets confused by 
preload=none on ogv.js
+   if ( player.preload() === 'none' ) {
+   player.preload( 'metadata' );
+   }
+   player.src( sources );
+   return player;
+   }
+   }
}
};
 
@@ -52,18 +57,17 @@
function loadSinglePlayer( index ) {
var i, l, preload, resolutions, playerHeight, 
defaultRes,
videoplayer = this,
-   $videoplayer = $( this );
+   $videoplayer = $( this ),
+   isAudio = videoplayer.tagName.toLowerCase() === 
'audio';
 
if ( $videoplayer.closest( '.video-js' ).length ) {
// This player has already been transformed.
return;
}
+
playerConfig = $.extend( {}, globalConfig );
-   if ( videoplayer.tagName.toLowerCase() === 'audio' ) {
-   // We hide the big play button, show the 
controlbar with CSS
-   // We remove the fullscreen button
-   playerConfig = $.extend( true, {}, 
playerConfig, audioConfig );
-   }
+   playerConfig = $.extend( true, {}, playerConfig, 
isAudio ? audioConfig : videoConfig );
+
// Future interactions go faster if we've preloaded a 
little
preload = 'metadata';
if ( !mw.OgvJsSupport.canPlayNatively() ) {
@@ -117,7 +121,7 @@
break;
}
}
-   if ( defaultRes ) {
+   if ( !isAudio && defaultRes ) {
playerConfig.plugins.videoJsResolutionSwitcher[ 
'default' ] = defaultRes;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/354736
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie90a16187d7c7fc5181a9b5a2963c3939f97668b
Gerrit-PatchSet: 1
Gerrit-Project: 

[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Remove geshi from composer and npm package manifests

2017-05-20 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354726 )

Change subject: Remove geshi from composer and npm package manifests
..

Remove geshi from composer and npm package manifests

Both of these seem to be private and are therefor easily renamed

Bug: T164939
Change-Id: I09be0ef0131d31182ed8bb6be221c76dba2c1a53
---
M composer.json
M package.json
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/26/354726/1

diff --git a/composer.json b/composer.json
index 30ac741..bc3fc91 100644
--- a/composer.json
+++ b/composer.json
@@ -1,5 +1,5 @@
 {
-   "name": "mediawiki/syntax-highlight_geshi",
+   "name": "mediawiki/syntax-highlight",
"description": "Syntax highlighting extension for MediaWiki",
"require": {
"symfony/process": "~3.2"
diff --git a/package.json b/package.json
index 443f5a2..07b0636 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
 {
-  "name": "SyntaxHighlight_GeSHi",
+  "name": "SyntaxHighlight",
   "version": "0.0.0",
   "private": true,
-  "description": "Build tools for the SyntaxHighlight_GeSHi MediaWiki 
extension.",
+  "description": "Build tools for the SyntaxHighlight MediaWiki extension.",
   "scripts": {
 "test": "grunt test"
   },

-- 
To view, visit https://gerrit.wikimedia.org/r/354726
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09be0ef0131d31182ed8bb6be221c76dba2c1a53
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: [WIP] Update to VideoJS v6

2017-05-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354601 )

Change subject: [WIP] Update to VideoJS v6
..

[WIP] Update to VideoJS v6

- update to video.js 6.10 (pre-release)
- remove the replay button plugin (now native)
- has hardcoded changes for videojs/video.js#4371

Bug: T165815
Change-Id: Ia1c16a4fab9af0481487f75c32d3ab1a191e555f
---
M Gruntfile.js
M TimedMediaHandler.hooks.php
M package.json
M resources/ext.tmh.player.js
M resources/mw-info-button/mw-info-button.js
D resources/videojs-replay/lang/en.js
D resources/videojs-replay/videojs-replay.css
D resources/videojs-replay/videojs-replay.js
M resources/videojs-resolution-switcher/videojs-resolution-switcher.css
M resources/videojs-resolution-switcher/videojs-resolution-switcher.js
A resources/videojs-responsive-layout/videojs-responsive-layout.min.js
M resources/videojs/lang/de.js
M resources/videojs/lang/el.js
M resources/videojs/lang/en.js
M resources/videojs/lang/es.js
M resources/videojs/lang/fr.js
A resources/videojs/lang/pt-PT.js
M resources/videojs/lang/ru.js
M resources/videojs/lang/tr.js
M resources/videojs/lang/uk.js
M resources/videojs/lang/vi.js
M resources/videojs/lang/zh-TW.js
M resources/videojs/video-js.css
D resources/videojs/video-js.swf
M resources/videojs/video.js
25 files changed, 13,964 insertions(+), 11,273 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/01/354601/1


-- 
To view, visit https://gerrit.wikimedia.org/r/354601
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1c16a4fab9af0481487f75c32d3ab1a191e555f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: jQuery3: size() -> length

2017-05-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354589 )

Change subject: jQuery3: size() -> length
..

jQuery3: size() -> length

Change-Id: I8627fced05c27ed3596f3915c9b72c25f13a2ed3
---
M resources/ext.tmh.player.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/89/354589/1

diff --git a/resources/ext.tmh.player.js b/resources/ext.tmh.player.js
index 51aa164..8e6f054 100755
--- a/resources/ext.tmh.player.js
+++ b/resources/ext.tmh.player.js
@@ -54,7 +54,7 @@
videoplayer = this,
$videoplayer = $( this );
 
-   if ( $videoplayer.closest( '.video-js' ).size() ) {
+   if ( $videoplayer.closest( '.video-js' ).length ) {
// This player has already been transformed.
return;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/354589
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8627fced05c27ed3596f3915c9b72c25f13a2ed3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Ensure parsercache consistency

2017-05-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354564 )

Change subject: Ensure parsercache consistency
..

Ensure parsercache consistency

- Make sure that anonymous pages only depend on the system default
- Make sure we can roll back and forth videojs and kaltura player
  without poisoning the parser cache
- Get rid of an older private property on parseroutput.

Bug: T100106
Change-Id: I2bf500ffcb2331e0920bc23aeeeaa3577f53f9c7
---
M TimedMediaHandler.hooks.php
M TimedMediaHandler_body.php
2 files changed, 27 insertions(+), 20 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/64/354564/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 69010dd..0b0ed5d 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -789,19 +789,18 @@
 * @return bool
 */
public static function rejectParserCacheValue( $parserOutput, 
$wikiPage, $parserOptions ) {
-   if (
-   $parserOutput->getExtensionData( 
'mw_ext_TMH_hasTimedMediaTransform' )
-   || isset( $parserOutput->hasTimedMediaTransform )
-   ) {
-   /* page has old style TMH elements */
-   if (
-   self::activePlayerMode() === 'mwembed' &&
+   global $wgTmhWebPlayer;
+   if ( $parserOutput->getExtensionData( 
'mw_ext_TMH_hasTimedMediaTransform' ) && (
+   (
+   $wgTmhWebPlayer === 'mwembed' &&
!in_array( 'mw.MediaWikiPlayer.loader', 
$parserOutput->getModules() )
-   ) {
-   wfDebug( 'Bad TMH parsercache value, throw this 
out.' );
-   $wikiPage->getTitle()->purgeSquid();
-   return false;
-   }
+   ) || (
+   $wgTmhWebPlayer === 'videojs' &&
+   !in_array( 'ext.tmh.video-js', 
$parserOutput->getModules() )
+   )
+   ) ) {
+   $wikiPage->getTitle()->purgeSquid();
+   return false;
}
return true;
}
@@ -851,6 +850,7 @@
}
 
/**
+* Return the configured player mode for this user
 * @return string
 */
public static function activePlayerMode() {
@@ -864,4 +864,14 @@
return $wgTmhWebPlayer;
}
}
+
+   /**
+* Return the default configured player mode
+* This mode is used for anonymous users
+* @return string
+*/
+   public static function defaultPlayerMode() {
+   global $wgTmhWebPlayer;
+   return $wgTmhWebPlayer;
+   }
 }
diff --git a/TimedMediaHandler_body.php b/TimedMediaHandler_body.php
index 3ae07c8..7f2dd6b 100644
--- a/TimedMediaHandler_body.php
+++ b/TimedMediaHandler_body.php
@@ -198,11 +198,11 @@
 */
function parserTransformHook( $parser, $file ) {
$parserOutput = $parser->getOutput();
-   if ( isset( $parserOutput->hasTimedMediaTransform ) ) {
+   if ( $parserOutput->getExtensionData( 
'mw_ext_TMH_hasTimedMediaTransform' ) ) {
return;
}
-   $parserOutput->hasTimedMediaTransform = true;
-   if ( TimedMediaHandlerHooks::activePlayerMode() === 'mwembed' ) 
{
+   $activePlayerMode = TimedMediaHandlerHooks::activePlayerMode();
+   if ( $activePlayerMode === 'mwembed' ) {
$parserOutput->addModuleStyles( 
'ext.tmh.thumbnail.styles' );
$parserOutput->addModules( [
'mw.MediaWikiPlayer.loader',
@@ -211,15 +211,12 @@
] );
}
 
-   if ( TimedMediaHandlerHooks::activePlayerMode() === 'videojs' ) 
{
+   if ( $activePlayerMode === 'videojs' ) {
$parserOutput->addModuleStyles( 'ext.tmh.player.styles' 
);
$parserOutput->addModules( 'ext.tmh.player' );
}
 
-   if ( $parserOutput ) {
-   // Not present when run from outputpage hooks, like 
File/Category etc...
-   $parserOutput->setExtensionData( 
'mw_ext_TMH_hasTimedMediaTransform', true );
-   }
+   $parserOutput->setExtensionData( 
'mw_ext_TMH_hasTimedMediaTransform', $activePlayerMode );
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/354564
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: 

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Prevent pagebreaking in the middle of the form

2017-05-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354497 )

Change subject: Prevent pagebreaking in the middle of the form
..

Prevent pagebreaking in the middle of the form

Bug: T150587
Change-Id: Ic3dc5fe2c7512ee9d72e15dc95dac3cb3f028774
---
M modules/ext.oath.showqrcode.styles.css
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/97/354497/1

diff --git a/modules/ext.oath.showqrcode.styles.css 
b/modules/ext.oath.showqrcode.styles.css
index aae0d95..0e2f48c 100644
--- a/modules/ext.oath.showqrcode.styles.css
+++ b/modules/ext.oath.showqrcode.styles.css
@@ -7,3 +7,7 @@
white-space: nowrap;
font-size: larger;
 }
+
+fieldset {
+   page-break-inside: avoid;
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/354497
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3dc5fe2c7512ee9d72e15dc95dac3cb3f028774
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: MimeAnalyzer: Add testcases for mp3 detection

2017-05-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354456 )

Change subject: MimeAnalyzer: Add testcases for mp3 detection
..

MimeAnalyzer: Add testcases for mp3 detection

This is a follow-up to change Ie1a63aa

Bug: T115170
Change-Id: Iab5e19e1dd26b0d88c72ad7253cd11e865c5e008
---
A tests/phpunit/data/media/say-test-mpeg1.mp3
A tests/phpunit/data/media/say-test-mpeg2.5.mp3
A tests/phpunit/data/media/say-test-mpeg2.mp3
A tests/phpunit/data/media/say-test-with-id3.mp3
M tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
5 files changed, 56 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/56/354456/1

diff --git a/tests/phpunit/data/media/say-test-mpeg1.mp3 
b/tests/phpunit/data/media/say-test-mpeg1.mp3
new file mode 100644
index 000..b3a6318
--- /dev/null
+++ b/tests/phpunit/data/media/say-test-mpeg1.mp3
Binary files differ
diff --git a/tests/phpunit/data/media/say-test-mpeg2.5.mp3 
b/tests/phpunit/data/media/say-test-mpeg2.5.mp3
new file mode 100644
index 000..e6743a8
--- /dev/null
+++ b/tests/phpunit/data/media/say-test-mpeg2.5.mp3
Binary files differ
diff --git a/tests/phpunit/data/media/say-test-mpeg2.mp3 
b/tests/phpunit/data/media/say-test-mpeg2.mp3
new file mode 100644
index 000..8b2aaa2
--- /dev/null
+++ b/tests/phpunit/data/media/say-test-mpeg2.mp3
Binary files differ
diff --git a/tests/phpunit/data/media/say-test-with-id3.mp3 
b/tests/phpunit/data/media/say-test-with-id3.mp3
new file mode 100644
index 000..04205d5
--- /dev/null
+++ b/tests/phpunit/data/media/say-test-with-id3.mp3
Binary files differ
diff --git a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php 
b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
index 787d9a8..a5cbeb5 100644
--- a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
+++ b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
@@ -1,4 +1,8 @@
 mimeAnalyzer) );
+   $method = $class->getMethod( 'doGuessMimeType' );
+   $method->setAccessible( true );
+   return $method->invokeArgs( $this->mimeAnalyzer, $parameters );
}
 
/**
@@ -69,4 +80,49 @@
$actualType = $this->mimeAnalyzer->getMediaType( $oggFile, 
'application/ogg' );
$this->assertEquals( $actualType, MEDIATYPE_AUDIO );
}
+
+   /**
+* Test to make sure that mp3 files are detected as audio type
+*/
+   function testMP3AsAudio() {
+   $file = __DIR__ . '/../../../data/media/say-test-with-id3.mp3';
+   $actualType = $this->mimeAnalyzer->getMediaType( $file );
+   $this->assertEquals( MEDIATYPE_AUDIO, $actualType );
+   }
+
+   /**
+* Test to make sure that MP3 with id3 tag is recognized
+*/
+   function testMP3WithID3Recognize() {
+   $file = __DIR__ . '/../../../data/media/say-test-with-id3.mp3';
+   $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] );
+   $this->assertEquals( 'audio/mpeg', $actualType );
+   }
+
+   /**
+* Test to make sure that MP3 without id3 tag is recognized (MPEG-1 
sample rates)
+*/
+   function testMP3NoID3RecognizeMPEG1() {
+   $file = __DIR__ . '/../../../data/media/say-test-mpeg1.mp3';
+   $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] );
+   $this->assertEquals( 'audio/mpeg', $actualType );
+   }
+
+   /**
+* Test to make sure that MP3 without id3 tag is recognized (MPEG-2 
sample rates)
+*/
+   function testMP3NoID3RecognizeMPEG2() {
+   $file = __DIR__ . '/../../../data/media/say-test-mpeg2.mp3';
+   $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] );
+   $this->assertEquals( 'audio/mpeg', $actualType );
+   }
+
+   /**
+* Test to make sure that MP3 without id3 tag is recognized (MPEG-2.5 
sample rates)
+*/
+   function testMP3NoID3RecognizeMPEG2_5() {
+   $file = __DIR__ . '/../../../data/media/say-test-mpeg2.5.mp3';
+   $actualType = $this->doGuessMimeType( [ $file, 'mp3' ] );
+   $this->assertEquals( 'audio/mpeg', $actualType );
+   }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/354456
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab5e19e1dd26b0d88c72ad7253cd11e865c5e008
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Tests: correct order of assertEquals arguments

2017-05-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354447 )

Change subject: Tests: correct order of assertEquals arguments
..

Tests: correct order of assertEquals arguments

Change-Id: Ib8d1e8aa92172a9abc0495dc0c18ea5df850dd5e
---
M tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/47/354447/1

diff --git a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php 
b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
index 787d9a8..7569515 100644
--- a/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
+++ b/tests/phpunit/includes/libs/mime/MimeAnalyzerTest.php
@@ -57,7 +57,7 @@
function testOggRecognize() {
$oggFile = __DIR__ . '/../../../data/media/say-test.ogg';
$actualType = $this->mimeAnalyzer->getMediaType( $oggFile, 
'application/ogg' );
-   $this->assertEquals( $actualType, MEDIATYPE_AUDIO );
+   $this->assertEquals( MEDIATYPE_AUDIO, $actualType  );
}
 
/**
@@ -67,6 +67,6 @@
function testOpusRecognize() {
$oggFile = __DIR__ . '/../../../data/media/say-test.opus';
$actualType = $this->mimeAnalyzer->getMediaType( $oggFile, 
'application/ogg' );
-   $this->assertEquals( $actualType, MEDIATYPE_AUDIO );
+   $this->assertEquals( MEDIATYPE_AUDIO, $actualType );
}
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/354447
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8d1e8aa92172a9abc0495dc0c18ea5df850dd5e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: GeSHi: Make sure the autoload of Compat doesn't load GeSHi

2017-05-13 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353704 )

Change subject: GeSHi: Make sure the autoload of Compat doesn't load GeSHi
..

GeSHi: Make sure the autoload of Compat doesn't load GeSHi

Bug: T139594
Change-Id: Ib8c78f6f1da9750e0429f7bcf29b8dcb5ecca8a1
---
A SyntaxHighlight_GeSHi.GeSHi.php
M SyntaxHighlight_GeSHi.compat.php
M extension.json
3 files changed, 40 insertions(+), 24 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/04/353704/1

diff --git a/SyntaxHighlight_GeSHi.GeSHi.php b/SyntaxHighlight_GeSHi.GeSHi.php
new file mode 100644
index 000..f71577c
--- /dev/null
+++ b/SyntaxHighlight_GeSHi.GeSHi.php
@@ -0,0 +1,39 @@
+http://www.gnu.org/copyleft/gpl.html
+ */
+
+/**
+ * Stub class for maintaining backward-compatibility with extensions
+ * that have not been updated for version 2.0 of SyntaxHighlight_GeSHi.
+ */
+class GeSHi {
+   public function __construct( $html ) {
+   $this->html = $html;
+   }
+
+   public function error() {
+   }
+
+   public function set_language( $language ) {
+   }
+
+   public function parse_code() {
+   global $wgOut;
+   $wgOut->addModuleStyles( 'ext.pygments' );
+   return $this->html;
+   }
+}
\ No newline at end of file
diff --git a/SyntaxHighlight_GeSHi.compat.php b/SyntaxHighlight_GeSHi.compat.php
index 277e334..17f1119 100644
--- a/SyntaxHighlight_GeSHi.compat.php
+++ b/SyntaxHighlight_GeSHi.compat.php
@@ -15,29 +15,6 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
  */
-
-/**
- * Stub class for maintaining backward-compatibility with extensions
- * that have not been updated for version 2.0 of SyntaxHighlight_GeSHi.
- */
-class GeSHi {
-   public function __construct( $html ) {
-   $this->html = $html;
-   }
-
-   public function error() {
-   }
-
-   public function set_language( $language ) {
-   }
-
-   public function parse_code() {
-   global $wgOut;
-   $wgOut->addModuleStyles( 'ext.pygments' );
-   return $this->html;
-   }
-}
-
 class SyntaxHighlightGeSHiCompat {
/** @var array A mapping of GeSHi lexer names to compatible Pygments 
lexers. */
private static $compatibleLexers = array(
diff --git a/extension.json b/extension.json
index 453d927..92b7a24 100644
--- a/extension.json
+++ b/extension.json
@@ -23,7 +23,7 @@
},
"AutoloadClasses": {
"SyntaxHighlight_GeSHi": "SyntaxHighlight_GeSHi.class.php",
-   "GeSHi": "SyntaxHighlight_GeSHi.compat.php",
+   "GeSHi": "SyntaxHighlight_GeSHi.GeSHi.php",
"SyntaxHighlightAce": "SyntaxHighlight_GeSHi.ace.php",
"SyntaxHighlightGeSHiCompat": 
"SyntaxHighlight_GeSHi.compat.php",
"ResourceLoaderGeSHiVisualEditorModule": 
"ResourceLoaderGeSHiVisualEditorModule.php"

-- 
To view, visit https://gerrit.wikimedia.org/r/353704
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8c78f6f1da9750e0429f7bcf29b8dcb5ecca8a1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[REL1_27]: Do not extend GeSHi class with private modifications

2017-05-12 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353503 )

Change subject: Do not extend GeSHi class with private modifications
..

Do not extend GeSHi class with private modifications

Our GeSHi class is intended for other extensions making use of GeSHi.
However other libraries or extensions can bring their own GeSHi to the
classloader. In those cases, we cannot find our private modifications
like $compatibleLexers on this class. Instead use
SyntaxHighlightGeSHiCompat for our privact modifications and keep GeSHi
closer to the original implementation.

Bug: T139594
Change-Id: I5c2ba9dfb08ec31f6b5cfd90083cbae0ae0ac3c4
(cherry picked from commit 1ce9975e18c6ed3e4358cea2e646684123ac78bf)
---
M ResourceLoaderGeSHiVisualEditorModule.php
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.compat.php
M extension.json
4 files changed, 29 insertions(+), 22 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/03/353503/1

diff --git a/ResourceLoaderGeSHiVisualEditorModule.php 
b/ResourceLoaderGeSHiVisualEditorModule.php
index 123fcd1..5cf2f96 100644
--- a/ResourceLoaderGeSHiVisualEditorModule.php
+++ b/ResourceLoaderGeSHiVisualEditorModule.php
@@ -49,7 +49,7 @@
 */
private function getLanguages() {
$lexers = require __DIR__ . '/SyntaxHighlight_GeSHi.lexers.php';
-   return array_merge( $lexers, array_keys( 
GeSHi::$compatibleLexers ) );
+   return array_merge( $lexers, array_keys( 
SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap() ) );
}
 
public function enableModuleContentVersion() {
diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index c722c1a..82cb6aa 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -73,10 +73,12 @@
return $lexer;
}
 
+   $geshi2pygments = 
SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap();
+
// Check if this is a GeSHi lexer name for which there exists
// a compatible Pygments lexer with a different name.
-   if ( isset( GeSHi::$compatibleLexers[$lexer] ) ) {
-   $lexer = GeSHi::$compatibleLexers[$lexer];
+   if ( isset( $geshi2pygments[$lexer] ) ) {
+   $lexer = $geshi2pygments[$lexer];
if ( in_array( $lexer, $lexers ) ) {
return $lexer;
}
diff --git a/SyntaxHighlight_GeSHi.compat.php b/SyntaxHighlight_GeSHi.compat.php
index ba208a4..ea4efed 100644
--- a/SyntaxHighlight_GeSHi.compat.php
+++ b/SyntaxHighlight_GeSHi.compat.php
@@ -17,14 +17,30 @@
  */
 
 /**
- * Stub object for maintaining backward-compatibility with extensions
- * that have not been updated for version 2.0 of SyntaxHighlight_GeSHi
- * and for supporting GeSHi lexer names whenever they map naturally to
- * a Pygments lexer.
+ * Stub class for maintaining backward-compatibility with extensions
+ * that have not been updated for version 2.0 of SyntaxHighlight_GeSHi.
  */
 class GeSHi {
+   public function __construct( $html ) {
+   $this->html = $html;
+   }
+
+   public function error() {
+   }
+
+   public function set_language( $language ) {
+   }
+
+   public function parse_code() {
+   global $wgOut;
+   $wgOut->addModuleStyles( 'ext.pygments' );
+   return $this->html;
+   }
+}
+
+class SyntaxHighlightGeSHiCompat {
/** @var array A mapping of GeSHi lexer names to compatible Pygments 
lexers. */
-   public static $compatibleLexers = array(
+   private static $compatibleLexers = array(
// Assembler
'arm'   => 'asm',
'6502acme'  => 'asm',
@@ -125,19 +141,7 @@
'apt_sources' => 'debsources',
);
 
-   public function __construct( $html ) {
-   $this->html = $html;
-   }
-
-   public function error() {
-   }
-
-   public function set_language( $language ) {
-   }
-
-   public function parse_code() {
-   global $wgOut;
-   $wgOut->addModuleStyles( 'ext.pygments' );
-   return $this->html;
+   public static function getGeSHiToPygmentsMap() {
+   return self::$compatibleLexers;
}
 }
diff --git a/extension.json b/extension.json
index 5611851..fa72254 100644
--- a/extension.json
+++ b/extension.json
@@ -24,6 +24,7 @@
"AutoloadClasses": {
"SyntaxHighlight_GeSHi": "SyntaxHighlight_GeSHi.class.php",
"GeSHi": "SyntaxHighlight_GeSHi.compat.php",
+   "SyntaxHighlightGeSHiCompat": 
"SyntaxHighlight_GeSHi.compat.php",
"ResourceLoaderGeSHiVisualEditorModule": 

[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[REL1_28]: Do not extend GeSHi class with private modifications

2017-05-12 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353500 )

Change subject: Do not extend GeSHi class with private modifications
..

Do not extend GeSHi class with private modifications

Our GeSHi class is intended for other extensions making use of GeSHi.
However other libraries or extensions can bring their own GeSHi to the
classloader. In those cases, we cannot find our private modifications
like $compatibleLexers on this class. Instead use
SyntaxHighlightGeSHiCompat for our privact modifications and keep GeSHi
closer to the original implementation.

Bug: T139594
Change-Id: I5c2ba9dfb08ec31f6b5cfd90083cbae0ae0ac3c4
(cherry picked from commit 1ce9975e18c6ed3e4358cea2e646684123ac78bf)
---
M ResourceLoaderGeSHiVisualEditorModule.php
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.compat.php
M extension.json
4 files changed, 29 insertions(+), 22 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/00/353500/1

diff --git a/ResourceLoaderGeSHiVisualEditorModule.php 
b/ResourceLoaderGeSHiVisualEditorModule.php
index 123fcd1..5cf2f96 100644
--- a/ResourceLoaderGeSHiVisualEditorModule.php
+++ b/ResourceLoaderGeSHiVisualEditorModule.php
@@ -49,7 +49,7 @@
 */
private function getLanguages() {
$lexers = require __DIR__ . '/SyntaxHighlight_GeSHi.lexers.php';
-   return array_merge( $lexers, array_keys( 
GeSHi::$compatibleLexers ) );
+   return array_merge( $lexers, array_keys( 
SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap() ) );
}
 
public function enableModuleContentVersion() {
diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index aa8caba..ae6f3ba 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -73,10 +73,12 @@
return $lexer;
}
 
+   $geshi2pygments = 
SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap();
+
// Check if this is a GeSHi lexer name for which there exists
// a compatible Pygments lexer with a different name.
-   if ( isset( GeSHi::$compatibleLexers[$lexer] ) ) {
-   $lexer = GeSHi::$compatibleLexers[$lexer];
+   if ( isset( $geshi2pygments[$lexer] ) ) {
+   $lexer = $geshi2pygments[$lexer];
if ( in_array( $lexer, $lexers ) ) {
return $lexer;
}
diff --git a/SyntaxHighlight_GeSHi.compat.php b/SyntaxHighlight_GeSHi.compat.php
index ba208a4..ea4efed 100644
--- a/SyntaxHighlight_GeSHi.compat.php
+++ b/SyntaxHighlight_GeSHi.compat.php
@@ -17,14 +17,30 @@
  */
 
 /**
- * Stub object for maintaining backward-compatibility with extensions
- * that have not been updated for version 2.0 of SyntaxHighlight_GeSHi
- * and for supporting GeSHi lexer names whenever they map naturally to
- * a Pygments lexer.
+ * Stub class for maintaining backward-compatibility with extensions
+ * that have not been updated for version 2.0 of SyntaxHighlight_GeSHi.
  */
 class GeSHi {
+   public function __construct( $html ) {
+   $this->html = $html;
+   }
+
+   public function error() {
+   }
+
+   public function set_language( $language ) {
+   }
+
+   public function parse_code() {
+   global $wgOut;
+   $wgOut->addModuleStyles( 'ext.pygments' );
+   return $this->html;
+   }
+}
+
+class SyntaxHighlightGeSHiCompat {
/** @var array A mapping of GeSHi lexer names to compatible Pygments 
lexers. */
-   public static $compatibleLexers = array(
+   private static $compatibleLexers = array(
// Assembler
'arm'   => 'asm',
'6502acme'  => 'asm',
@@ -125,19 +141,7 @@
'apt_sources' => 'debsources',
);
 
-   public function __construct( $html ) {
-   $this->html = $html;
-   }
-
-   public function error() {
-   }
-
-   public function set_language( $language ) {
-   }
-
-   public function parse_code() {
-   global $wgOut;
-   $wgOut->addModuleStyles( 'ext.pygments' );
-   return $this->html;
+   public static function getGeSHiToPygmentsMap() {
+   return self::$compatibleLexers;
}
 }
diff --git a/extension.json b/extension.json
index 9786168..ef04d0a 100644
--- a/extension.json
+++ b/extension.json
@@ -24,6 +24,7 @@
"AutoloadClasses": {
"SyntaxHighlight_GeSHi": "SyntaxHighlight_GeSHi.class.php",
"GeSHi": "SyntaxHighlight_GeSHi.compat.php",
+   "SyntaxHighlightGeSHiCompat": 
"SyntaxHighlight_GeSHi.compat.php",
"ResourceLoaderGeSHiVisualEditorModule": 

[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Remove GeSHi from class and filenames

2017-05-10 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353076 )

Change subject: Remove GeSHi from class and filenames
..

Remove GeSHi from class and filenames

Remove the GeSHi name from filenames and classes where possible. We no
longer actually use GeSHi, and though we cannot rename the extension or
repo atm, we can rename these.

Change-Id: I02bc3304d88103c5302f203e788fc73ff20e1050
---
R ResourceLoaderSyntaxHighlightVisualEditorModule.php
R SyntaxHighlight.ace.php
R SyntaxHighlight.class.php
R SyntaxHighlight.compat.php
R SyntaxHighlight.lexers.php
M extension.json
M maintenance/updateCSS.php
M maintenance/updateLexerList.php
8 files changed, 24 insertions(+), 19 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/76/353076/1

diff --git a/ResourceLoaderGeSHiVisualEditorModule.php 
b/ResourceLoaderSyntaxHighlightVisualEditorModule.php
similarity index 87%
rename from ResourceLoaderGeSHiVisualEditorModule.php
rename to ResourceLoaderSyntaxHighlightVisualEditorModule.php
index 64c1e41..ab8d20a 100644
--- a/ResourceLoaderGeSHiVisualEditorModule.php
+++ b/ResourceLoaderSyntaxHighlightVisualEditorModule.php
@@ -17,7 +17,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-class ResourceLoaderGeSHiVisualEditorModule extends ResourceLoaderFileModule {
+class ResourceLoaderSyntaxHighlightVisualEditorModule extends 
ResourceLoaderFileModule {
 
protected $targets = array( 'desktop', 'mobile' );
 
@@ -58,7 +58,7 @@
 * @return array
 */
private function getPygmentsLanguages() {
-   $lexers = require __DIR__ . '/SyntaxHighlight_GeSHi.lexers.php';
+   $lexers = require __DIR__ . '/SyntaxHighlight.lexers.php';
return $lexers;
}
 
@@ -66,3 +66,4 @@
return true;
}
 }
+class_alias( ResourceLoaderSyntaxHighlightVisualEditorModule::class, 
ResourceLoaderGeSHiVisualEditorModule::class );
diff --git a/SyntaxHighlight_GeSHi.ace.php b/SyntaxHighlight.ace.php
similarity index 100%
rename from SyntaxHighlight_GeSHi.ace.php
rename to SyntaxHighlight.ace.php
diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight.class.php
similarity index 98%
rename from SyntaxHighlight_GeSHi.class.php
rename to SyntaxHighlight.class.php
index e409e9c..19bf70b 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight.class.php
@@ -19,7 +19,7 @@
 use Symfony\Component\Process\ProcessBuilder;
 
 // @codingStandardsIgnoreStart
-class SyntaxHighlight_GeSHi {
+class SyntaxHighlight {
 // @codingStandardsIgnoreEnd
 
/** @var int The maximum number of lines that may be selected for 
highlighting. **/
@@ -64,7 +64,7 @@
}
 
if ( !$lexers ) {
-   $lexers = require __DIR__ . 
'/SyntaxHighlight_GeSHi.lexers.php';
+   $lexers = require __DIR__ . 
'/SyntaxHighlight.lexers.php';
}
 
$lexer = strtolower( $lang );
@@ -513,7 +513,7 @@
}
 
$resourceLoader->register( 'ext.geshi.visualEditor', [
-   'class' => 'ResourceLoaderGeSHiVisualEditorModule',
+   'class' => 'ResourceLoaderVisualEditorModule',
'localBasePath' => __DIR__ . DIRECTORY_SEPARATOR . 
'modules',
'remoteExtPath' => 'SyntaxHighlight_GeSHi/modules',
'scripts' => [
@@ -565,3 +565,5 @@
return '';
}
 }
+class_alias(SyntaxHighlight::class, SyntaxHighlight_GeSHi::class);
+
diff --git a/SyntaxHighlight_GeSHi.compat.php b/SyntaxHighlight.compat.php
similarity index 100%
rename from SyntaxHighlight_GeSHi.compat.php
rename to SyntaxHighlight.compat.php
diff --git a/SyntaxHighlight_GeSHi.lexers.php b/SyntaxHighlight.lexers.php
similarity index 100%
rename from SyntaxHighlight_GeSHi.lexers.php
rename to SyntaxHighlight.lexers.php
diff --git a/extension.json b/extension.json
index 331f6e8..e57480d 100644
--- a/extension.json
+++ b/extension.json
@@ -9,7 +9,7 @@
"Ori Livneh",
"Ed Sanders"
],
-   "url": "https://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi;,
+   "url": "https://www.mediawiki.org/wiki/Extension:SyntaxHighlight;,
"descriptionmsg": "syntaxhighlight-desc",
"license-name": "GPL-2.0+",
"type": "parserhook",
@@ -22,13 +22,15 @@
]
},
"AutoloadClasses": {
-   "SyntaxHighlight_GeSHi": "SyntaxHighlight_GeSHi.class.php",
-   "GeSHi": "SyntaxHighlight_GeSHi.compat.php",
-   "SyntaxHighlightAce": "SyntaxHighlight_GeSHi.ace.php",
-   "ResourceLoaderGeSHiVisualEditorModule": 
"ResourceLoaderGeSHiVisualEditorModule.php"
+   "SyntaxHighlight": "SyntaxHighlight.class.php",
+   

[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Do not extend GeSHi class with private modifications

2017-05-10 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353065 )

Change subject: Do not extend GeSHi class with private modifications
..

Do not extend GeSHi class with private modifications

Our GeSHi class is intended for other extensions making use of GeSHi.
However other libraries or extensions can bring their own GeSHi to the
classloader. In those cases, we cannot find our private modifications
like $compatibleLexers on this class. Instead use
SyntaxHighlightGeSHiCompat for our privact modifications and keep GeSHi
closer to the original implementation.

Bug: T139594
Change-Id: I5c2ba9dfb08ec31f6b5cfd90083cbae0ae0ac3c4
---
M ResourceLoaderGeSHiVisualEditorModule.php
M SyntaxHighlight_GeSHi.class.php
M SyntaxHighlight_GeSHi.compat.php
M extension.json
4 files changed, 27 insertions(+), 18 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/65/353065/1

diff --git a/ResourceLoaderGeSHiVisualEditorModule.php 
b/ResourceLoaderGeSHiVisualEditorModule.php
index 64c1e41..1f2f850 100644
--- a/ResourceLoaderGeSHiVisualEditorModule.php
+++ b/ResourceLoaderGeSHiVisualEditorModule.php
@@ -35,7 +35,7 @@
ResourceLoader::inDebugMode()
) . Xml::encodeJsCall(

've.dm.MWSyntaxHighlightNode.static.addGeshiToPygmentsMap', array(
-   GeSHi::$compatibleLexers
+   
SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap()
),
ResourceLoader::inDebugMode()
) . Xml::encodeJsCall(
diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php
index e409e9c..e00a918 100644
--- a/SyntaxHighlight_GeSHi.class.php
+++ b/SyntaxHighlight_GeSHi.class.php
@@ -73,10 +73,12 @@
return $lexer;
}
 
+   $geshi2pygments = 
SyntaxHighlightGeSHiCompat::getGeSHiToPygmentsMap();
+
// Check if this is a GeSHi lexer name for which there exists
// a compatible Pygments lexer with a different name.
-   if ( isset( GeSHi::$compatibleLexers[$lexer] ) ) {
-   $lexer = GeSHi::$compatibleLexers[$lexer];
+   if ( isset( $geshi2pygments[$lexer] ) ) {
+   $lexer = $geshi2pygments[$lexer];
if ( in_array( $lexer, $lexers ) ) {
return $lexer;
}
diff --git a/SyntaxHighlight_GeSHi.compat.php b/SyntaxHighlight_GeSHi.compat.php
index 61a808d..3f734c5 100644
--- a/SyntaxHighlight_GeSHi.compat.php
+++ b/SyntaxHighlight_GeSHi.compat.php
@@ -23,8 +23,26 @@
  * a Pygments lexer.
  */
 class GeSHi {
+   public function __construct( $html ) {
+   $this->html = $html;
+   }
+
+   public function error() {
+   }
+
+   public function set_language( $language ) {
+   }
+
+   public function parse_code() {
+   global $wgOut;
+   $wgOut->addModuleStyles( 'ext.pygments' );
+   return $this->html;
+   }
+}
+
+class SyntaxHighlightGeshiCompat {
/** @var array A mapping of GeSHi lexer names to compatible Pygments 
lexers. */
-   public static $compatibleLexers = array(
+   private static $compatibleLexers = array(
// Assembler
'arm'   => 'asm',
'6502acme'  => 'asm',
@@ -114,19 +132,7 @@
'apt_sources' => 'debsources',
);
 
-   public function __construct( $html ) {
-   $this->html = $html;
-   }
-
-   public function error() {
-   }
-
-   public function set_language( $language ) {
-   }
-
-   public function parse_code() {
-   global $wgOut;
-   $wgOut->addModuleStyles( 'ext.pygments' );
-   return $this->html;
+   public static function getGeSHiToPygmentsMap() {
+   return self::$compatibleLexers;
}
 }
diff --git a/extension.json b/extension.json
index 331f6e8..453d927 100644
--- a/extension.json
+++ b/extension.json
@@ -25,6 +25,7 @@
"SyntaxHighlight_GeSHi": "SyntaxHighlight_GeSHi.class.php",
"GeSHi": "SyntaxHighlight_GeSHi.compat.php",
"SyntaxHighlightAce": "SyntaxHighlight_GeSHi.ace.php",
+   "SyntaxHighlightGeSHiCompat": 
"SyntaxHighlight_GeSHi.compat.php",
"ResourceLoaderGeSHiVisualEditorModule": 
"ResourceLoaderGeSHiVisualEditorModule.php"
},
"ExtensionFunctions": [

-- 
To view, visit https://gerrit.wikimedia.org/r/353065
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c2ba9dfb08ec31f6b5cfd90083cbae0ae0ac3c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: CryptRand: only use random_bytes on php 7 and later

2017-05-10 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/353026 )

Change subject: CryptRand: only use random_bytes on php 7 and later
..

CryptRand: only use random_bytes on php 7 and later

This avoids random_bytes polyfills used on older versions of PHP.

Bug: T143788
Change-Id: Ic9e511ccc043d50e0a9051cdfe069c27e4f4c339
---
M includes/libs/CryptRand.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/353026/1

diff --git a/includes/libs/CryptRand.php b/includes/libs/CryptRand.php
index 0d3613a..3bcc96f 100644
--- a/includes/libs/CryptRand.php
+++ b/includes/libs/CryptRand.php
@@ -247,8 +247,9 @@
// On Linux, getrandom syscall will be used if 
available.
// On Windows CryptGenRandom will always be used
// On other platforms, /dev/urandom will be used.
+   // Avoids polyfills from before php 7.0
// All error situations will throw Exceptions and or 
Errors
-   if ( function_exists( 'random_bytes' ) ) {
+   if ( PHP_VERSION_ID >= 7 && function_exists( 
'random_bytes' ) ) {
$rem = $bytes - strlen( $buffer );
$buffer .= random_bytes( $rem );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/353026
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9e511ccc043d50e0a9051cdfe069c27e4f4c339
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Avoid background when the content is narrow

2017-04-27 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350602 )

Change subject: Avoid background when the content is narrow
..

Avoid background when the content is narrow

All our highlight content is inside a  block. When this block is
more narrow that the page (due to being pushed aside by floating
context for instance), then the background of this parent element will
extend beyond the contents.

An alternative could be setting overflow:hidden; and then setting
margin:0 on the included  element (which has UA default margins)

Bug: T126010
Change-Id: Id3c9544ea8fa379c7c640afa692d6184ad9c550f
---
M modules/pygments.wrapper.css
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/02/350602/1

diff --git a/modules/pygments.wrapper.css b/modules/pygments.wrapper.css
index 5a55bc0..50cfa19 100644
--- a/modules/pygments.wrapper.css
+++ b/modules/pygments.wrapper.css
@@ -23,6 +23,11 @@
padding: 0;
 }
 
+/* The nested pre already has a background. T126010 */
+div.mw-hightlight {
+   background-color: inherit;
+}
+
 /*
  * Don't show a red border around syntax errors. This behavior may be useful
  * in code editors, but it is not useful in a wiki environment, especially

-- 
To view, visit https://gerrit.wikimedia.org/r/350602
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3c9544ea8fa379c7c640afa692d6184ad9c550f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Remove no longer needed tsql->sql mapping

2017-04-27 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350574 )

Change subject: Remove no longer needed tsql->sql mapping
..

Remove no longer needed tsql->sql mapping

This is a follow-up to I4dc1782f19881ba1294308e1cdea1b2e063f438a
Bug: T156573

Change-Id: I5a1756a8db97aa336c810fb44bb108d77b8f89c7
---
M SyntaxHighlight_GeSHi.compat.php
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/74/350574/1

diff --git a/SyntaxHighlight_GeSHi.compat.php b/SyntaxHighlight_GeSHi.compat.php
index ba208a4..13b6629 100644
--- a/SyntaxHighlight_GeSHi.compat.php
+++ b/SyntaxHighlight_GeSHi.compat.php
@@ -99,7 +99,6 @@
 
// SQL
'dcl'  => 'sql',
-   'tsql' => 'sql',
'plsql'=> 'sql',
'oracle11' => 'sql',
'oracle8'  => 'sql',

-- 
To view, visit https://gerrit.wikimedia.org/r/350574
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a1756a8db97aa336c810fb44bb108d77b8f89c7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Remove printable version in favor of JS print

2017-04-25 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350197 )

Change subject: Remove printable version in favor of JS print
..

Remove printable version in favor of JS print

Only add a print link for JS enhanced views, and directly use the JS
print option. Due to async loading of Javascript, we need to avoid the
user interacting too soon with the link. For now do this by adapting
the style. Ideally, we would add 'href' atttribute at a later moment,
but not sure if BaseTemplate has provisions for that.
Alternative to I7faecdbc2ddc0c15a9f31ca6414ede81fa93462a

Bug: T24256
Change-Id: Ic3dc15e578ce4a94959285c9ae579e9088423544
---
M includes/skins/BaseTemplate.php
M resources/src/mediawiki.skinning/interface.css
M resources/src/mediawiki/page/ready.js
3 files changed, 20 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/350197/1

diff --git a/includes/skins/BaseTemplate.php b/includes/skins/BaseTemplate.php
index 5868904..48301ed 100644
--- a/includes/skins/BaseTemplate.php
+++ b/includes/skins/BaseTemplate.php
@@ -91,10 +91,10 @@
}
}
if ( isset( $this->data['nav_urls']['print'] ) && 
$this->data['nav_urls']['print'] ) {
-   $toolbox['print'] = $this->data['nav_urls']['print'];
+   $toolbox['print'];// = $this->data['nav_urls']['print'];
$toolbox['print']['id'] = 't-print';
-   $toolbox['print']['rel'] = 'alternate';
$toolbox['print']['msg'] = 'printableversion';
+   $toolbox['print']['href'] = '';
}
if ( isset( $this->data['nav_urls']['permalink'] ) && 
$this->data['nav_urls']['permalink'] ) {
$toolbox['permalink'] = 
$this->data['nav_urls']['permalink'];
diff --git a/resources/src/mediawiki.skinning/interface.css 
b/resources/src/mediawiki.skinning/interface.css
index c6d5082..ac11858 100644
--- a/resources/src/mediawiki.skinning/interface.css
+++ b/resources/src/mediawiki.skinning/interface.css
@@ -79,3 +79,16 @@
 span.subpages {
display: block;
 }
+
+.client-nojs #t-print {
+   display: none;
+}
+#t-print:not(.loaded) a,
+#t-print:not(.loaded) a:link,
+#t-print:not(.loaded) a:visited,
+#t-print:not(.loaded) a:active {
+   cursor: default;
+   opacity: 0.1;
+   text-decoration: none;
+   color: black !important;
+}
diff --git a/resources/src/mediawiki/page/ready.js 
b/resources/src/mediawiki/page/ready.js
index d5a667e..220658c 100644
--- a/resources/src/mediawiki/page/ready.js
+++ b/resources/src/mediawiki/page/ready.js
@@ -58,6 +58,11 @@
 */
mw.hook( 'wikipage.categories' ).fire( $nodes );
}
+
+   $( '#t-print' ).addClass( 'loaded' ).click( function( event ) {
+   window.print();
+   event.preventDefault();
+   } );
} );
 
 }( mediaWiki, jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/350197
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3dc15e578ce4a94959285c9ae579e9088423544
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] operations/mediawiki-config[master]: Disable mp3 uploads for now

2017-04-22 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349733 )

Change subject: Disable mp3 uploads for now
..

Disable mp3 uploads for now

Bug: T115170
Change-Id: Id34b00be61c165aa4b0bdf49a334e3d8f887
---
M wmf-config/CommonSettings.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/33/349733/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 3e11fd4..4763a94 100644
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -479,6 +479,9 @@
$wgUploadStashMaxAge = $wmgUploadStashMaxAge;
 }
 
+// Disable mp3 for now. T115170
+$wgFileExtensions = array_values( array_diff( $wgFileExtensions, [ 'mp3' ] ) );
+
 if ( $wmgPrivateWikiUploads ) {
# mav forced me to --midom
$wgFileExtensions[] = 'ppt';

-- 
To view, visit https://gerrit.wikimedia.org/r/349733
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id34b00be61c165aa4b0bdf49a334e3d8f887
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: TMH: Add support for MP3 files

2017-04-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349622 )

Change subject: TMH: Add support for MP3 files
..

TMH: Add support for MP3 files

Bug: T115170
Change-Id: I2b59f828d70a961e34b58414c24bbff0098b979f
---
M MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php
M MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js
M MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js
M TimedMediaHandler.hooks.php
M TimedMediaHandler.php
A handlers/Mp3Handler/Mp3Handler.php
M i18n/en.json
M i18n/qqq.json
8 files changed, 81 insertions(+), 18 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/22/349622/1

diff --git a/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php 
b/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php
index af32b4d..59fa159 100644
--- a/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php
+++ b/MwEmbedModules/EmbedPlayer/EmbedPlayer.config.php
@@ -10,7 +10,7 @@
 
// The preferred media codec preference
// Note user selected format order
-   'EmbedPlayer.CodecPreference' => array( 'vp9', 'webm', 
'h264', 'ogg' ),
+   'EmbedPlayer.CodecPreference' => array( 'vp9', 'webm', 
'h264', 'ogg', 'mp3' ),
 
// If video tag support should be disabled 
all-together, used to test
// fallback decoding methods and direct file links
diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js 
b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js
index 21b2f45..b0a2aff 100644
--- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js
+++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js
@@ -137,21 +137,6 @@
return this.mediaPlayers;
},
 
-   /**
-* If the browsers supports a given mimetype
-*
-* @param {String}
-*  mimeType Mime type for browser plug-in check
-*/
-   supportedMimeType: function( mimeType ) {
-   for ( var i =0; i < navigator.plugins.length; i++ ) {
-   var plugin = navigator.plugins[i];
-   if ( typeof plugin[ mimeType ] != "undefined" ){
-   return true;
-   }
-   }
-   return false;
-   },
addFlashPlayer: function(){
if( !mw.config.get( 'EmbedPlayer.DisableHTML5FlashFallback' ) ){
this.mediaPlayers.addPlayer( kplayer );
@@ -208,7 +193,7 @@
}
 
// Test for MP3:
-   if ( 
this.supportedMimeType('audio/mpeg') ) {
+   if ( dummyvid.canPlayType('audio/mpeg') 
) {

this.mediaPlayers.addPlayer( mp3NativePlayer );
}
 
diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js 
b/MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js
index 31308c0..e9f3553 100644
--- a/MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js
+++ b/MwEmbedModules/EmbedPlayer/resources/mw.processEmbedPlayers.js
@@ -151,6 +151,7 @@
}
// If we don't have a native player don't wait for metadata
if( !mw.EmbedTypes.getMediaPlayers().isSupportedPlayer( 
'oggNative') &&
+   !mw.EmbedTypes.getMediaPlayers().isSupportedPlayer( 
'mp3Native') &&
!mw.EmbedTypes.getMediaPlayers().isSupportedPlayer( 
'webmNative') &&
!mw.EmbedTypes.getMediaPlayers().isSupportedPlayer( 
'h264Native' ) &&
!mw.EmbedTypes.getMediaPlayers().isSupportedPlayer( 
'appleVdnPlayer' ) )
diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 78a5f1e..5c5d5cd 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -258,6 +258,7 @@
$wgMediaHandlers['audio/x-flac'] = 'FLACHandler';
$wgMediaHandlers['audio/flac'] = 'FLACHandler';
$wgMediaHandlers['audio/wav'] = 'WAVHandler';
+   $wgMediaHandlers['audio/mpeg'] = 'Mp3Handler';
 
// Add transcode job class:
$wgJobClasses['webVideoTranscode'] = 'WebVideoTranscodeJob';
diff --git a/TimedMediaHandler.php b/TimedMediaHandler.php
index 983cdb0..5cc5fba 100644
--- a/TimedMediaHandler.php
+++ b/TimedMediaHandler.php
@@ -240,7 +240,7 @@
 // List of extensions handled by Timed Media Handler since its referenced in a 
few places.
 // you should not modify this variable
 
-$wgTmhFileExtensions = [ 'ogg', 'ogv', 'oga', 'flac', 'opus', 'wav', 'webm', 
'mp4' ];
+$wgTmhFileExtensions = [ 'ogg', 'ogv', 'oga', 'flac', 'opus', 'wav', 'webm', 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: MimeAnalyzer: Detect magic bytes for mp3

2017-04-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349596 )

Change subject: MimeAnalyzer: Detect magic bytes for mp3
..

MimeAnalyzer: Detect magic bytes for mp3

Bug: T115170
Change-Id: Ie1a63aa319cebbb2efb3cdc478416f5947078cbe
---
M includes/libs/mime/MimeAnalyzer.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/96/349596/1

diff --git a/includes/libs/mime/MimeAnalyzer.php 
b/includes/libs/mime/MimeAnalyzer.php
index 6ea3c21..3e66188 100644
--- a/includes/libs/mime/MimeAnalyzer.php
+++ b/includes/libs/mime/MimeAnalyzer.php
@@ -670,6 +670,8 @@
// Multimedia...
'MThd' => 'audio/midi',
'OggS' => 'application/ogg',
+   'ID3'  => 'audio/mpeg',
+   "\xff\xfb" => 'audio/mpeg',
 
// Image formats...
// Note that WMF may have a bare header, no magic 
number.

-- 
To view, visit https://gerrit.wikimedia.org/r/349596
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1a63aa319cebbb2efb3cdc478416f5947078cbe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: More unused oathauth message keys

2017-04-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349516 )

Change subject: More unused oathauth message keys
..

More unused oathauth message keys

More message keys that became unused during various rewrite stages

Bug: T151536
Change-Id: Ic261ba73207793f3223227227d93624676290d3d
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 0 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/16/349516/1

diff --git a/i18n/en.json b/i18n/en.json
index 4d9e827..93cbe5a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -9,34 +9,17 @@
"oath": "OATHAuth",
"specialpages-group-oath": "Two-factor authentication",
"oathauth-account": "Account name:",
-   "oathauth-legend": "Verify your credentials",
"oathauth-secret": "Two-factor authentication secret key:",
"oathauth-enable": "Enable two-factor authentication",
-   "oathauth-failedtoenableoauth": "Failed to enable two-factor 
authentication.",
-   "oathauth-alreadyenabled": "Two-factor authentication is already 
enabled.",
-   "oathauth-verify": "Verify two-factor authentication token",
"oathauth-scratchtokens": "The following list is a list of one-time use 
scratch tokens. These tokens can only be used once, and are for emergency use. 
Please write these down and keep them in a secure location. If you lose your 
phone, these tokens are the only way to rescue your account. These tokens will 
never be shown again.",
-   "oathauth-reset": "Reset two-factor credentials",
-   "oathauth-donotdeleteoldsecret": "Please do not delete your old 
credentials until you have validated your new credentials.",
"oathauth-token": "Token",
-   "oathauth-currenttoken": "Current token",
-   "oathauth-newtoken": "New token",
"oathauth-disable": "Disable two-factor authentication",
"oathauth-login": "Login with two-factor authentication",
"oathauth-displayoathinfo": "two-factor authentication options",
"oathauth-validatedoath": "Validated two-factor credentials. Two-factor 
authentication will now be enforced.",
-   "oathauth-backtopreferences": "Back to preferences.",
"oathauth-failedtovalidateoauth": "Failed to validate two-factor 
credentials",
-   "oathauth-reattemptreset": "Reattempt reset of two-factor credentials.",
-   "oathauth-reattemptenable": "Reattempt enabling of two-factor 
authentication.",
"oathauth-disabledoath": "Disabled two-factor authentication.",
-   "oathauth-failedtodisableoauth": "Failed to disable two-factor 
authentication.",
-   "oathauth-reattemptdisable": "Reattempt disabling of two-factor 
authentication.",
-   "oathauth-failedtoresetoath": "Failed to reset two-factor 
authentication credentials.",
-   "oathauth-notloggedin": "Login required",
-   "oathauth-mustbeloggedin": "You must be logged in to perform this 
action.",
"oathauth-prefs-label": "Two-factor authentication:",
-   "oathauth-abortlogin": "The two-factor authentication token provided 
was invalid.",
"oathauth-abortlogin-throttled": "Too many verification attempts! 
Please try again later.",
"oathauth-step1": "Step 1: Download a two-factor authentication 
program",
"oathauth-step1-test": "Download a program for two-factor 
authentication. That can be a mobile application (such as Google Authenticator) 
or a desktop application",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 682f457..a5d73e1 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -16,34 +16,17 @@
"oath": "{{optional}}\n{{doc-special|OATH}}",
"specialpages-group-oath": 
"{{doc-special-group|like=[[Special:OATH]]}}\n\nSee 
[[w:en:Two_factor_authentication|Wikipedia article on two factor 
authentication]].\n\n{{Identical|Two factor authentication}}",
"oathauth-account": "Plain text associated with 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication] on this wiki (username@) found on 
Special:OATH.\n{{Identical|Account name}}",
-   "oathauth-legend": "Label for the legend on Special:OATH",
"oathauth-secret": "Plain text found on Special:OATH while enabling 
OATH\n\nSee [https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",
"oathauth-enable": "Page title on Special:OATH, when enabling 
OATH.\n\nSee [https://en.wikipedia.org/wiki/Two_factor_authentication two 
factor authentication]",
-   "oathauth-failedtoenableoauth": "Plain text, found on Special:OATH when 
failing to enable OATH.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",
-   "oathauth-alreadyenabled": "Plain text, found on Special:OATH when 
failing to enable OATH.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: OathAuth: rename failedtovalidateoauth

2017-04-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349517 )

Change subject: OathAuth: rename failedtovalidateoauth
..

OathAuth: rename failedtovalidateoauth

Rename this key from failedtovalidateoauth to failedtovalidateoath
as it has nothing to do with OAuth

Bug: T151536
Change-Id: Ib34ef3dbdef8eda515748140960ef240e4990044
---
M i18n/en.json
M i18n/qqq.json
M special/SpecialOATHDisable.php
M special/SpecialOATHEnable.php
4 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/17/349517/1

diff --git a/i18n/en.json b/i18n/en.json
index 93cbe5a..b7db997 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -17,7 +17,7 @@
"oathauth-login": "Login with two-factor authentication",
"oathauth-displayoathinfo": "two-factor authentication options",
"oathauth-validatedoath": "Validated two-factor credentials. Two-factor 
authentication will now be enforced.",
-   "oathauth-failedtovalidateoauth": "Failed to validate two-factor 
credentials",
+   "oathauth-failedtovalidateoath": "Failed to validate two-factor 
credentials",
"oathauth-disabledoath": "Disabled two-factor authentication.",
"oathauth-prefs-label": "Two-factor authentication:",
"oathauth-abortlogin-throttled": "Too many verification attempts! 
Please try again later.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index a5d73e1..ab6a26f 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -24,7 +24,7 @@
"oathauth-login": "Page title on Special:OATH while loggin in with 
OATH.",
"oathauth-displayoathinfo": "Page title on Special:OATH when no 
parameters are passed.\n\nSee 
[https://en.wikipedia.org/wiki/Multi-factor_authentication Two-factor 
authentication]",
"oathauth-validatedoath": "Plain text found on Special:OATH after a 
token has been validated.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",
-   "oathauth-failedtovalidateoauth": "Plain text found on Special:OATH 
when validation of a token has failed.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",
+   "oathauth-failedtovalidateoath": "Plain text found on Special:OATH when 
validation of a token has failed.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",
"oathauth-disabledoath": "Plain text found on Special:OATH when 
disabling OATH has been successful.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",
"oathauth-prefs-label": "Plain text label seen on 
Special:Preferences\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]\n{{Identical|Two factor authentication}}",
"oathauth-abortlogin-throttled": "Error message shown on login and 
password change pages when authentication is aborted due to rate limit 
violations.\n\nSee [https://en.wikipedia.org/wiki/Two_factor_authentication two 
factor authentication]",
diff --git a/special/SpecialOATHDisable.php b/special/SpecialOATHDisable.php
index d177867..3782016 100644
--- a/special/SpecialOATHDisable.php
+++ b/special/SpecialOATHDisable.php
@@ -104,7 +104,7 @@
}
 
if ( !$this->OATHUser->getKey()->verifyToken( 
$formData['token'], $this->OATHUser ) ) {
-   return [ 'oathauth-failedtovalidateoauth' ];
+   return [ 'oathauth-failedtovalidateoath' ];
}
 
$this->OATHUser->setKey( null );
diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index 7318d6a..44d887d 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -158,7 +158,7 @@
$key = $this->getRequest()->getSessionData( 'oathauth_key' );
 
if ( !$key->verifyToken( $formData['token'], $this->OATHUser ) 
) {
-   return [ 'oathauth-failedtovalidateoauth' ];
+   return [ 'oathauth-failedtovalidateoath' ];
}
 
$this->getRequest()->setSessionData( 'oathauth_key', null );

-- 
To view, visit https://gerrit.wikimedia.org/r/349517
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib34ef3dbdef8eda515748140960ef240e4990044
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: OathAuth: remove message Oathauth-displayoathinfo

2017-04-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349502 )

Change subject: OathAuth: remove message Oathauth-displayoathinfo
..

OathAuth: remove message Oathauth-displayoathinfo

This message key was unused since change
I17ac042f5a5093b2c0b2ce8d088f95213d1c0509

Bug: T151604
Change-Id: Ic6686f34cf5dd3161d4d3df200b336c4eb5a3f83
---
M i18n/en.json
M i18n/qqq.json
2 files changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/02/349502/1

diff --git a/i18n/en.json b/i18n/en.json
index 4d9e827..e14f9af 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -23,7 +23,6 @@
"oathauth-newtoken": "New token",
"oathauth-disable": "Disable two-factor authentication",
"oathauth-login": "Login with two-factor authentication",
-   "oathauth-displayoathinfo": "two-factor authentication options",
"oathauth-validatedoath": "Validated two-factor credentials. Two-factor 
authentication will now be enforced.",
"oathauth-backtopreferences": "Back to preferences.",
"oathauth-failedtovalidateoauth": "Failed to validate two-factor 
credentials",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 682f457..aec515f 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -30,7 +30,6 @@
"oathauth-newtoken": "HTMLForm label, found on Special:OATH, when 
verifying OATH.",
"oathauth-disable": "Page title on Special:OATH while disabling 
OATH.\n\nSee [https://en.wikipedia.org/wiki/Two_factor_authentication two 
factor authentication]",
"oathauth-login": "Page title on Special:OATH while loggin in with 
OATH.",
-   "oathauth-displayoathinfo": "Page title on Special:OATH when no 
parameters are passed.\n\nSee 
[https://en.wikipedia.org/wiki/Multi-factor_authentication Two-factor 
authentication]",
"oathauth-validatedoath": "Plain text found on Special:OATH after a 
token has been validated.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",
"oathauth-backtopreferences": "Used as link text. Link found on 
Special:OATH after any action has completed.",
"oathauth-failedtovalidateoauth": "Plain text found on Special:OATH 
when validation of a token has failed.\n\nSee 
[https://en.wikipedia.org/wiki/Two_factor_authentication two factor 
authentication]",

-- 
To view, visit https://gerrit.wikimedia.org/r/349502
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6686f34cf5dd3161d4d3df200b336c4eb5a3f83
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: HTMLForm: add errors to html in ooui variants

2017-04-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349425 )

Change subject: HTMLForm: add errors to html in ooui variants
..

HTMLForm: add errors to html in ooui variants

HTMLForm when using OOUI mode was not adding errors to the resulting
HTML, if depending on message arrays, as previously used before
Status.

Bug: T158492
Change-Id: I8765a025dd441676e35a7c183c67b37036643c1e
---
M includes/htmlform/OOUIHTMLForm.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/25/349425/1

diff --git a/includes/htmlform/OOUIHTMLForm.php 
b/includes/htmlform/OOUIHTMLForm.php
index 549edde..33e7895 100644
--- a/includes/htmlform/OOUIHTMLForm.php
+++ b/includes/htmlform/OOUIHTMLForm.php
@@ -207,7 +207,7 @@
$error = array_merge( [ 
$error['message'] ], $error['params'] );
}
}
-   } elseif ( $elementsType === 'errors' ) {
+   } elseif ( $elementsType === 'error' ) {
$errors = $elements;
if ( !is_array( $errors ) ) {
$errors = [ $errors ];

-- 
To view, visit https://gerrit.wikimedia.org/r/349425
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8765a025dd441676e35a7c183c67b37036643c1e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid overflowing of unbreakable words in interwiki search r...

2017-04-14 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348218 )

Change subject: Avoid overflowing of unbreakable words in interwiki search 
results
..

Avoid overflowing of unbreakable words in interwiki search results

The interwiki search results can be pretty narrow, and longer
unbreakable words or titles in the results might easily overflow the
containing box. break-word fixes all that.

Change-Id: I97e2b101433bde50a0aa48b772b2fe5a7157aed4
---
M 
resources/src/mediawiki.special/mediawiki.special.search.interwikiwidget.styles.less
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/18/348218/1

diff --git 
a/resources/src/mediawiki.special/mediawiki.special.search.interwikiwidget.styles.less
 
b/resources/src/mediawiki.special/mediawiki.special.search.interwikiwidget.styles.less
index d5e1c48..3f23dc4 100644
--- 
a/resources/src/mediawiki.special/mediawiki.special.search.interwikiwidget.styles.less
+++ 
b/resources/src/mediawiki.special/mediawiki.special.search.interwikiwidget.styles.less
@@ -20,6 +20,7 @@
width: 100%;
float: left;
list-style-type: none;
+   word-break: break-word;
 }
 
 /* clearfix */

-- 
To view, visit https://gerrit.wikimedia.org/r/348218
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I97e2b101433bde50a0aa48b772b2fe5a7157aed4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...ParserMigration[master]: Start at the top when comparing ParserMigration results

2017-04-13 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348070 )

Change subject: Start at the top when comparing ParserMigration results
..

Start at the top when comparing ParserMigration results

Enforce that pages start rendering at the top. When pages are middle
aligned inside the table, and they differ in height, then they are a lot
harder to compare.

Change-Id: Ie39634831c35941dc2f061c707bdf9954bff5e82
---
M resources/ext.parsermigration.edit.css
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ParserMigration 
refs/changes/70/348070/1

diff --git a/resources/ext.parsermigration.edit.css 
b/resources/ext.parsermigration.edit.css
index 8683c9f..117373c 100644
--- a/resources/ext.parsermigration.edit.css
+++ b/resources/ext.parsermigration.edit.css
@@ -7,9 +7,11 @@
width: 50%;
overflow: scroll;
border-right: thin solid #ccc;
+   vertical-align: top;
 }
 .mw-parsermigration-right {
padding-left: 0.4em;
+   vertical-align: top;
 }
 .mw-parsermigration-sxs > tbody > tr > th {
border-bottom: thin solid #ccc;

-- 
To view, visit https://gerrit.wikimedia.org/r/348070
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie39634831c35941dc2f061c707bdf9954bff5e82
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ParserMigration
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CodeEditor[master]: Define explicit default for usecodeeditor

2017-04-13 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/348065 )

Change subject: Define explicit default for usecodeeditor
..

Define explicit default for usecodeeditor

Bug: T162877
Change-Id: I7591ac81e1cf8c1097e68d3517b7421bea3face2
---
M extension.json
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor 
refs/changes/65/348065/1

diff --git a/extension.json b/extension.json
index 38ee68a..2349736 100644
--- a/extension.json
+++ b/extension.json
@@ -34,6 +34,9 @@
"config": {
"CodeEditorEnableCore": true
},
+   "DefaultUserOptions": {
+   "usecodeeditor": 1
+   },
"ResourceModules": {
"ext.codeEditor": {
"scripts": "ext.codeEditor.js",

-- 
To view, visit https://gerrit.wikimedia.org/r/348065
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7591ac81e1cf8c1097e68d3517b7421bea3face2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Add support for postgres to TMH

2017-03-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343833 )

Change subject: Add support for postgres to TMH
..

Add support for postgres to TMH

SQL provided By 0xAFFF

Change-Id: I025625f55467a11a018b8d2a0fe89ef385144a7c
---
M TimedMediaHandler.hooks.php
A TimedMediaHandler.postgres.sql
2 files changed, 17 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/33/343833/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 1a1d46e..73f66be 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -769,7 +769,7 @@
"$base/archives/transcode_name_key.sql", true ] 
);
break;
case 'postgres':
-   // TODO
+   $updater->addExtensionTable( 'transcode', 
"$base/TimedMediaHandler.postgres.sql" );
break;
}
return true;
diff --git a/TimedMediaHandler.postgres.sql b/TimedMediaHandler.postgres.sql
new file mode 100644
index 000..671682b
--- /dev/null
+++ b/TimedMediaHandler.postgres.sql
@@ -0,0 +1,16 @@
+CREATE TABLE /*_*/transcode (
+   transcode_id SERIAL NOT NULL,
+   transcode_image_name VARCHAR(255) NOT NULL,
+   transcode_key VARCHAR(48) NOT NULL,
+   transcode_error longtext NOT NULL,
+   transcode_time_addjob VARCHAR(14) NULL,
+   transcode_time_startwork VARCHAR(14) NULL,
+   transcode_time_success VARCHAR(14) NULL,
+   transcode_time_error VARCHAR(14) NULL,
+   transcode_final_bitrate INT NOT NULL
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX /*i*/transcode_time_inx ON /*_*/transcode( transcode_time_addjob 
,transcode_time_startwork , transcode_time_success, transcode_time_error );
+CREATE INDEX /*i*/transcode_key_idx ON /*_*/transcode( transcode_key );
+
+CREATE UNIQUE INDEX /*i*/transcode_name_key ON /*_*/transcode 
(transcode_image_name,transcode_key);

-- 
To view, visit https://gerrit.wikimedia.org/r/343833
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I025625f55467a11a018b8d2a0fe89ef385144a7c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Remove duplicate hook for extension schema updates

2017-03-20 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/343625 )

Change subject: Remove duplicate hook for extension schema updates
..

Remove duplicate hook for extension schema updates

Change-Id: I50c7d55e5113e8aedcb0757f684f18dce8b5eb59
---
M TimedMediaHandler.hooks.php
1 file changed, 0 insertions(+), 12 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/25/343625/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 1a1d46e..78a5f1e 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -351,8 +351,6 @@
$wgExcludeFromThumbnailPurge[] = 'log';
}
 
-   $wgHooks['LoadExtensionSchemaUpdates'][] = 
'TimedMediaHandlerHooks::loadExtensionSchemaUpdates';
-
// Add unit tests
$wgHooks['UnitTestsList'][] = 
'TimedMediaHandlerHooks::registerUnitTests';
$wgHooks['ParserTestTables'][] = 
'TimedMediaHandlerHooks::onParserTestTables';
@@ -652,16 +650,6 @@
WebVideoTranscode::cleanupTranscodes( $file );
}
}
-   return true;
-   }
-
-   /**
-* Adds the transcode sql
-* @param $updater DatabaseUpdater
-* @return bool
-*/
-   public static function loadExtensionSchemaUpdates( $updater ) {
-   $updater->addExtensionTable( 'transcode', __DIR__ . 
'/TimedMediaHandler.sql' );
return true;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/343625
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50c7d55e5113e8aedcb0757f684f18dce8b5eb59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make ext-curl a suggested package for mediawiki core.

2017-03-09 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/342037 )

Change subject: Make ext-curl a suggested package for mediawiki core.
..

Make ext-curl a suggested package for mediawiki core.

curl is the preferred http implementation as far as I'm a aware and the
only implementation used by multi-http-request, a requirement for
something like VisualEditor

Change-Id: I40a015339d4a3f92cfadcd92dfd70425639d0412
---
M composer.json
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/37/342037/1

diff --git a/composer.json b/composer.json
index ce38914..af8635a 100644
--- a/composer.json
+++ b/composer.json
@@ -64,6 +64,7 @@
},
"suggest": {
"ext-apc": "Local data and opcode cache",
+   "ext-curl": "Improved http communication abilities",
"ext-fileinfo": "Improved mime magic detection",
"ext-intl": "ICU integration",
"ext-wikidiff2": "Diff accelerator",

-- 
To view, visit https://gerrit.wikimedia.org/r/342037
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40a015339d4a3f92cfadcd92dfd70425639d0412
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Correct 1px offset error in SVG mask.

2017-03-02 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340738 )

Change subject: Correct 1px offset error in SVG mask.
..

Correct 1px offset error in SVG mask.

All the other masks use an 8px offset for the triangle. But this
specific mask used 250 - 243 = 7px offset.

Bug: T153840
Change-Id: Ib72842d18bd844ff37509cf5bf1dedd4e0f99dbc
---
M src/renderer.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/38/340738/1

diff --git a/src/renderer.js b/src/renderer.js
index 751216a..fb7bffa 100644
--- a/src/renderer.js
+++ b/src/renderer.js
@@ -36,7 +36,7 @@
'' +
'' +
'' +
-   '' +
+   '' +
'' +
'' +
''

-- 
To view, visit https://gerrit.wikimedia.org/r/340738
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib72842d18bd844ff37509cf5bf1dedd4e0f99dbc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Popups[master]: Position image correctly inside the card

2017-02-16 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338166 )

Change subject: Position image correctly inside the card
..

Position image correctly inside the card

inline-blocks need to be forced to be aligned correctly on the baseline

Bug: T153840§
Change-Id: Iec45caa4483b36b01261309e4895c71e3fc2e675
---
M resources/ext.popups/styles/ext.popups.core.less
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/66/338166/1

diff --git a/resources/ext.popups/styles/ext.popups.core.less 
b/resources/ext.popups/styles/ext.popups.core.less
index b4db7e3..a370979 100644
--- a/resources/ext.popups/styles/ext.popups.core.less
+++ b/resources/ext.popups/styles/ext.popups.core.less
@@ -145,7 +145,7 @@
width: 450px;
 
> div > a > svg {
-   margin-bottom: -7px;
+   vertical-align: middle;
}
 
.mwe-popups-extract {

-- 
To view, visit https://gerrit.wikimedia.org/r/338166
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec45caa4483b36b01261309e4895c71e3fc2e675
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Convert TMH's 3rd party JS libs to use npm+yarn

2017-02-05 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/336170 )

Change subject: Convert TMH's 3rd party JS libs to use npm+yarn
..

Convert TMH's 3rd party JS libs to use npm+yarn

Use npm for the 3rd party js libraries.
 - yarn install --prod to install
 - yarn upgrade to upgrade
 - yarn.lock ensures version consistency

Further ideas:
* Might want to expand RL, to warn when an extensions uses files
  starting with node_modules that have not been installed.
* Update extension and release scripts to automatically include npm
  dependencies.

Bug: T107561
Change-Id: I8f632b7f6feafe8cff062370046b324f88bd49c5
---
M TimedMediaHandler.hooks.php
M package.json
A yarn.lock
3 files changed, 2,209 insertions(+), 43 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/70/336170/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 016ae73..f0fbcc3 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -90,46 +90,46 @@
'position' => 'top',
],
'ext.tmh.video-js' => $baseExtensionResource + [
-   'scripts' => 'resources/videojs/video.js',
-   'styles' => 'resources/videojs/video-js.css',
+   'scripts' => 
'node_modules/video.js/dist/video.js',
+   'styles' => 
'node_modules/video.js/dist/video-js.css',
'noflip' => true,
'targets' => [ 'mobile', 'desktop' ],
'languageScripts' => [
-   'ar' => 'resources/videojs/lang/ar.js',
-   'ba' => 'resources/videojs/lang/ba.js',
-   'bg' => 'resources/videojs/lang/bg.js',
-   'ca' => 'resources/videojs/lang/ca.js',
-   'cs' => 'resources/videojs/lang/cs.js',
-   'da' => 'resources/videojs/lang/da.js',
-   'de' => 'resources/videojs/lang/de.js',
-   'el' => 'resources/videojs/lang/el.js',
-   'en' => 'resources/videojs/lang/en.js',
-   'es' => 'resources/videojs/lang/es.js',
-   'fa' => 'resources/videojs/lang/fa.js',
-   'fi' => 'resources/videojs/lang/fi.js',
-   'fr' => 'resources/videojs/lang/fr.js',
-   'hr' => 'resources/videojs/lang/hr.js',
-   'hu' => 'resources/videojs/lang/hu.js',
-   'it' => 'resources/videojs/lang/it.js',
-   'ja' => 'resources/videojs/lang/ja.js',
-   'ko' => 'resources/videojs/lang/ko.js',
-   'nb' => 'resources/videojs/lang/nb.js',
-   'nl' => 'resources/videojs/lang/nl.js',
-   'nn' => 'resources/videojs/lang/nn.js',
-   'pl' => 'resources/videojs/lang/pl.js',
-   'pt-BR' => 
'resources/videojs/lang/pt-BR.js',
-   'ru' => 'resources/videojs/lang/ru.js',
-   'sr' => 'resources/videojs/lang/sr.js',
-   'sv' => 'resources/videojs/lang/sv.js',
-   'tr' => 'resources/videojs/lang/tr.js',
-   'uk' => 'resources/videojs/lang/uk.js',
-   'vi' => 'resources/videojs/lang/vi.js',
-   'zh-CN' => 
'resources/videojs/lang/zh-CN.js',
-   'zh-TW' => 
'resources/videojs/lang/zh-TW.js',
+   'ar' => 
'node_modules/video.js/dist/lang/ar.js',
+   'ba' => 
'node_modules/video.js/dist/lang/ba.js',
+   'bg' => 
'node_modules/video.js/dist/lang/bg.js',
+   'ca' => 
'node_modules/video.js/dist/lang/ca.js',
+   'cs' => 
'node_modules/video.js/dist/lang/cs.js',
+   'da' => 
'node_modules/video.js/dist/lang/da.js',
+   'de' => 
'node_modules/video.js/dist/lang/de.js',
+   'el' => 
'node_modules/video.js/dist/lang/el.js',

[MediaWiki-commits] [Gerrit] mediawiki...WikiEditor[REL1_27]: Load module 'mediawiki.diff.styles' on show changes

2017-02-03 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/335775 )

Change subject: Load module 'mediawiki.diff.styles' on show changes
..

Load module 'mediawiki.diff.styles' on show changes

The loading of the diff styles get lost in 6627f2cd, which is part of LTS
REL 1.27. There have been complaints, so backporting makes sense.

In MediaWiki 1.28 the name of the module was renamed from
'mediawiki.action.history.diff' to 'mediawiki.diff.styles'.

Bug: T142845
Change-Id: I86ed2a0568c6bc4e81819633a295cec2e8924215
(cherry picked from commit fe7e2a790c42d7e88de3f8582ad0213ff414f974)
---
M modules/jquery.wikiEditor.preview.js
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikiEditor 
refs/changes/75/335775/1

diff --git a/modules/jquery.wikiEditor.preview.js 
b/modules/jquery.wikiEditor.preview.js
index 00edd40..754414b 100644
--- a/modules/jquery.wikiEditor.preview.js
+++ b/modules/jquery.wikiEditor.preview.js
@@ -118,11 +118,12 @@
rvprop: '',
rvsection: section === '' ? 
undefined : section
};
+   var postPromise = api.post( postdata );
 
-   api.post( postdata )
-   .done( function ( data ) {
+   $.when( postPromise, mw.loader.using( 
'mediawiki.diff.styles' ) )
+   .done( function ( postResult ) {
try {
-   var diff = 
data.query.pages[ 0 ]
+   var diff = postResult[ 
0 ].query.pages[ 0 ]
.revisions[ 0 
].diff.body;
 

context.$changesTab.find( 'table.diff tbody' )

-- 
To view, visit https://gerrit.wikimedia.org/r/335775
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86ed2a0568c6bc4e81819633a295cec2e8924215
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikiEditor
Gerrit-Branch: REL1_27
Gerrit-Owner: TheDJ 
Gerrit-Reviewer: Fomafix 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Make noresize non-specific to thumbnails and cleanup

2017-01-28 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334754 )

Change subject: Make noresize non-specific to thumbnails and cleanup
..

Make noresize non-specific to thumbnails and cleanup

It seems that some styles were mixed up a bit. magnify is only used by
thumbnails, yet was in images.less and noresize needs to balance out
responsive max-width on images, which not specific to thumbnails.

Also adapt noresize to not reset the width, but to set max-width
instead, which will be more reliable and match original intent of
T22030.

Updated the comments to refer the phab instead of bugzilla numbers.

Bug: T154432
Change-Id: Id1e46435c02c2fd10f2163717feeb681569b74f9
---
M resources/skins.minerva.content.styles/images.less
M resources/skins.minerva.content.styles/thumbnails.less
2 files changed, 14 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/54/334754/1

diff --git a/resources/skins.minerva.content.styles/images.less 
b/resources/skins.minerva.content.styles/images.less
index a10e841..97a34eb 100644
--- a/resources/skins.minerva.content.styles/images.less
+++ b/resources/skins.minerva.content.styles/images.less
@@ -48,7 +48,7 @@
 
// Prevent inline styles on images in wikitext
// Note we restrict to img's to avoid conflicts with VisualEditor 
shields
-   // See bug 62460
+   // See bug T64460
a > img {
// make sure that images in articles don't cause a horizontal 
scrollbar
// on small screens
@@ -56,8 +56,13 @@
height: auto !important;
}
 
-   // Hide the image magnification icon normally displayed in image 
captions
-   div.magnify {
-   display: none;
+   // bug T22030
+   .noresize {
+   max-width: 100%;
+   overflow-x: auto;
+
+   img {
+   max-width: none !important;
+   }
}
 }
diff --git a/resources/skins.minerva.content.styles/thumbnails.less 
b/resources/skins.minerva.content.styles/thumbnails.less
index 8da82bd..2ff13de 100644
--- a/resources/skins.minerva.content.styles/thumbnails.less
+++ b/resources/skins.minerva.content.styles/thumbnails.less
@@ -22,16 +22,6 @@
// !important is needed because of Bug T87198 for 
example
max-width: 100% !important;
}
-
-   /* bug 20030 */
-   .noresize {
-   width: 100%;
-   overflow-x: auto;
-
-   img {
-   max-width: none !important;
-   }
-   }
}
 
.thumbcaption {
@@ -46,4 +36,9 @@
.thumbborder {
border: 1px solid @colorGray12;
}
+
+   // Hide the image magnification icon normally displayed in image 
captions
+   div.magnify {
+   display: none;
+   }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/334754
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1e46435c02c2fd10f2163717feeb681569b74f9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Don't remove border for floatright and floatleft

2017-01-24 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333910 )

Change subject: Don't remove border for floatright and floatleft
..

Don't remove border for floatright and floatleft

This is a leftover from T2691, from a time when the skin still used
borders to fake a margin that didn't overlap with H2 elements. We fixed
this a long time ago in T28449 and it's follow ups, but this border: 0;
remained.

I discovered this now no longer desired side effect when trying to
apply these classes to tables.

Change-Id: I52b18c7c5b3dfea39c4653a8add00a607e7eab73
---
M resources/src/mediawiki.skinning/content.css
1 file changed, 0 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/333910/1

diff --git a/resources/src/mediawiki.skinning/content.css 
b/resources/src/mediawiki.skinning/content.css
index a62ef2e..87e209e 100644
--- a/resources/src/mediawiki.skinning/content.css
+++ b/resources/src/mediawiki.skinning/content.css
@@ -123,7 +123,6 @@
 /* Images */
 /* @noflip */div.floatright, table.floatright {
margin: 0 0 .5em .5em;
-   border: 0;
 }
 
 div.floatright p {
@@ -132,7 +131,6 @@
 
 /* @noflip */div.floatleft, table.floatleft {
margin: 0 .5em .5em 0;
-   border: 0;
 }
 
 div.floatleft p {

-- 
To view, visit https://gerrit.wikimedia.org/r/333910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52b18c7c5b3dfea39c4653a8add00a607e7eab73
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Special:Upload should not crash on failing previews

2017-01-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/333079 )

Change subject: Special:Upload should not crash on failing previews
..

Special:Upload should not crash on failing previews

A thumbnail transformation can fail, but the preview on Special:Upload
was not accounting for failed previews and caused a stacktrace on
accessing getUrl on 'false'.

Bug: T155771
Change-Id: Iff3a2ae3512a34a2d2efb981b7ea85da71aaf637
---
M includes/specials/SpecialUpload.php
1 file changed, 8 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/79/333079/1

diff --git a/includes/specials/SpecialUpload.php 
b/includes/specials/SpecialUpload.php
index 8b8e514..436bb2c 100644
--- a/includes/specials/SpecialUpload.php
+++ b/includes/specials/SpecialUpload.php
@@ -1090,12 +1090,14 @@
global $wgContLang;
 
$mto = $file->transform( [ 'width' => 120 ] );
-   $this->addHeaderText(
-   '' .
-   Html::element( 'img', [
-   'src' => $mto->getUrl(),
-   'class' => 'thumbimage',
-   ] ) . '', 'description' );
+   if ( $mto ) {
+i  $this->addHeaderText(
+   '' .
+   Html::element( 'img', [
+   'src' => $mto->getUrl(),
+   'class' => 'thumbimage',
+   ] ) . '', 'description' );
+   }
}
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/333079
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff3a2ae3512a34a2d2efb981b7ea85da71aaf637
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Center iframe content in video.js mode

2017-01-15 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332206 )

Change subject: Center iframe content in video.js mode
..

Center iframe content in video.js mode

Also make sure it's background is black.

Note that it centers slightly different compared to mwembed, since
video.js aligns the player controls with the canvas, instead of
adapting the canvas inside the player. Shouldn't matter too much
however.

Bug: T138772
Change-Id: I38ca8a2e6f33045ed723991b0ddef9d65bd4b09c
---
M TimedMediaIframeOutput.php
M resources/embedPlayerIframe.css
2 files changed, 9 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/06/332206/1

diff --git a/TimedMediaIframeOutput.php b/TimedMediaIframeOutput.php
index 1fff8c8..379040e 100644
--- a/TimedMediaIframeOutput.php
+++ b/TimedMediaIframeOutput.php
@@ -70,13 +70,13 @@
 
if ( TimedMediaHandlerHooks::activePlayerMode() === 'mwembed' ) 
{
$wgOut->addModules( [ 'mw.MediaWikiPlayer.loader', 
'ext.tmh.embedPlayerIframe' ] );
-   $wgOut->addModuleStyles( 'embedPlayerIframeStyle' );
}
 
if ( TimedMediaHandlerHooks::activePlayerMode() === 'videojs' ) 
{
$wgOut->addModules( 'ext.tmh.player' );
$wgOut->addModuleStyles( 'ext.tmh.player.styles' );
}
+   $wgOut->addModuleStyles( 'embedPlayerIframeStyle' );
 
$wgOut->sendCacheControl();
$rlClient = $wgOut->getRlClient();
diff --git a/resources/embedPlayerIframe.css b/resources/embedPlayerIframe.css
index 5dd8c32..3bc5902 100644
--- a/resources/embedPlayerIframe.css
+++ b/resources/embedPlayerIframe.css
@@ -17,3 +17,11 @@
 #videoContainer .videoHolder {
position: static;
 }
+#videoContainer {
+   width: 100%;
+   height: 100%;
+   background-color: #000;
+   display: flex;
+   align-items: center;
+   justify-content: center;
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/332206
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38ca8a2e6f33045ed723991b0ddef9d65bd4b09c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Remove no longer useful css change

2017-01-15 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332205 )

Change subject: Remove no longer useful css change
..

Remove no longer useful css change

Follow-up to: Ide8912e

Change-Id: I86e39dc070d164ff29e8a0f6fdffd4aa855d0642
---
M resources/ext.tmh.embedPlayerIframe.js
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/05/332205/1

diff --git a/resources/ext.tmh.embedPlayerIframe.js 
b/resources/ext.tmh.embedPlayerIframe.js
index b3523de..fbef29f 100644
--- a/resources/ext.tmh.embedPlayerIframe.js
+++ b/resources/ext.tmh.embedPlayerIframe.js
@@ -7,11 +7,7 @@
var iframePlayerInit = function () {
// rewrite player, normally done by mw.EmbedPlayer.loader upon 
wikipage.content hook
var $players = $( mw.config.get( 'EmbedPlayer.RewriteSelector' 
) );
-   $players.embedPlayer( function () {
-   $( '#videoContainer' ).css( {
-   visibility: 'visible'
-   } );
-   } );
+   $players.embedPlayer();
};
 
$( iframePlayerInit );

-- 
To view, visit https://gerrit.wikimedia.org/r/332205
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86e39dc070d164ff29e8a0f6fdffd4aa855d0642
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Remove last trace of bgimage

2017-01-15 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332204 )

Change subject: Remove last trace of bgimage
..

Remove last trace of bgimage

Follow-up to: Ide8912e
Bug: T138773

Change-Id: I0f515a567034daf16ae5b5448121a20c8f29a044
---
M resources/embedPlayerIframe.css
M resources/ext.tmh.embedPlayerIframe.js
2 files changed, 0 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/04/332204/1

diff --git a/resources/embedPlayerIframe.css b/resources/embedPlayerIframe.css
index 5dd8c32..50c368e 100644
--- a/resources/embedPlayerIframe.css
+++ b/resources/embedPlayerIframe.css
@@ -11,9 +11,6 @@
margin: 0;
padding: 0;
 }
-img#bgimage {
-   display: none;
-}
 #videoContainer .videoHolder {
position: static;
 }
diff --git a/resources/ext.tmh.embedPlayerIframe.js 
b/resources/ext.tmh.embedPlayerIframe.js
index 704793c..b3523de 100644
--- a/resources/ext.tmh.embedPlayerIframe.js
+++ b/resources/ext.tmh.embedPlayerIframe.js
@@ -11,7 +11,6 @@
$( '#videoContainer' ).css( {
visibility: 'visible'
} );
-   $( '#bgimage' ).remove();
} );
};
 

-- 
To view, visit https://gerrit.wikimedia.org/r/332204
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0f515a567034daf16ae5b5448121a20c8f29a044
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Special case opus mime detction

2017-01-14 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332072 )

Change subject: Special case opus mime detction
..

Special case opus mime detction

Bug: T151352
Change-Id: I44be5d6b407752b39fc8148d31e9f01de28014dc
---
M includes/libs/mime/MimeAnalyzer.php
M includes/libs/mime/mime.info
M includes/libs/mime/mime.types
3 files changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/72/332072/1

diff --git a/includes/libs/mime/MimeAnalyzer.php 
b/includes/libs/mime/MimeAnalyzer.php
index e42d1a9..6ea3c21 100644
--- a/includes/libs/mime/MimeAnalyzer.php
+++ b/includes/libs/mime/MimeAnalyzer.php
@@ -83,7 +83,7 @@
 * what will break? In practice this probably isn't a problem anyway -- 
Bryan)
 */
protected static $wellKnownTypes = <

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: [WIP] Adapt content to narrow screens

2017-01-12 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331948 )

Change subject: [WIP] Adapt content to narrow screens
..

[WIP] Adapt content to narrow screens

Move some of the content adaptation rules of MobileFrontend into core.
These rules are set to VERY narrow dimensions to avoid that desktop
users run into them too quickly.

Ideally at some point, make 'chrome' offset known to this kind of
styling.

Also add CSS to make images full width on hidpi screens.

Change-Id: I3d2c38d2f250d99f247e461b9430079e89f7782c
---
M resources/Resources.php
A resources/src/mediawiki.skinning/content-narrow-hidpi.less
A resources/src/mediawiki.skinning/content-narrow.less
3 files changed, 68 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/48/331948/1

diff --git a/resources/Resources.php b/resources/Resources.php
index 7c00feb..419e031 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -101,6 +101,12 @@
'styles' => [
'resources/src/mediawiki.skinning/elements.css' => [ 
'media' => 'screen' ],
'resources/src/mediawiki.skinning/content.css' => [ 
'media' => 'screen' ],
+   'resources/src/mediawiki.skinning/content-narrow.less' 
=> [ 'media' => 'screen'],
+   'resources/src/mediawiki.skinning/content-narrow.less' 
=> [ 'media' => 'screen and (max-width:500px)' ],
+   
'resources/src/mediawiki.skinning/content-narrow-hidpi.less' => [
+   'media' => 'screen and (max-width:500px) and 
(-webkit-min-device-pixel-ratio: 1.5),' .
+   'screen and (max-width:500px) and 
(min-resolution: 1.5dppx)'
+   ],
],
],
// Used in the web installer. Test it after modifying this definition!
@@ -109,6 +115,11 @@
'styles' => [
'resources/src/mediawiki.skinning/elements.css' => [ 
'media' => 'screen' ],
'resources/src/mediawiki.skinning/content.css' => [ 
'media' => 'screen' ],
+   'resources/src/mediawiki.skinning/content-narrow.less' 
=> [ 'media' => 'screen and (max-width:500px)' ],
+   
'resources/src/mediawiki.skinning/content-narrow-hidpi.less' => [
+   'media' => 'screen and (max-width:500px) and 
(-webkit-min-device-pixel-ratio: 1.5),' .
+   'screen and (max-width:500px) and 
(min-resolution: 1.5dppx)'
+   ],
'resources/src/mediawiki.skinning/interface.css' => [ 
'media' => 'screen' ],
],
],
diff --git a/resources/src/mediawiki.skinning/content-narrow-hidpi.less 
b/resources/src/mediawiki.skinning/content-narrow-hidpi.less
new file mode 100644
index 000..ce035cd
--- /dev/null
+++ b/resources/src/mediawiki.skinning/content-narrow-hidpi.less
@@ -0,0 +1,24 @@
+/* Make images fullwidth, if we can ensure aspect ratio */
+@supports (object-fit: contain) {
+   div.thumbinner {
+   width: 100% !important;
+   }
+   div.thumbinner .thumbimage {
+   width: 100%;
+   object-fit: contain;
+   /* Never more than 60 percent of viewport height,
+* to make sure upright images don't fillout the entire screen 
*/
+   max-height: 60vh;
+   }
+
+   /* This isn't really pretty with normal frames, so make them 
transparents */
+   div.thumbinner {
+   box-sizing: border-box;
+   border: 0;
+   background-color: transparent;
+   }
+   html .thumbimage {
+   border: 0;
+   background-color: transparent;
+   }
+}
\ No newline at end of file
diff --git a/resources/src/mediawiki.skinning/content-narrow.less 
b/resources/src/mediawiki.skinning/content-narrow.less
new file mode 100644
index 000..9a7c872
--- /dev/null
+++ b/resources/src/mediawiki.skinning/content-narrow.less
@@ -0,0 +1,33 @@
+/* !important is used to ignore inline styling */
+/* Center clear tables */
+.mw-content-ltr table,
+.mw-content-rtl table {
+   float: none !important;
+   margin-left: auto !important;
+   margin-right: auto !important;
+}
+.mw-content-ltr table,
+.mw-content-rtl table {
+   margin: 1em 0;
+   overflow: auto;
+   overflow-y: hidden;
+   overflow-x: auto;
+   display: block;
+   max-width: 100% !important;
+}
+
+/* Center and clear thumbnails */
+div.thumb {
+   float: none;
+   clear: none;
+   margin: .5em auto;
+}
+div.thumbinner {
+   margin: 0 auto;
+   /* Make sure we don't overflow the viewport */
+   max-width: 100%;
+}
+div.thumbinner .thumbimage {
+   max-width: 100%;
+   height: auto;
+}
\ No newline at 

[MediaWiki-commits] [Gerrit] mediawiki...Kartographer[master]: Maps: Improve frame genertion

2017-01-12 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331942 )

Change subject: Maps: Improve frame genertion
..

Maps: Improve frame genertion

- Fix missing tnone
- Don't use align classes for fullwidth maps
- Closer emulation of structure as images use
  - No div for none aligned content
  - Makes sure we don't need to redefine floatleft/right and center
  - Use a single consistent 'content' part for framed and frameless
- Use a  element inside the  link.
  -  are one of few elements that feature replacement content.
  - replacement content automagically can keep aspect ratio using
content-fit, which is nice for mobile.
  - Now matches scaling logic for MF
  - Make more sense HTML wise

TODO:
 - I don't understand some of that 'staticframe' stuff
 - lots of commented code should be made actionable
 - probably need to fix the VE editor now.

Change-Id: I9909e47ecc430f384d0fc7166ebb555c093e936a
---
M includes/Tag/MapFrame.php
M modules/staticframe/staticframe.js
M styles/kartographer.less
3 files changed, 21 insertions(+), 59 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/42/331942/1

diff --git a/includes/Tag/MapFrame.php b/includes/Tag/MapFrame.php
index 38627eb..7ce9767 100644
--- a/includes/Tag/MapFrame.php
+++ b/includes/Tag/MapFrame.php
@@ -45,6 +45,7 @@
'left' => 'tleft',
'center' => 'center',
'right' => 'tright',
+   'none' => 'tnone',
];
 
$caption = $this->getText( 'text', null );
@@ -158,7 +159,9 @@
$containerClass = 'mw-kartographer-container';
if ( $fullWidth ) {
$containerClass .= ' mw-kartographer-full';
+   $this->align = 'none';
}
+   $attrs['class'] .= " {$containerClass}";
 
$bgUrl = 
"{$wgKartographerMapServer}/img/{$this->mapStyle},{$staticZoom},{$staticLat},{$staticLon},{$staticWidth}x{$this->height}.png";
if ( $this->showGroups ) {
@@ -167,27 +170,31 @@
$bgUrl .= 
"?domain={$wgServerName}={$title}={$groupList}";
}
 
-   $attrs['style'] = "background-image: url({$bgUrl});";
+   $mapElement = Html::rawElement( 'a', $attrs,
+   Html::rawElement( 'img', [
+   'src' => $bgUrl,
+   'width' => $staticWidth,
+   'height' => 
$this->height,
+   ] ) );
 
if ( !$framed ) {
-   $attrs['style'] .= " width: {$width}; height: 
{$height};";
-   $attrs['class'] .= " {$containerClass} 
{$alignClasses[$this->align]}";
-
-   return Html::rawElement( 'a', $attrs );
+   if ( $this->align === 'none' ) {
+   return $mapElement;
+   }
+   return Html::rawElement( 'div', [
+   'class' => 
"{$alignClasses[$this->align]}"
+   ], $mapElement );
}
-
-   $attrs['style'] .= " height: {$height};";
-   $containerClass .= " thumb {$thumbAlignClasses[$this->align]}";
 
$captionFrame = Html::rawElement( 'div', [ 'class' => 
'thumbcaption' ],
$this->parser->recursiveTagParse( $caption ) );
 
-   $mapDiv = Html::rawElement( 'a', $attrs );
-
-   return Html::rawElement( 'div', [ 'class' => $containerClass ],
+   return Html::rawElement( 'div', [
+   'class' => "thumb 
{$thumbAlignClasses[$this->align]}"
+   ],
Html::rawElement( 'div', [
'class' => 'thumbinner',
'style' => "width: {$width};",
-   ], $mapDiv . $captionFrame ) );
+   ], $mapElement . $captionFrame ) );
}
 }
diff --git a/modules/staticframe/staticframe.js 
b/modules/staticframe/staticframe.js
index ac36428..7cd23de 100644
--- a/modules/staticframe/staticframe.js
+++ b/modules/staticframe/staticframe.js
@@ -72,8 +72,7 @@
maps.pop().remove();
} );
 
-   // need to find 
.mw-kartographer-interactive:not(.mw-kartographer-map) for backward 
compatibility
-   $content.find( '.mw-kartographer-map, 
.mw-kartographer-interactive:not(.mw-kartographer-map)' ).each( function ( 
index ) {
+   $content.find( '.mw-kartographer-map' ).each( 

[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: Graph: cleanup styles a bit

2017-01-12 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331910 )

Change subject: Graph: cleanup styles a bit
..

Graph: cleanup styles a bit

- properly divide into agnostic vs client-js vs client-nojs
- remove duplicate display:block; on mw-graph-layover
- hide all layover content (play button, title, loader) when we don't
  have JS.

Change-Id: I1c2b6b0308f77d977b7dc5fcef05833bb600f5ec
---
M styles/common.less
1 file changed, 41 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph 
refs/changes/10/331910/1

diff --git a/styles/common.less b/styles/common.less
index 94c232e..ed36242 100644
--- a/styles/common.less
+++ b/styles/common.less
@@ -8,42 +8,45 @@
 /* TODO: This file has a lot of descending specificity and needs a cleanup */
 /* stylelint-disable no-descending-specificity */
 
-.client-js {
+.mw-graph {
+   display: inline-block;
+   border: 1px solid transparent;
+   position: relative;
 
-   .mw-graph {
+   .mw-graph-img,
+   canvas {
display: inline-block;
-   border: 1px solid transparent;
-   position: relative;
+   vertical-align: middle;
+   }
+}
 
-   .mw-graph-img,
-   canvas {
-   display: inline-block;
-   vertical-align: middle;
-   }
+.client-nojs {
+   .mw-graph-layover {
+   display: none;
+   }
+}
 
-   &.mw-graph-interactable {
-   &:hover {
-   cursor: pointer;
+.client-js {
+   .mw-graph-interactable {
+   &:hover {
+   cursor: pointer;
 
-   .mw-graph-hover-title {
-   display: block;
+   .mw-graph-hover-title {
+   display: block;
+   }
+
+   .mw-graph-layover {
+   background-color: @colorWhiteOpac;
+   }
+
+   .mw-graph-switch {
+   &.mw-graph-loading {
+   background-color: @colorWhite;
}
 
-   .mw-graph-layover {
-   display: block;
-   background-color: @colorWhiteOpac;
+   &:hover {
+   background-color: @colorWhite;
}
-
-   .mw-graph-switch {
-   &.mw-graph-loading {
-   background-color: @colorWhite;
-   }
-
-   &:hover {
-   background-color: @colorWhite;
-   }
-   }
-
}
}
}
@@ -65,17 +68,17 @@
left: 10px;
top: 10px;
}
+   }
 
-   .mw-graph-hover-title {
-   display: none;
-   position: absolute;
-   top: ~'calc( 50% - 17px )';
-   left: 1em;
-   right: 1em;
-   text-align: center;
-   font-size: 150%;
-   background-color: @colorWhite;
-   }
+   .mw-graph-hover-title {
+   display: none;
+   position: absolute;
+   top: ~'calc( 50% - 17px )';
+   left: 1em;
+   right: 1em;
+   text-align: center;
+   font-size: 150%;
+   background-color: @colorWhite;
}
 
/* common button style */

-- 
To view, visit https://gerrit.wikimedia.org/r/331910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c2b6b0308f77d977b7dc5fcef05833bb600f5ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: jquery.tablersorter: Sort invalid elements as -Infinity

2016-12-30 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329673 )

Change subject: jquery.tablersorter: Sort invalid elements as -Infinity
..

jquery.tablersorter: Sort invalid elements as -Infinity

NaN is problematic when sorting. We used 0 before, but that means that
these items get mixed in between 0 elements or in the middle of a column
when it has both negative and positive numbers. Therefor, sort as
-Infinity instead which is a proper number and will always sort to the
edge.

Bug: T154307
Change-Id: I4837669205a6c6d470f19b26d721efd2ccdcc3a0
---
M resources/src/jquery/jquery.tablesorter.js
M tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
M tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js
3 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/73/329673/1

diff --git a/resources/src/jquery/jquery.tablesorter.js 
b/resources/src/jquery/jquery.tablesorter.js
index 4da05e6..1b64237 100644
--- a/resources/src/jquery/jquery.tablesorter.js
+++ b/resources/src/jquery/jquery.tablesorter.js
@@ -1018,17 +1018,17 @@
s = out;
}
i = parseFloat( s.replace( /[, ]/g, '' ).replace( 
'\u2212', '-' ) );
-   return isNaN( i ) ? 0 : i;
+   return isNaN( i ) ? -Infinity : i;
},
 
formatFloat: function ( s ) {
var i = parseFloat( s );
-   return isNaN( i ) ? 0 : i;
+   return isNaN( i ) ? -Infinity : i;
},
 
formatInt: function ( s ) {
var i = parseInt( s, 10 );
-   return isNaN( i ) ? 0 : i;
+   return isNaN( i ) ? -Infinity : i;
},
 
clearTableBody: function ( table ) {
diff --git 
a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js 
b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
index 11ceeea2..5203def 100644
--- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
+++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js
@@ -88,7 +88,7 @@
[ '1.238.27.1', true, 1238027001, 'An IP address with small 
numbers' ],
[ '238.27.1', false, 238027001, 'A malformed IP Address' ],
[ '1', false, 1, 'A super malformed IP Address' ],
-   [ 'Just text', false, 0, 'A line with just text' ],
+   [ 'Just text', false, -Infinity, 'A line with just text' ],
[ '45.238.27.109Postfix', false, 45238027109, 'An IP address 
with a connected postfix' ],
[ '45.238.27.109 postfix', false, 45238027109, 'An IP address 
with a seperated postfix' ]
];
@@ -177,22 +177,22 @@
[ '2000',   false, 0, 'Plain 4-digit year' ],
[ '2000-01',false, 0, 'Year with month' ],
[ '2000-01-01', true, 94668480, 'Year with month and day' ],
-   [ '2000-13-01', true, 0, 'Non existant month' ],
-   [ '2000-01-32', true, 0, 'Non existant day' ],
+   [ '2000-13-01', true, -Infinity, 'Non existant month' ],
+   [ '2000-01-32', true, -Infinity, 'Non existant day' ],
[ '2000-01-01T12:30:30',true, 94672983, 
'Date with a time' ],
[ '2000-01-01T12:30:30Z',   true, 94672983, 'Date with 
a UTC+0 time' ],
-   [ '2000-01-01T24:30:30Z',   true, 0, 'Date with invalid 
hours' ],
-   [ '2000-01-01T12:60:30Z',   true, 0, 'Date with invalid 
minutes' ],
+   [ '2000-01-01T24:30:30Z',   true, -Infinity, 'Date with 
invalid hours' ],
+   [ '2000-01-01T12:60:30Z',   true, -Infinity, 'Date with 
invalid minutes' ],
[ '2000-01-01T12:30:61Z',   true, 94672980, 'Date with 
invalid amount of seconds, drops seconds' ],
[ '2000-01-01T23:59:59Z',   true, 946771199000, 'Edges of 
time' ],
[ '2000-01-01T12:30:30.111Z',   true, 946729830111, 'Date with 
milliseconds' ],
[ '2000-01-01T12:30:30.1Z', true, 946729830111, 'Date with 
too high precision' ],
-   [ '2000-01-01T12:30:30,111Z',   true, 0, 'Date with 
milliseconds and , separator' ],
+   [ '2000-01-01T12:30:30,111Z',   true, -Infinity, 'Date with 
milliseconds and , separator' ],
[ '2000-01-01T12:30:30+01:00',  true, 94672623, 'Date time 
in UTC+1' ],
[ '2000-01-01T12:30:30+01:30',  true, 94672443, 'Date time 
in UTC+1:30' ],
[ '2000-01-01T12:30:30-01:00',  true, 94673343, 'Date time 
in UTC-1' ],
[ 

[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: The direction of token field should be ltr

2016-12-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328152 )

Change subject: The direction of token field should be ltr
..

The direction of token field should be ltr

Before it was shown in RTL in RTL wikis. The code is always a six digit
number or a scratch code in Latin (English) characters.
This textbox should thus never be RTL.

Bug: T153556
Change-Id: Idaa3f1a54e749929e0779e7478fca2896f5d5f0b
---
M OATHAuth.hooks.php
M special/SpecialOATHDisable.php
M special/SpecialOATHEnable.php
M special/SpecialOATHLogin.php
4 files changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/52/328152/1

diff --git a/OATHAuth.hooks.php b/OATHAuth.hooks.php
index 8718224..331373f 100644
--- a/OATHAuth.hooks.php
+++ b/OATHAuth.hooks.php
@@ -45,6 +45,7 @@
'cssClass' => 'loginText',
'id' => 'wpOATHToken',
'size' => 20,
+   'dir' => 'ltr',
'autofocus' => true,
'persistent' => false,
'autocomplete' => false,
diff --git a/special/SpecialOATHDisable.php b/special/SpecialOATHDisable.php
index d177867..14d9449 100644
--- a/special/SpecialOATHDisable.php
+++ b/special/SpecialOATHDisable.php
@@ -75,6 +75,7 @@
'type' => 'text',
'label-message' => 'oathauth-entertoken',
'name' => 'token',
+   'dir' => 'ltr',
'required' => true,
'autofocus' => true,
],
diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index 7318d6a..6217c18 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -135,6 +135,7 @@
'label-message' => 'oathauth-entertoken',
'name' => 'token',
'section' => 'step4',
+   'dir' => 'ltr',
],
'returnto' => [
'type' => 'hidden',
diff --git a/special/SpecialOATHLogin.php b/special/SpecialOATHLogin.php
index 9a0f18e..4d04c4d 100644
--- a/special/SpecialOATHLogin.php
+++ b/special/SpecialOATHLogin.php
@@ -65,6 +65,7 @@
'default' => '',
'label-message' => 'oathauth-entertoken',
'name' => 'token',
+   'dir' => 'ltr',
'required' => true,
'autofocus' => true,
],

-- 
To view, visit https://gerrit.wikimedia.org/r/328152
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idaa3f1a54e749929e0779e7478fca2896f5d5f0b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add support for PHP7 random_bytes in favor of mcrypt_create_iv

2016-12-02 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324897

Change subject: Add support for PHP7 random_bytes in favor of mcrypt_create_iv
..

Add support for PHP7 random_bytes in favor of mcrypt_create_iv

Bug: T143788
Change-Id: Ib49eab7983a82966d167f03761e32461f9b9f602
---
M includes/libs/CryptRand.php
1 file changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/324897/1

diff --git a/includes/libs/CryptRand.php b/includes/libs/CryptRand.php
index 10088f2..0d3613a 100644
--- a/includes/libs/CryptRand.php
+++ b/includes/libs/CryptRand.php
@@ -243,6 +243,21 @@
}
 
if ( strlen( $buffer ) < $bytes ) {
+   // If available make use of PHP 7's random_bytes
+   // On Linux, getrandom syscall will be used if 
available.
+   // On Windows CryptGenRandom will always be used
+   // On other platforms, /dev/urandom will be used.
+   // All error situations will throw Exceptions and or 
Errors
+   if ( function_exists( 'random_bytes' ) ) {
+   $rem = $bytes - strlen( $buffer );
+   $buffer .= random_bytes( $rem );
+   }
+   if ( strlen( $buffer ) >= $bytes ) {
+   $this->strong = true;
+   }
+   }
+
+   if ( strlen( $buffer ) < $bytes ) {
// If available make use of mcrypt_create_iv URANDOM 
source to generate randomness
// On unix-like systems this reads from /dev/urandom 
but does it without any buffering
// and bypasses openbasedir restrictions, so it's 
preferable to reading directly

-- 
To view, visit https://gerrit.wikimedia.org/r/324897
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib49eab7983a82966d167f03761e32461f9b9f602
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: OAuth -> OATH for used tokens memcache

2016-11-24 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323381

Change subject: OAuth -> OATH for used tokens memcache
..

OAuth -> OATH for used tokens memcache

Bug: T151536
Change-Id: Ib059cef70a86c6f0430719a799ce20c1b869d316
---
M OATHAuthKey.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/81/323381/1

diff --git a/OATHAuthKey.php b/OATHAuthKey.php
index 0a4be15..f2f8834 100644
--- a/OATHAuthKey.php
+++ b/OATHAuthKey.php
@@ -90,7 +90,7 @@
// Prevent replay attacks
$memc = ObjectCache::newAnything( [] );
$uid = CentralIdLookup::factory()->centralIdFromLocalUser( 
$user->getUser() );
-   $memcKey = wfMemcKey( 'oauthauth', 'usedtokens', $uid );
+   $memcKey = wfMemcKey( 'oathauth', 'usedtokens', $uid );
$lastWindow = (int)$memc->get( $memcKey );
 
$retval = false;

-- 
To view, visit https://gerrit.wikimedia.org/r/323381
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib059cef70a86c6f0430719a799ce20c1b869d316
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Disable page was using the OAuth throttler instead of OATH

2016-11-24 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323380

Change subject: Disable page was using the OAuth throttler instead of OATH
..

Disable page was using the OAuth throttler instead of OATH

Follow-up to: Icbe5cdf
Bug: T151536

Change-Id: Id25eaa86f31aab20b1e597c0711b71ad109fbf77
---
M special/SpecialOATHDisable.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/80/323380/1

diff --git a/special/SpecialOATHDisable.php b/special/SpecialOATHDisable.php
index 2c06f22..f4bb01a 100644
--- a/special/SpecialOATHDisable.php
+++ b/special/SpecialOATHDisable.php
@@ -100,7 +100,7 @@
// Don't increase pingLimiter, just check for limit exceeded.
if ( $this->OATHUser->getUser()->pingLimiter( 'badoath', 0 ) ) {
// Arbitrary duration given here
-   return [ 'oauthauth-throttled', Message::durationParam( 
60 ) ];
+   return [ 'oathauth-throttled', Message::durationParam( 
60 ) ];
}
 
if ( !$this->OATHUser->getKey()->verifyToken( 
$formData['token'], $this->OATHUser ) ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/323380
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id25eaa86f31aab20b1e597c0711b71ad109fbf77
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: typo in comment: OAuth -> Oath

2016-11-24 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/323379

Change subject: typo in comment: OAuth -> Oath
..

typo in comment: OAuth -> Oath

Bug: T151536
Change-Id: I39e3a3cca04be79f735e5e2050cf573ec9073169
---
M OATHAuthKey.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/79/323379/1

diff --git a/OATHAuthKey.php b/OATHAuthKey.php
index 0a4be15..e7e397d 100644
--- a/OATHAuthKey.php
+++ b/OATHAuthKey.php
@@ -3,7 +3,7 @@
 /**
  * Class representing a two-factor key
  *
- * Keys can be tied to OAUTHUsers
+ * Keys can be tied to OATHUsers
  *
  * @ingroup Extensions
  */

-- 
To view, visit https://gerrit.wikimedia.org/r/323379
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39e3a3cca04be79f735e5e2050cf573ec9073169
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[wmf/1.29.0-wmf.3]: Correct flex display for thumbnail contents on mobile

2016-11-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322638

Change subject: Correct flex display for thumbnail contents on mobile
..

Correct flex display for thumbnail contents on mobile

Follow-up to: Ib6c1a4a
Bug: T150706
Change-Id: Iccfa26c95ed579b203c1e337b1e60b809ace488f
(cherry picked from commit a23f9ffeeba5034028ed546c9fe96134c320d4f9)
---
M resources/skins.minerva.content.styles/hacks.less
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/38/322638/1

diff --git a/resources/skins.minerva.content.styles/hacks.less 
b/resources/skins.minerva.content.styles/hacks.less
index f426485..7d4dc9e 100644
--- a/resources/skins.minerva.content.styles/hacks.less
+++ b/resources/skins.minerva.content.styles/hacks.less
@@ -134,14 +134,14 @@
}
// Deal with Template:Multiple_image.  T38030 and T148505
.thumb .thumbinner {
-   > div {
-   .flex-display( flex );
-   justify-content: center;
-   flex-wrap: wrap;
-   align-content: flex-start;
-   }
+   .flex-display( flex );
+   justify-content: center;
+   flex-wrap: wrap;
+   align-content: flex-start;
+
> .thumbcaption {
.flex( 1, 0, 100% );
+   display: block;
}
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/322638
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccfa26c95ed579b203c1e337b1e60b809ace488f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.29.0-wmf.3
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Improve legibility of secret and tokens

2016-11-17 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322115

Change subject: Improve legibility of secret and tokens
..

Improve legibility of secret and tokens

- add space char seperators and create groups of 4 chars
- use monospace font
- increase the size of the codes slightly

Bug: T150907
Change-Id: Idb99f48b2d9eae6acacca80be61203ca6404782c
---
M OATHAuthKey.php
M modules/ext.oath.showqrcode.styles.css
M special/SpecialOATHEnable.php
3 files changed, 36 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/15/322115/1

diff --git a/OATHAuthKey.php b/OATHAuthKey.php
index 0a4be15..95566b1 100644
--- a/OATHAuthKey.php
+++ b/OATHAuthKey.php
@@ -65,6 +65,13 @@
}
 
/**
+* @return String
+*/
+   public function getSecretForDisplay() {
+   return $this->tokenFormatterFunction( $this->secret['secret'] );
+   }
+
+   /**
 * @return array
 */
public function getScratchTokens() {
@@ -72,6 +79,27 @@
}
 
/**
+* Retrieve current scratch tokens for display purposes
+*
+* The characters of the token are split in groups of 4
+*
+* @return array
+*/
+   public function getScratchTokensForDisplay() {
+   return array_map( [$this, 'tokenFormatterFunction'], 
$this->scratchTokens );
+   }
+
+   /**
+* Formats a key or scratch token by creating groups of 4 seperated by 
space characters
+* @param string $token Token to format
+*
+* @return string The token formatted for display
+*/
+   private function tokenFormatterFunction( $token ) {
+   return implode( ' ', str_split( $token, 4 ) );
+   }
+
+   /**
 * Verify a token against the secret or scratch tokens
 *
 * @param string $token Token to verify
diff --git a/modules/ext.oath.showqrcode.styles.css 
b/modules/ext.oath.showqrcode.styles.css
index 7d8f0e5..dbb01c4 100644
--- a/modules/ext.oath.showqrcode.styles.css
+++ b/modules/ext.oath.showqrcode.styles.css
@@ -1,3 +1,9 @@
 .client-nojs .mw-display-qrcode {
 display: none;
 }
+
+kbd {
+font-family: monospace;
+white-space: nowrap;
+font-size: 120%;
+}
diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index f37aafc..6fe3cb7 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -117,7 +117,7 @@
'' . $this->msg( 
'oathauth-account' )->escaped() . ''
. $this->OATHUser->getAccount() . 
''
. '' . $this->msg( 
'oathauth-secret' )->escaped() . ''
-   . $key->getSecret() . '',
+   . '' . $key->getSecretForDisplay() 
. '',
'raw' => true,
'section' => 'step2',
],
@@ -180,7 +180,7 @@
private function createResourceList( $resources ) {
$resourceList = '';
foreach ( $resources as $resource ) {
-   $resourceList .= Html::rawElement( 'li', [], $resource 
);
+   $resourceList .= Html::rawElement( 'li', [], 
HTML::rawElement( 'kbd', [], $resource ) );
}
return Html::rawElement( 'ul', [], $resourceList );
}

-- 
To view, visit https://gerrit.wikimedia.org/r/322115
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb99f48b2d9eae6acacca80be61203ca6404782c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Switch OATH to OOUI

2016-11-17 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322100

Change subject: Switch OATH to OOUI
..

Switch OATH to OOUI

Bug: T150863
Change-Id: If7fe0f8bd4908823a175373b340dce28e90512b2
---
M special/SpecialOATHDisable.php
M special/SpecialOATHEnable.php
M special/SpecialOATHLogin.php
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/00/322100/1

diff --git a/special/SpecialOATHDisable.php b/special/SpecialOATHDisable.php
index 0a75b27..68f700d 100644
--- a/special/SpecialOATHDisable.php
+++ b/special/SpecialOATHDisable.php
@@ -43,7 +43,7 @@
 * @return string
 */
protected function getDisplayFormat() {
-   return 'vform';
+   return 'ooui';
}
 
/**
diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index f37aafc..5f3490e 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -46,7 +46,7 @@
 * @return string
 */
protected function getDisplayFormat() {
-   return 'vform';
+   return 'ooui';
}
 
/**
diff --git a/special/SpecialOATHLogin.php b/special/SpecialOATHLogin.php
index eae24bb..c7814c3 100644
--- a/special/SpecialOATHLogin.php
+++ b/special/SpecialOATHLogin.php
@@ -45,7 +45,7 @@
 * @return string
 */
public function getDisplayFormat() {
-   return 'vform';
+   return 'ooui';
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/322100
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7fe0f8bd4908823a175373b340dce28e90512b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Don't allow scratch tokens when enrolling for 2 auth.

2016-11-16 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/322009

Change subject: Don't allow scratch tokens when enrolling for 2 auth.
..

Don't allow scratch tokens when enrolling for 2 auth.

Validating with a scratch code is probably a "giant trap that newbies
could fall into".

Bug: T150824
Change-Id: I5710b151d7682e4cdb0b6a692f7b2c108f051caf
---
M special/SpecialOATHEnable.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/09/322009/1

diff --git a/special/SpecialOATHEnable.php b/special/SpecialOATHEnable.php
index 700d78b..feea477 100644
--- a/special/SpecialOATHEnable.php
+++ b/special/SpecialOATHEnable.php
@@ -157,7 +157,7 @@
/** @var OATHAuthKey $key */
$key = $this->getRequest()->getSessionData( 'oathauth_key' );
 
-   if ( !$key->verifyToken( $formData['token'], $this->OATHUser ) 
) {
+   if ( OATHAuthKey::MAIN_TOKEN !== $key->verifyToken( 
$formData['token'], $this->OATHUser ) ) {
return [ 'oathauth-failedtovalidateoauth' ];
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/322009
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5710b151d7682e4cdb0b6a692f7b2c108f051caf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...OATHAuth[master]: Trim surrounding whitespace and seperators from tokens

2016-11-16 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/321998

Change subject: Trim surrounding whitespace and seperators from tokens
..

Trim surrounding whitespace and seperators from tokens

Google authenticator uses a space character as a group seperator.
We can thus expect users to enter such a separator and we should not
fail on that. Might as well trim whitespace too, as that is another
oft occuring user input mistake, that should not affect functionality.

Bug: T150603
Change-Id: I7334ed5dfaf933e61831438e2f86aa979cf9f51b
---
M OATHAuthKey.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OATHAuth 
refs/changes/98/321998/1

diff --git a/OATHAuthKey.php b/OATHAuthKey.php
index 63225d3..0a4be15 100644
--- a/OATHAuthKey.php
+++ b/OATHAuthKey.php
@@ -98,6 +98,11 @@
Base32::decode( $this->secret['secret'] ),
$this->secret['period'], -$wgOATHAuthWindowRadius, 
$wgOATHAuthWindowRadius
);
+
+   // Remove any whitespace from the received token, which can be 
an intended group seperator
+   // or trimmeable whitespace
+   $token = preg_replace( '/\s+/', '', $token );
+
// Check to see if the user's given token is in the list of 
tokens generated
// for the time window.
foreach ( $results as $window => $result ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/321998
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7334ed5dfaf933e61831438e2f86aa979cf9f51b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OATHAuth
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Correct flex display for thumbnail contents on mobile

2016-11-15 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/321708

Change subject: Correct flex display for thumbnail contents on mobile
..

Correct flex display for thumbnail contents on mobile

Follow-up to: Ib6c1a4a
Bug: T150706

Change-Id: Iccfa26c95ed579b203c1e337b1e60b809ace488f
---
M resources/skins.minerva.content.styles/hacks.less
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/08/321708/1

diff --git a/resources/skins.minerva.content.styles/hacks.less 
b/resources/skins.minerva.content.styles/hacks.less
index f426485..7d4dc9e 100644
--- a/resources/skins.minerva.content.styles/hacks.less
+++ b/resources/skins.minerva.content.styles/hacks.less
@@ -134,14 +134,14 @@
}
// Deal with Template:Multiple_image.  T38030 and T148505
.thumb .thumbinner {
-   > div {
-   .flex-display( flex );
-   justify-content: center;
-   flex-wrap: wrap;
-   align-content: flex-start;
-   }
+   .flex-display( flex );
+   justify-content: center;
+   flex-wrap: wrap;
+   align-content: flex-start;
+
> .thumbcaption {
.flex( 1, 0, 100% );
+   display: block;
}
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/321708
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccfa26c95ed579b203c1e337b1e60b809ace488f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Initialize gallery slideshow on wikipage.content hook

2016-11-14 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/321500

Change subject: Initialize gallery slideshow on wikipage.content hook
..

Initialize gallery slideshow on wikipage.content hook

The slideshow mode of gallery tag was triggered upon document.ready,
instead of on wikipage.content. For this reason, after editing and
saving one of these galleries in VE, you would loose your slideshow
mode and default back to packed mode.

Change-Id: I411703b3c1cafbd7d763cbaa8bc9585924c51030
---
M resources/src/mediawiki/page/gallery-slideshow.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/00/321500/1

diff --git a/resources/src/mediawiki/page/gallery-slideshow.js 
b/resources/src/mediawiki/page/gallery-slideshow.js
index cf448b0..26f568b 100644
--- a/resources/src/mediawiki/page/gallery-slideshow.js
+++ b/resources/src/mediawiki/page/gallery-slideshow.js
@@ -450,8 +450,8 @@
};
 
// Bootstrap all slideshow galleries
-   $( function () {
-   $( '.mw-gallery-slideshow' ).each( function () {
+   mw.hook( 'wikipage.content' ).add( function ( $content ) {
+   $content.find( '.mw-gallery-slideshow' ).each( function () {
/*jshint -W031 */
new mw.GallerySlideshow( this );
/*jshint +W031 */

-- 
To view, visit https://gerrit.wikimedia.org/r/321500
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I411703b3c1cafbd7d763cbaa8bc9585924c51030
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MultimediaViewer[master]: Skip deocorative images in Multimedia viewer

2016-11-11 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/320987

Change subject: Skip deocorative images in Multimedia viewer
..

Skip deocorative images in Multimedia viewer

Let's skip any images that we know are purely decorative and thus not
likely to be part of what we consider 'content'.

For an example see https://meta.wikimedia.org/wiki/CopyPatrol

Change-Id: Id3c17c765afd9cbc33609fbfc9e5fba32749aed2
---
M resources/mmv/mmv.bootstrap.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer 
refs/changes/87/320987/1

diff --git a/resources/mmv/mmv.bootstrap.js b/resources/mmv/mmv.bootstrap.js
index 978ad6d..29fe721 100644
--- a/resources/mmv/mmv.bootstrap.js
+++ b/resources/mmv/mmv.bootstrap.js
@@ -161,6 +161,11 @@
 * @return {boolean}
 */
MMVB.isAllowedThumb = function ( $thumb ) {
+   // images that set explicit empty string alt are considered to 
be decorative
+   // and can thus be excluded
+   if ( $thumb.attr( 'alt' ) === '' ) {
+   return false;
+   }
// .metadata means this is inside an informational template 
like {{refimprove}} on enwiki.
// .noviewer means MediaViewer has been specifically disabled 
for this image
// .noarticletext means we are on an error page for a 
non-existing article, the image is part of some

-- 
To view, visit https://gerrit.wikimedia.org/r/320987
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3c17c765afd9cbc33609fbfc9e5fba32749aed2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Rework Template:Multiple_image hack

2016-11-02 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/319474

Change subject: Rework Template:Multiple_image hack
..

Rework Template:Multiple_image hack

- Move it into the hacks file where it belongs.
- Only apply when under tablet-width
- Add comment referring to tickets for future reference
- Use display box to
 - align center
 - wrap sibling images to the next line if needed
 - make sure a thumbcaption child is always on it's own line

Bug: T148505
Change-Id: Ib6c1a4af34157384aded880c13078a647e342588
---
M resources/skins.minerva.content.styles/hacks.less
M resources/skins.minerva.content.styles/thumbnails.less
2 files changed, 12 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/74/319474/1

diff --git a/resources/skins.minerva.content.styles/hacks.less 
b/resources/skins.minerva.content.styles/hacks.less
index 41950cc..f426485 100644
--- a/resources/skins.minerva.content.styles/hacks.less
+++ b/resources/skins.minerva.content.styles/hacks.less
@@ -132,5 +132,17 @@
}
}
}
+   // Deal with Template:Multiple_image.  T38030 and T148505
+   .thumb .thumbinner {
+   > div {
+   .flex-display( flex );
+   justify-content: center;
+   flex-wrap: wrap;
+   align-content: flex-start;
+   }
+   > .thumbcaption {
+   .flex( 1, 0, 100% );
+   }
+   }
}
 }
diff --git a/resources/skins.minerva.content.styles/thumbnails.less 
b/resources/skins.minerva.content.styles/thumbnails.less
index 25a7507..8da82bd 100644
--- a/resources/skins.minerva.content.styles/thumbnails.less
+++ b/resources/skins.minerva.content.styles/thumbnails.less
@@ -21,12 +21,6 @@
margin: 0 auto;
// !important is needed because of Bug T87198 for 
example
max-width: 100% !important;
-
-   > div {
-   float: none !important;
-   width: auto !important;
-   clear: both !important;
-   }
}
 
/* bug 20030 */

-- 
To view, visit https://gerrit.wikimedia.org/r/319474
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6c1a4af34157384aded880c13078a647e342588
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Add default page specific classes to minerva skin

2016-11-01 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/319044

Change subject: Add default page specific classes to minerva skin
..

Add default page specific classes to minerva skin

All our skins add these and they are useful for both scripts and
styling. Not having them only in Minverva is annoying and inconsistent.

Change-Id: I2446e729d93ab8870c139b8e71ebf6d20b0f11d4
---
M includes/skins/SkinMinerva.php
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/44/319044/1

diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 47eac56..ef8cba1 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -240,10 +240,9 @@
 * @return string
 */
public function getPageClasses( $title ) {
-   $className = $this->getMode();
-   if ( $title->isMainPage() ) {
-   $className .= ' page-Main_Page ';
-   } elseif ( $title->isSpecialPage() ) {
+   $className = parent::getPageClasses();
+   $className .= ' ' . $this->getMode();
+   if ( $title->isSpecialPage() ) {
$className .= ' mw-mf-special ';
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/319044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2446e729d93ab8870c139b8e71ebf6d20b0f11d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CodeEditor[master]: Remove inline CodeEditor for

2016-10-31 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/318913

Change subject: Remove inline CodeEditor for 
..

Remove inline CodeEditor for 

This was an unfinished module to enable the CodeEditor to do inline
editing of  blocks. It was never finished and I think
that with the VE and WE 2017 work, it likely will never be finished
either. For that reason, it is better to remove it altogether.

Change-Id: I83714188a53d2ca6bb7bf0dc6d0c89b7fb45a47a
---
M CodeEditor.hooks.php
M extension.json
D modules/ext.codeEditor.geshi.css
D modules/ext.codeEditor.geshi.js
4 files changed, 0 insertions(+), 180 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor 
refs/changes/13/318913/1

diff --git a/CodeEditor.hooks.php b/CodeEditor.hooks.php
index 7ae7396..fb21b45 100644
--- a/CodeEditor.hooks.php
+++ b/CodeEditor.hooks.php
@@ -44,12 +44,4 @@
}
return true;
}
-
-   public static function onBeforePageDisplay( $out, $skin ) {
-   global $wgCodeEditorGeshiIntegration;
-   if ( $wgCodeEditorGeshiIntegration ) {
-   $out->addModules( 'ext.codeEditor.geshi' );
-   }
-   return true;
-   }
 }
diff --git a/extension.json b/extension.json
index ef0b047..2f706ce 100644
--- a/extension.json
+++ b/extension.json
@@ -101,20 +101,6 @@
"ace/mode-scala.js"
],
"dependencies": "ext.codeEditor.ace"
-   },
-   "ext.codeEditor.geshi": {
-   "scripts": [
-   "ext.codeEditor.geshi.js"
-   ],
-   "styles": [
-   "ext.codeEditor.geshi.css"
-   ],
-   "messages": [
-   "editsection",
-   "savearticle"
-   ],
-   "dependencies": "mediawiki.api.parse",
-   "group": "ext.wikiEditor"
}
},
"ResourceFileModulePaths": {
diff --git a/modules/ext.codeEditor.geshi.css b/modules/ext.codeEditor.geshi.css
deleted file mode 100644
index 30e17cf..000
--- a/modules/ext.codeEditor.geshi.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.mw-geshi .mw-editsection {
-   float: right;
-}
diff --git a/modules/ext.codeEditor.geshi.js b/modules/ext.codeEditor.geshi.js
deleted file mode 100644
index 7dd99d0..000
--- a/modules/ext.codeEditor.geshi.js
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- * This is experimental and does not yet actually save anything back.
- * Has to be manually enabled.
- * Needs some code de-dup with the full-page JS/CSS page editing.
- */
-/*global ace */
-( function ( $, mw ) {
-
-$( function () {
-   var $sources, setupEditor, openEditor;
-
-   $sources = $( '.mw-geshi' );
-
-   if ( $sources.length > 0 ) {
-   setupEditor = function ( $div ) {
-   var $link, $edit;
-
-   $link = $( '' )
-   .text( mw.msg( 'editsection' ) )
-   .attr( 'href', '#' )
-   .attr( 'title', 'Edit this code section' )
-   .click( function ( event ) {
-   openEditor( $div );
-   event.preventDefault();
-   } );
-   $edit = $( '' )
-   .addClass( 'mw-editsection' )
-   .append( '[' )
-   .append( $link )
-   .append( ']' );
-   $div.prepend( $edit );
-   };
-
-   openEditor = function ( $div ) {
-   var $main, geshiLang, matches, $label, $langDropDown, 
$xcontainer, codeEditor;
-
-   $main = $div.find( 'div' );
-   geshiLang = null;
-   matches = /(?:^| )source-([a-z0-9_-]+)/.exec( 
$main.attr( 'class' ) );
-
-   if ( matches ) {
-   geshiLang = matches[ 1 ];
-   }
-   mw.loader.using( 'ext.codeEditor.ace.modes', function 
() {
-   var map, $container, $save, $cancel, $controls, 
setLanguage, closeEditor;
-
-   // @fixme de-duplicate
-   map = {
-   c: 'c_cpp',
-   cpp: 'c_cpp',
-   clojure: 'clojure',
-   csharp: 'csharp',
-   css: 'css',
- 

[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: [WIP] Provide fallback content

2016-10-22 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/317313

Change subject: [WIP] Provide  fallback content
..

[WIP] Provide  fallback content

Provide some fallback content inside the Html5 video/audio element,
for the benefit of older browser that do no support such content.

- This is a lot of bytes. worth it ?
- What does this mean for parsoid ?
- I reused some of the playbutton code
- shouldn't we flip the links. Make the image the play link, and use
  another description below the image to link to the file ?
- Do we need a "you should upgrade to a modern browser" text ?

Bug: T148586
Change-Id: Iea18f5a9ffdeb5b699c283fccf7ddf063440ab86
---
M TimedMediaTransformOutput.php
M resources/PopUpThumbVideo.css
M resources/ext.tmh.player.styles.less
3 files changed, 74 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/13/317313/1

diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php
index 215754d..cff33ea 100644
--- a/TimedMediaTransformOutput.php
+++ b/TimedMediaTransformOutput.php
@@ -351,12 +351,14 @@
}
 
// Build the video tag output:
-   $s = Html::rawElement( $this->getTagName(), 
$this->getMediaAttr( $sizeOverride, $autoPlay ),
+   $s = Html::rawElement( $this->getTagName() , 
$this->getMediaAttr( $sizeOverride, $autoPlay ),
// The set of media sources:
self::htmlTagSet( 'source', $mediaSources ) .
 
// Timed text:
-   self::htmlTagSet( 'track', $mediaTracks )
+   self::htmlTagSet( 'track', $mediaTracks ) .
+
+   $this->getVideoElementFallbackContent()
);
 
if ( TimedMediaHandlerHooks::activePlayerMode() === 'videojs' ) 
{
@@ -370,6 +372,42 @@
], $s );
}
 
+   function getVideoElementFallbackContent() {
+   if ( TimedMediaHandlerHooks::activePlayerMode() === 'mwembed' ) 
{
+   return '';
+   }
+   // Build fallback content
+   return Xml::tags( 'div', [
+   'class' => 'mw-tmh-fallback'
+   ],  Xml::tags( 'a', [
+   'href' => $this->file->getTitle()->getLocalUrl()
+   ], Xml::tags( 'img', [
+   'alt' => $this->file->getTitle(),
+   'style' => "width:" . $this->getPlayerWidth() . 
"px;height:" .
+   
$this->getPlayerHeight() . "px",
+   'src' =>  $this->getUrl(),
+   ], '' ))
+   .
+   // For non-HTML5 browsers provide a link to the asset:
+   Xml::tags( 'a', [
+   'href'=> $this->file->getUrl(),
+   'title' => wfMessage( 
'timedmedia-play-media' )->escaped(),
+   'target' => 'new'
+   ],
+   Xml::tags( 'span', [
+   'class' => 'play-btn-large'
+   ],
+   // Have some sort of text for lynx & 
screen readers.
+   Html::element(
+   'span',
+   [ 'class' => 'mw-tmh-playtext' 
],
+   wfMessage( 
'timedmedia-play-media' )->text()
+   )
+   )
+   )
+   );
+   }
+
/**
 * Get poster.
 * @param $width Integer width of poster. Should not equal $this->width.
diff --git a/resources/PopUpThumbVideo.css b/resources/PopUpThumbVideo.css
index 5f97d7f..d9ad6bf 100644
--- a/resources/PopUpThumbVideo.css
+++ b/resources/PopUpThumbVideo.css
@@ -1,4 +1,7 @@
 .PopUpMediaTransform a .play-btn-large {
+   position: absolute;
+   cursor: pointer;
+   border: none !important;
top: 50%;
left : 50%;
width: 70px;
diff --git a/resources/ext.tmh.player.styles.less 
b/resources/ext.tmh.player.styles.less
index b4fa311..9d58c56 100644
--- a/resources/ext.tmh.player.styles.less
+++ b/resources/ext.tmh.player.styles.less
@@ -19,6 +19,37 @@
display: table-cell;
 }
 
+.mw-tmh-fallback {
+   margin: 0;
+   padding: 0;
+   position: relative;
+   display: inline-block;
+
+   .play-btn-large {
+   position: absolute;
+   cursor: pointer;
+   border: none;
+   top: 50%;
+

[MediaWiki-commits] [Gerrit] mediawiki...SyntaxHighlight_GeSHi[master]: Convert SyntaxHighlight names to Ace names

2016-10-21 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/317150

Change subject: Convert SyntaxHighlight names to Ace names
..

Convert SyntaxHighlight names to Ace names

Provide a translation from Syntaxhighlight compatible Pygments and
GeSHi language names to CodeEditor compatible Ace lexer names

Now when you select php4, the CodeEditor will use the Ace lexer php,
instead of falling back to text mode.

Bug: T148515
Change-Id: Ibc209f97318614f764457726f8d55f4e15276d79
---
M ResourceLoaderGeSHiVisualEditorModule.php
A SyntaxHighlight_GeSHi.ace.php
M extension.json
M modules/ve-syntaxhighlight/ve.dm.MWSyntaxHighlightNode.js
M modules/ve-syntaxhighlight/ve.ui.MWSyntaxHighlightDialog.js
5 files changed, 228 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/50/317150/1

diff --git a/ResourceLoaderGeSHiVisualEditorModule.php 
b/ResourceLoaderGeSHiVisualEditorModule.php
index 123fcd1..64c1e41 100644
--- a/ResourceLoaderGeSHiVisualEditorModule.php
+++ b/ResourceLoaderGeSHiVisualEditorModule.php
@@ -29,8 +29,18 @@
$scripts = parent::getScript( $context );
 
return $scripts . Xml::encodeJsCall(
-   've.dm.MWSyntaxHighlightNode.static.addLanguages', 
array(
-   $this->getLanguages()
+   
've.dm.MWSyntaxHighlightNode.static.addPygmentsLanguages', array(
+   $this->getPygmentsLanguages()
+   ),
+   ResourceLoader::inDebugMode()
+   ) . Xml::encodeJsCall(
+   
've.dm.MWSyntaxHighlightNode.static.addGeshiToPygmentsMap', array(
+   GeSHi::$compatibleLexers
+   ),
+   ResourceLoader::inDebugMode()
+   ) . Xml::encodeJsCall(
+   
've.dm.MWSyntaxHighlightNode.static.addPygmentsToAceMap', array(
+   SyntaxHighlightAce::getPygmentsToAceMap()
),
ResourceLoader::inDebugMode()
);
@@ -47,9 +57,9 @@
 * Get a full list of available langauges
 * @return array
 */
-   private function getLanguages() {
+   private function getPygmentsLanguages() {
$lexers = require __DIR__ . '/SyntaxHighlight_GeSHi.lexers.php';
-   return array_merge( $lexers, array_keys( 
GeSHi::$compatibleLexers ) );
+   return $lexers;
}
 
public function enableModuleContentVersion() {
diff --git a/SyntaxHighlight_GeSHi.ace.php b/SyntaxHighlight_GeSHi.ace.php
new file mode 100644
index 000..2d358ea
--- /dev/null
+++ b/SyntaxHighlight_GeSHi.ace.php
@@ -0,0 +1,174 @@
+http://www.gnu.org/copyleft/gpl.html
+ */
+
+/**
+ * Class provides functionality to map Ace lexer definitions
+ */
+class SyntaxHighlightAce
+ {
+   /** @var array This map is inverted, because it is easier to maintain 
this way */
+   private static $aceLexers = [
+   'ABAP'  =>  [ 'abap' ],
+   'ABC'   =>  [],
+   'ActionScript'  =>  [ 'actionscript', 'actionscript3' ],
+   'ADA'   =>  [ 'ada', 'ada2005', 'ada95' ],
+   'Apache_Conf'   =>  [ 'apache', 'apacheconf', 'aconf'],
+   'AsciiDoc'  =>  [],
+   'Assembly_x86'  =>  [ 'nasm' ],
+   'AutoHotKey'=>  [ 'autohotkey', 'ah' ],
+   'BatchFile' =>  [ 'bat', 'batch', 'dosbatch', 
'winbatch' ],
+   'C_Cpp' =>  [ 'cpp', 'c++' ],
+   'C9Search'  =>  [],
+   'Cirru' =>  [ 'cirru' ],
+   'Clojure'   =>  [ 'clojure', 'clj' ],
+   'Cobol' =>  [ 'cobol' ],
+   'coffee'=>  [ 'coffee', 'coffeescript', 
'coffee-script' ],
+   'ColdFusion'=>  [ 'cfm' ],
+   'CSharp'=>  [ 'csharp', '#' ],
+   'CSS'   =>  [ 'css' ],
+   'Curly' =>  [],
+   'D' =>  [ 'd' ],
+   'Dart'  =>  [ 'dart' ],
+   'Diff'  =>  [ 'diff', 'udiff' ],
+   'Dockerfile'=>  [ 'Dockerfile', 'docker' ],
+   'Dot'   =>  [],
+   'Dummy' =>  [],
+   'DummySyntax'   =>  [],
+   'Eiffel'=>  [ 'eiffel' ],
+   'EJS'   =>  [],
+   'Elixir'=>  [ 

[MediaWiki-commits] [Gerrit] mediawiki...CodeEditor[master]: Simplify modeloading

2016-10-20 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316949

Change subject: Simplify modeloading
..

Simplify modeloading

Analogous to I82d278920695be12aa80a79548abf8b8ce5445fd, make sure that
we can lazy load any language that Ace supports. Not because we need
it, but because it's the nicer way to do it.

Change-Id: I19b8a31041814ac1273d62a24b5ed622fd91a7a8
---
M extension.json
M modules/jquery.codeEditor.js
2 files changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor 
refs/changes/49/316949/1

diff --git a/extension.json b/extension.json
index e890a7e..ef0b047 100644
--- a/extension.json
+++ b/extension.json
@@ -78,7 +78,8 @@
"ace/mode-json.js",
"ace/mode-css.js",
"ace/mode-lua.js",
-   "ace/ext-language_tools.js"
+   "ace/ext-language_tools.js",
+   "ace/ext-modelist.js"
]
},
"ext.codeEditor.ace.modes": {
diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js
index 5e661ae..e639a73 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -388,9 +388,11 @@
 
mw.hook( 'codeEditor.configure' ).fire( 
session );
 
-   ace.config.loadModule( 'ace/mode/' + 
lang, function () {
-   AceLangMode = ace.require( 
'ace/mode/' + lang ).Mode;
-   session.setMode( new 
AceLangMode() );
+   ace.config.loadModule( 
'ace/ext/modelist', function ( modelist ) {
+   if ( !modelist || 
!modelist.modesByName[ lang ] ) {
+   lang = 'text';
+   }
+   session.setMode( 'ace/mode/' + 
lang );
} );
 
// Use jquery.ui.resizable so user can 
make the box taller too

-- 
To view, visit https://gerrit.wikimedia.org/r/316949
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I19b8a31041814ac1273d62a24b5ed622fd91a7a8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Untested: Encode namespace when generating info link

2016-10-20 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316938

Change subject: Untested: Encode namespace when generating info link
..

Untested: Encode namespace when generating info link

Bug: T138770
Change-Id: I0c0e5fce0c482050126efe40b3d329bdffd900f5
---
M TimedMediaHandler.hooks.php
M resources/mw-info-button/mw-info-button.js
2 files changed, 3 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/38/316938/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 5123520..90f980f 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -155,6 +155,7 @@
'targets' => [ 'mobile', 'desktop' ],
'dependencies' => [
'ext.tmh.video-js',
+   'mediawiki.Title',
],
],
'ext.tmh.player' => $baseExtensionResource + [
diff --git a/resources/mw-info-button/mw-info-button.js 
b/resources/mw-info-button/mw-info-button.js
index cb0f081..59ca57f 100644
--- a/resources/mw-info-button/mw-info-button.js
+++ b/resources/mw-info-button/mw-info-button.js
@@ -36,10 +36,8 @@
   var player = this;
 
   player.ready(function(){
-var link = mw.config.get('wgScript') + '?title='
-  + mw.config.get( 'wgFormattedNamespaces' )['6'] + ':'
-  + encodeURIComponent( player.el().getAttribute( 'data-mwtitle' ) );
-var button = new InfoButton( Button, link );
+var title = mw.Title.makeTitle( mw.config.get( 'wgNamespaceIds' 
).file, player.el().getAttribute( 'data-mwtitle' ) );
+var button = new InfoButton( Button, title.getUrl() );
 player.controlBar.infoButton = player.controlBar.addChild(button);
   });
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/316938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c0e5fce0c482050126efe40b3d329bdffd900f5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Remove swp file from repo

2016-10-19 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316761

Change subject: Remove swp file from repo
..

Remove swp file from repo

Change-Id: I1d6f65a32e345e829a22d4550d8d5fb40caa5c7e
---
D resources/.swp
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/61/316761/1

diff --git a/resources/.swp b/resources/.swp
deleted file mode 100644
index d4122c0..000
--- a/resources/.swp
+++ /dev/null
Binary files differ

-- 
To view, visit https://gerrit.wikimedia.org/r/316761
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d6f65a32e345e829a22d4550d8d5fb40caa5c7e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Enable conditional loading of ACE language modes

2016-10-18 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316572

Change subject: Enable conditional loading of ACE language modes
..

Enable conditional loading of ACE language modes

require bypasses Ace's internal loadModule() logic which is capable of
on demand loading of Ace modules. Because unloaded modules are not
defined, they cannot be required, and because we don't use RL to preload
all modes (because it's a lot of bytes), currently only very few of the
available language modes were currently available.

Bug: T148518
Change-Id: I82d278920695be12aa80a79548abf8b8ce5445fd
---
M modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
1 file changed, 3 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/72/316572/1

diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
index 187c9d2..e349efa 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
@@ -70,8 +70,8 @@
  */
 ve.ui.MWAceEditorWidget.prototype.setup = function () {
if ( !this.loadingPromise ) {
-   this.loadingPromise = mw.loader.getState( 
'ext.codeEditor.ace.modes' ) ?
-   mw.loader.using( 'ext.codeEditor.ace.modes' ) :
+   this.loadingPromise = mw.loader.getState( 'ext.codeEditor.ace' 
) ?
+   mw.loader.using( 'ext.codeEditor.ace' ) :
$.Deferred().reject().promise();
// Resolved promises will run synchronously, so ensure 
#setupEditor
// runs after this.loadingPromise is stored.
@@ -327,9 +327,7 @@
 ve.ui.MWAceEditorWidget.prototype.setLanguage = function ( lang ) {
var widget = this;
this.loadingPromise.done( function () {
-   // TODO: Just use ace.require once T127643 is resolved
-   var require = ace.require || require;
-   widget.editor.getSession().setMode( 'ace/mode/' + ( require( 
'ace/mode/' + lang ) ? lang : 'text' ) );
+   widget.editor.getSession().setMode( 'ace/mode/' + lang );
} );
return this;
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/316572
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82d278920695be12aa80a79548abf8b8ce5445fd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: Remove thumbnail style rule that is no longer required

2016-10-18 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316551

Change subject: Remove thumbnail style rule that is no longer required
..

Remove thumbnail style rule that is no longer required

This makes was a workaround for English Wikipedia's Template:Multiple
image. This workaround no longer appears to be required and the template
functions correctly without it.

Bug: T148505
Change-Id: Ia6b60203d3b81d447c1f58bdba32dfcaf2fcc53d
---
M resources/skins.minerva.content.styles/thumbnails.less
1 file changed, 0 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/51/316551/1

diff --git a/resources/skins.minerva.content.styles/thumbnails.less 
b/resources/skins.minerva.content.styles/thumbnails.less
index 25a7507..8da82bd 100644
--- a/resources/skins.minerva.content.styles/thumbnails.less
+++ b/resources/skins.minerva.content.styles/thumbnails.less
@@ -21,12 +21,6 @@
margin: 0 auto;
// !important is needed because of Bug T87198 for 
example
max-width: 100% !important;
-
-   > div {
-   float: none !important;
-   width: auto !important;
-   clear: both !important;
-   }
}
 
/* bug 20030 */

-- 
To view, visit https://gerrit.wikimedia.org/r/316551
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6b60203d3b81d447c1f58bdba32dfcaf2fcc53d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Made the dependency on videojs-ogvjs conditional

2016-10-17 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316485

Change subject: Made the dependency on videojs-ogvjs conditional
..

Made the dependency on videojs-ogvjs conditional

This saves about 112Kb compressed, so I think worth it.
TODO: Might want to merge some of this logic into ext.tmh.OgvJsSupport.js

Bug: T133228
Change-Id: Ia2f7a596ae1679e4aab85761d894945ac9929131
---
M TimedMediaHandler.hooks.php
M resources/ext.tmh.player.js
2 files changed, 26 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/85/316485/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 5dd38b0..6c867dc 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -162,7 +162,6 @@
'dependencies' => [
'ext.tmh.video-js',

'ext.tmh.videojs-resolution-switcher',
-   'ext.tmh.videojs-ogvjs',

'ext.tmh.videojs-responsive-layout',
'ext.tmh.videojs-replay',
'ext.tmh.mw-info-button',
diff --git a/resources/ext.tmh.player.js b/resources/ext.tmh.player.js
index 43fb7ea..31861ca 100755
--- a/resources/ext.tmh.player.js
+++ b/resources/ext.tmh.player.js
@@ -34,9 +34,6 @@
},
replayButton: {},
infoButton: {}
-   },
-   ogvjs: {
-   base: mw.OgvJsSupport.basePath()
}
};
 
@@ -48,11 +45,11 @@
 
/**
 * Load video players for a jQuery collection
- */
+*/
function loadVideoPlayer() {
-   var videoplayer, $videoplayer;
+   var videoplayer, $videoplayer, $collection = this;
 
-   this.each( function ( index ) {
+   function loadSinglePlayer( index ) {
videoplayer = this;
$videoplayer = $( this );
if ( $videoplayer.closest( '.video-js' ).size() ) {
@@ -129,7 +126,29 @@
videojs( videoplayer, playerConfig ).ready( function () 
{
/* More custom stuff goes here */
} );
-   } );
+   }
+
+   if( isOGVSupported() ) {
+   $collection.each( loadSinglePlayer );
+   } else {
+   mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( 
function() {
+   globalConfig.ogvjs = {
+   base: mw.OgvJsSupport.basePath()
+   };
+   $collection.each( loadSinglePlayer );
+   } );
+   }
+   }
+
+   function isOGVSupported() {
+   var el = document.createElement('video');
+   if( el && el.canPlayType && el.canPlayType( 'application/ogg' ) 
) {
+   return true;
+   }
+   return false;
+   }
+   if( !isOGVSupported() ) {
+   mw.loader.load( 'ext.tmh.videojs-ogvjs' );
}
 
$.fn.loadVideoPlayer = loadVideoPlayer;

-- 
To view, visit https://gerrit.wikimedia.org/r/316485
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2f7a596ae1679e4aab85761d894945ac9929131
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Move videojs-replay dependecy to devDependencies

2016-10-15 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316078

Change subject: Move videojs-replay dependecy to devDependencies
..

Move videojs-replay dependecy to devDependencies

This is only required to run the grunt update-videojs

Change-Id: Idc522f3fa31bfdbd14939af1362905ca4950ebe0
---
M package.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/78/316078/1

diff --git a/package.json b/package.json
index 86aa812..0998d9c 100644
--- a/package.json
+++ b/package.json
@@ -16,10 +16,10 @@
 "jscs-preset-wikimedia": "~1.0.0",
 "video.js": "^5.10.1",
 "videojs-ogvjs": "^1.3.1",
+"videojs-replay": "^1.1.0",
 "videojs-resolution-switcher": "^0.4.2",
 "videojs-responsive-layout": "^1.1.0"
   },
   "dependencies": {
-"videojs-replay": "^1.1.0"
   }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/316078
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc522f3fa31bfdbd14939af1362905ca4950ebe0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...TimedMediaHandler[master]: Repair text track attributes

2016-10-15 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316068

Change subject: Repair text track attributes
..

Repair text track attributes

This was broken in I4227b88ae94e3cfcfd62fb7fe221190d7fe33f71

Relates to bug: T122737

Change-Id: I6498c32929892454700e852d412056a5acc2453a
---
M TimedMediaTransformOutput.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/68/316068/1

diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php
index b15ed68..215754d 100644
--- a/TimedMediaTransformOutput.php
+++ b/TimedMediaTransformOutput.php
@@ -334,11 +334,11 @@
foreach ( $mediaTracks as &$track ) {
foreach ( $track as $attr => $val ) {
if ( $attr === 'title' || $attr === 'provider' 
) {
-   $source[ 'data-mw' . $attr ] = $val;
-   unset( $source[ $attr ] );
+   $track[ 'data-mw' . $attr ] = $val;
+   unset( $track[ $attr ] );
} elseif ( $attr === 'dir' ) {
-   $source[ 'data-' . $attr ] = $val;
-   unset( $source[ $attr ] );
+   $track[ 'data-' . $attr ] = $val;
+   unset( $track[ $attr ] );
}
}
}

-- 
To view, visit https://gerrit.wikimedia.org/r/316068
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6498c32929892454700e852d412056a5acc2453a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Math[master]: Don't use img SVGs on Opera 9 and earlier

2016-10-13 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/315654

Change subject: Don't use img SVGs on Opera 9 and earlier
..

Don't use img SVGs on Opera 9 and earlier

It seems that Opera 9 does support SVG, but not inside an image, as it
claims to. Therefor detect if this is old style Opera (window.opera) and
if it is before v9 (window.setDocument was removed in Opera 10).

Bug: T137765
Change-Id: Idc83d5ae56e41976b6a596c4de1b5d5599df8708
---
M modules/ext.math.js
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/54/315654/1

diff --git a/modules/ext.math.js b/modules/ext.math.js
index 912798c..e2a69b8 100644
--- a/modules/ext.math.js
+++ b/modules/ext.math.js
@@ -10,7 +10,9 @@
 
// We verify whether SVG as  is supported and otherwise use the
// PNG fallback. See 
https://github.com/Modernizr/Modernizr/blob/master/feature-detects/svg/asimg.js
-   if ( !document.implementation.hasFeature( 
'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
+   if ( !document.implementation.hasFeature( 
'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ||
+   ( !!window.opera && !window.setDocument ) // Detect < Opera 10
+   ) {
$( '.mwe-math-fallback-image-inline, 
.mwe-math-fallback-image-display' ).each( function ( ) {
this.src = this.src.replace( 'media/math/render/svg/', 
'media/math/render/png/' );
} );

-- 
To view, visit https://gerrit.wikimedia.org/r/315654
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc83d5ae56e41976b6a596c4de1b5d5599df8708
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...CodeEditor[master]: Use slice instead of substring per code conventions

2016-09-26 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312866

Change subject: Use slice instead of substring per code conventions
..

Use slice instead of substring per code conventions

Change-Id: Id9b08270c377f2b31486dbdb9492b77860f436e7
---
M modules/jquery.codeEditor.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeEditor 
refs/changes/66/312866/1

diff --git a/modules/jquery.codeEditor.js b/modules/jquery.codeEditor.js
index 7f695a8..5e661ae 100644
--- a/modules/jquery.codeEditor.js
+++ b/modules/jquery.codeEditor.js
@@ -329,7 +329,7 @@
box = context.$textarea;
lang = mw.config.get( 
'wgCodeEditorCurrentLanguage' );
basePath = mw.config.get( 
'wgExtensionAssetsPath', '' );
-   if ( basePath.substring( 0, 2 ) === '//' ) {
+   if ( basePath.slice( 0, 2 ) === '//' ) {
// ACE uses web workers, which have 
importScripts, which don't like relative links.
// This is a problem only when the 
assets are on another server, so this rewrite should suffice
// Protocol relative

-- 
To view, visit https://gerrit.wikimedia.org/r/312866
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9b08270c377f2b31486dbdb9492b77860f436e7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: Use slice instead of substring per code conventions

2016-09-26 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312864

Change subject: Use slice instead of substring per code conventions
..

Use slice instead of substring per code conventions

Change-Id: I5de8b485d287db097f2ad63a7edf75f86a86822d
---
M modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/64/312864/1

diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
index b14de0e..187c9d2 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
@@ -100,7 +100,7 @@
  */
 ve.ui.MWAceEditorWidget.prototype.setupEditor = function () {
var basePath = mw.config.get( 'wgExtensionAssetsPath', '' );
-   if ( basePath.substring( 0, 2 ) === '//' ) {
+   if ( basePath.slice( 0, 2 ) === '//' ) {
// ACE uses web workers, which have importScripts, which don't 
like relative links.
basePath = window.location.protocol + basePath;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/312864
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5de8b485d287db097f2ad63a7edf75f86a86822d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...VisualEditor[master]: [Untested] Configure Ace with it's base path

2016-09-08 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/309288

Change subject: [Untested] Configure Ace with it's base path
..

[Untested] Configure Ace with it's base path

Configure the basePath of ace, so that its own loader knows where to
lazy load additional resources from. This enables all known modes and
the worker scripts for linting.

Bug: T124419
Change-Id: Ie71518917ab966743e8397b23ffb050ca47e9ff4
---
M modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/88/309288/1

diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js 
b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
index 5889b78..63a37a8 100644
--- a/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
+++ b/modules/ve-mw/ui/widgets/ve.ui.MWAceEditorWidget.js
@@ -99,6 +99,15 @@
  * @fires resize
  */
 ve.ui.MWAceEditorWidget.prototype.setupEditor = function () {
+   var basePath = mw.config.get( 'wgExtensionAssetsPath', '' );
+   if ( basePath.substring( 0, 2 ) === '//' ) {
+   // ACE uses web workers, which have importScripts, which don't 
like relative links.
+   basePath = window.location.protocol + basePath;
+   }
+   ace.config.set( 'basePath', basePath + '/CodeEditor/modules/ace' );
+   // Non-lazy loaded dependencies: Enable code completion
+   ace.require( 'ace/ext/language_tools' );
+
this.$input.addClass( 'oo-ui-element-hidden' );
this.editor = ace.edit( this.$ace[ 0 ] );
this.setMinRows( this.minRows );

-- 
To view, visit https://gerrit.wikimedia.org/r/309288
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie71518917ab966743e8397b23ffb050ca47e9ff4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Revert "TimedMediaHandler: Don't try to calculate width and ... - change (mediawiki...TimedMediaHandler)

2016-07-13 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/298872

Change subject: Revert "TimedMediaHandler: Don't try to calculate width and 
height for audio files"
..

Revert "TimedMediaHandler: Don't try to calculate width and height for audio 
files"

This reverts commit 1c9d3e1adbfbfcbeec3a0c9b80a17d922a5ee2fc.

Change-Id: I91c5fa8ca5586be7fa03b61efbc56ee61e02d79e
---
M TimedMediaHandler_body.php
1 file changed, 14 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/72/298872/1

diff --git a/TimedMediaHandler_body.php b/TimedMediaHandler_body.php
index d766449..b3419f8 100644
--- a/TimedMediaHandler_body.php
+++ b/TimedMediaHandler_body.php
@@ -364,14 +364,24 @@
return new TransformParameterError( $params );
}
 
+   $srcWidth = $file->getWidth();
+   $srcHeight = $file->getHeight();
+
+   $params['width'] = isset( $params['width'] ) ? $params['width'] 
: $srcWidth;
+
+   // if height overtakes width use height as max:
+   $targetWidth = $params['width'];
+   $targetHeight = $srcWidth == 0 ? $srcHeight : round( 
$params['width'] * $srcHeight / $srcWidth );
+   if ( isset( $params['height'] ) && $targetHeight > 
$params['height'] ) {
+   $targetHeight = $params['height'];
+   $targetWidth = round( $params['height'] * $srcWidth / 
$srcHeight );
+   }
$options = [
'file' => $file,
'length' => $this->getLength( $file ),
'offset' => $this->getOffset( $file ),
-   // Thumbnail width and height for audio files is 
hardcoded to match the dimensions of the
-   // filetype icon, see 
TimedMediaTransformOutput::getUrl(). Overridden for video below.
-   'width' => 120,
-   'height' => 120,
+   'width' => $targetWidth,
+   'height' =>  $targetHeight,
'isVideo' => !$this->isAudio( $file ),
'thumbtime' => isset(
$params['thumbtime']
@@ -386,23 +396,6 @@
if ( !$options['isVideo'] ) {
return new TimedMediaTransformOutput( $options );
}
-
-   // We're dealing with a video file now, set width and height
-   $srcWidth = $file->getWidth();
-   $srcHeight = $file->getHeight();
-
-   $params['width'] = isset( $params['width'] ) ? $params['width'] 
: $srcWidth;
-
-   // if height overtakes width use height as max:
-   $targetWidth = $params['width'];
-   $targetHeight = $srcWidth == 0 ? $srcHeight : round( 
$params['width'] * $srcHeight / $srcWidth );
-   if ( isset( $params['height'] ) && $targetHeight > 
$params['height'] ) {
-   $targetHeight = $params['height'];
-   $targetWidth = round( $params['height'] * $srcWidth / 
$srcHeight );
-   }
-
-   $options[ 'width' ] = $targetWidth;
-   $options[ 'height' ] = $targetHeight;
 
// Setup pointer to thumb arguments
$options[ 'thumbUrl' ] = $dstUrl;

-- 
To view, visit https://gerrit.wikimedia.org/r/298872
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91c5fa8ca5586be7fa03b61efbc56ee61e02d79e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TimedMediaHandler
Gerrit-Branch: master
Gerrit-Owner: TheDJ 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] iframe embed: Allow videojs inside iframe mode - change (mediawiki...TimedMediaHandler)

2016-06-26 Thread TheDJ (Code Review)
TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/296156

Change subject: iframe embed: Allow videojs inside iframe mode
..

iframe embed: Allow videojs inside iframe mode

Change-Id: I74c83ec4cb27abb5f9ed8b6731579e316cc922f9
---
M TimedMediaHandler.hooks.php
M TimedMediaIframeOutput.php
M TimedMediaTransformOutput.php
M resources/embedPlayerIframe.css
M resources/ext.tmh.player.js
5 files changed, 29 insertions(+), 10 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler 
refs/changes/56/296156/1

diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php
index 7585d1b..ed63763 100644
--- a/TimedMediaHandler.hooks.php
+++ b/TimedMediaHandler.hooks.php
@@ -59,10 +59,6 @@
// position top needed as it 
needs to load before mediawiki.page.gallery
'position' => 'top',
],
-   'embedPlayerIframeStyle'=> 
$baseExtensionResource + [
-   'styles' => 
'resources/embedPlayerIframe.css',
-   'position' => 'bottom',
-   ],
'ext.tmh.embedPlayerIframe' => 
$baseExtensionResource + [
'scripts' => 
'resources/ext.tmh.embedPlayerIframe.js',
'dependencies' => [
@@ -172,7 +168,7 @@
'ext.tmh.player.styles' => 
$baseExtensionResource + [
'styles' => 
'resources/ext.tmh.player.styles.less',
'targets' => [ 'mobile', 
'desktop' ],
-   ]
+   ],
];
}
 
@@ -287,6 +283,10 @@
'dependencies' => 'ext.tmh.OgvJsSupport',
'targets' => [ 'mobile', 'desktop' ],
],
+   'embedPlayerIframeStyle'=> $baseExtensionResource + [
+   'styles' => 'resources/embedPlayerIframe.css',
+   'targets' => [ 'mobile', 'desktop' ],
+   ],
];
 
// Setup a hook for iframe embed handling:
diff --git a/TimedMediaIframeOutput.php b/TimedMediaIframeOutput.php
index 0eb23a2..95ef71d 100644
--- a/TimedMediaIframeOutput.php
+++ b/TimedMediaIframeOutput.php
@@ -71,10 +71,12 @@
if ( $wgTmhWebPlayer == 'mwembed' ) {
$wgOut->addModules( [ 'mw.MediaWikiPlayer.loader', 
'ext.tmh.embedPlayerIframe' ] );
} elseif ( $wgTmhWebPlayer === 'videojs' ) {
-   $wgOut->addModuleStyles( 'ext.tmh.player.styles' );
$wgOut->addModules( 'ext.tmh.player' );
+   $wgOut->addModuleStyles( 'ext.tmh.player.styles' );
+   $styleModules[] = 'ext.tmh.player.styles';
}
$wgOut->addModuleStyles( 'embedPlayerIframeStyle' );
+   $styleModules[] = 'embedPlayerIframeStyle';
$wgOut->sendCacheControl();
?>
 
@@ -88,7 +90,7 @@
makeResourceLoaderLink(
-   'embedPlayerIframeStyle', 
ResourceLoaderModule::TYPE_STYLES
+   $styleModules, ResourceLoaderModule::TYPE_STYLES
);
echo implode( "\n", $links["html"] );
 
@@ -98,9 +100,7 @@

 

-   
-   toHtml(); ?>
-   
+   toHtml(); ?>
getBottomScripts(); ?>
 
 
diff --git a/TimedMediaTransformOutput.php b/TimedMediaTransformOutput.php
index ef57847..85b837e 100644
--- a/TimedMediaTransformOutput.php
+++ b/TimedMediaTransformOutput.php
@@ -445,6 +445,15 @@
} else {
unset( $mediaAttr['height'] );
}
+   if ( $this->fillwindow ) {
+   unset( $mediaAttr['width'] );
+   unset( $mediaAttr['height'] );
+   $mediaAttr[ 'class' ] .= ' vjs-fluid';
+   $mediaAttr[ 'data-player' ] = 'fillwindow';
+   }
+   if ( $this->disablecontrols ) {
+   $mediaAttr[ 'controls' ] = false;
+   }
} else {
$mediaAttr['style'] = "width:{$width}";
 
diff --git a/resources/embedPlayerIframe.css b/resources/embedPlayerIframe.css
index ec05700..3fb3f32 100644
--- a/resources/embedPlayerIframe.css

  1   2   3   4   5   6   7   >