[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Version 1.6

2018-01-22 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405745 )

Change subject: Version 1.6
..

Version 1.6

Change-Id: Idb18df0ca13390f73a378d6aa13f948ff6f11e96
---
M Cargo.hooks.php
M Cargo.php
M README
M extension.json
M specials/CargoRecreateData.php
5 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/45/405745/2

diff --git a/Cargo.hooks.php b/Cargo.hooks.php
index 58b7a9b..2026d55 100644
--- a/Cargo.hooks.php
+++ b/Cargo.hooks.php
@@ -11,7 +11,7 @@
public static function registerExtension() {
global $cgScriptPath, $wgScriptPath, $wgCargoFieldTypes, 
$wgGroupPermissions;
 
-   define( 'CARGO_VERSION', '1.5' );
+   define( 'CARGO_VERSION', '1.6' );
 
// Script path.
$cgScriptPath = $wgScriptPath . '/extensions/Cargo';
@@ -58,7 +58,7 @@
$vars['wgCargoMonthNames'] = 
$out->getLanguage()->getMonthNamesArray();
/**
 * @TODO - all these arrays should perhaps be switched to start
-* keys from 1, in order to match built-in arrys, such as
+* keys from 1, in order to match built-in arrays, such as
 * $wgMonthNames.
 */
array_shift( $vars['wgCargoMonthNames'] ); //start keys from 0
diff --git a/Cargo.php b/Cargo.php
index 4e92ccf..bae64be 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -25,7 +25,7 @@
 
 // All the rest is for backward compatibility, for MW 1.26 and lower.
 
-define( 'CARGO_VERSION', '1.5' );
+define( 'CARGO_VERSION', '1.6' );
 
 $wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
diff --git a/README b/README
index 160de63..4b6b7f5 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 Cargo extension
 
-Version 1.5
+Version 1.6
 Yaron Koren
 
 This is free software licensed under the GNU General Public License. Please
diff --git a/extension.json b/extension.json
index a503672..a953948 100644
--- a/extension.json
+++ b/extension.json
@@ -1,7 +1,7 @@
 {
"name": "Cargo",
"namemsg": "cargo-extensionname",
-   "version": "1.5",
+   "version": "1.6",
"author": "Yaron Koren",
"url": "https://www.mediawiki.org/wiki/Extension:Cargo;,
"descriptionmsg": "cargo-desc",
diff --git a/specials/CargoRecreateData.php b/specials/CargoRecreateData.php
index 0574b87..8354e20 100644
--- a/specials/CargoRecreateData.php
+++ b/specials/CargoRecreateData.php
@@ -117,7 +117,7 @@
$text .= '' . "\n";
if ( $tableExists ) {
// Possibly disable checkbox, to avoid problems if the
-   // DB hasn't been updated for version 1.5.
+   // DB hasn't been updated for version 1.5+.
$indexExists = $dbw->indexExists( 'cargo_tables', 
'cargo_tables_template_id' );
if ( $indexExists ) {
$text .= 'The checkbox intended to go 
here is temporarily disabled; please run update.php to see 
it.';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb18df0ca13390f73a378d6aa13f948ff6f11e96
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added more forbidden pseudo-SQL keywords for field names

2018-01-22 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405740 )

Change subject: Added more forbidden pseudo-SQL keywords for field names
..

Added more forbidden pseudo-SQL keywords for field names

Change-Id: I9b4e0d8cc5ab43bd3fa3c1408e0cc950e0dfd6f7
---
M includes/parserfunctions/CargoDeclare.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/40/405740/2

diff --git a/includes/parserfunctions/CargoDeclare.php 
b/includes/parserfunctions/CargoDeclare.php
index 0fcd7bc..26f3c88 100644
--- a/includes/parserfunctions/CargoDeclare.php
+++ b/includes/parserfunctions/CargoDeclare.php
@@ -67,7 +67,7 @@
} elseif ( in_array( strtolower( $fieldName ),
// Similarly, handle the Cargo
// pseudo-SQL keywords.
-   array( 'holds', 'near' ) ) ) {
+   array( 'holds', 'matches', 'near', 
'within' ) ) ) {
return CargoUtils::formatError( "Error: 
\"$fieldName\" cannot be used as a Cargo field name, because it is already a 
Cargo keyword." );
}
try {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b4e0d8cc5ab43bd3fa3c1408e0cc950e0dfd6f7
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Another fix for MW 1.23 - fix for c8194fe6c88f

2018-01-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405667 )

Change subject: Another fix for MW 1.23 - fix for c8194fe6c88f
..

Another fix for MW 1.23 - fix for c8194fe6c88f

Change-Id: I4d1f0eec10fca62e3bc75258e94904d58e19dc1f
---
M includes/CargoPageValuesAction.php
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/67/405667/2

diff --git a/includes/CargoPageValuesAction.php 
b/includes/CargoPageValuesAction.php
index 693943b..b2799fa 100644
--- a/includes/CargoPageValuesAction.php
+++ b/includes/CargoPageValuesAction.php
@@ -8,7 +8,7 @@
 
 class CargoPageValuesAction extends Action {
/**
-* Return the name of the action this object responds to
+* Return the name of the action this object responds to.
 * @return String lowercase
 */
public function getName() {
@@ -27,7 +27,7 @@
}
 
/**
-* Add the "Page values" link to the toolbox
+* Add the "Page values" link to the toolbox.
 *
 * @param BaseTemplate $skinTemplate
 * @param array $toolbox
@@ -50,4 +50,11 @@
 
return true;
}
+
+   /**
+* Implement this to support MW 1.23, which has it as an abstract
+* function.
+*/
+   public function execute() { }
+
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4d1f0eec10fca62e3bc75258e94904d58e19dc1f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fixed support for MW 1.23 - fix for c686d11b9f88

2018-01-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405666 )

Change subject: Fixed support for MW 1.23 - fix for c686d11b9f88
..

Fixed support for MW 1.23 - fix for c686d11b9f88

Change-Id: Ie2d322b3410d8ccffb1827e687bf4288fd879967
---
M includes/CargoRecreateDataAction.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/66/405666/2

diff --git a/includes/CargoRecreateDataAction.php 
b/includes/CargoRecreateDataAction.php
index c4b574c..ebce0be 100644
--- a/includes/CargoRecreateDataAction.php
+++ b/includes/CargoRecreateDataAction.php
@@ -95,5 +95,11 @@
$links['actions'] = $views_links;
return true;
}
+  
+   /**
+* Implement this to support MW 1.23, which has it as an abstract
+* function.
+*/
+   public function execute() { }
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2d322b3410d8ccffb1827e687bf4288fd879967
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix to not delete data from "read-only" tables

2018-01-21 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405660 )

Change subject: Fix to not delete data from "read-only" tables
..

Fix to not delete data from "read-only" tables

i.e., tables that have an existing "replacement table".

Change-Id: Ie0dc47b5e5b81aabbae68f2a50a2441dd1d2cfdf
---
M Cargo.hooks.php
1 file changed, 8 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/60/405660/2

diff --git a/Cargo.hooks.php b/Cargo.hooks.php
index e7ab103..58b7a9b 100644
--- a/Cargo.hooks.php
+++ b/Cargo.hooks.php
@@ -122,7 +122,9 @@
}
 
/**
-* Delete a page
+* Deletes all Cargo data for a specific page - *except* data
+* contained in Cargo tables which are read-only because their
+* "replacement table" exists.
 *
 * @param int $pageID
 * @TODO - move this to a different class, like CargoUtils?
@@ -142,6 +144,11 @@
while ( $row = $dbw->fetchRow( $res ) ) {
$curMainTable = $row['table_name'];
 
+   if ( $cdb->tableExists( $curMainTable . '__NEXT' ) ) {
+   // It's a "read-only" table - ignore.
+   continue;
+   }
+
// First, delete from the "field" tables.
$res2 = $dbw->select( 'cargo_tables', 'field_tables', 
array( 'main_table' => $curMainTable ) );
$row2 = $dbw->fetchRow( $res2 );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0dc47b5e5b81aabbae68f2a50a2441dd1d2cfdf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Display template names in CargoTables even if table doesn't ...

2018-01-18 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405017 )

Change subject: Display template names in CargoTables even if table doesn't 
exist
..

Display template names in CargoTables even if table doesn't exist

Change-Id: I4a80cc637b2d13c408f75820ef4705eabaaa9e7d
---
M specials/CargoTables.php
1 file changed, 46 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/17/405017/2

diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index f23ec3a..9879044 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -260,6 +260,49 @@
return $actionLinks;
}
 
+   function tableTemplatesText( $tableName, $templatesThatDeclareTables, 
$templatesThatAttachToTables ) {
+   if ( method_exists( $this, 'getLinkRenderer' ) ) {
+   $linkRenderer = $this->getLinkRenderer();
+   } else {
+   $linkRenderer = null;
+   }
+
+   // "Declared by" text
+   if ( !array_key_exists( $tableName, $templatesThatDeclareTables 
) ) {
+   $declaringTemplatesText = $this->msg( 
'cargo-cargotables-notdeclared' )->text();
+   } else {
+   $templatesThatDeclareThisTable = 
$templatesThatDeclareTables[$tableName];
+   $templateLinks = array();
+   foreach ( $templatesThatDeclareThisTable as $templateID 
) {
+   $templateTitle = Title::newFromID( $templateID 
);
+   $templateLinks[] = CargoUtils::makeLink( 
$linkRenderer, $templateTitle );
+   }
+   $declaringTemplatesText = $this->msg(
+   'cargo-cargotables-declaredby', implode( 
$templateLinks ) )->text();
+   }
+
+   // "Attached by" text
+   if ( array_key_exists( $tableName, $templatesThatAttachToTables 
) ) {
+   $templatesThatAttachToThisTable = 
$templatesThatAttachToTables[$tableName];
+   } else {
+   $templatesThatAttachToThisTable = array();
+   }
+
+   if ( count( $templatesThatAttachToThisTable ) == 0 ) {
+   return $declaringTemplatesText;
+   }
+
+   $templateLinks = array();
+   foreach ( $templatesThatAttachToThisTable as $templateID ) {
+   $templateTitle = Title::newFromID( $templateID );
+   $templateLinks[] = CargoUtils::makeLink( $linkRenderer, 
$templateTitle );
+   }
+   $attachingTemplatesText = $this->msg(
+   'cargo-cargotables-attachedby', implode( $templateLinks 
) )->text();
+
+   return "$declaringTemplatesText, $attachingTemplatesText";
+   }
+
/**
 * Returns HTML for a bulleted list of Cargo tables, with various
 * links and information for each one.
@@ -296,6 +339,7 @@
if ( !$cdb->tableExists( $tableName ) ) {
$tableText = "$tableName - ";
$tableText .= '' . 
$this->msg( "cargo-cargotables-nonexistenttable" )->parse() . '';
+   $tableText .= ' (' . $this->tableTemplatesText( 
$tableName, $templatesThatDeclareTables, $templatesThatAttachToTables ) . ')';
$text .= Html::rawElement( 'li', null, 
$tableText );
continue;
}
@@ -306,45 +350,9 @@
$firstTemplateID = $canBeRecreated ? 
$templatesThatDeclareTables[$tableName][0] : null;
$actionLinks = $this->displayActionLinksForTable( 
$tableName, false, $canBeRecreated, $firstTemplateID );
$numRowsText = $this->displayNumRowsForTable( $cdb, 
$tableName );
+   $templatesText = $this->tableTemplatesText( $tableName, 
$templatesThatDeclareTables, $templatesThatAttachToTables );
 
-   // "Declared by" text
-   if ( !array_key_exists( $tableName, 
$templatesThatDeclareTables ) ) {
-   $declaringTemplatesText = $this->msg( 
'cargo-cargotables-notdeclared' )->text();
-   } else {
-   $templatesThatDeclareThisTable = 
$templatesThatDeclareTables[$tableName];
-   $templateLinks = array();
-   foreach ( $templatesThatDeclareThisTable as 
$templateID ) {
-   $templateTitle = Title::newFromID( 
$templateID );
-   $templateLinks[] = 
CargoUtils::makeLink( $linkRenderer, $templateTitle 

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for 3a2c71e36276 - fix if DB prefix exists

2018-01-18 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405011 )

Change subject: Fix for 3a2c71e36276 - fix if DB prefix exists
..

Fix for 3a2c71e36276 - fix if DB prefix exists

Replaced "UPDATE" queries with calls to $dbw->update()

Change-Id: I3b19b6e50a8e6e923ad58318b2bdb2001db8d477
---
M specials/CargoSwitchTable.php
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/11/405011/2

diff --git a/specials/CargoSwitchTable.php b/specials/CargoSwitchTable.php
index 01ff625..e05bea9 100644
--- a/specials/CargoSwitchTable.php
+++ b/specials/CargoSwitchTable.php
@@ -66,14 +66,13 @@
$dbw = wfGetDB( DB_MASTER );
$dbw->delete( 'cargo_tables', array( 'main_table' => $mainTable 
) );
$dbw->delete( 'cargo_pages', array( 'table_name' => $mainTable 
) );
-   $dbw->query( 'UPDATE cargo_tables SET main_table = \'' . 
$mainTable . '\' WHERE main_table = \'' . $mainTable . '__NEXT\'' );
+   $dbw->update( 'cargo_tables', array( 'main_table' => $mainTable 
), array( 'main_table' => $mainTable . '__NEXT' ) );
$origFieldTableNames = array();
foreach ( $fieldTables as $fieldTable ) {
$origFieldTableNames[] = str_replace( '__NEXT', '', 
$fieldTable );
}
-   $dbw->query( 'UPDATE cargo_tables SET field_tables = \'' . 
serialize( $origFieldTableNames ) . '\' WHERE main_table = \'' .
-   $mainTable . '\'' );
-   $dbw->query( 'UPDATE cargo_pages SET table_name = \'' . 
$mainTable . '\' WHERE table_name = \'' . $mainTable . '__NEXT\'' );
+   $dbw->update( 'cargo_tables', array( 'field_tables' => 
serialize( $origFieldTableNames ) ), array( 'main_table' => $mainTable ) );
+   $dbw->update( 'cargo_pages', array( 'table_name' => $mainTable 
), array( 'table_name' => $mainTable . '__NEXT' ) );
}
 
function execute( $subpage = false ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3b19b6e50a8e6e923ad58318b2bdb2001db8d477
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added "table exists" check for replacement tables

2018-01-17 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/404746 )

Change subject: Added "table exists" check for replacement tables
..


Added "table exists" check for replacement tables

Change-Id: I6ac47b70dd32031503cf56da4d08ee4f5ce0359b
---
M specials/CargoTables.php
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index 28836b4..f23ec3a 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -347,6 +347,14 @@
$tableText .= ')';
 
if ( $hasReplacementTable ) {
+   if ( !$cdb->tableExists( $tableName . '__NEXT' 
) ) {
+   $tableText .= "\n";
+   $tableText .= $tableName . '__NEXT - ';
+   $tableText .= '' . 
$this->msg( "cargo-cargotables-nonexistenttable" )->parse() . '';
+   $tableText .= "";
+   $text .= Html::rawElement( 'li', null, 
$tableText );
+   continue;
+   }
global $wgUser;
$numRowsText = $this->displayNumRowsForTable( 
$cdb, $tableName . '__NEXT' );
$actionLinks = 
$this->displayActionLinksForTable( $tableName, true, false, null );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ac47b70dd32031503cf56da4d08ee4f5ce0359b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added "table exists" check for replacement tables

2018-01-17 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404746 )

Change subject: Added "table exists" check for replacement tables
..

Added "table exists" check for replacement tables

Change-Id: I6ac47b70dd32031503cf56da4d08ee4f5ce0359b
---
M specials/CargoTables.php
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/46/404746/2

diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index 28836b4..f23ec3a 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -347,6 +347,14 @@
$tableText .= ')';
 
if ( $hasReplacementTable ) {
+   if ( !$cdb->tableExists( $tableName . '__NEXT' 
) ) {
+   $tableText .= "\n";
+   $tableText .= $tableName . '__NEXT - ';
+   $tableText .= '' . 
$this->msg( "cargo-cargotables-nonexistenttable" )->parse() . '';
+   $tableText .= "";
+   $text .= Html::rawElement( 'li', null, 
$tableText );
+   continue;
+   }
global $wgUser;
$numRowsText = $this->displayNumRowsForTable( 
$cdb, $tableName . '__NEXT' );
$actionLinks = 
$this->displayActionLinksForTable( $tableName, true, false, null );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ac47b70dd32031503cf56da4d08ee4f5ce0359b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added option for "create/edit title"

2018-01-16 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404599 )

Change subject: Added  option for "create/edit title"
..

Added  option for "create/edit title"

Change-Id: I62c91907f8862faaa2b0da1e367e209c0e4e1a92
---
M includes/PF_AutoeditAPI.php
M specials/PF_FormEdit.php
2 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/99/404599/2

diff --git a/includes/PF_AutoeditAPI.php b/includes/PF_AutoeditAPI.php
index 09ec5ec..a403101 100644
--- a/includes/PF_AutoeditAPI.php
+++ b/includes/PF_AutoeditAPI.php
@@ -912,8 +912,7 @@
$wgRequest = $oldRequest;
 
if ( $generatedFormName !== '' ) {
-   $formTitle = Title::newFromText( $generatedFormName );
-   $this->mOptions['formtitle'] = $formTitle->getText();
+   $this->mOptions['formtitle'] = $generatedFormName;
}
 
$this->mOptions['formHTML'] = $formHTML;
diff --git a/specials/PF_FormEdit.php b/specials/PF_FormEdit.php
index 7b29736..44858f7 100644
--- a/specials/PF_FormEdit.php
+++ b/specials/PF_FormEdit.php
@@ -126,17 +126,18 @@
$targetTitle = Title::newFromText( $result[ 'target' ] );
 
// Set page title depending on whether an explicit title was
-   // specified in the form definition.
+   // specified in the form definition, and whether this is a
+   // new or existing page being edited.
if ( array_key_exists( 'formtitle', $result ) ) {
-   // set page title depending on whether the target page 
exists
+   $pageTitle = $result[ 'formtitle' ];
if ( empty( $targetName ) ) {
-   $pageTitle = $result[ 'formtitle' ];
+   // This is a new page - we're done.
+   } elseif ( strpos( $pageTitle, 'page name' ) 
!== false ) {
+   $pageTitle = str_replace( 'page name', 
$targetName, $pageTitle );
} else {
$pageTitle = $result[ 'formtitle' ] . ': ' . 
$targetName;
}
} elseif ( $result[ 'form' ] !== '' ) {
-   // Set page title depending on whether the target page
-   // exists.
if ( empty( $targetName ) ) {
$pageTitle = wfMessage( 
'pf_formedit_createtitlenotarget', $result[ 'form' ] )->text();
} elseif ( $targetTitle->exists() ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I62c91907f8862faaa2b0da1e367e209c0e4e1a92
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Version 4.2.1

2018-01-16 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404493 )

Change subject: Version 4.2.1
..

Version 4.2.1

Change-Id: Id4bcaa250c214a663cec3652ce184d317b680eba
---
M INSTALL
M PageForms.php
M extension.json
M includes/PF_Hooks.php
4 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/93/404493/2

diff --git a/INSTALL b/INSTALL
index f64c154..88a9bfa 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-[[Page Forms 4.2]]
+[[Page Forms 4.2.1]]
 
 Contents:
 * Disclaimer
@@ -17,7 +17,7 @@
 
 == Requirements ==
 
-The extension requires MediaWiki 1.21 or greater.
+The extension requires MediaWiki 1.23 or greater.
 
 == Installation ==
 
diff --git a/PageForms.php b/PageForms.php
index 50fff08..6cabbd9 100644
--- a/PageForms.php
+++ b/PageForms.php
@@ -69,7 +69,7 @@
return 1;
 }
 
-define( 'PF_VERSION', '4.2' );
+define( 'PF_VERSION', '4.2.1' );
 
 $GLOBALS['wgExtensionCredits']['specialpage'][] = array(
'path' => __FILE__,
diff --git a/extension.json b/extension.json
index 4a5090a..18c48d9 100644
--- a/extension.json
+++ b/extension.json
@@ -1,7 +1,7 @@
 {
"@Note": "When updating this file please also update PageForms.php with 
the same changes.",
"name": "Page Forms",
-   "version": "4.2",
+   "version": "4.2.1",
"author": [
"Yaron Koren",
"Stephan Gambke",
diff --git a/includes/PF_Hooks.php b/includes/PF_Hooks.php
index 1ca3ca2..71ab94c 100644
--- a/includes/PF_Hooks.php
+++ b/includes/PF_Hooks.php
@@ -16,7 +16,7 @@
return 1;
}
 
-   define( 'PF_VERSION', '4.2' );
+   define( 'PF_VERSION', '4.2.1' );
 
$GLOBALS['wgPageFormsIP'] = dirname( __DIR__ ) . '/../';
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id4bcaa250c214a663cec3652ce184d317b680eba
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Removed _table param for Special:Drilldown

2018-01-15 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404296 )

Change subject: Removed _table param for Special:Drilldown
..

Removed _table param for Special:Drilldown

Seemed unnecessary, and wasn't working very well.

Change-Id: I603ff2c0866b930ddd41ed711b70d3359415a691
---
M drilldown/CargoSpecialDrilldown.php
1 file changed, 2 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/96/404296/2

diff --git a/drilldown/CargoSpecialDrilldown.php 
b/drilldown/CargoSpecialDrilldown.php
index 9c9eb90..6e3a58a 100644
--- a/drilldown/CargoSpecialDrilldown.php
+++ b/drilldown/CargoSpecialDrilldown.php
@@ -34,14 +34,8 @@
$out->addScript( '' );
 
-   // Get information on current table and the filters
-   // that have already been applied from the query string.
-   $tableName = str_replace( '_', ' ', $request->getVal( '_table' 
) );
-   // if query string did not contain this variable, try the URL
-   if ( !$tableName ) {
-   $queryparts = explode( '/', $query, 1 );
-   $tableName = isset( $queryparts[0] ) ? $queryparts[0] : 
'';
-   }
+   $queryparts = explode( '/', $query, 1 );
+   $tableName = isset( $queryparts[0] ) ? $queryparts[0] : '';
 
// If no table was specified, go with the first table,
// alphabetically.
@@ -1285,7 +1279,6 @@
if ( $this->isReplacementTable ) {
$params['_replacement'] = null;
}
-   $params['_table'] = $this->tableName;
if ( $this->fullTextSearchTerm != '' ) {
$params['_search'] = $this->fullTextSearchTerm;
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I603ff2c0866b930ddd41ed711b70d3359415a691
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Contributors[master]: Fix for 2270fb67891f - remove unset() call

2018-01-10 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/403551 )

Change subject: Fix for 2270fb67891f - remove unset() call
..


Fix for 2270fb67891f - remove unset() call

It led to an error in certain cases - see T181903.

Bug: T181903
Change-Id: Ia2c07fca66edfb07c2d1ca58394fd07c0f9c766f
---
M includes/SpecialContributors.php
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/SpecialContributors.php b/includes/SpecialContributors.php
index f847ee7..4f36722 100644
--- a/includes/SpecialContributors.php
+++ b/includes/SpecialContributors.php
@@ -32,10 +32,9 @@
$this->setHeaders();
 
$opts = $this->getOptions();
-   $target = $opts['target'];
-   unset( $opts['target'] );
$this->setContributorsClass(
-   new Contributors( Title::newFromText( $target ), 
$opts->getAllValues() ) );
+   new Contributors( Title::newFromText( $opts['target'] 
), $opts->getAllValues() )
+   );
 
# What are we doing? Different execution paths for inclusion,
# direct access and raw access

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2c07fca66edfb07c2d1ca58394fd07c0f9c766f
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Contributors
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Contributors[master]: Fix for 2270fb67891f - removed unset() call

2018-01-10 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403551 )

Change subject: Fix for 2270fb67891f - removed unset() call
..

Fix for 2270fb67891f - removed unset() call

It led to an error in certain cases - see 
https://phabricator.wikimedia.org/T181903

Change-Id: Ia2c07fca66edfb07c2d1ca58394fd07c0f9c766f
---
M includes/SpecialContributors.php
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Contributors 
refs/changes/51/403551/2

diff --git a/includes/SpecialContributors.php b/includes/SpecialContributors.php
index f847ee7..6c06c32 100644
--- a/includes/SpecialContributors.php
+++ b/includes/SpecialContributors.php
@@ -32,10 +32,8 @@
$this->setHeaders();
 
$opts = $this->getOptions();
-   $target = $opts['target'];
-   unset( $opts['target'] );
$this->setContributorsClass(
-   new Contributors( Title::newFromText( $target ), 
$opts->getAllValues() ) );
+   new Contributors( Title::newFromText( $opts['target'] 
), $opts->getAllValues() ) );
 
# What are we doing? Different execution paths for inclusion,
# direct access and raw access

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2c07fca66edfb07c2d1ca58394fd07c0f9c766f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Contributors
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added "delimiter" param for "template" format

2018-01-10 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403478 )

Change subject: Added "delimiter" param for "template" format
..

Added "delimiter" param for "template" format

Change-Id: I311c48adb41940e066e10fce310ff738b22f7a25
---
M formats/CargoTemplateFormat.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/78/403478/2

diff --git a/formats/CargoTemplateFormat.php b/formats/CargoTemplateFormat.php
index a658188..1fa5b36 100644
--- a/formats/CargoTemplateFormat.php
+++ b/formats/CargoTemplateFormat.php
@@ -7,7 +7,7 @@
 class CargoTemplateFormat extends CargoDisplayFormat {
 
function allowedParameters() {
-   return array( 'template', 'named args' );
+   return array( 'template', 'named args', 'delimiter' );
}
 
function displayRow( $templateName, $row, $fieldDescriptions, 
$namedArgs ) {
@@ -56,8 +56,13 @@
if ( array_key_exists( 'named args', $displayParams ) ) {
$namedArgs = strtolower( $displayParams['named args'] ) 
== 'yes';
}
+   $delimiter = ( array_key_exists( 'delimiter', $displayParams ) 
) ?
+   $displayParams['delimiter'] : '';
$text = '';
-   foreach ( $valuesTable as $row ) {
+   foreach ( $valuesTable as $i => $row ) {
+   if ( $i > 0 ) {
+   $text .= $delimiter;
+   }
$text .= $this->displayRow( $templateName, $row, 
$fieldDescriptions, $namedArgs );
}
global $wgTitle;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I311c48adb41940e066e10fce310ff738b22f7a25
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: More forbidden field names (SQL keywords)

2018-01-10 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403452 )

Change subject: More forbidden field names (SQL keywords)
..

More forbidden field names (SQL keywords)

Change-Id: Ied31df58c31913d1ea232c44ec1f85cbdf1bf802
---
M includes/parserfunctions/CargoDeclare.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/52/403452/2

diff --git a/includes/parserfunctions/CargoDeclare.php 
b/includes/parserfunctions/CargoDeclare.php
index b5d9cd6..8934608 100644
--- a/includes/parserfunctions/CargoDeclare.php
+++ b/includes/parserfunctions/CargoDeclare.php
@@ -56,6 +56,8 @@
// Some of these are more likely as
// field names than others...
array( 'create', 'table', 'update', 
'insert', 'delete',
+   'unique', 'char', 'varchar', 
'text', 'blob',
+   'enum', 'set', 'int', 'float', 
'double', 'decimal'
'select', 'distinct', 'from', 
'join', 'on',
'where', 'order', 'by', 'asc', 
'desc', 'limit',
'group', 'having', 'like', 
'is', 'null',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied31df58c31913d1ea232c44ec1f85cbdf1bf802
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Added extension.json file

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402902 )

Change subject: Added extension.json file
..


Added extension.json file

Change-Id: I2f4ab164744d77474452bc8735cf035f9d425615
---
M INSTALL
A extension.json
2 files changed, 79 insertions(+), 8 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/INSTALL b/INSTALL
index 5361da4..4cab3a9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-[[Data Transfer 0.6.2]]
+[[Data Transfer 1.0-alpha]]
 
 Contents:
 * Disclaimer
@@ -12,21 +12,20 @@
 
 == Requirements ==
 
-The extension can make use of, but does not require, an install of
-Semantic MediaWiki. If Semantic MediaWiki is used, it must be of
-version 1.5 or greater. For more details, see Semantic MediaWiki's
-own installation requirements.
+This extension requires MediaWiki 1.23 or greater.
 
 == Installation ==
 
 (1) Extract the archive to obtain the directory "DataTransfer"
 that contains all relevant files. Copy this directory (or
 extract/download it) to "[wikipath]/extensions/".
-(2) Insert the following line into the file "[wikipath]/LocalSettings.php":
+(2) Insert either of the following lines into the file
+"[wikipath]/LocalSettings.php":
   include_once( "$IP/extensions/DataTransfer/DataTransfer.php" );
-(3) To enable importing spreadsheet files (Excel, OOCalc, Gnumeric, ...)
+  wfLoadExtension( 'DataTransfer' );
+(3) To enable importing spreadsheet files (Excel, OOCalc, Gnumeric, ...),
 use Composer to install the phpoffice/phpexcel module. From the MediaWiki
-installation directory call
+installation directory call:
   composer require "phpoffice/phpexcel:~1.8"
 
 == Contact ==
diff --git a/extension.json b/extension.json
new file mode 100644
index 000..d35206c
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,72 @@
+{
+   "@Note": "When updating this file please also update DataTransfer.php 
with the same changes.",
+   "name": "Data Transfer",
+   "version": "1.0-alpha",
+   "author": [
+   "Yaron Koren",
+   "..."
+   ],
+   "url": "https://www.mediawiki.org/wiki/Extension:Data_Transfer;,
+   "descriptionmsg": "datatransfer-desc",
+   "license-name": "GPL-2.0+",
+   "type": "specialpage",
+   "GroupPermissions": {
+   "sysop": {
+   "datatransferimport": true
+   }
+   },
+   "AvailableRights": [
+   "datatransferimport"
+   ],
+   "SpecialPages": {
+   "ViewXML": "DTViewXML",
+   "ImportXML": "DTImportXML",
+   "ImportCSV": "DTImportCSV",
+   "ImportSpreadsheet": "DTImportSpreadsheet"
+   },
+"JobClasses": {
+  "dtImport": "DTImportJob"
+},
+   "MessagesDirs": {
+   "DataTransfer": [
+   "i18n"
+   ]
+   },
+   "ExtensionMessagesFiles": {
+   "DataTransferAlias": "DataTransfer.i18n.alias.php"
+   },
+   "AutoloadClasses": {
+   "DTPageStructure": "includes/DT_PageStructure.php",
+   "DTPageComponent": "includes/DT_PageComponent.php",
+   "DTPage": "includes/DT_Page.php",
+   "DTUtils": "includes/DT_Utils.php",
+   "DTImportJob": "includes/DT_ImportJob.php",
+   "DTXMLParser": "includes/DT_XMLParser.php",
+   "DTWikiTemplate": "includes/DT_WikiTemplate.php",
+   "DTWikiPage": "includes/DT_WikiPage.php",
+   "DTHooks": "includes/DT_Hooks.php",
+   "DTViewXML": "specials/DT_ViewXML.php",
+   "DTImportXML": "specials/DT_ImportXML.php",
+   "DTImportCSV": "specials/DT_ImportCSV.php",
+   "DTImportSpreadsheet": "specials/DT_ImportSpreadsheet.php"
+   },
+   "ResourceModules": {
+   "ext.datatransfer": {
+   "styles": "styles/DataTransfer.css"
+   }
+   },
+   "ResourceFileModulePaths": {
+   "localBasePath": "",
+   "remoteExtPath": "DataTransfer"
+   },
+   "Hooks": {
+   "AdminLinks": [
+   "DTHooks::addToAdminLinks"
+   ]
+   },
+   "config": {
+   "DataTransferViewXMLParseFields": false,
+   "DataTransferViewXMLParseFreeText": true
+   },
+   "manifest_version": 1
+}
\ No newline at end of file

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f4ab164744d77474452bc8735cf035f9d425615
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 

[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Added extension.json file

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402902 )

Change subject: Added extension.json file
..

Added extension.json file

Change-Id: I2f4ab164744d77474452bc8735cf035f9d425615
---
M INSTALL
A extension.json
2 files changed, 79 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/02/402902/2

diff --git a/INSTALL b/INSTALL
index 5361da4..4cab3a9 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-[[Data Transfer 0.6.2]]
+[[Data Transfer 1.0-alpha]]
 
 Contents:
 * Disclaimer
@@ -12,21 +12,20 @@
 
 == Requirements ==
 
-The extension can make use of, but does not require, an install of
-Semantic MediaWiki. If Semantic MediaWiki is used, it must be of
-version 1.5 or greater. For more details, see Semantic MediaWiki's
-own installation requirements.
+This extension requires MediaWiki 1.23 or greater.
 
 == Installation ==
 
 (1) Extract the archive to obtain the directory "DataTransfer"
 that contains all relevant files. Copy this directory (or
 extract/download it) to "[wikipath]/extensions/".
-(2) Insert the following line into the file "[wikipath]/LocalSettings.php":
+(2) Insert either of the following lines into the file
+"[wikipath]/LocalSettings.php":
   include_once( "$IP/extensions/DataTransfer/DataTransfer.php" );
-(3) To enable importing spreadsheet files (Excel, OOCalc, Gnumeric, ...)
+  wfLoadExtension( 'DataTransfer' );
+(3) To enable importing spreadsheet files (Excel, OOCalc, Gnumeric, ...),
 use Composer to install the phpoffice/phpexcel module. From the MediaWiki
-installation directory call
+installation directory call:
   composer require "phpoffice/phpexcel:~1.8"
 
 == Contact ==
diff --git a/extension.json b/extension.json
new file mode 100644
index 000..d35206c
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,72 @@
+{
+   "@Note": "When updating this file please also update DataTransfer.php 
with the same changes.",
+   "name": "Data Transfer",
+   "version": "1.0-alpha",
+   "author": [
+   "Yaron Koren",
+   "..."
+   ],
+   "url": "https://www.mediawiki.org/wiki/Extension:Data_Transfer;,
+   "descriptionmsg": "datatransfer-desc",
+   "license-name": "GPL-2.0+",
+   "type": "specialpage",
+   "GroupPermissions": {
+   "sysop": {
+   "datatransferimport": true
+   }
+   },
+   "AvailableRights": [
+   "datatransferimport"
+   ],
+   "SpecialPages": {
+   "ViewXML": "DTViewXML",
+   "ImportXML": "DTImportXML",
+   "ImportCSV": "DTImportCSV",
+   "ImportSpreadsheet": "DTImportSpreadsheet"
+   },
+"JobClasses": {
+  "dtImport": "DTImportJob"
+},
+   "MessagesDirs": {
+   "DataTransfer": [
+   "i18n"
+   ]
+   },
+   "ExtensionMessagesFiles": {
+   "DataTransferAlias": "DataTransfer.i18n.alias.php"
+   },
+   "AutoloadClasses": {
+   "DTPageStructure": "includes/DT_PageStructure.php",
+   "DTPageComponent": "includes/DT_PageComponent.php",
+   "DTPage": "includes/DT_Page.php",
+   "DTUtils": "includes/DT_Utils.php",
+   "DTImportJob": "includes/DT_ImportJob.php",
+   "DTXMLParser": "includes/DT_XMLParser.php",
+   "DTWikiTemplate": "includes/DT_WikiTemplate.php",
+   "DTWikiPage": "includes/DT_WikiPage.php",
+   "DTHooks": "includes/DT_Hooks.php",
+   "DTViewXML": "specials/DT_ViewXML.php",
+   "DTImportXML": "specials/DT_ImportXML.php",
+   "DTImportCSV": "specials/DT_ImportCSV.php",
+   "DTImportSpreadsheet": "specials/DT_ImportSpreadsheet.php"
+   },
+   "ResourceModules": {
+   "ext.datatransfer": {
+   "styles": "styles/DataTransfer.css"
+   }
+   },
+   "ResourceFileModulePaths": {
+   "localBasePath": "",
+   "remoteExtPath": "DataTransfer"
+   },
+   "Hooks": {
+   "AdminLinks": [
+   "DTHooks::addToAdminLinks"
+   ]
+   },
+   "config": {
+   "DataTransferViewXMLParseFields": false,
+   "DataTransferViewXMLParseFreeText": true
+   },
+   "manifest_version": 1
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f4ab164744d77474452bc8735cf035f9d425615
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: 

[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Renamed and moved aliases file

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402893 )

Change subject: Renamed and moved aliases file
..

Renamed and moved aliases file

Change-Id: Ieb103875820df11f29129da3fc0466e6a82e5a91
---
R DataTransfer.i18n.alias.php
1 file changed, 0 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/93/402893/2

diff --git a/languages/DT_Aliases.php b/DataTransfer.i18n.alias.php
similarity index 100%
rename from languages/DT_Aliases.php
rename to DataTransfer.i18n.alias.php

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb103875820df11f29129da3fc0466e6a82e5a91
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Moved PHPExcel check inside Special:ImportSpreadsheet

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402887 )

Change subject: Moved PHPExcel check inside Special:ImportSpreadsheet
..


Moved PHPExcel check inside Special:ImportSpreadsheet

Change-Id: I9fb63a78d609eaa5784180411c57351517a62019
---
M DataTransfer.php
M specials/DT_ImportSpreadsheet.php
2 files changed, 9 insertions(+), 7 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/DataTransfer.php b/DataTransfer.php
index 0897559..a22930b 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -34,7 +34,7 @@
 'position' => 'bottom',
 );
 
-// register all special pages and other classes
+// Register all special pages and other classes.
 $wgAutoloadClasses['DTPageStructure'] = $dtgIP . 
'/includes/DT_PageStructure.php';
 $wgAutoloadClasses['DTPageComponent'] = $dtgIP . 
'/includes/DT_PageComponent.php';
 $wgAutoloadClasses['DTPage'] = $dtgIP . '/includes/DT_Page.php';
@@ -45,19 +45,16 @@
 $wgAutoloadClasses['DTImportXML'] = $dtgIP . '/specials/DT_ImportXML.php';
 $wgSpecialPages['ImportCSV'] = 'DTImportCSV';
 $wgAutoloadClasses['DTImportCSV'] = $dtgIP . '/specials/DT_ImportCSV.php';
+$wgSpecialPages['ImportSpreadsheet'] = 'DTImportSpreadsheet';
+$wgAutoloadClasses['DTImportSpreadsheet'] = $dtgIP . 
'/specials/DT_ImportSpreadsheet.php';
 $wgJobClasses['dtImport'] = 'DTImportJob';
 $wgAutoloadClasses['DTImportJob'] = $dtgIP . '/includes/DT_ImportJob.php';
 $wgAutoloadClasses['DTXMLParser'] = $dtgIP . '/includes/DT_XMLParser.php';
 $wgAutoloadClasses['DTWikiTemplate'] = $dtgIP . 
'/includes/DT_WikiTemplate.php';
 $wgAutoloadClasses['DTWikiPage'] = $dtgIP . '/includes/DT_WikiPage.php';
 $wgAutoloadClasses['DTHooks'] = $dtgIP . '/includes/DT_Hooks.php';
-$wgHooks['AdminLinks'][] = 'DTHooks::addToAdminLinks';
 
-// Only enable spreadsheet import if PHPExcel is installed.
-if ( class_exists( 'PHPExcel' )) {
-   $wgSpecialPages['ImportSpreadsheet'] = 'DTImportSpreadsheet';
-   $wgAutoloadClasses['DTImportSpreadsheet'] = $dtgIP . 
'/specials/DT_ImportSpreadsheet.php';
-}
+$wgHooks['AdminLinks'][] = 'DTHooks::addToAdminLinks';
 
 ###
 # Permission to import files
diff --git a/specials/DT_ImportSpreadsheet.php 
b/specials/DT_ImportSpreadsheet.php
index 2fb751c..c1da80a 100644
--- a/specials/DT_ImportSpreadsheet.php
+++ b/specials/DT_ImportSpreadsheet.php
@@ -3,6 +3,7 @@
  * Lets the user import a spreadsheet file to turn into wiki pages
  *
  * @author Stephan Gambke
+ * @ingroup DataTransfer
  */
 
 class DTImportSpreadsheet extends DTImportCSV {
@@ -12,6 +13,10 @@
}
 
protected function printForm() {
+   if ( !class_exists( 'PHPExcel' ) ) {
+   return 'You must have the PHPExcel 
library installed to run this page.';
+   }
+
$formText = DTUtils::printFileSelector( $this->getFiletype() );
$formText .= DTUtils::printExistingPagesHandling();
$formText .= DTUtils::printImportSummaryInput( 
$this->getFiletype() );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9fb63a78d609eaa5784180411c57351517a62019
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Moved PHPExcel check inside Special:ImportSpreadsheet

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402887 )

Change subject: Moved PHPExcel check inside Special:ImportSpreadsheet
..

Moved PHPExcel check inside Special:ImportSpreadsheet

Change-Id: I9fb63a78d609eaa5784180411c57351517a62019
---
M DataTransfer.php
M specials/DT_ImportSpreadsheet.php
2 files changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/87/402887/2

diff --git a/DataTransfer.php b/DataTransfer.php
index 0897559..a22930b 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -34,7 +34,7 @@
 'position' => 'bottom',
 );
 
-// register all special pages and other classes
+// Register all special pages and other classes.
 $wgAutoloadClasses['DTPageStructure'] = $dtgIP . 
'/includes/DT_PageStructure.php';
 $wgAutoloadClasses['DTPageComponent'] = $dtgIP . 
'/includes/DT_PageComponent.php';
 $wgAutoloadClasses['DTPage'] = $dtgIP . '/includes/DT_Page.php';
@@ -45,19 +45,16 @@
 $wgAutoloadClasses['DTImportXML'] = $dtgIP . '/specials/DT_ImportXML.php';
 $wgSpecialPages['ImportCSV'] = 'DTImportCSV';
 $wgAutoloadClasses['DTImportCSV'] = $dtgIP . '/specials/DT_ImportCSV.php';
+$wgSpecialPages['ImportSpreadsheet'] = 'DTImportSpreadsheet';
+$wgAutoloadClasses['DTImportSpreadsheet'] = $dtgIP . 
'/specials/DT_ImportSpreadsheet.php';
 $wgJobClasses['dtImport'] = 'DTImportJob';
 $wgAutoloadClasses['DTImportJob'] = $dtgIP . '/includes/DT_ImportJob.php';
 $wgAutoloadClasses['DTXMLParser'] = $dtgIP . '/includes/DT_XMLParser.php';
 $wgAutoloadClasses['DTWikiTemplate'] = $dtgIP . 
'/includes/DT_WikiTemplate.php';
 $wgAutoloadClasses['DTWikiPage'] = $dtgIP . '/includes/DT_WikiPage.php';
 $wgAutoloadClasses['DTHooks'] = $dtgIP . '/includes/DT_Hooks.php';
-$wgHooks['AdminLinks'][] = 'DTHooks::addToAdminLinks';
 
-// Only enable spreadsheet import if PHPExcel is installed.
-if ( class_exists( 'PHPExcel' )) {
-   $wgSpecialPages['ImportSpreadsheet'] = 'DTImportSpreadsheet';
-   $wgAutoloadClasses['DTImportSpreadsheet'] = $dtgIP . 
'/specials/DT_ImportSpreadsheet.php';
-}
+$wgHooks['AdminLinks'][] = 'DTHooks::addToAdminLinks';
 
 ###
 # Permission to import files
diff --git a/specials/DT_ImportSpreadsheet.php 
b/specials/DT_ImportSpreadsheet.php
index 2fb751c..c1da80a 100644
--- a/specials/DT_ImportSpreadsheet.php
+++ b/specials/DT_ImportSpreadsheet.php
@@ -3,6 +3,7 @@
  * Lets the user import a spreadsheet file to turn into wiki pages
  *
  * @author Stephan Gambke
+ * @ingroup DataTransfer
  */
 
 class DTImportSpreadsheet extends DTImportCSV {
@@ -12,6 +13,10 @@
}
 
protected function printForm() {
+   if ( !class_exists( 'PHPExcel' ) ) {
+   return 'You must have the PHPExcel 
library installed to run this page.';
+   }
+
$formText = DTUtils::printFileSelector( $this->getFiletype() );
$formText .= DTUtils::printExistingPagesHandling();
$formText .= DTUtils::printImportSummaryInput( 
$this->getFiletype() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9fb63a78d609eaa5784180411c57351517a62019
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Removed unused variable

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402877 )

Change subject: Removed unused variable
..


Removed unused variable

Change-Id: Ic34781b857bd03e3091498336ad1846057f08360
---
M DataTransfer.php
1 file changed, 1 insertion(+), 8 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/DataTransfer.php b/DataTransfer.php
index 7bfc9e5..0897559 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -3,6 +3,7 @@
  * Global functions and constants for the Data Transfer extension.
  *
  * @author Yaron Koren
+ * @ingroup DataTransfer
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) die();
@@ -57,14 +58,6 @@
$wgSpecialPages['ImportSpreadsheet'] = 'DTImportSpreadsheet';
$wgAutoloadClasses['DTImportSpreadsheet'] = $dtgIP . 
'/specials/DT_ImportSpreadsheet.php';
 }
-
-###
-# This is the path to your installation of the Data Transfer extension as
-# seen from the web. Change it if required ($wgScriptPath is the
-# path to the base directory of your wiki). No final slash.
-##
-$dtgScriptPath = $wgScriptPath . '/extensions/DataTransfer';
-##
 
 ###
 # Permission to import files

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic34781b857bd03e3091498336ad1846057f08360
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Removed unused variable

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402877 )

Change subject: Removed unused variable
..

Removed unused variable

Change-Id: Ic34781b857bd03e3091498336ad1846057f08360
---
M DataTransfer.php
1 file changed, 1 insertion(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/77/402877/2

diff --git a/DataTransfer.php b/DataTransfer.php
index 7bfc9e5..0897559 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -3,6 +3,7 @@
  * Global functions and constants for the Data Transfer extension.
  *
  * @author Yaron Koren
+ * @ingroup DataTransfer
  */
 
 if ( !defined( 'MEDIAWIKI' ) ) die();
@@ -57,14 +58,6 @@
$wgSpecialPages['ImportSpreadsheet'] = 'DTImportSpreadsheet';
$wgAutoloadClasses['DTImportSpreadsheet'] = $dtgIP . 
'/specials/DT_ImportSpreadsheet.php';
 }
-
-###
-# This is the path to your installation of the Data Transfer extension as
-# seen from the web. Change it if required ($wgScriptPath is the
-# path to the base directory of your wiki). No final slash.
-##
-$dtgScriptPath = $wgScriptPath . '/extensions/DataTransfer';
-##
 
 ###
 # Permission to import files

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic34781b857bd03e3091498336ad1846057f08360
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Moved hook function to new class, DTHooks

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402873 )

Change subject: Moved hook function to new class, DTHooks
..

Moved hook function to new class, DTHooks

Change-Id: Ie5b5d19b64c10b3907826f5d27ffbf2326aaa3fb
---
M DataTransfer.php
A includes/DT_Hooks.php
2 files changed, 29 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/73/402873/2

diff --git a/DataTransfer.php b/DataTransfer.php
index a502a5a..7bfc9e5 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -49,7 +49,8 @@
 $wgAutoloadClasses['DTXMLParser'] = $dtgIP . '/includes/DT_XMLParser.php';
 $wgAutoloadClasses['DTWikiTemplate'] = $dtgIP . 
'/includes/DT_WikiTemplate.php';
 $wgAutoloadClasses['DTWikiPage'] = $dtgIP . '/includes/DT_WikiPage.php';
-$wgHooks['AdminLinks'][] = 'dtfAddToAdminLinks';
+$wgAutoloadClasses['DTHooks'] = $dtgIP . '/includes/DT_Hooks.php';
+$wgHooks['AdminLinks'][] = 'DTHooks::addToAdminLinks';
 
 // Only enable spreadsheet import if PHPExcel is installed.
 if ( class_exists( 'PHPExcel' )) {
@@ -76,24 +77,4 @@
 $wgDataTransferViewXMLParseFreeText = true;
 
 $wgMessagesDirs['DataTransfer'] = __DIR__ . '/i18n';
-$wgExtensionMessagesFiles['DataTransferAlias'] = $dtgIP . 
'/languages/DT_Aliases.php';
-
-/**/
-/* other global helpers   */
-/**/
-
-/**
- * Add links to the 'AdminLinks' special page, defined by the Admin Links
- * extension
- */
-function dtfAddToAdminLinks( $admin_links_tree ) {
-   $import_export_section = $admin_links_tree->getSection( wfMessage( 
'adminlinks_importexport' )->text() );
-   $main_row = $import_export_section->getRow( 'main' );
-   $main_row->addItem( ALItem::newFromSpecialPage( 'ViewXML' ) );
-   $main_row->addItem( ALItem::newFromSpecialPage( 'ImportXML' ) );
-   $main_row->addItem( ALItem::newFromSpecialPage( 'ImportCSV' ) );
-   if ( class_exists( 'PHPExcel' )) {
-   $main_row->addItem( ALItem::newFromSpecialPage( 
'ImportSpreadsheet' ) );
-   }
-   return true;
-}
+$wgExtensionMessagesFiles['DataTransferAlias'] = $dtgIP . 
'/languages/DT_Aliases.php';
\ No newline at end of file
diff --git a/includes/DT_Hooks.php b/includes/DT_Hooks.php
new file mode 100644
index 000..9599933
--- /dev/null
+++ b/includes/DT_Hooks.php
@@ -0,0 +1,26 @@
+getSection( 
wfMessage( 'adminlinks_importexport' )->text() );
+   $main_row = $import_export_section->getRow( 'main' );
+   $main_row->addItem( ALItem::newFromSpecialPage( 'ViewXML' ) );
+   $main_row->addItem( ALItem::newFromSpecialPage( 'ImportXML' ) );
+   $main_row->addItem( ALItem::newFromSpecialPage( 'ImportCSV' ) );
+   if ( class_exists( 'PHPExcel' )) {
+   $main_row->addItem( ALItem::newFromSpecialPage( 
'ImportSpreadsheet' ) );
+   }
+   return true;
+   }
+
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie5b5d19b64c10b3907826f5d27ffbf2326aaa3fb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: One class per file

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402866 )

Change subject: One class per file
..

One class per file

Change-Id: Ie2550603937b1596f35bec7ff9977a96183edde6
---
M DataTransfer.php
A includes/DT_PageComponent.php
M includes/DT_PageStructure.php
A includes/DT_WikiPage.php
A includes/DT_WikiTemplate.php
M includes/DT_XMLParser.php
6 files changed, 214 insertions(+), 196 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/66/402866/2

diff --git a/DataTransfer.php b/DataTransfer.php
index 63b9597..a502a5a 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -35,7 +35,7 @@
 
 // register all special pages and other classes
 $wgAutoloadClasses['DTPageStructure'] = $dtgIP . 
'/includes/DT_PageStructure.php';
-$wgAutoloadClasses['DTPageComponent'] = $dtgIP . 
'/includes/DT_PageStructure.php';
+$wgAutoloadClasses['DTPageComponent'] = $dtgIP . 
'/includes/DT_PageComponent.php';
 $wgAutoloadClasses['DTPage'] = $dtgIP . '/includes/DT_Page.php';
 $wgAutoloadClasses['DTUtils'] = $dtgIP . '/includes/DT_Utils.php';
 $wgSpecialPages['ViewXML'] = 'DTViewXML';
@@ -47,8 +47,8 @@
 $wgJobClasses['dtImport'] = 'DTImportJob';
 $wgAutoloadClasses['DTImportJob'] = $dtgIP . '/includes/DT_ImportJob.php';
 $wgAutoloadClasses['DTXMLParser'] = $dtgIP . '/includes/DT_XMLParser.php';
-$wgAutoloadClasses['DTWikiTemplate'] = $dtgIP . '/includes/DT_XMLParser.php';
-$wgAutoloadClasses['DTWikiPage'] = $dtgIP . '/includes/DT_XMLParser.php';
+$wgAutoloadClasses['DTWikiTemplate'] = $dtgIP . 
'/includes/DT_WikiTemplate.php';
+$wgAutoloadClasses['DTWikiPage'] = $dtgIP . '/includes/DT_WikiPage.php';
 $wgHooks['AdminLinks'][] = 'dtfAddToAdminLinks';
 
 // Only enable spreadsheet import if PHPExcel is installed.
diff --git a/includes/DT_PageComponent.php b/includes/DT_PageComponent.php
new file mode 100644
index 000..24c9171
--- /dev/null
+++ b/includes/DT_PageComponent.php
@@ -0,0 +1,131 @@
+mTemplateName = trim( $templateName );
+   $dtPageComponent->mIsTemplate = true;
+   $dtPageComponent->mFields = array();
+   self::$mUnnamedFieldCounter = 1;
+   return $dtPageComponent;
+   }
+   public static function newFreeText( $freeText ) {
+   $dtPageComponent = new DTPageComponent();
+   $dtPageComponent->mIsTemplate = false;
+   $dtPageComponent->mFreeText = $freeText;
+   $dtPageComponent->mFreeTextID = self::$mFreeTextIDCounter++;
+   return $dtPageComponent;
+   }
+
+   public function addNamedField( $fieldName, $fieldValue ) {
+   $this->mFields[trim( $fieldName )] = trim( $fieldValue );
+   }
+
+   public function addUnnamedField( $fieldValue ) {
+   $fieldName = self::$mUnnamedFieldCounter++;
+   $this->mFields[$fieldName] = trim( $fieldValue );
+   }
+
+   public function toWikitext() {
+   if ( $this->mIsTemplate ) {
+   $wikitext = '{{' . $this->mTemplateName;
+   foreach ( $this->mFields as $fieldName => $fieldValue ) 
{
+   if ( is_numeric( $fieldName ) ) {
+   $wikitext .= '|' . $fieldValue;
+   } else {
+   $wikitext .= 
"\n|$fieldName=$fieldValue";
+   }
+   }
+   $wikitext .= "\n}}";
+   return $wikitext;
+   } else {
+   return $this->mFreeText;
+   }
+   }
+
+   public function toXML( $isSimplified ) {
+   global $wgDataTransferViewXMLParseFields;
+   global $wgDataTransferViewXMLParseFreeText;
+   global $wgParser, $wgTitle;
+
+   if ( $this->mIsTemplate ) {
+   global $wgContLang;
+   $namespace_labels = $wgContLang->getNamespaces();
+   $template_label = $namespace_labels[NS_TEMPLATE];
+   $field_str = str_replace( ' ', '_', wfMessage( 
'dt_xml_field' )->inContentLanguage()->text() );
+   $name_str = str_replace( ' ', '_', wfMessage( 
'dt_xml_name' )->inContentLanguage()->text() );
+
+   $bodyXML = '';
+   foreach ( $this->mFields as $fieldName => $fieldValue ) 
{
+   // If this field itself holds template calls,
+   // get the XML for those calls.
+   if ( is_array( $fieldValue ) ) {
+   $fieldValueXML = '';
+   foreach ( $fieldValue as $subComponent 
) {
+   $fieldValueXML .= 

[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Removed now-unnecessary support for MW < 1.21

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402833 )

Change subject: Removed now-unnecessary support for MW < 1.21
..

Removed now-unnecessary support for MW < 1.21

Change-Id: I5b0faf5219070eb48fbb5c2f7f399658759215ec
---
M specials/DT_ImportCSV.php
M specials/DT_ImportXML.php
2 files changed, 4 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/33/402833/2

diff --git a/specials/DT_ImportCSV.php b/specials/DT_ImportCSV.php
index 71c5651..ec8c4d4 100644
--- a/specials/DT_ImportCSV.php
+++ b/specials/DT_ImportCSV.php
@@ -204,12 +204,8 @@
$jobParams['text'] = $page->createText();
$jobs[] = new DTImportJob( $title, $jobParams );
}
-   // MW 1.21+
-   if ( class_exists( 'JobQueueGroup' ) ) {
-   JobQueueGroup::singleton()->push( $jobs );
-   } else {
-   Job::batchInsert( $jobs );
-   }
+   JobQueueGroup::singleton()->push( $jobs );
+
$text .= $this->msg( 'dt_import_success' )->numParams( count( 
$jobs ) )->params( $this->getFiletype() )->parseAsBlock();
 
return $text;
diff --git a/specials/DT_ImportXML.php b/specials/DT_ImportXML.php
index 20bda5e..42f7d14 100644
--- a/specials/DT_ImportXML.php
+++ b/specials/DT_ImportXML.php
@@ -64,12 +64,8 @@
$job_params['text'] = $page->createText();
$jobs[] = new DTImportJob( $title, $job_params );
}
-   // MW 1.21+
-   if ( class_exists( 'JobQueueGroup' ) ) {
-   JobQueueGroup::singleton()->push( $jobs );
-   } else {
-   Job::batchInsert( $jobs );
-   }
+   JobQueueGroup::singleton()->push( $jobs );
+
$text .= $this->msg( 'dt_import_success' )->numParams( count( 
$jobs ) )->params( 'XML' )
->parseAsBlock();
return $text;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b0faf5219070eb48fbb5c2f7f399658759215ec
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DataTransfer
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Removed SMW "special properties"

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402831 )

Change subject: Removed SMW "special properties"
..


Removed SMW "special properties"

The two special properties, "Has XML grouping" and "Is excluded from XML", were 
removed - they no longer work, and I'm not sure they've ever been used, or at 
least they haven't been used in a long time.

Change-Id: I755a1c4308a00a8ac9ea04275b43cfc0b3027270
---
M DataTransfer.php
D languages/DT_Language.php
D languages/DT_LanguageDE.php
D languages/DT_LanguageEn.php
M specials/DT_ViewXML.php
5 files changed, 6 insertions(+), 256 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/DataTransfer.php b/DataTransfer.php
index 93e3fae..63b9597 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -7,11 +7,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) die();
 
-define( 'DATA_TRANSFER_VERSION', '0.6.2' );
-
-// constants for special properties
-define( 'DT_SP_HAS_XML_GROUPING', 1 );
-define( 'DT_SP_IS_EXCLUDED_FROM_XML', 2 );
+define( 'DATA_TRANSFER_VERSION', '1.0-alpha' );
 
 $wgExtensionCredits['specialpage'][] = array(
'path'   => __FILE__,
@@ -54,7 +50,6 @@
 $wgAutoloadClasses['DTWikiTemplate'] = $dtgIP . '/includes/DT_XMLParser.php';
 $wgAutoloadClasses['DTWikiPage'] = $dtgIP . '/includes/DT_XMLParser.php';
 $wgHooks['AdminLinks'][] = 'dtfAddToAdminLinks';
-$wgHooks['smwInitProperties'][] = 'dtfInitProperties';
 
 // Only enable spreadsheet import if PHPExcel is installed.
 if ( class_exists( 'PHPExcel' )) {
@@ -80,81 +75,12 @@
 $wgDataTransferViewXMLParseFields = false;
 $wgDataTransferViewXMLParseFreeText = true;
 
-// initialize content language
-require_once($dtgIP . '/languages/DT_Language.php');
-global $wgLanguageCode;
-dtfInitContentLanguage($wgLanguageCode);
-
 $wgMessagesDirs['DataTransfer'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['DataTransferAlias'] = $dtgIP . 
'/languages/DT_Aliases.php';
 
 /**/
-/* language settings  */
-/**/
-
-/**
- * Initialise a global language object for content language. This
- * must happen early on, even before user language is known, to
- * determine labels for additional namespaces. In contrast, messages
- * can be initialised much later when they are actually needed.
- */
-function dtfInitContentLanguage( $langcode ) {
-   global $dtgIP, $dtgContLang;
-
-   if ( !empty( $dtgContLang ) ) { return; }
-
-   $dtContLangClass = 'DT_Language' . str_replace( '-', '_', ucfirst( 
$langcode ) );
-
-   if ( file_exists( $dtgIP . '/languages/' . $dtContLangClass . '.php' ) 
) {
-   include_once( $dtgIP . '/languages/' . $dtContLangClass . 
'.php' );
-   }
-
-   // fallback if language not supported
-   if ( !class_exists( $dtContLangClass ) ) {
-   include_once( $dtgIP . '/languages/DT_LanguageEn.php' );
-   $dtContLangClass = 'DT_LanguageEn';
-   }
-
-   $dtgContLang = new $dtContLangClass();
-}
-
-/**
- * Initialise the global language object for user language. This
- * must happen after the content language was initialised, since
- * this language is used as a fallback.
- */
-function dtfInitUserLanguage( $langcode ) {
-   global $dtgIP, $dtgLang;
-
-   if ( !empty( $dtgLang ) ) { return; }
-
-   $dtLangClass = 'DT_Language' . str_replace( '-', '_', ucfirst( 
$langcode ) );
-
-   if ( file_exists( $dtgIP . '/languages/' . $dtLangClass . '.php' ) ) {
-   include_once( $dtgIP . '/languages/' . $dtLangClass . '.php' );
-   }
-
-   // fallback if language not supported
-   if ( !class_exists( $dtLangClass ) ) {
-   global $dtgContLang;
-   $dtgLang = $dtgContLang;
-   } else {
-   $dtgLang = new $dtLangClass();
-   }
-}
-
-/**/
 /* other global helpers   */
 /**/
-
-function dtfInitProperties() {
-   global $dtgContLang;
-   $dt_props = $dtgContLang->getPropertyLabels();
-   SMWDIProperty::registerProperty( '_DT_XG', '_str', 
$dt_props[DT_SP_HAS_XML_GROUPING], true );
-   // TODO - this should set a "backup" English value as well,
-   // so that the phrase "Has XML grouping" works in all languages
-   return true;
-}
 
 /**
  * Add links to the 'AdminLinks' special page, defined by the Admin Links
diff --git a/languages/DT_Language.php b/languages/DT_Language.php
deleted file mode 100644
index 00e7b5c..000
--- a/languages/DT_Language.php
+++ /dev/null
@@ -1,34 +0,0 @@
- DT_SP_HAS_XML_GROUPING,
-   'Excluded from XML' => DT_SP_IS_EXCLUDED_FROM_XML,
-   );
-
-   /**
-* Function that returns the labels for the special properties.
-  

[MediaWiki-commits] [Gerrit] mediawiki...DataTransfer[master]: Removed SMW "special properties"

2018-01-08 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402831 )

Change subject: Removed SMW "special properties"
..

Removed SMW "special properties"

The two special properties, "Has XML grouping" and "Is excluded from XML", were 
removed - they no longer work, and I'm not sure they've ever been used, or at 
least they haven't been used in a long time.

Change-Id: I755a1c4308a00a8ac9ea04275b43cfc0b3027270
---
M DataTransfer.php
D languages/DT_Language.php
D languages/DT_LanguageDE.php
D languages/DT_LanguageEn.php
M specials/DT_ViewXML.php
5 files changed, 6 insertions(+), 256 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataTransfer 
refs/changes/31/402831/2

diff --git a/DataTransfer.php b/DataTransfer.php
index 93e3fae..63b9597 100644
--- a/DataTransfer.php
+++ b/DataTransfer.php
@@ -7,11 +7,7 @@
 
 if ( !defined( 'MEDIAWIKI' ) ) die();
 
-define( 'DATA_TRANSFER_VERSION', '0.6.2' );
-
-// constants for special properties
-define( 'DT_SP_HAS_XML_GROUPING', 1 );
-define( 'DT_SP_IS_EXCLUDED_FROM_XML', 2 );
+define( 'DATA_TRANSFER_VERSION', '1.0-alpha' );
 
 $wgExtensionCredits['specialpage'][] = array(
'path'   => __FILE__,
@@ -54,7 +50,6 @@
 $wgAutoloadClasses['DTWikiTemplate'] = $dtgIP . '/includes/DT_XMLParser.php';
 $wgAutoloadClasses['DTWikiPage'] = $dtgIP . '/includes/DT_XMLParser.php';
 $wgHooks['AdminLinks'][] = 'dtfAddToAdminLinks';
-$wgHooks['smwInitProperties'][] = 'dtfInitProperties';
 
 // Only enable spreadsheet import if PHPExcel is installed.
 if ( class_exists( 'PHPExcel' )) {
@@ -80,81 +75,12 @@
 $wgDataTransferViewXMLParseFields = false;
 $wgDataTransferViewXMLParseFreeText = true;
 
-// initialize content language
-require_once($dtgIP . '/languages/DT_Language.php');
-global $wgLanguageCode;
-dtfInitContentLanguage($wgLanguageCode);
-
 $wgMessagesDirs['DataTransfer'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['DataTransferAlias'] = $dtgIP . 
'/languages/DT_Aliases.php';
 
 /**/
-/* language settings  */
-/**/
-
-/**
- * Initialise a global language object for content language. This
- * must happen early on, even before user language is known, to
- * determine labels for additional namespaces. In contrast, messages
- * can be initialised much later when they are actually needed.
- */
-function dtfInitContentLanguage( $langcode ) {
-   global $dtgIP, $dtgContLang;
-
-   if ( !empty( $dtgContLang ) ) { return; }
-
-   $dtContLangClass = 'DT_Language' . str_replace( '-', '_', ucfirst( 
$langcode ) );
-
-   if ( file_exists( $dtgIP . '/languages/' . $dtContLangClass . '.php' ) 
) {
-   include_once( $dtgIP . '/languages/' . $dtContLangClass . 
'.php' );
-   }
-
-   // fallback if language not supported
-   if ( !class_exists( $dtContLangClass ) ) {
-   include_once( $dtgIP . '/languages/DT_LanguageEn.php' );
-   $dtContLangClass = 'DT_LanguageEn';
-   }
-
-   $dtgContLang = new $dtContLangClass();
-}
-
-/**
- * Initialise the global language object for user language. This
- * must happen after the content language was initialised, since
- * this language is used as a fallback.
- */
-function dtfInitUserLanguage( $langcode ) {
-   global $dtgIP, $dtgLang;
-
-   if ( !empty( $dtgLang ) ) { return; }
-
-   $dtLangClass = 'DT_Language' . str_replace( '-', '_', ucfirst( 
$langcode ) );
-
-   if ( file_exists( $dtgIP . '/languages/' . $dtLangClass . '.php' ) ) {
-   include_once( $dtgIP . '/languages/' . $dtLangClass . '.php' );
-   }
-
-   // fallback if language not supported
-   if ( !class_exists( $dtLangClass ) ) {
-   global $dtgContLang;
-   $dtgLang = $dtgContLang;
-   } else {
-   $dtgLang = new $dtLangClass();
-   }
-}
-
-/**/
 /* other global helpers   */
 /**/
-
-function dtfInitProperties() {
-   global $dtgContLang;
-   $dt_props = $dtgContLang->getPropertyLabels();
-   SMWDIProperty::registerProperty( '_DT_XG', '_str', 
$dt_props[DT_SP_HAS_XML_GROUPING], true );
-   // TODO - this should set a "backup" English value as well,
-   // so that the phrase "Has XML grouping" works in all languages
-   return true;
-}
 
 /**
  * Add links to the 'AdminLinks' special page, defined by the Admin Links
diff --git a/languages/DT_Language.php b/languages/DT_Language.php
deleted file mode 100644
index 00e7b5c..000
--- a/languages/DT_Language.php
+++ /dev/null
@@ -1,34 +0,0 @@
- DT_SP_HAS_XML_GROUPING,
-   'Excluded from XML' => DT_SP_IS_EXCLUDED_FROM_XML,
-   );
-
-   /**
-* Function that returns the labels for the 

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Changed default sort to be on more than one field

2018-01-07 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402761 )

Change subject: Changed default sort to be on more than one field
..

Changed default sort to be on more than one field

Change-Id: Ieaedbcb5e375aae27eabe99e0ba931522e185f05
---
M includes/CargoSQLQuery.php
1 file changed, 19 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/61/402761/2

diff --git a/includes/CargoSQLQuery.php b/includes/CargoSQLQuery.php
index 3a475bb..b41c058 100644
--- a/includes/CargoSQLQuery.php
+++ b/includes/CargoSQLQuery.php
@@ -392,13 +392,25 @@
if ( $orderByStr != '' ) {
$this->mOrderByStr = $orderByStr;
} else {
-   // By default, sort on the first field.
-   reset( $this->mAliasedFieldNames );
-   $firstField = current( $this->mAliasedFieldNames );
-   if ( strpos( $firstField, '(' ) === false && strpos( 
$firstField, '.' ) === false ) {
-   $this->mOrderByStr = 
$this->mCargoDB->addIdentifierQuotes( $firstField );
-   } else {
-   $this->mOrderByStr = $firstField;
+   // By default, sort on up to the first five fields, in
+   // the order in which they're defined. Five seems like
+   // enough to make sure everything is in the right order,
+   // no? Or should it always be all the fields?
+   $this->mOrderByStr = '';
+   $fieldNum = 1;
+   foreach ( $this->mAliasedFieldNames as $fieldName ) {
+   if ( $fieldNum > 1 ) {
+   $this->mOrderByStr .= ', ';
+   }
+   if ( strpos( $fieldName, '(' ) === false && 
strpos( $fieldName, '.' ) === false ) {
+   $this->mOrderByStr .= 
$this->mCargoDB->addIdentifierQuotes( $fieldName );
+   } else {
+   $this->mOrderByStr .= $fieldName;
+   }
+   $fieldNum++;
+   if ( $fieldNum > 5 ) {
+   break;
+   }
}
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieaedbcb5e375aae27eabe99e0ba931522e185f05
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added FancyBox fix for jQuery 3

2018-01-04 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402171 )

Change subject: Added FancyBox fix for jQuery 3
..


Added FancyBox fix for jQuery 3

Based on this fix: https://github.com/nvidoni/fancybox/issues/2

The FancyBox library used by PF still needs to be updated.

Change-Id: I39d19cfb708ff10db657205d458d3785b908c448
---
M libs/jquery.fancybox.js
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/libs/jquery.fancybox.js b/libs/jquery.fancybox.js
index 68d2865..81f1406 100644
--- a/libs/jquery.fancybox.js
+++ b/libs/jquery.fancybox.js
@@ -577,8 +577,8 @@
 
_finish = function () {
if (!$.support.opacity) {
-   content.get(0).style.removeAttribute('filter');
-   wrap.get(0).style.removeAttribute('filter');
+   content.css('filter', 0);
+   wrap.css('filter', 0);
}
 
if (selectedOpts.autoDimensions) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I39d19cfb708ff10db657205d458d3785b908c448
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added FancyBox fix for jQuery 3

2018-01-04 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402171 )

Change subject: Added FancyBox fix for jQuery 3
..

Added FancyBox fix for jQuery 3

Based on this fix: https://github.com/nvidoni/fancybox/issues/2

The FancyBox library used by PF still needs to be updated.

Change-Id: I39d19cfb708ff10db657205d458d3785b908c448
---
M libs/jquery.fancybox.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/71/402171/2

diff --git a/libs/jquery.fancybox.js b/libs/jquery.fancybox.js
index 68d2865..81f1406 100644
--- a/libs/jquery.fancybox.js
+++ b/libs/jquery.fancybox.js
@@ -577,8 +577,8 @@
 
_finish = function () {
if (!$.support.opacity) {
-   content.get(0).style.removeAttribute('filter');
-   wrap.get(0).style.removeAttribute('filter');
+   content.css('filter', 0);
+   wrap.css('filter', 0);
}
 
if (selectedOpts.autoDimensions) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I39d19cfb708ff10db657205d458d3785b908c448
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Fix for jQuery 3 - removeAttr('disabled') deprecated

2018-01-04 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402162 )

Change subject: Fix for jQuery 3 - removeAttr('disabled') deprecated
..


Fix for jQuery 3 - removeAttr('disabled') deprecated

Change-Id: I81b29858a9527d7565ada2006874e5ef3fe15644
---
M libs/PF_submit.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/libs/PF_submit.js b/libs/PF_submit.js
index 3a2ccf4..598ef32 100644
--- a/libs/PF_submit.js
+++ b/libs/PF_submit.js
@@ -15,7 +15,7 @@
 
function setChanged( event ) {
sacButtons
-   .removeAttr( 'disabled' )
+   .prop( 'disabled', false )
.addClass( 'pf-save_and_continue-changed' );
 
return true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I81b29858a9527d7565ada2006874e5ef3fe15644
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Fix for jQuery 3 - removeAttr('disabled') deprecated

2018-01-04 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402162 )

Change subject: Fix for jQuery 3 - removeAttr('disabled') deprecated
..

Fix for jQuery 3 - removeAttr('disabled') deprecated

Change-Id: I81b29858a9527d7565ada2006874e5ef3fe15644
---
M libs/PF_submit.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/62/402162/2

diff --git a/libs/PF_submit.js b/libs/PF_submit.js
index 3a2ccf4..598ef32 100644
--- a/libs/PF_submit.js
+++ b/libs/PF_submit.js
@@ -15,7 +15,7 @@
 
function setChanged( event ) {
sacButtons
-   .removeAttr( 'disabled' )
+   .prop( 'disabled', false )
.addClass( 'pf-save_and_continue-changed' );
 
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81b29858a9527d7565ada2006874e5ef3fe15644
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Changed list display delimiter from "middot" to "bullet"

2018-01-04 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402144 )

Change subject: Changed list display delimiter from "middot" to "bullet"
..


Changed list display delimiter from "middot" to "bullet"

Also added CSS class for it.

Change-Id: I7ed08996f51c04277fa69dedca0f53d8c6f7d975
---
M includes/CargoQueryDisplayer.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/CargoQueryDisplayer.php b/includes/CargoQueryDisplayer.php
index b5e384d..c509033 100644
--- a/includes/CargoQueryDisplayer.php
+++ b/includes/CargoQueryDisplayer.php
@@ -113,7 +113,7 @@
continue;
}
if ( $i > 0 ) {
-   // Use a "middle dot" as
+   // Use a bullet point as
// the list delimiter -
// it's better than 
using
// a comma, or the
@@ -122,7 +122,7 @@
// consistent and makes
// it clearer whether
// list parsing worked.
-   $text .= "  ";
+   $text .= '  ';
}
$text .= 
self::formatFieldValue( $fieldValue, $fieldType, $fieldDescription, 
$this->mParser );
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ed08996f51c04277fa69dedca0f53d8c6f7d975
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Changed list display delimiter from "middot" to "bullet"

2018-01-04 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402144 )

Change subject: Changed list display delimiter from "middot" to "bullet"
..

Changed list display delimiter from "middot" to "bullet"

Also added CSS class for it.

Change-Id: I7ed08996f51c04277fa69dedca0f53d8c6f7d975
---
M includes/CargoQueryDisplayer.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/44/402144/2

diff --git a/includes/CargoQueryDisplayer.php b/includes/CargoQueryDisplayer.php
index b5e384d..c509033 100644
--- a/includes/CargoQueryDisplayer.php
+++ b/includes/CargoQueryDisplayer.php
@@ -113,7 +113,7 @@
continue;
}
if ( $i > 0 ) {
-   // Use a "middle dot" as
+   // Use a bullet point as
// the list delimiter -
// it's better than 
using
// a comma, or the
@@ -122,7 +122,7 @@
// consistent and makes
// it clearer whether
// list parsing worked.
-   $text .= "  ";
+   $text .= '  ';
}
$text .= 
self::formatFieldValue( $fieldValue, $fieldType, $fieldDescription, 
$this->mParser );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7ed08996f51c04277fa69dedca0f53d8c6f7d975
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for 7af3648c8d98 - got blank aliases working again

2018-01-02 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401528 )

Change subject: Fix for 7af3648c8d98 - got blank aliases working again
..

Fix for 7af3648c8d98 - got blank aliases working again

It's necessary for smartSplit() to return blank values for field=alias 
combinations.

Change-Id: Icb4d55f8544805ac72897a06f624d9e88d1d5aed
---
M includes/CargoSQLQuery.php
M includes/CargoUtils.php
2 files changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/28/401528/2

diff --git a/includes/CargoSQLQuery.php b/includes/CargoSQLQuery.php
index 77685f1..3a475bb 100644
--- a/includes/CargoSQLQuery.php
+++ b/includes/CargoSQLQuery.php
@@ -191,7 +191,7 @@
// displayed.
$blankAliasCount = 0;
foreach ( $fieldStrings as $i => $fieldString ) {
-   $fieldStringParts = CargoUtils::smartSplit( '=', 
$fieldString );
+   $fieldStringParts = CargoUtils::smartSplit( '=', 
$fieldString, true );
if ( count( $fieldStringParts ) == 2 ) {
$fieldName = trim( $fieldStringParts[0] );
$alias = trim( $fieldStringParts[1] );
diff --git a/includes/CargoUtils.php b/includes/CargoUtils.php
index ca0f294..9561881 100644
--- a/includes/CargoUtils.php
+++ b/includes/CargoUtils.php
@@ -204,10 +204,11 @@
 * lexically.
 * @param string $delimiter The delimiter to split by.
 * @param string $string The string to split.
-* @return string[] Array of substrings (with no empty values).
+* @param boolean $includeBlankValues Whether to include blank values 
in the returned array.
+* @return string[] Array of substrings (with or without blank values).
 * @throws MWException On unmatched quotes or incomplete escape 
sequences.
 */
-   static function smartSplit( $delimiter, $string ) {
+   static function smartSplit( $delimiter, $string, $includeBlankValues = 
false ) {
if ( $string == '' ) {
return array();
}
@@ -254,6 +255,10 @@
throw new MWException( "Error: incomplete escape 
sequence." );
}
 
+   if ( $includeBlankValues ) {
+   return $returnValues;
+   }
+
// Remove empty strings (but not other quasi-empty values, like 
'0') and re-key the array.
$noEmptyStrings = function($s) {
return $s !== '';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb4d55f8544805ac72897a06f624d9e88d1d5aed
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...AdminLinks[master]: build: Updating mediawiki/mediawiki-codesniffer to 15.0.0

2017-12-31 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/401103 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
..


build: Updating mediawiki/mediawiki-codesniffer to 15.0.0

Change-Id: I8e271513e8d5daf4e0b1a90bf92c11c305d223ca
---
M .phpcs.xml
M composer.json
2 files changed, 3 insertions(+), 2 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.phpcs.xml b/.phpcs.xml
index b957e41..e38ac01 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -3,8 +3,9 @@



-   
+   

+   



diff --git a/composer.json b/composer.json
index 79b6d3d..6393815 100644
--- a/composer.json
+++ b/composer.json
@@ -26,7 +26,7 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
-   "mediawiki/mediawiki-codesniffer": "14.1.0",
+   "mediawiki/mediawiki-codesniffer": "15.0.0",
"jakub-onderka/php-console-highlighter": "0.3.2",
"mediawiki/minus-x": "0.2.1"
},

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e271513e8d5daf4e0b1a90bf92c11c305d223ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdminLinks
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 
Gerrit-Reviewer: Legoktm 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added delimiter for list of "attached templates"

2017-12-29 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401004 )

Change subject: Added delimiter for list of "attached templates"
..

Added delimiter for list of "attached templates"

Change-Id: I843cdb463d03b70ba877494648d876e6fafb5e17
---
M specials/CargoTables.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/04/401004/2

diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index f05914f..28836b4 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -318,7 +318,7 @@
$templateLinks[] = 
CargoUtils::makeLink( $linkRenderer, $templateTitle );
}
$declaringTemplatesText = $this->msg(
-   'cargo-cargotables-declaredby', 
implode( $templateLinks ) )->text();
+   'cargo-cargotables-declaredby', 
implode( ', ', $templateLinks ) )->text();
}
 
// "Attached by" text
@@ -337,7 +337,7 @@
$templateLinks[] = 
CargoUtils::makeLink( $linkRenderer, $templateTitle );
}
$attachingTemplatesText = $this->msg(
-   'cargo-cargotables-attachedby', 
implode( $templateLinks ) )->text();
+   'cargo-cargotables-attachedby', 
implode( ', ', $templateLinks ) )->text();
}
 
$tableText = "$tableName ($actionLinks) - $numRowsText 
($declaringTemplatesText";

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I843cdb463d03b70ba877494648d876e6fafb5e17
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for "group by" and "having" in query API

2017-12-29 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/400984 )

Change subject: Fix for "group by" and "having" in query API
..

Fix for "group by" and "having" in query API

Change-Id: Ibfbfdc13f0b095173bed17f1a3f28846d3418ae8
---
M api/CargoQueryAPI.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/84/400984/2

diff --git a/api/CargoQueryAPI.php b/api/CargoQueryAPI.php
index 70afdb8..6be5dc5 100644
--- a/api/CargoQueryAPI.php
+++ b/api/CargoQueryAPI.php
@@ -28,7 +28,7 @@
}
 
$sqlQuery = CargoSQLQuery::newFromValues( $tablesStr, 
$fieldsStr, $whereStr, $joinOnStr,
-   $havingStr, $groupByStr, $orderByStr, $limitStr 
);
+   $groupByStr, $havingStr, $orderByStr, $limitStr 
);
try {
$queryResults = $sqlQuery->run();
} catch ( Exception $e ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibfbfdc13f0b095173bed17f1a3f28846d3418ae8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added CSS class for multi-instance template tables

2017-12-22 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399828 )

Change subject: Added CSS class for multi-instance template tables
..

Added CSS class for multi-instance template tables

Change-Id: I51c82a7b9c6a60af595c18bd1c2dce5751c46364
---
M includes/PF_FormPrinter.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/28/399828/2

diff --git a/includes/PF_FormPrinter.php b/includes/PF_FormPrinter.php
index ed30c87..38cce33 100644
--- a/includes/PF_FormPrinter.php
+++ b/includes/PF_FormPrinter.php
@@ -313,7 +313,7 @@
}
 
$text = <<
+   


$mainText

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I51c82a7b9c6a60af595c18bd1c2dce5751c46364
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Fix for c81949280a0e - fixed escaping of quotes in file names

2017-12-22 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399815 )

Change subject: Fix for c81949280a0e - fixed escaping of quotes in file names
..

Fix for c81949280a0e - fixed escaping of quotes in file names

Change-Id: I02ef2e5eff23de2dd9d195c36f5ba210d8cedc32
---
M libs/ext.pf.select2.base.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/15/399815/2

diff --git a/libs/ext.pf.select2.base.js b/libs/ext.pf.select2.base.js
index 854e13b..ac1bbc3 100644
--- a/libs/ext.pf.select2.base.js
+++ b/libs/ext.pf.select2.base.js
@@ -75,9 +75,9 @@
var description = value.description;
var markup = "";
 
-   // Escape quotes in image.
+   // HTML-encode quotes in image name.
if ( image !== undefined ) {
-   image = image.replace( /"/g, '\\\"' );
+   image = image.replace( /"/g, "" );
}
 
var highlightedText = 
pf.select2.base.prototype.textHighlight( text, term );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02ef2e5eff23de2dd9d195c36f5ba210d8cedc32
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Fix for wikis with default URL structure

2017-12-22 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399813 )

Change subject: Fix for wikis with default URL structure
..

Fix for wikis with default URL structure

Change-Id: Ia9e9dfd61818d1971b71c04e2df4cf3dfb9e2483
---
M libs/PF_simpleupload.js
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/13/399813/2

diff --git a/libs/PF_simpleupload.js b/libs/PF_simpleupload.js
index 0881368..4fea7fb 100644
--- a/libs/PF_simpleupload.js
+++ b/libs/PF_simpleupload.js
@@ -56,8 +56,10 @@
if ( !data.error ) {
input.val(fileName);

input.parent().find('img.simpleupload_prv').remove();
-   $('').insertAfter(input);
+   var imagePreviewURL = 
mw.config.get('wgArticlePath').replace( '$1', 'Special:Redirect/file/' + 
encodeURIComponent( input.val() ) );
+   imagePreviewURL += ( 
imagePreviewURL.indexOf('?') === -1 ) ? '?' : '&';
+   imagePreviewURL += 'width=100';
+   $('').insertAfter(input);

_this.parent().find('.simpleupload_btn').show().val( mw.message( 
'pf_forminputs_change_file' ).text() );

_this.parent().find('img.loading').hide();

_this.parent().find('.simpleupload_rmv_btn').show();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9e9dfd61818d1971b71c04e2df4cf3dfb9e2483
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...ExternalData[master]: Adds json offset, introtemplate, and outrotemplate

2017-12-21 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/399456 )

Change subject: Adds json offset, introtemplate, and outrotemplate
..


Adds json offset, introtemplate, and outrotemplate

Some JSON sources prefix the JSON with text the prevent Cross Site Script
Inclusion (XSSI) attacks. This prefix must be stripped before passing
the text to a JSON parser.  The new json offset parameter indicates how
long the prefix that needs to be stripped is. For example, see
https://gerrit-review.googlesource.com/Documentation/rest-api.html#output.

Also adds intro template and outro template to display_external_table to
suppress the header and footer when there is no data displayed.

Change-Id: I88d849b5c8201ac03cdb3f2e085d9460a4f93bc2
---
M ED_ParserFunctions.php
M ED_Utils.php
2 files changed, 21 insertions(+), 7 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ED_ParserFunctions.php b/ED_ParserFunctions.php
index de79f8b..8edc7e1 100644
--- a/ED_ParserFunctions.php
+++ b/ED_ParserFunctions.php
@@ -123,8 +123,14 @@
$cacheExpireTime = $edgCacheExpireTime;
}
 
+   if ( array_key_exists( 'json offset', $args) ) {
+   $prefixLength = $args['json offset'];
+   } else {
+   $prefixLength = 0;
+   }
+
$postData = array_key_exists( 'post data', $args ) ? 
$args['post data'] : '';
-   $external_values = EDUtils::getDataFromURL( $url, $format, 
$mappings, $postData, $cacheExpireTime );
+   $external_values = EDUtils::getDataFromURL( $url, $format, 
$mappings, $postData, $cacheExpireTime, $prefixLength );
if ( is_string( $external_values ) ) {
// It's an error message - display it on the screen.
return EDUtils::formatErrorMessage( $external_values );
@@ -540,7 +546,11 @@
$num_loops = max( $num_loops, count( 
$edgValues[$local_variable] ) );
}
 
-   $text = "";
+   if ( array_key_exists( 'intro template', $args ) && $num_loops 
> 0) {
+   $text = '{{' . $args['intro template'] . '}}';
+   } else {
+   $text = "";
+   }
for ( $i = 0; $i < $num_loops; $i++ ) {
if ( $i > 0 ) {
$text .= $delimiter;
@@ -552,6 +562,9 @@
}
$text .= "}}";
}
+   if ( array_key_exists( 'outro template', $args ) && $num_loops 
> 0 ) {
+   $text .= '{{' . $args['outro template'] . '}}';
+   }
 
// This actually 'calls' the template that we built above
return array( $text, 'noparse' => false );
diff --git a/ED_Utils.php b/ED_Utils.php
index 5293713..8274c30 100644
--- a/ED_Utils.php
+++ b/ED_Utils.php
@@ -876,7 +876,8 @@
}
}
 
-   static function getJSONData( $json ) {
+   static function getJSONData( $json, $prefixLength ) {
+   $json = substr( $json, $prefixLength );
$json_tree = FormatJson::decode( $json, true );
if ( is_null( $json_tree ) ) {
// It's probably invalid JSON.
@@ -955,7 +956,7 @@
}
}
 
-   static private function getDataFromText( $contents, $format, $mappings, 
$source ) {
+   static private function getDataFromText( $contents, $format, $mappings, 
$source, $prefixLength = 0 ) {
// For now, this is only done for the CSV formats.
if ( is_array( $format ) ) {
list( $format, $delimiter ) = $format;
@@ -972,7 +973,7 @@
} elseif ( $format == 'csv with header' ) {
return self::getCSVData( $contents, true, $delimiter );
} elseif ( $format == 'json' ) {
-   return self::getJSONData( $contents );
+   return self::getJSONData( $contents, $prefixLength );
} elseif ( $format == 'gff' ) {
return self::getGFFData( $contents );
} else {
@@ -1007,14 +1008,14 @@
}
}
 
-   static public function getDataFromURL( $url, $format, $mappings, 
$postData = null, $cacheExpireTime ) {
+   static public function getDataFromURL( $url, $format, $mappings, 
$postData = null, $cacheExpireTime, $prefixLength ) {
$url_contents = self::fetchURL( $url, $postData, 
$cacheExpireTime );
// Show an error message if there's nothing there.
if ( empty( $url_contents ) ) {
return "Error: No contents found at URL $url.";
}
 

[MediaWiki-commits] [Gerrit] mediawiki...PageForms[REL1_30]: Fix for Unicode handling change in MW 1.30

2017-12-18 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398892 )

Change subject: Fix for Unicode handling change in MW 1.30
..


Fix for Unicode handling change in MW 1.30

Bug: T183120
Change-Id: I2d669f531658f589ede082bc73451c69fb11962f
(cherry picked from commit b093691bf79c8a011969c8e3453304a32b7266b1)
---
M includes/PF_FormPrinter.php
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PF_FormPrinter.php b/includes/PF_FormPrinter.php
index 3319d3e..e2228ad 100644
--- a/includes/PF_FormPrinter.php
+++ b/includes/PF_FormPrinter.php
@@ -1544,8 +1544,11 @@
$form_text .= Html::hidden( 'wpStarttime', 
wfTimestampNow() );
$article = new Article( $this->mPageTitle, 0 );
$form_text .= Html::hidden( 'wpEdittime', 
$article->getTimestamp() );
-
$form_text .= Html::hidden( 'wpEditToken', 
$wgUser->getEditToken() );
+   if ( defined( 'EditPage::UNICODE_CHECK' ) ) {
+   // MW 1.30+
+   $form_text .= Html::hidden( 'wpUnicodeCheck', 
EditPage::UNICODE_CHECK );
+   }
}
 
$form_text .= "\t\n";

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d669f531658f589ede082bc73451c69fb11962f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: REL1_30
Gerrit-Owner: Legoktm 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Revert of 164d2d64ccf9 - DB_REPLICA was only added in MW 1.28

2017-12-17 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398776 )

Change subject: Revert of 164d2d64ccf9 - DB_REPLICA was only added in MW 1.28
..

Revert of 164d2d64ccf9 - DB_REPLICA was only added in MW 1.28

Change-Id: I571973d5aa595cb44c5008d1c71634249dec589e
---
M includes/PF_AutocompleteAPI.php
M includes/PF_FormEditAction.php
M includes/PF_FormLinker.php
M includes/PF_Utils.php
M includes/PF_ValuesUtils.php
M includes/forminputs/PF_Tree.php
M specials/PF_CreateForm.php
7 files changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/76/398776/2

diff --git a/includes/PF_AutocompleteAPI.php b/includes/PF_AutocompleteAPI.php
index ff5501a..b57bd77 100644
--- a/includes/PF_AutocompleteAPI.php
+++ b/includes/PF_AutocompleteAPI.php
@@ -187,7 +187,7 @@
global $smwgDefaultStore;
 
$values = array();
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$sqlOptions = array();
$sqlOptions['LIMIT'] = $wgPageFormsMaxAutocompleteValues;
 
diff --git a/includes/PF_FormEditAction.php b/includes/PF_FormEditAction.php
index c68d566..9d6f93e 100644
--- a/includes/PF_FormEditAction.php
+++ b/includes/PF_FormEditAction.php
@@ -225,7 +225,7 @@
 * (hopefully) pretty rare.
 */
static function getNumPagesPerForm() {
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select(
array( 'category', 'page', 'page_props' ),
array( 'pp_value', 'SUM(cat_pages) AS total_pages' ),
diff --git a/includes/PF_FormLinker.php b/includes/PF_FormLinker.php
index a25bb53..8f6a731 100644
--- a/includes/PF_FormLinker.php
+++ b/includes/PF_FormLinker.php
@@ -21,7 +21,7 @@
}
 
$pageID = $title->getArticleID();
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'page_props',
array(
'pp_value'
diff --git a/includes/PF_Utils.php b/includes/PF_Utils.php
index 00574f7..81b6c5f 100644
--- a/includes/PF_Utils.php
+++ b/includes/PF_Utils.php
@@ -234,7 +234,7 @@
 * Returns an array of all form names on this wiki.
*/
public static function getAllForms() {
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'page',
'page_title',
array( 'page_namespace' => PF_NS_FORM,
diff --git a/includes/PF_ValuesUtils.php b/includes/PF_ValuesUtils.php
index a6cb598..e806a4b 100644
--- a/includes/PF_ValuesUtils.php
+++ b/includes/PF_ValuesUtils.php
@@ -51,7 +51,7 @@
 */
public static function getCategoriesForPage( $title = null ) {
$categories = array();
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$conditions = null;
if ( !is_null( $title ) ) {
$titlekey = $title->getArticleID();
@@ -149,7 +149,7 @@
}
global $wgPageFormsMaxAutocompleteValues, 
$wgPageFormsUseDisplayTitle;
 
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$top_category = str_replace( ' ', '_', $top_category );
$categories = array( $top_category );
$checkcategories = array( $top_category );
@@ -392,7 +392,7 @@
return wfMessage( 'pf-missingnamespace', 
wfEscapeWikiText( $namespace_name ) );
}
 
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$tables = array( 'page' );
$columns = array( 'page_title' );
$conditions = array();
@@ -540,7 +540,7 @@
public static function getSQLConditionForAutocompleteInColumn( $column, 
$substring, $replaceSpaces = true ) {
global $wgDBtype, $wgPageFormsAutocompleteOnAllChars;
 
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
 
// CONVERT() is also supported in PostgreSQL, but it doesn't
// seem to work the same way.
diff --git a/includes/forminputs/PF_Tree.php b/includes/forminputs/PF_Tree.php
index 2802d49..b9efb29 100644
--- a/includes/forminputs/PF_Tree.php
+++ b/includes/forminputs/PF_Tree.php
@@ -86,7 +86,7 @@
 * @return array
 */
private static function getSubcategories( $categoryName ) {
-   $dbr = wfGetDb( DB_REPLICA );
+   $dbr = wfGetDb( DB_SLAVE );
 
$tables = array( 'page', 'categorylinks' );
$fields = array( 

[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Revert of 164d2d64ccf9 - DB_REPLICA was only added in MW 1.28

2017-12-17 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398776 )

Change subject: Revert of 164d2d64ccf9 - DB_REPLICA was only added in MW 1.28
..


Revert of 164d2d64ccf9 - DB_REPLICA was only added in MW 1.28

Change-Id: I571973d5aa595cb44c5008d1c71634249dec589e
---
M includes/PF_AutocompleteAPI.php
M includes/PF_FormEditAction.php
M includes/PF_FormLinker.php
M includes/PF_Utils.php
M includes/PF_ValuesUtils.php
M includes/forminputs/PF_Tree.php
M specials/PF_CreateForm.php
7 files changed, 10 insertions(+), 10 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PF_AutocompleteAPI.php b/includes/PF_AutocompleteAPI.php
index ff5501a..b57bd77 100644
--- a/includes/PF_AutocompleteAPI.php
+++ b/includes/PF_AutocompleteAPI.php
@@ -187,7 +187,7 @@
global $smwgDefaultStore;
 
$values = array();
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$sqlOptions = array();
$sqlOptions['LIMIT'] = $wgPageFormsMaxAutocompleteValues;
 
diff --git a/includes/PF_FormEditAction.php b/includes/PF_FormEditAction.php
index c68d566..9d6f93e 100644
--- a/includes/PF_FormEditAction.php
+++ b/includes/PF_FormEditAction.php
@@ -225,7 +225,7 @@
 * (hopefully) pretty rare.
 */
static function getNumPagesPerForm() {
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select(
array( 'category', 'page', 'page_props' ),
array( 'pp_value', 'SUM(cat_pages) AS total_pages' ),
diff --git a/includes/PF_FormLinker.php b/includes/PF_FormLinker.php
index a25bb53..8f6a731 100644
--- a/includes/PF_FormLinker.php
+++ b/includes/PF_FormLinker.php
@@ -21,7 +21,7 @@
}
 
$pageID = $title->getArticleID();
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'page_props',
array(
'pp_value'
diff --git a/includes/PF_Utils.php b/includes/PF_Utils.php
index 00574f7..81b6c5f 100644
--- a/includes/PF_Utils.php
+++ b/includes/PF_Utils.php
@@ -234,7 +234,7 @@
 * Returns an array of all form names on this wiki.
*/
public static function getAllForms() {
-   $dbr = wfGetDB( DB_REPLICA );
+   $dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'page',
'page_title',
array( 'page_namespace' => PF_NS_FORM,
diff --git a/includes/PF_ValuesUtils.php b/includes/PF_ValuesUtils.php
index a6cb598..e806a4b 100644
--- a/includes/PF_ValuesUtils.php
+++ b/includes/PF_ValuesUtils.php
@@ -51,7 +51,7 @@
 */
public static function getCategoriesForPage( $title = null ) {
$categories = array();
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$conditions = null;
if ( !is_null( $title ) ) {
$titlekey = $title->getArticleID();
@@ -149,7 +149,7 @@
}
global $wgPageFormsMaxAutocompleteValues, 
$wgPageFormsUseDisplayTitle;
 
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$top_category = str_replace( ' ', '_', $top_category );
$categories = array( $top_category );
$checkcategories = array( $top_category );
@@ -392,7 +392,7 @@
return wfMessage( 'pf-missingnamespace', 
wfEscapeWikiText( $namespace_name ) );
}
 
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
$tables = array( 'page' );
$columns = array( 'page_title' );
$conditions = array();
@@ -540,7 +540,7 @@
public static function getSQLConditionForAutocompleteInColumn( $column, 
$substring, $replaceSpaces = true ) {
global $wgDBtype, $wgPageFormsAutocompleteOnAllChars;
 
-   $db = wfGetDB( DB_REPLICA );
+   $db = wfGetDB( DB_SLAVE );
 
// CONVERT() is also supported in PostgreSQL, but it doesn't
// seem to work the same way.
diff --git a/includes/forminputs/PF_Tree.php b/includes/forminputs/PF_Tree.php
index 2802d49..b9efb29 100644
--- a/includes/forminputs/PF_Tree.php
+++ b/includes/forminputs/PF_Tree.php
@@ -86,7 +86,7 @@
 * @return array
 */
private static function getSubcategories( $categoryName ) {
-   $dbr = wfGetDb( DB_REPLICA );
+   $dbr = wfGetDb( DB_SLAVE );
 
$tables = array( 'page', 'categorylinks' );
$fields = array( 'page_id', 

[MediaWiki-commits] [Gerrit] mediawiki...SiteSettings[master]: Allowed NULL value for more DB fields

2017-12-13 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398119 )

Change subject: Allowed NULL value for more DB fields
..

Allowed NULL value for more DB fields

Change-Id: If33b86239fcd27064fcb57b614883edc0d6b24a9
---
M SiteSettings.sql
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SiteSettings 
refs/changes/19/398119/2

diff --git a/SiteSettings.sql b/SiteSettings.sql
index bcf3139..65527ef 100644
--- a/SiteSettings.sql
+++ b/SiteSettings.sql
@@ -21,8 +21,8 @@
background_color varchar(20) default NULL,
sidebar_color varchar(20) default NULL,
sidebar_border_color varchar(20) NULL,
-   copyright_text varchar(255) NOT NULL,
-   copyright_url varchar(150) NOT NULL,
+   copyright_text varchar(255) default NULL,
+   copyright_url varchar(150) default NULL,
logo_file varchar(100) default NULL,
favicon_file varchar(50) default NULL,
viewing_policy_id int(11) NOT NULL,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If33b86239fcd27064fcb57b614883edc0d6b24a9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/SiteSettings
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Skip 'replacement' tables in drilldown display, recreate script

2017-12-07 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/396300 )

Change subject: Skip 'replacement' tables in drilldown display, recreate script
..

Skip 'replacement' tables in drilldown display, recreate script

Change-Id: I48787eec4e0c1cf09a32fcab411a7a527b7a3fdc
---
M includes/CargoUtils.php
M specials/CargoTables.php
2 files changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/00/396300/2

diff --git a/includes/CargoUtils.php b/includes/CargoUtils.php
index 7238401..ca0f294 100644
--- a/includes/CargoUtils.php
+++ b/includes/CargoUtils.php
@@ -137,7 +137,12 @@
$dbw = wfGetDB( DB_MASTER );
$res = $dbw->select( 'cargo_tables', 'main_table' );
while ( $row = $dbw->fetchRow( $res ) ) {
-   $tableNames[] = $row['main_table'];
+   $tableName = $row['main_table'];
+   // Skip "replacement" tables.
+   if ( substr( $tableName, -6 ) == '__NEXT' ) {
+   continue;
+   }
+   $tableNames[] = $tableName;
}
return $tableNames;
}
diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index 9fef7fd..f05914f 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -300,17 +300,12 @@
continue;
}
 
-   // Special handling for "replacement" tables.
-   if ( substr( $tableName, -6 ) == '__NEXT' ) {
-   continue;
-   }
-   $hasReplacementTable = in_array( $tableName . '__NEXT', 
$tableNames );
-
-   $numRowsText = $this->displayNumRowsForTable( $cdb, 
$tableName );
-
+   $possibleReplacementTable = $tableName . '__NEXT';
+   $hasReplacementTable = $cdb->tableExists( 
$possibleReplacementTable );
$canBeRecreated = !$hasReplacementTable && 
array_key_exists( $tableName, $templatesThatDeclareTables );
$firstTemplateID = $canBeRecreated ? 
$templatesThatDeclareTables[$tableName][0] : null;
$actionLinks = $this->displayActionLinksForTable( 
$tableName, false, $canBeRecreated, $firstTemplateID );
+   $numRowsText = $this->displayNumRowsForTable( $cdb, 
$tableName );
 
// "Declared by" text
if ( !array_key_exists( $tableName, 
$templatesThatDeclareTables ) ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I48787eec4e0c1cf09a32fcab411a7a527b7a3fdc
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Moved "Hide" link for minimized text to beginning of text

2017-12-06 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395828 )

Change subject: Moved "Hide" link for minimized text to beginning of text
..

Moved "Hide" link for minimized text to beginning of text

Change-Id: Ic0a9e0fc73de129f6af8f8548257901051951f5a
---
M libs/Cargo.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/28/395828/2

diff --git a/libs/Cargo.js b/libs/Cargo.js
index fce9838..022f361 100644
--- a/libs/Cargo.js
+++ b/libs/Cargo.js
@@ -13,11 +13,11 @@
 
 $('span.cargoMinimizedText')
.hide()
-   .parent().append('' + showText + '');
+   .parent().prepend('' + showText + ' ');
 
 $('a.cargoToggle').click( function() {
if ( $(this).text() == showText ) {
-   $(this).siblings('.cargoMinimizedText').show(400);
+   
$(this).siblings('.cargoMinimizedText').show(400).css('display', 'inline');
$(this).text(hideText);
} else {
$(this).siblings('.cargoMinimizedText').hide(400);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0a9e0fc73de129f6af8f8548257901051951f5a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Made "table" format top-aligned

2017-12-06 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395825 )

Change subject: Made "table" format top-aligned
..

Made "table" format top-aligned

Change-Id: I43e668c4ba55e38bdd96ca533f28877b44ecb6f1
---
M Cargo.css
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/25/395825/2

diff --git a/Cargo.css b/Cargo.css
index 009eb41..6bd5b6b 100644
--- a/Cargo.css
+++ b/Cargo.css
@@ -15,6 +15,7 @@
 }
 
 table.cargoTable td {
+   vertical-align: top;
padding: 5px;
border: #ccc 1px solid;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43e668c4ba55e38bdd96ca533f28877b44ecb6f1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fixes for display of main Cargo CSS, JS

2017-12-06 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395813 )

Change subject: Fixes for display of main Cargo CSS, JS
..

Fixes for display of main Cargo CSS, JS

Change-Id: Iaceb32d40cfdec9d6b66046bf3f1891c3404b137
---
M Cargo.php
M extension.json
M formats/CargoTableFormat.php
3 files changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/13/395813/2

diff --git a/Cargo.php b/Cargo.php
index 5ccba75..4e92ccf 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -177,7 +177,6 @@
'show',
'hide'
),
-   'position' => 'top',
'localBasePath' => __DIR__,
'remoteExtPath' => 'Cargo'
),
diff --git a/extension.json b/extension.json
index 5a0debe..a503672 100644
--- a/extension.json
+++ b/extension.json
@@ -119,8 +119,7 @@
"messages": [
"show",
"hide"
-   ],
-   "position": "top"
+   ]
},
"ext.cargo.recreatedata": {
"scripts": [
diff --git a/formats/CargoTableFormat.php b/formats/CargoTableFormat.php
index b21628f..37f8fdf 100644
--- a/formats/CargoTableFormat.php
+++ b/formats/CargoTableFormat.php
@@ -59,7 +59,7 @@
 * @return string HTML
 */
function display( $valuesTable, $formattedValuesTable, 
$fieldDescriptions, $displayParams ) {
-   $this->mOutput->addModuleStyles( 'ext.cargo.main' );
+   $this->mOutput->addModules( 'ext.cargo.main' );
 
$mergeSimilarCells = false;
if ( array_key_exists( 'merge similar cells', $displayParams ) 
) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaceb32d40cfdec9d6b66046bf3f1891c3404b137
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: New query param, 'max display chars'

2017-12-06 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395805 )

Change subject: New query param, 'max display chars'
..

New query param, 'max display chars'

Change-Id: Ib7cb0d8bfae7c1fbbb3fff2869580137470708aa
---
M includes/CargoQueryDisplayer.php
M specials/CargoTables.php
2 files changed, 14 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/05/395805/2

diff --git a/includes/CargoQueryDisplayer.php b/includes/CargoQueryDisplayer.php
index 7ca23ab..b5e384d 100644
--- a/includes/CargoQueryDisplayer.php
+++ b/includes/CargoQueryDisplayer.php
@@ -155,6 +155,14 @@
} else {
$text = self::formatFieldValue( $value, 
$fieldType, $fieldDescription, $this->mParser );
}
+
+   if ( array_key_exists( 'max display chars', 
$this->mDisplayParams ) && ( $fieldType == 'Text' || $fieldType == 'Wikitext' ) 
) {
+   $maxDisplayChars = 
$this->mDisplayParams['max display chars'];
+   if ( strlen( $text ) > $maxDisplayChars 
&& strlen( strip_tags( $text ) ) > $maxDisplayChars ) {
+   $text = '' . $text . '';
+   }
+   }
+
if ( $text != '' ) {

$formattedQueryResults[$rowNum][$fieldName] = $text;
}
diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index 5ad69ac..9fef7fd 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -176,22 +176,13 @@
 
$queryResults = $sqlQuery->run();
 
-   $queryDisplayer = CargoQueryDisplayer::newFromSQLQuery( 
$sqlQuery );
-   $formattedQueryResults = 
$queryDisplayer->getFormattedQueryResults( $queryResults );
-
-   // Modify values to minimize cells that have more than a
-   // certain number of characters, to make the table more
-   // readable.
-   $maxChars = 300;
-   foreach ( $formattedQueryResults as $rowNum => $row ) {
-   foreach ( $row as $colNum => $value ) {
-   if ( strlen( $value ) > $maxChars && strlen( 
strip_tags( $value ) ) > $maxChars ) {
-   
$formattedQueryResults[$rowNum][$colNum] = '' 
. $value . '';
-   }
-   }
-   }
-
$displayParams = array();
+   $displayParams['max display chars'] = 300;
+
+
+   $queryDisplayer = CargoQueryDisplayer::newFromSQLQuery( 
$sqlQuery );
+   $queryDisplayer->mDisplayParams = $displayParams;
+   $formattedQueryResults = 
$queryDisplayer->getFormattedQueryResults( $queryResults );
 
$tableFormat = new CargoTableFormat( $this->getOutput() );
$text = $tableFormat->display( $queryResults, 
$formattedQueryResults,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7cb0d8bfae7c1fbbb3fff2869580137470708aa
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added i18n message for "simple upload"

2017-12-06 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395752 )

Change subject: Added i18n message for "simple upload"
..

Added i18n message for "simple upload"

Change-Id: I0a09a02c910f9dc1bda4b0ef1816640a7e8ea9b8
---
M PageForms.php
M extension.json
M i18n/en.json
M i18n/qqq.json
M includes/forminputs/PF_TextInput.php
M libs/PF_simpleupload.js
6 files changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/52/395752/2

diff --git a/PageForms.php b/PageForms.php
index f5bacc2..ccc881d 100644
--- a/PageForms.php
+++ b/PageForms.php
@@ -378,7 +378,7 @@
),
 'messages' => array(
'pf_forminputs_change_file',
-   'upload-dialog-button-upload'
+   'pf-simpleupload'
),
),
'ext.pageforms.select2' => $wgPageFormsResourceTemplate + array(
diff --git a/extension.json b/extension.json
index 1748b82..4a5090a 100644
--- a/extension.json
+++ b/extension.json
@@ -302,7 +302,7 @@
],
"messages": [
"pf_forminputs_change_file",
-   "upload-dialog-button-upload"
+   "pf-simpleupload"
]
},
"ext.pageforms.select2": {
diff --git a/i18n/en.json b/i18n/en.json
index 0eba774..4a6196c 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -215,6 +215,7 @@
"pf_modified_input_error": "This modification should be approved or 
rejected",
"pf_pipe_error": "\"|\" is not allowed, except within {{...}} or 
[[...]]",
"uploadwindow": "Upload window",
+   "pf-simpleupload": "Upload",
"pf_deletionlog": "Deletion log",
"pf-preview-header": "Form preview",
"pf-preview-note": "This is what the form will look like when it is in 
use:",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 43c40a2..c74a17a 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -232,6 +232,7 @@
"pf_modified_input_error": "Warning message",
"pf_pipe_error": "An error message - if an input contains a pipe 
character (\"|\"), the pipe must be part of a link, like \"[[a|b]]\", or a call 
to a template, like \"{{c|d}}\", or a parser function, like \"{{#e:f}}\".",
"uploadwindow": "Special page name for 
[[Special:UploadWindow]].\n\n'''This is about a window for uploading files. The 
window is not the thing being uploaded.'''",
+   "pf-simpleupload": "A button label\n{{{Identical|Upload}}}",
"pf_deletionlog": "{{Identical|Deletion log}}",
"pf-preview-header": "Header when previewing a form in 
Special:CreateForm",
"pf-preview-note": "Informational message when previewing a form in 
Special:CreateForm",
diff --git a/includes/forminputs/PF_TextInput.php 
b/includes/forminputs/PF_TextInput.php
index fa11a7e..6ad9e4b 100644
--- a/includes/forminputs/PF_TextInput.php
+++ b/includes/forminputs/PF_TextInput.php
@@ -148,7 +148,7 @@
if ( $wgPageFormsSimpleUpload ) {
$text = "\n" . '' 
. "\n";
$text .= Html::input( '',
-   wfMessage( 'upload-dialog-button-upload' 
)->escaped(),
+   wfMessage( 'pf-simpleupload' )->escaped(),
'button',
array(
'class' => 'simpleupload_btn',
diff --git a/libs/PF_simpleupload.js b/libs/PF_simpleupload.js
index 1da6ee2..0881368 100644
--- a/libs/PF_simpleupload.js
+++ b/libs/PF_simpleupload.js
@@ -22,7 +22,7 @@
_this.parent().find( "input[type='file']" ).val('');
input.val('');
_this.hide();
-   _this.parent().find('.simpleupload_btn').val( mw.message( 
'upload-dialog-button-upload' ).text() );
+   _this.parent().find('.simpleupload_btn').val( mw.message( 
'pf-simpleupload' ).text() );
});
 
$( ".simpleupload_btn" ).click(function () {
@@ -32,7 +32,7 @@
$( "input[type='file'].simpleupload" ).change(function(event) {
var _this = $(this);
var input = _this.parent().find('#' + _this.data('id'));
-   var fileToUpload = event.target.files[0]; // get (first) File 
+   var fileToUpload = event.target.files[0]; // get (first) File
var fileName = event.target.files[0].name;
 
var formdata = new FormData(); //see 
https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
@@ -63,13 +63,13 @@

_this.parent().find('.simpleupload_rmv_btn').show();
} else {

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for d81158f36c91

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

Change subject: Fix for d81158f36c91
..

Fix for d81158f36c91

Change-Id: I9b942d508c9475dfb78502eca66509c1881bd15d
---
M includes/CargoUtils.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/46/395646/2

diff --git a/includes/CargoUtils.php b/includes/CargoUtils.php
index 76bf893..7238401 100644
--- a/includes/CargoUtils.php
+++ b/includes/CargoUtils.php
@@ -387,7 +387,7 @@
// Add a newline at the beginning if it looks like the value
// starts with a bulleted or numbered list, to make sure that
// the first line gets formatted correctly.
-   if ( strpos( $value, '*' ) === 0 || strpos( $value, '*' ) === 0 
) {
+   if ( strpos( $value, '*' ) === 0 || strpos( $value, '#' ) === 0 
) {
$value = "\n" . $value;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9b942d508c9475dfb78502eca66509c1881bd15d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added automatic minimizing of large texts in Special:CargoTa...

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

Change subject: Added automatic minimizing of large texts in Special:CargoTables
..

Added automatic minimizing of large texts in Special:CargoTables

Change-Id: Ieacab0f45e8804eb286a90728d9aa9f9e9b7b62a
---
M Cargo.php
M extension.json
A libs/Cargo.js
M specials/CargoTables.php
4 files changed, 52 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/42/395642/2

diff --git a/Cargo.php b/Cargo.php
index be5e8cb..5ccba75 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -171,7 +171,12 @@
 // ResourceLoader modules
 $wgResourceModules += array(
'ext.cargo.main' => array(
+   'scripts' => 'libs/Cargo.js',
'styles' => 'Cargo.css',
+   'messages' => array(
+   'show',
+   'hide'
+   ),
'position' => 'top',
'localBasePath' => __DIR__,
'remoteExtPath' => 'Cargo'
diff --git a/extension.json b/extension.json
index af542fa..5a0debe 100644
--- a/extension.json
+++ b/extension.json
@@ -114,7 +114,12 @@
},
"ResourceModules": {
"ext.cargo.main": {
+   "scripts": "libs/Cargo.js",
"styles": "Cargo.css",
+   "messages": [
+   "show",
+   "hide"
+   ],
"position": "top"
},
"ext.cargo.recreatedata": {
diff --git a/libs/Cargo.js b/libs/Cargo.js
new file mode 100644
index 000..fce9838
--- /dev/null
+++ b/libs/Cargo.js
@@ -0,0 +1,28 @@
+/**
+ * Cargo.js
+ *
+ * JavaScript utility functionality for the Cargo extension.
+ *
+ * @author Yaron Koren
+ */
+
+( function ( $, mw ) {
+
+var showText = '[' + mw.msg( 'show' ) + ']';
+var hideText = '[' + mw.msg( 'hide' ) + ']';
+
+$('span.cargoMinimizedText')
+   .hide()
+   .parent().append('' + showText + '');
+
+$('a.cargoToggle').click( function() {
+   if ( $(this).text() == showText ) {
+   $(this).siblings('.cargoMinimizedText').show(400);
+   $(this).text(hideText);
+   } else {
+   $(this).siblings('.cargoMinimizedText').hide(400);
+   $(this).text(showText);
+   }
+});
+
+}( jQuery, mediaWiki ) );
\ No newline at end of file
diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index 117200a..5ad69ac 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -22,6 +22,8 @@
$user = $this->getUser();
$this->setHeaders();
 
+   $out->addModules( 'ext.cargo.main' );
+
if ( $tableName == '' ) {
$out->addHTML( $this->displayListOfTables() );
return;
@@ -177,6 +179,18 @@
$queryDisplayer = CargoQueryDisplayer::newFromSQLQuery( 
$sqlQuery );
$formattedQueryResults = 
$queryDisplayer->getFormattedQueryResults( $queryResults );
 
+   // Modify values to minimize cells that have more than a
+   // certain number of characters, to make the table more
+   // readable.
+   $maxChars = 300;
+   foreach ( $formattedQueryResults as $rowNum => $row ) {
+   foreach ( $row as $colNum => $value ) {
+   if ( strlen( $value ) > $maxChars && strlen( 
strip_tags( $value ) ) > $maxChars ) {
+   
$formattedQueryResults[$rowNum][$colNum] = '' 
. $value . '';
+   }
+   }
+   }
+
$displayParams = array();
 
$tableFormat = new CargoTableFormat( $this->getOutput() );
@@ -260,8 +274,6 @@
 * links and information for each one.
 */
function displayListOfTables() {
-   $this->getOutput()->addModules( 'ext.cargo.main' );
-
$text = '';
 
// Show a note if there are currently Cargo populate-data jobs

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieacab0f45e8804eb286a90728d9aa9f9e9b7b62a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: Added extension.json

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

Change subject: Added extension.json
..

Added extension.json

Change-Id: I0ea86b25ab0bd21f124753ac4817c01d3b5aa4aa
---
M ApprovedRevs.php
A extension.json
2 files changed, 172 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApprovedRevs 
refs/changes/18/395618/2

diff --git a/ApprovedRevs.php b/ApprovedRevs.php
index 250a919..30e6316 100644
--- a/ApprovedRevs.php
+++ b/ApprovedRevs.php
@@ -1,5 +1,19 @@
 ' ) ) {
+   wfLoadExtension( 'ApprovedRevs' );
+   // Keep i18n globals so mergeMessageFileList.php doesn't break
+   $GLOBALS['wgMessagesDirs']['ApprovedRevs'] = __DIR__ . '/i18n';
+   $GLOBALS['wgExtensionMessagesFiles']['ApprovedRevsAlias'] = __DIR__ . 
'/ApprovedRevs.alias.php';
+   $GLOBALS['wgExtensionMessagesFiles']['ApprovedRevsMagic'] = __DIR__ . 
'/ApprovedRevs.i18n.magic.php';
+   /* wfWarn(
+   'Deprecated PHP entry point used for Approved Revs extension. ' 
.
+   'Please use wfLoadExtension instead, ' .
+   'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+   ); */
+   return;
+}
+
 if ( !defined( 'MEDIAWIKI' ) ) die();
 
 /**
@@ -9,7 +23,7 @@
  * @author Yaron Koren
  */
 
-define( 'APPROVED_REVS_VERSION', '0.7.3' );
+define( 'APPROVED_REVS_VERSION', '0.8-alpha' );
 
 // credits
 $wgExtensionCredits['other'][] = array(
diff --git a/extension.json b/extension.json
new file mode 100644
index 000..432667c
--- /dev/null
+++ b/extension.json
@@ -0,0 +1,157 @@
+{
+   "@Note": "When updating this file please also update ApprovedRevs.php 
with the same changes.",
+   "name": "Approved Revs",
+   "version": "0.8-alpha",
+   "author": [
+   "Yaron Koren",
+   "..."
+   ],
+   "url": "https://www.mediawiki.org/wiki/Extension:Approved_Revs;,
+   "descriptionmsg": "approvedrevs-desc",
+   "license-name": "GPL-2.0+",
+   "type": "hook",
+   "requires": {
+   "MediaWiki": ">= 1.27.0"
+   },
+   "GroupPermissions": {
+   "sysop": {
+   "approverevisions": true
+   },
+   "*": {
+   "viewlinktolatest": true
+   }
+   },
+   "AvailableRights": [
+   "approverevisions",
+   "viewlinktolatest"
+   ],
+   "LogTypes": [
+   "approval"
+   ],
+   "LogNames": {
+   "approval": "approvedrevs-logname"
+   },
+   "LogHeaders": {
+   "approval": "approvedrevs-logdesc"
+   },
+   "LogActions": {
+   "approval/approve": "approvedrevs-approveaction",
+   "approval/unapprove": "approvedrevs-unapproveaction"
+   },
+   "SpecialPages": {
+   "ApprovedRevs": "SpecialApprovedRevs"
+   },
+   "APIModules": {
+   "approve": "ApiApprove"
+   },
+   "MessagesDirs": {
+   "ApprovedRevs": [
+   "i18n"
+   ]
+   },
+   "ExtensionMessagesFiles": {
+   "ApprovedRevsAlias": "ApprovedRevs.alias.php",
+   "ApprovedRevsMagic": "ApprovedRevs.i18n.magic.php"
+   },
+   "AutoloadClasses": {
+   "ApprovedRevs": "ApprovedRevs_body.php",
+   "ApprovedRevsHooks": "ApprovedRevs.hooks.php",
+   "SpecialApprovedRevs": "SpecialApprovedRevs.php",
+   "SpecialApprovedRevsPage": "SpecialApprovedRevsPage.php",
+   "ApiApprove": "ApiApprove.php"
+   },
+   "ResourceModules": {
+   "ext.ApprovedRevs": {
+   "styles": "ApprovedRevs.css",
+   "position": "bottom"
+   }
+   },
+   "ResourceFileModulePaths": {
+   "localBasePath": "",
+   "remoteExtPath": "ApprovedRevs"
+   },
+   "Hooks": {
+   "ArticleEditUpdates": [
+   "ApprovedRevsHooks::updateLinksAfterEdit"
+   ],
+   "PageContentSaveComplete": [
+   "ApprovedRevsHooks::setLatestAsApproved",
+   "ApprovedRevsHooks::setSearchText"
+   ],
+   "SearchResultInitFromTitle": [
+   "ApprovedRevsHooks::setSearchRevisionID"
+   ],
+   "PersonalUrls": [
+   "ApprovedRevsHooks::removeRobotsTag"
+   ],
+   "ArticleFromTitle": [
+   "ApprovedRevsHooks::showApprovedRevision"
+   ],
+   "ArticleAfterFetchContentObject": [
+   "ApprovedRevsHooks::showBlankIfUnapproved"
+   ],
+   "DisplayOldSubtitle": [
+   

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for HTML-encoding in "template" format

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

Change subject: Fix for HTML-encoding in "template" format
..

Fix for HTML-encoding in "template" format

Change-Id: If0f61a1caba26b8b108d57e0f8b44c9f37370a15
---
M formats/CargoTemplateFormat.php
1 file changed, 12 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/98/395598/2

diff --git a/formats/CargoTemplateFormat.php b/formats/CargoTemplateFormat.php
index 3363f4a..a658188 100644
--- a/formats/CargoTemplateFormat.php
+++ b/formats/CargoTemplateFormat.php
@@ -18,7 +18,18 @@
foreach ( $fieldDescriptions as $fieldName => $fieldDescription 
) {
if ( array_key_exists( $fieldName, $row ) ) {
$paramName = $namedArgs ? $fieldName : 
$fieldNum;
-   $wikiText .= '|' . $paramName . '=' . 
$row[$fieldName];
+   // HTML-decode the Wikitext values, which were
+   // encoded in CargoSQLQuery::run().
+   // We do this only for the "template" format
+   // because it's the only one that uses the
+   // unformatted values - the formatted values
+   // do this HTML-encoding on their own.
+   if ( $fieldDescription->mType == 'Wikitext' ) {
+   $value = htmlspecialchars_decode( 
$row[$fieldName] );
+   } else {
+   $value = $row[$fieldName];
+   }
+   $wikiText .= '|' . $paramName . '=' . $value;
$fieldNum++;
}
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0f61a1caba26b8b108d57e0f8b44c9f37370a15
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix display of values that start with a '*' or '#'

2017-12-04 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395081 )

Change subject: Fix display of values that start with a '*' or '#'
..

Fix display of values that start with a '*' or '#'

Change-Id: I44ff56b8d5b5b4275955fdaca39c141176f19296
---
M includes/CargoUtils.php
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/81/395081/2

diff --git a/includes/CargoUtils.php b/includes/CargoUtils.php
index 1e89617..76bf893 100644
--- a/includes/CargoUtils.php
+++ b/includes/CargoUtils.php
@@ -383,6 +383,14 @@
// Of course, String and Page fields could be set using
// {{PAGENAME}} as well, but those seem less likely.
$value = htmlspecialchars_decode( $value );
+
+   // Add a newline at the beginning if it looks like the value
+   // starts with a bulleted or numbered list, to make sure that
+   // the first line gets formatted correctly.
+   if ( strpos( $value, '*' ) === 0 || strpos( $value, '*' ) === 0 
) {
+   $value = "\n" . $value;
+   }
+
// Parse it as if it's wikitext. The exact call
// depends on whether we're in a special page or not.
global $wgRequest;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44ff56b8d5b5b4275955fdaca39c141176f19296
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: Updated Semantic Forms support to Page Forms

2017-12-04 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/395002 )

Change subject: Updated Semantic Forms support to Page Forms
..


Updated Semantic Forms support to Page Forms

Change-Id: If763fb4ae2a0229393277944d4549d6c1a10aa88
---
M ApprovedRevs.hooks.php
M ApprovedRevs.php
2 files changed, 6 insertions(+), 10 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ApprovedRevs.hooks.php b/ApprovedRevs.hooks.php
index 6791533..56fec24 100644
--- a/ApprovedRevs.hooks.php
+++ b/ApprovedRevs.hooks.php
@@ -173,7 +173,7 @@
return true;
}
 
-   if ( ! ApprovedRevs::pageIsApprovable( $title ) ) {
+   if ( ! ApprovedRevs::pageIsApprovable( $title ) ) {
return true;
}
 
@@ -514,16 +514,12 @@
}
 
/**
-* Same as addWarningToEditPage(), but for the Semantic Foms
+* Same as addWarningToEditPage(), but for the Page Forms
 * 'edit with form' tab.
 */
-   public static function addWarningToSFForm( &$pageName, &$preFormHTML ) {
-   // The title could be obtained via $pageName in theory - the
-   // problem is that, pre-SF 2.0.2, that variable wasn't set
-   // correctly.
-   global $wgTitle;
-   $approvedRevID = ApprovedRevs::getApprovedRevID( $wgTitle );
-   $latestRevID = $wgTitle->getLatestRevID();
+   public static function addWarningToPFForm( &$title, &$preFormHTML ) {
+   $approvedRevID = ApprovedRevs::getApprovedRevID( $title );
+   $latestRevID = $title->getLatestRevID();
if ( ! empty( $approvedRevID ) && $approvedRevID != 
$latestRevID ) {
ApprovedRevs::addCSS();
$preFormHTML .= Xml::element ( 'p',
diff --git a/ApprovedRevs.php b/ApprovedRevs.php
index faf2db0..250a919 100644
--- a/ApprovedRevs.php
+++ b/ApprovedRevs.php
@@ -68,7 +68,7 @@
 $wgHooks['AdminLinks'][] = 'ApprovedRevsHooks::addToAdminLinks';
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'ApprovedRevsHooks::describeDBSchema';
 $wgHooks['EditPage::showEditForm:initial'][] = 
'ApprovedRevsHooks::addWarningToEditPage';
-$wgHooks['sfHTMLBeforeForm'][] = 'ApprovedRevsHooks::addWarningToSFForm';
+$wgHooks['PageForms::HTMLBeforeForm'][] = 
'ApprovedRevsHooks::addWarningToPFForm';
 $wgHooks['ArticleViewHeader'][] = 'ApprovedRevsHooks::setArticleHeader';
 $wgHooks['ArticleViewHeader'][] = 
'ApprovedRevsHooks::displayNotApprovedHeader';
 $wgHooks['OutputPageBodyAttributes'][] = 'ApprovedRevsHooks::addBodyClass';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If763fb4ae2a0229393277944d4549d6c1a10aa88
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ApprovedRevs
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ApprovedRevs[master]: Updated Semantic Forms support to Page Forms

2017-12-04 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/395002 )

Change subject: Updated Semantic Forms support to Page Forms
..

Updated Semantic Forms support to Page Forms

Change-Id: If763fb4ae2a0229393277944d4549d6c1a10aa88
---
M ApprovedRevs.hooks.php
M ApprovedRevs.php
2 files changed, 6 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ApprovedRevs 
refs/changes/02/395002/2

diff --git a/ApprovedRevs.hooks.php b/ApprovedRevs.hooks.php
index 6791533..56fec24 100644
--- a/ApprovedRevs.hooks.php
+++ b/ApprovedRevs.hooks.php
@@ -173,7 +173,7 @@
return true;
}
 
-   if ( ! ApprovedRevs::pageIsApprovable( $title ) ) {
+   if ( ! ApprovedRevs::pageIsApprovable( $title ) ) {
return true;
}
 
@@ -514,16 +514,12 @@
}
 
/**
-* Same as addWarningToEditPage(), but for the Semantic Foms
+* Same as addWarningToEditPage(), but for the Page Forms
 * 'edit with form' tab.
 */
-   public static function addWarningToSFForm( &$pageName, &$preFormHTML ) {
-   // The title could be obtained via $pageName in theory - the
-   // problem is that, pre-SF 2.0.2, that variable wasn't set
-   // correctly.
-   global $wgTitle;
-   $approvedRevID = ApprovedRevs::getApprovedRevID( $wgTitle );
-   $latestRevID = $wgTitle->getLatestRevID();
+   public static function addWarningToPFForm( &$title, &$preFormHTML ) {
+   $approvedRevID = ApprovedRevs::getApprovedRevID( $title );
+   $latestRevID = $title->getLatestRevID();
if ( ! empty( $approvedRevID ) && $approvedRevID != 
$latestRevID ) {
ApprovedRevs::addCSS();
$preFormHTML .= Xml::element ( 'p',
diff --git a/ApprovedRevs.php b/ApprovedRevs.php
index faf2db0..250a919 100644
--- a/ApprovedRevs.php
+++ b/ApprovedRevs.php
@@ -68,7 +68,7 @@
 $wgHooks['AdminLinks'][] = 'ApprovedRevsHooks::addToAdminLinks';
 $wgHooks['LoadExtensionSchemaUpdates'][] = 
'ApprovedRevsHooks::describeDBSchema';
 $wgHooks['EditPage::showEditForm:initial'][] = 
'ApprovedRevsHooks::addWarningToEditPage';
-$wgHooks['sfHTMLBeforeForm'][] = 'ApprovedRevsHooks::addWarningToSFForm';
+$wgHooks['PageForms::HTMLBeforeForm'][] = 
'ApprovedRevsHooks::addWarningToPFForm';
 $wgHooks['ArticleViewHeader'][] = 'ApprovedRevsHooks::setArticleHeader';
 $wgHooks['ArticleViewHeader'][] = 
'ApprovedRevsHooks::displayNotApprovedHeader';
 $wgHooks['OutputPageBodyAttributes'][] = 'ApprovedRevsHooks::addBodyClass';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If763fb4ae2a0229393277944d4549d6c1a10aa88
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ApprovedRevs
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added handling for invalid "File" values

2017-12-01 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394646 )

Change subject: Added handling for invalid "File" values
..


Added handling for invalid "File" values

Change-Id: I5658d24514bd859d187ccdf402064ed3c42bf44e
---
M includes/CargoQueryDisplayer.php
M includes/CargoUtils.php
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/CargoQueryDisplayer.php b/includes/CargoQueryDisplayer.php
index 9b2dc04..7ca23ab 100644
--- a/includes/CargoQueryDisplayer.php
+++ b/includes/CargoQueryDisplayer.php
@@ -201,6 +201,9 @@
// namespace; they are displayed as thumbnails within
// queries.
$title = Title::newFromText( $value, NS_FILE );
+   if ( $title == null ) {
+   return $value;
+   }
// makeThumbLinkObj() is still not deprecated in MW 
1.28,
// but presumably it will be at some point.
return Linker::makeThumbLinkObj( $title, wfLocalFile( 
$title ), $value, '' );
diff --git a/includes/CargoUtils.php b/includes/CargoUtils.php
index 172e4c1..1e89617 100644
--- a/includes/CargoUtils.php
+++ b/includes/CargoUtils.php
@@ -300,6 +300,9 @@
 */
public static function removeNamespaceFromFileName( $fileName ) {
$fileTitle = Title::newFromText( $fileName, NS_FILE );
+   if ( $fileTitle == null ) {
+   return null;
+   }
return $fileTitle->getText();
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5658d24514bd859d187ccdf402064ed3c42bf44e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added handling for invalid "File" values

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

Change subject: Added handling for invalid "File" values
..

Added handling for invalid "File" values

Change-Id: I5658d24514bd859d187ccdf402064ed3c42bf44e
---
M includes/CargoQueryDisplayer.php
M includes/CargoUtils.php
2 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/46/394646/2

diff --git a/includes/CargoQueryDisplayer.php b/includes/CargoQueryDisplayer.php
index 9b2dc04..7ca23ab 100644
--- a/includes/CargoQueryDisplayer.php
+++ b/includes/CargoQueryDisplayer.php
@@ -201,6 +201,9 @@
// namespace; they are displayed as thumbnails within
// queries.
$title = Title::newFromText( $value, NS_FILE );
+   if ( $title == null ) {
+   return $value;
+   }
// makeThumbLinkObj() is still not deprecated in MW 
1.28,
// but presumably it will be at some point.
return Linker::makeThumbLinkObj( $title, wfLocalFile( 
$title ), $value, '' );
diff --git a/includes/CargoUtils.php b/includes/CargoUtils.php
index 172e4c1..1e89617 100644
--- a/includes/CargoUtils.php
+++ b/includes/CargoUtils.php
@@ -300,6 +300,9 @@
 */
public static function removeNamespaceFromFileName( $fileName ) {
$fileTitle = Title::newFromText( $fileName, NS_FILE );
+   if ( $fileTitle == null ) {
+   return null;
+   }
return $fileTitle->getText();
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5658d24514bd859d187ccdf402064ed3c42bf44e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for 3a2c71e36276 - "field_tables" val needs update on sw...

2017-12-01 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394606 )

Change subject: Fix for 3a2c71e36276 - "field_tables" val needs update on switch
..


Fix for 3a2c71e36276 - "field_tables" val needs update on switch

Change-Id: I7528fe2e1b17740051d710361e7247075357e442
---
M specials/CargoSwitchTable.php
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/CargoSwitchTable.php b/specials/CargoSwitchTable.php
index d4fe6dc..01ff625 100644
--- a/specials/CargoSwitchTable.php
+++ b/specials/CargoSwitchTable.php
@@ -67,6 +67,12 @@
$dbw->delete( 'cargo_tables', array( 'main_table' => $mainTable 
) );
$dbw->delete( 'cargo_pages', array( 'table_name' => $mainTable 
) );
$dbw->query( 'UPDATE cargo_tables SET main_table = \'' . 
$mainTable . '\' WHERE main_table = \'' . $mainTable . '__NEXT\'' );
+   $origFieldTableNames = array();
+   foreach ( $fieldTables as $fieldTable ) {
+   $origFieldTableNames[] = str_replace( '__NEXT', '', 
$fieldTable );
+   }
+   $dbw->query( 'UPDATE cargo_tables SET field_tables = \'' . 
serialize( $origFieldTableNames ) . '\' WHERE main_table = \'' .
+   $mainTable . '\'' );
$dbw->query( 'UPDATE cargo_pages SET table_name = \'' . 
$mainTable . '\' WHERE table_name = \'' . $mainTable . '__NEXT\'' );
}
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7528fe2e1b17740051d710361e7247075357e442
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for 3a2c71e36276 - "field_tables" val needs update on sw...

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

Change subject: Fix for 3a2c71e36276 - "field_tables" val needs update on switch
..

Fix for 3a2c71e36276 - "field_tables" val needs update on switch

Change-Id: I7528fe2e1b17740051d710361e7247075357e442
---
M specials/CargoSwitchTable.php
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/06/394606/2

diff --git a/specials/CargoSwitchTable.php b/specials/CargoSwitchTable.php
index d4fe6dc..01ff625 100644
--- a/specials/CargoSwitchTable.php
+++ b/specials/CargoSwitchTable.php
@@ -67,6 +67,12 @@
$dbw->delete( 'cargo_tables', array( 'main_table' => $mainTable 
) );
$dbw->delete( 'cargo_pages', array( 'table_name' => $mainTable 
) );
$dbw->query( 'UPDATE cargo_tables SET main_table = \'' . 
$mainTable . '\' WHERE main_table = \'' . $mainTable . '__NEXT\'' );
+   $origFieldTableNames = array();
+   foreach ( $fieldTables as $fieldTable ) {
+   $origFieldTableNames[] = str_replace( '__NEXT', '', 
$fieldTable );
+   }
+   $dbw->query( 'UPDATE cargo_tables SET field_tables = \'' . 
serialize( $origFieldTableNames ) . '\' WHERE main_table = \'' .
+   $mainTable . '\'' );
$dbw->query( 'UPDATE cargo_pages SET table_name = \'' . 
$mainTable . '\' WHERE table_name = \'' . $mainTable . '__NEXT\'' );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7528fe2e1b17740051d710361e7247075357e442
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...HeaderTabs[master]: Fixed JS bug for some non-Vector skins

2017-12-01 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394594 )

Change subject: Fixed JS bug for some non-Vector skins
..


Fixed JS bug for some non-Vector skins

This seems to happen at least with Chameleon, in some cases - fix derived from:

https://github.com/lvivski/animatic/issues/27

Change-Id: I05e37c76508d29e672fb9e2c82ffe7b88b629c31
---
M HeaderTabs_body.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/HeaderTabs_body.php b/HeaderTabs_body.php
index 5a5c562..ab687eb 100644
--- a/HeaderTabs_body.php
+++ b/HeaderTabs_body.php
@@ -257,7 +257,7 @@
 
$text = $above . $tabhtml . $below;
 
-   $parser->getOutput()->addHeadItem(Html::inlineScript( 
'document.styleSheets[0].insertRule?document.styleSheets[0].insertRule(".unselected
 {display:none;}", 0):document.styleSheets[0].addRule(".unselected", 
"display:none");' ), true );
+   $parser->getOutput()->addHeadItem(Html::inlineScript( 'var ss = 
document.styleSheets[0]; ss.insertRule ? ss.insertRule(".unselected 
{display:none;}", ss.rules.length) : ss.addRule(".unselected", 
"display:none");' ), true );
 
foreach ( $tabs as $i => $tab ) {
$tabTitle = str_replace( ' ', '_', $tab['title'] );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I05e37c76508d29e672fb9e2c82ffe7b88b629c31
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/HeaderTabs
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...HeaderTabs[master]: Fixed JS bug for some non-Vector skins

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

Change subject: Fixed JS bug for some non-Vector skins
..

Fixed JS bug for some non-Vector skins

This seems to happen at least with Chameleon, in some cases - fix derived from:

https://github.com/lvivski/animatic/issues/27

Change-Id: I05e37c76508d29e672fb9e2c82ffe7b88b629c31
---
M HeaderTabs_body.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HeaderTabs 
refs/changes/94/394594/2

diff --git a/HeaderTabs_body.php b/HeaderTabs_body.php
index 5a5c562..ab687eb 100644
--- a/HeaderTabs_body.php
+++ b/HeaderTabs_body.php
@@ -257,7 +257,7 @@
 
$text = $above . $tabhtml . $below;
 
-   $parser->getOutput()->addHeadItem(Html::inlineScript( 
'document.styleSheets[0].insertRule?document.styleSheets[0].insertRule(".unselected
 {display:none;}", 0):document.styleSheets[0].addRule(".unselected", 
"display:none");' ), true );
+   $parser->getOutput()->addHeadItem(Html::inlineScript( 'var ss = 
document.styleSheets[0]; ss.insertRule ? ss.insertRule(".unselected 
{display:none;}", ss.rules.length) : ss.addRule(".unselected", 
"display:none");' ), true );
 
foreach ( $tabs as $i => $tab ) {
$tabTitle = str_replace( ' ', '_', $tab['title'] );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I05e37c76508d29e672fb9e2c82ffe7b88b629c31
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/HeaderTabs
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added table structure to top of "View table"

2017-11-30 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394394 )

Change subject: Added table structure to top of "View table"
..


Added table structure to top of "View table"

Change-Id: I49be8abd7dff3d196e4e625cb3f3d3565f92bc02
---
M i18n/en.json
M i18n/qqq.json
M specials/CargoTables.php
3 files changed, 26 insertions(+), 3 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 4474f0e..fc0baff 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -75,6 +75,8 @@
"cargo-cargotables-declaredby": "Declared by $1",
"cargo-cargotables-attachedby": "attached by $1",
"cargo-cargotables-tablenotfound": "Table \"$1\" not found in Cargo 
database.",
+   "cargo-cargotables-tablestructure": "Table structure:",
+   "cargo-cargotables-listof": "List of $1",
"cargo-cargotables-totalrows": "This table has '''$1''' 
{{PLURAL:$1|row|rows}} altogether.",
"cargo-cargotables-totalrowsshort": "$1 {{PLURAL:$1|row|rows}}",
"cargo-cargotables-switch": "Switch to using this table.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 97fbe99..791d773 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -81,6 +81,8 @@
"cargo-cargotables-declaredby": "Parameters:\n* $1 - template name",
"cargo-cargotables-attachedby": "Parameters:\n* $1 - template name",
"cargo-cargotables-tablenotfound": "An error message. 
({{doc-cargo}})\n\nParameters:\n* $1 - table name.",
+   "cargo-cargotables-tablestructure": "A header for a list of fields",
+   "cargo-cargotables-listof": "An informational message",
"cargo-cargotables-totalrows": "Parameters:\n* $1 - number of rows in a 
database table.",
"cargo-cargotables-totalrowsshort": "Parameters:\n* $1 - number of rows 
in a database table.",
"cargo-cargotables-switch": "The text of a link to a subpage of 
[[Special:SwitchCargoTable]].",
diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index 16b8c79..117200a 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -81,7 +81,26 @@
);
$out->setSubtitle( '< '. $mainPageLink );
 
-   // First, display a count.
+   $tableSchemas = CargoUtils::getTableSchemas( array( $tableName 
) );
+   $fieldDescriptions = 
$tableSchemas[$tableName]->mFieldDescriptions;
+
+   // Display the table structure.
+   $structureDesc = '' . $this->msg( 
'cargo-cargotables-tablestructure' )->parse() . '';
+   $structureDesc .= '';
+   foreach ( $fieldDescriptions as $fieldName => $fieldDescription 
) {
+   $fieldDesc = '' . $fieldName . ' - ';
+   $typeDesc = '' . $fieldDescription->mType . '';
+   if ( $fieldDescription->mIsList ) {
+   $fieldDesc .= $this->msg( 
'cargo-cargotables-listof', $typeDesc )->parse();
+   } else {
+   $fieldDesc .= $typeDesc;
+   }
+   $structureDesc .= Html::rawElement( 'li', null, 
$fieldDesc ) . "\n";
+   }
+   $structureDesc .= '';
+   $out->addHTML( $structureDesc );
+
+   // Then, display a count.
try {
$res = $cdb->select( $tableName, 'COUNT(*) AS total' );
} catch ( Exception $e ) {
@@ -92,15 +111,15 @@
$row = $cdb->fetchRow( $res );
$out->addWikiText( $this->msg( 'cargo-cargotables-totalrows' 
)->numParams( intval($row['total']) )->text() . "\n" );
 
+   // Then, show the actual table, via a query.
$sqlQuery = new CargoSQLQuery();
$sqlQuery->mTablesStr = $tableName;
$sqlQuery->mAliasedTableNames = array( $tableName => $tableName 
);
 
-   $tableSchemas = CargoUtils::getTableSchemas( array( $tableName 
) );
$sqlQuery->mTableSchemas = $tableSchemas;
 
$aliasedFieldNames = array( $this->msg( 'nstab-main' )->parse() 
=> '_pageName' );
-   foreach ( $tableSchemas[$tableName]->mFieldDescriptions as 
$fieldName => $fieldDescription ) {
+   foreach ( $fieldDescriptions as $fieldName => $fieldDescription 
) {
// Skip "hidden" fields.
if ( array_key_exists( 'hidden', $fieldDescription ) ) {
continue;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I49be8abd7dff3d196e4e625cb3f3d3565f92bc02
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added table structure to top of "View table"

2017-11-30 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394394 )

Change subject: Added table structure to top of "View table"
..

Added table structure to top of "View table"

Change-Id: I49be8abd7dff3d196e4e625cb3f3d3565f92bc02
---
M i18n/en.json
M i18n/qqq.json
M specials/CargoTables.php
3 files changed, 26 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/94/394394/2

diff --git a/i18n/en.json b/i18n/en.json
index 4474f0e..fc0baff 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -75,6 +75,8 @@
"cargo-cargotables-declaredby": "Declared by $1",
"cargo-cargotables-attachedby": "attached by $1",
"cargo-cargotables-tablenotfound": "Table \"$1\" not found in Cargo 
database.",
+   "cargo-cargotables-tablestructure": "Table structure:",
+   "cargo-cargotables-listof": "List of $1",
"cargo-cargotables-totalrows": "This table has '''$1''' 
{{PLURAL:$1|row|rows}} altogether.",
"cargo-cargotables-totalrowsshort": "$1 {{PLURAL:$1|row|rows}}",
"cargo-cargotables-switch": "Switch to using this table.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 97fbe99..791d773 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -81,6 +81,8 @@
"cargo-cargotables-declaredby": "Parameters:\n* $1 - template name",
"cargo-cargotables-attachedby": "Parameters:\n* $1 - template name",
"cargo-cargotables-tablenotfound": "An error message. 
({{doc-cargo}})\n\nParameters:\n* $1 - table name.",
+   "cargo-cargotables-tablestructure": "A header for a list of fields",
+   "cargo-cargotables-listof": "An informational message",
"cargo-cargotables-totalrows": "Parameters:\n* $1 - number of rows in a 
database table.",
"cargo-cargotables-totalrowsshort": "Parameters:\n* $1 - number of rows 
in a database table.",
"cargo-cargotables-switch": "The text of a link to a subpage of 
[[Special:SwitchCargoTable]].",
diff --git a/specials/CargoTables.php b/specials/CargoTables.php
index 16b8c79..117200a 100644
--- a/specials/CargoTables.php
+++ b/specials/CargoTables.php
@@ -81,7 +81,26 @@
);
$out->setSubtitle( '< '. $mainPageLink );
 
-   // First, display a count.
+   $tableSchemas = CargoUtils::getTableSchemas( array( $tableName 
) );
+   $fieldDescriptions = 
$tableSchemas[$tableName]->mFieldDescriptions;
+
+   // Display the table structure.
+   $structureDesc = '' . $this->msg( 
'cargo-cargotables-tablestructure' )->parse() . '';
+   $structureDesc .= '';
+   foreach ( $fieldDescriptions as $fieldName => $fieldDescription 
) {
+   $fieldDesc = '' . $fieldName . ' - ';
+   $typeDesc = '' . $fieldDescription->mType . '';
+   if ( $fieldDescription->mIsList ) {
+   $fieldDesc .= $this->msg( 
'cargo-cargotables-listof', $typeDesc )->parse();
+   } else {
+   $fieldDesc .= $typeDesc;
+   }
+   $structureDesc .= Html::rawElement( 'li', null, 
$fieldDesc ) . "\n";
+   }
+   $structureDesc .= '';
+   $out->addHTML( $structureDesc );
+
+   // Then, display a count.
try {
$res = $cdb->select( $tableName, 'COUNT(*) AS total' );
} catch ( Exception $e ) {
@@ -92,15 +111,15 @@
$row = $cdb->fetchRow( $res );
$out->addWikiText( $this->msg( 'cargo-cargotables-totalrows' 
)->numParams( intval($row['total']) )->text() . "\n" );
 
+   // Then, show the actual table, via a query.
$sqlQuery = new CargoSQLQuery();
$sqlQuery->mTablesStr = $tableName;
$sqlQuery->mAliasedTableNames = array( $tableName => $tableName 
);
 
-   $tableSchemas = CargoUtils::getTableSchemas( array( $tableName 
) );
$sqlQuery->mTableSchemas = $tableSchemas;
 
$aliasedFieldNames = array( $this->msg( 'nstab-main' )->parse() 
=> '_pageName' );
-   foreach ( $tableSchemas[$tableName]->mFieldDescriptions as 
$fieldName => $fieldDescription ) {
+   foreach ( $fieldDescriptions as $fieldName => $fieldDescription 
) {
// Skip "hidden" fields.
if ( array_key_exists( 'hidden', $fieldDescription ) ) {
continue;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I49be8abd7dff3d196e4e625cb3f3d3565f92bc02
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master

[MediaWiki-commits] [Gerrit] mediawiki...HeaderTabs[master]: Revert cb814545aafc

2017-11-30 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/394342 )

Change subject: Revert cb814545aafc
..


Revert cb814545aafc

Change-Id: Ie65bc065a0aa5548faabba3953c27e3bdc179ce8
---
D CODE_OF_CONDUCT.md
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index d8e5d08..000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1 +0,0 @@
-The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie65bc065a0aa5548faabba3953c27e3bdc179ce8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/HeaderTabs
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...HeaderTabs[master]: Revert cb814545aafc

2017-11-30 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394342 )

Change subject: Revert cb814545aafc
..

Revert cb814545aafc

Change-Id: Ie65bc065a0aa5548faabba3953c27e3bdc179ce8
---
D CODE_OF_CONDUCT.md
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/HeaderTabs 
refs/changes/42/394342/2

diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index d8e5d08..000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1 +0,0 @@
-The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie65bc065a0aa5548faabba3953c27e3bdc179ce8
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/HeaderTabs
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Add "merge similar cells" param to "table" format

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393653 )

Change subject: Add "merge similar cells" param to "table" format
..


Add "merge similar cells" param to "table" format

Change-Id: Iba43cd590be6aa0af32177ff5aa580f74d9230b6
---
M Cargo.css
M formats/CargoTableFormat.php
2 files changed, 90 insertions(+), 7 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Cargo.css b/Cargo.css
index 998e683..009eb41 100644
--- a/Cargo.css
+++ b/Cargo.css
@@ -6,11 +6,11 @@
border-collapse: collapse;
 }
 
-table.cargoTable tr:nth-child(odd) {
+table.cargoTable td.odd {
background: #fff;
 }
 
-table.cargoTable tr:nth-child(even) {
+table.cargoTable td.even {
background: #eee;
 }
 
diff --git a/formats/CargoTableFormat.php b/formats/CargoTableFormat.php
index efc8714..b21628f 100644
--- a/formats/CargoTableFormat.php
+++ b/formats/CargoTableFormat.php
@@ -7,7 +7,47 @@
 class CargoTableFormat extends CargoDisplayFormat {
 
function allowedParameters() {
-   return array();
+   return array( 'merge similar cells' );
+   }
+
+   /**
+* Creates helper data structures that make merging cells
+* easier, if it's going to be done.
+*/
+   function getHelperDataForMerging( $formattedValuesTable ) {
+   $duplicateValuesInTable = array();
+   $blankedCells = array();
+   $numRows = count( $formattedValuesTable );
+   foreach ( $formattedValuesTable as $rowNum => $row ) {
+   foreach ( $row as $columnNum => $value ) {
+   if ( strpos( $columnNum, '__' ) !== false ) {
+   continue;
+   }
+   if ( array_key_exists( $rowNum, $blankedCells ) 
&& in_array( $columnNum, $blankedCells[$rowNum] ) ) {
+   continue;
+   }
+   $numMatches = 0;
+   $nextRowNum = $rowNum;
+   while (
+   ( ++$nextRowNum < $numRows ) &&
+   ( 
$formattedValuesTable[$nextRowNum][$columnNum] == $value )
+   ) {
+   $numMatches++;
+   if ( !array_key_exists( $nextRowNum, 
$blankedCells ) ) {
+   $blankedCells[$nextRowNum] = 
array();
+   }
+   $blankedCells[$nextRowNum][] = 
$columnNum;
+   }
+   if ( $numMatches > 0 ) {
+   if ( !array_key_exists( $rowNum, 
$duplicateValuesInTable ) ) {
+   
$duplicateValuesInTable[$rowNum] = array();
+   }
+   
$duplicateValuesInTable[$rowNum][$columnNum] = $numMatches + 1;
+   }
+   }
+   }
+
+   return array( $duplicateValuesInTable, $blankedCells );
}
 
/**
@@ -21,6 +61,11 @@
function display( $valuesTable, $formattedValuesTable, 
$fieldDescriptions, $displayParams ) {
$this->mOutput->addModuleStyles( 'ext.cargo.main' );
 
+   $mergeSimilarCells = false;
+   if ( array_key_exists( 'merge similar cells', $displayParams ) 
) {
+   $mergeSimilarCells = strtolower( $displayParams['merge 
similar cells'] ) == 'yes';
+   }
+
$text = '';
$text .= '';
foreach ( array_keys( $fieldDescriptions ) as $field ) {
@@ -32,18 +77,56 @@
}
}
$text .= "\n";
-   foreach ( $formattedValuesTable as $row ) {
+
+   if ( $mergeSimilarCells ) {
+   list( $duplicateValuesInTable, $blankedCells ) = 
$this->getHelperDataForMerging( $formattedValuesTable );
+   }
+
+   $columnIsOdd = array();
+
+   foreach ( $formattedValuesTable as $rowNum => $row ) {
$text .= "\n";
foreach ( array_keys( $fieldDescriptions ) as $field ) {
+   if (
+   $mergeSimilarCells &&
+   array_key_exists( $rowNum, 
$blankedCells ) &&
+   in_array( $field, 
$blankedCells[$rowNum] )
+   ) {
+   continue;
+

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Add "merge similar cells" param to "table" format

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393653 )

Change subject: Add "merge similar cells" param to "table" format
..

Add "merge similar cells" param to "table" format

Change-Id: Iba43cd590be6aa0af32177ff5aa580f74d9230b6
---
M Cargo.css
M formats/CargoTableFormat.php
2 files changed, 90 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/53/393653/2

diff --git a/Cargo.css b/Cargo.css
index 998e683..009eb41 100644
--- a/Cargo.css
+++ b/Cargo.css
@@ -6,11 +6,11 @@
border-collapse: collapse;
 }
 
-table.cargoTable tr:nth-child(odd) {
+table.cargoTable td.odd {
background: #fff;
 }
 
-table.cargoTable tr:nth-child(even) {
+table.cargoTable td.even {
background: #eee;
 }
 
diff --git a/formats/CargoTableFormat.php b/formats/CargoTableFormat.php
index efc8714..b21628f 100644
--- a/formats/CargoTableFormat.php
+++ b/formats/CargoTableFormat.php
@@ -7,7 +7,47 @@
 class CargoTableFormat extends CargoDisplayFormat {
 
function allowedParameters() {
-   return array();
+   return array( 'merge similar cells' );
+   }
+
+   /**
+* Creates helper data structures that make merging cells
+* easier, if it's going to be done.
+*/
+   function getHelperDataForMerging( $formattedValuesTable ) {
+   $duplicateValuesInTable = array();
+   $blankedCells = array();
+   $numRows = count( $formattedValuesTable );
+   foreach ( $formattedValuesTable as $rowNum => $row ) {
+   foreach ( $row as $columnNum => $value ) {
+   if ( strpos( $columnNum, '__' ) !== false ) {
+   continue;
+   }
+   if ( array_key_exists( $rowNum, $blankedCells ) 
&& in_array( $columnNum, $blankedCells[$rowNum] ) ) {
+   continue;
+   }
+   $numMatches = 0;
+   $nextRowNum = $rowNum;
+   while (
+   ( ++$nextRowNum < $numRows ) &&
+   ( 
$formattedValuesTable[$nextRowNum][$columnNum] == $value )
+   ) {
+   $numMatches++;
+   if ( !array_key_exists( $nextRowNum, 
$blankedCells ) ) {
+   $blankedCells[$nextRowNum] = 
array();
+   }
+   $blankedCells[$nextRowNum][] = 
$columnNum;
+   }
+   if ( $numMatches > 0 ) {
+   if ( !array_key_exists( $rowNum, 
$duplicateValuesInTable ) ) {
+   
$duplicateValuesInTable[$rowNum] = array();
+   }
+   
$duplicateValuesInTable[$rowNum][$columnNum] = $numMatches + 1;
+   }
+   }
+   }
+
+   return array( $duplicateValuesInTable, $blankedCells );
}
 
/**
@@ -21,6 +61,11 @@
function display( $valuesTable, $formattedValuesTable, 
$fieldDescriptions, $displayParams ) {
$this->mOutput->addModuleStyles( 'ext.cargo.main' );
 
+   $mergeSimilarCells = false;
+   if ( array_key_exists( 'merge similar cells', $displayParams ) 
) {
+   $mergeSimilarCells = strtolower( $displayParams['merge 
similar cells'] ) == 'yes';
+   }
+
$text = '';
$text .= '';
foreach ( array_keys( $fieldDescriptions ) as $field ) {
@@ -32,18 +77,56 @@
}
}
$text .= "\n";
-   foreach ( $formattedValuesTable as $row ) {
+
+   if ( $mergeSimilarCells ) {
+   list( $duplicateValuesInTable, $blankedCells ) = 
$this->getHelperDataForMerging( $formattedValuesTable );
+   }
+
+   $columnIsOdd = array();
+
+   foreach ( $formattedValuesTable as $rowNum => $row ) {
$text .= "\n";
foreach ( array_keys( $fieldDescriptions ) as $field ) {
+   if (
+   $mergeSimilarCells &&
+   array_key_exists( $rowNum, 
$blankedCells ) &&
+   in_array( $field, 
$blankedCells[$rowNum] )
+   ) {
+   continue;
+ 

[MediaWiki-commits] [Gerrit] mediawiki...ReplaceText[master]: Revert ef3263497f3b

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393619 )

Change subject: Revert ef3263497f3b
..


Revert ef3263497f3b

Change-Id: I1d75e2e0e70a3c924e67185b4c13af218b123267
---
D CODE_OF_CONDUCT.md
1 file changed, 0 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index d8e5d08..000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1 +0,0 @@
-The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1d75e2e0e70a3c924e67185b4c13af218b123267
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ReplaceText
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ReplaceText[master]: Revert ef3263497f3b

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393619 )

Change subject: Revert ef3263497f3b
..

Revert ef3263497f3b

Change-Id: I1d75e2e0e70a3c924e67185b4c13af218b123267
---
D CODE_OF_CONDUCT.md
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ReplaceText 
refs/changes/19/393619/2

diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
deleted file mode 100644
index d8e5d08..000
--- a/CODE_OF_CONDUCT.md
+++ /dev/null
@@ -1 +0,0 @@
-The development of this software is covered by a [Code of 
Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct).

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d75e2e0e70a3c924e67185b4c13af218b123267
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ReplaceText
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...ReplaceText[master]: Removed unnecessary handling for MW < 1.20

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393616 )

Change subject: Removed unnecessary handling for MW < 1.20
..


Removed unnecessary handling for MW < 1.20

Change-Id: I103d80348c5ca1db744ae9eb3fae0d6f36001f6e
---
M SpecialReplaceText.php
1 file changed, 2 insertions(+), 34 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SpecialReplaceText.php b/SpecialReplaceText.php
index c8d08b4..b4fc1df 100644
--- a/SpecialReplaceText.php
+++ b/SpecialReplaceText.php
@@ -278,8 +278,6 @@
}
 
function showForm( $warning_msg = null ) {
-   global $wgVersion;
-
$out = $this->getOutput();
 
$out->addHTML(
@@ -345,44 +343,14 @@
// message to see if we can use this functionality here.
if ( $this->msg( 'powersearch-togglelabel' )->isDisabled() ) {
// do nothing
-   } elseif ( version_compare( $wgVersion, '1.20', '>=' ) ) {
-   // In MediaWiki 1.20, this became a lot simpler after
-   // the main work was passed off to Javascript
+   } else {
$out->addHTML(
Html::element(
'div',
[ 'id' => 'mw-search-togglebox' ]
)
);
-   } else { // MW <= 1.19
-   $out->addHTML(
-   Xml::tags(
-   'div',
-   [ 'id' => 'mw-search-togglebox' ],
-   Xml::label( $this->msg( 
'powersearch-togglelabel' )->text(), 'mw-search-togglelabel' ) .
-   Xml::element(
-   'input',
-   [
-   'type' => 'button',
-   'id' => 
'mw-search-toggleall',
-   // 'onclick' value 
needed for MW 1.16
-   'onclick' => 
'mwToggleSearchCheckboxes("all");',
-   'value' => $this->msg( 
'powersearch-toggleall' )->text()
-   ]
-   ) .
-   Xml::element(
-   'input',
-   [
-   'type' => 'button',
-   'id' => 
'mw-search-togglenone',
-   // 'onclick' value 
needed for MW 1.16
-   'onclick' => 
'mwToggleSearchCheckboxes("none");',
-   'value' => $this->msg( 
'powersearch-togglenone' )->text()
-   ]
-   )
-   )
-   );
-   } // end if
+   }
$out->addHTML(
Xml::element( 'div', [ 'class' => 'divider' ], '', 
false ) .
"$tables\n"

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I103d80348c5ca1db744ae9eb3fae0d6f36001f6e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ReplaceText
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...ReplaceText[master]: Removed unnecessary handling for MW < 1.20

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393616 )

Change subject: Removed unnecessary handling for MW < 1.20
..

Removed unnecessary handling for MW < 1.20

Change-Id: I103d80348c5ca1db744ae9eb3fae0d6f36001f6e
---
M SpecialReplaceText.php
1 file changed, 2 insertions(+), 34 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ReplaceText 
refs/changes/16/393616/2

diff --git a/SpecialReplaceText.php b/SpecialReplaceText.php
index c8d08b4..b4fc1df 100644
--- a/SpecialReplaceText.php
+++ b/SpecialReplaceText.php
@@ -278,8 +278,6 @@
}
 
function showForm( $warning_msg = null ) {
-   global $wgVersion;
-
$out = $this->getOutput();
 
$out->addHTML(
@@ -345,44 +343,14 @@
// message to see if we can use this functionality here.
if ( $this->msg( 'powersearch-togglelabel' )->isDisabled() ) {
// do nothing
-   } elseif ( version_compare( $wgVersion, '1.20', '>=' ) ) {
-   // In MediaWiki 1.20, this became a lot simpler after
-   // the main work was passed off to Javascript
+   } else {
$out->addHTML(
Html::element(
'div',
[ 'id' => 'mw-search-togglebox' ]
)
);
-   } else { // MW <= 1.19
-   $out->addHTML(
-   Xml::tags(
-   'div',
-   [ 'id' => 'mw-search-togglebox' ],
-   Xml::label( $this->msg( 
'powersearch-togglelabel' )->text(), 'mw-search-togglelabel' ) .
-   Xml::element(
-   'input',
-   [
-   'type' => 'button',
-   'id' => 
'mw-search-toggleall',
-   // 'onclick' value 
needed for MW 1.16
-   'onclick' => 
'mwToggleSearchCheckboxes("all");',
-   'value' => $this->msg( 
'powersearch-toggleall' )->text()
-   ]
-   ) .
-   Xml::element(
-   'input',
-   [
-   'type' => 'button',
-   'id' => 
'mw-search-togglenone',
-   // 'onclick' value 
needed for MW 1.16
-   'onclick' => 
'mwToggleSearchCheckboxes("none");',
-   'value' => $this->msg( 
'powersearch-togglenone' )->text()
-   ]
-   )
-   )
-   );
-   } // end if
+   }
$out->addHTML(
Xml::element( 'div', [ 'class' => 'divider' ], '', 
false ) .
"$tables\n"

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I103d80348c5ca1db744ae9eb3fae0d6f36001f6e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/ReplaceText
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Replaced "jquery.wikiEditor" with "ext.wikiEditor" in depend...

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393608 )

Change subject: Replaced "jquery.wikiEditor" with "ext.wikiEditor" in 
dependencies
..


Replaced "jquery.wikiEditor" with "ext.wikiEditor" in dependencies

Were the package names changed in the WikiEditor extension at some point?

Change-Id: I9f5713c78362c302c5718ed8cf2279ae67f155eb
---
M includes/PF_Hooks.php
M includes/forminputs/PF_TextAreaInput.php
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PF_Hooks.php b/includes/PF_Hooks.php
index 4f7186f..5ba4b8d 100644
--- a/includes/PF_Hooks.php
+++ b/includes/PF_Hooks.php
@@ -80,7 +80,7 @@
'styles' => '/skins/PF_wikieditor.css',
'dependencies' => array(
'ext.pageforms.main',
-   'jquery.wikiEditor'
+   'ext.wikiEditor'
),
),
) );
diff --git a/includes/forminputs/PF_TextAreaInput.php 
b/includes/forminputs/PF_TextAreaInput.php
index 3cdf39c..14be782 100644
--- a/includes/forminputs/PF_TextAreaInput.php
+++ b/includes/forminputs/PF_TextAreaInput.php
@@ -50,7 +50,7 @@
if (
array_key_exists( 'editor', $this->mOtherArgs ) &&
$this->mOtherArgs['editor'] == 'wikieditor' &&
-   in_array( 'jquery.wikiEditor', 
$wgOut->getResourceLoader()->getModuleNames() ) &&
+   in_array( 'ext.wikiEditor', 
$wgOut->getResourceLoader()->getModuleNames() ) &&
class_exists( 'WikiEditorHooks' )
) {
$this->mEditor = 'wikieditor';

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9f5713c78362c302c5718ed8cf2279ae67f155eb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Replaced "jquery.wikiEditor" with "ext.wikiEditor" in depend...

2017-11-27 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393608 )

Change subject: Replaced "jquery.wikiEditor" with "ext.wikiEditor" in 
dependencies
..

Replaced "jquery.wikiEditor" with "ext.wikiEditor" in dependencies

Were the package names changed in the WikiEditor extension at some point?

Change-Id: I9f5713c78362c302c5718ed8cf2279ae67f155eb
---
M includes/PF_Hooks.php
M includes/forminputs/PF_TextAreaInput.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/08/393608/2

diff --git a/includes/PF_Hooks.php b/includes/PF_Hooks.php
index 4f7186f..5ba4b8d 100644
--- a/includes/PF_Hooks.php
+++ b/includes/PF_Hooks.php
@@ -80,7 +80,7 @@
'styles' => '/skins/PF_wikieditor.css',
'dependencies' => array(
'ext.pageforms.main',
-   'jquery.wikiEditor'
+   'ext.wikiEditor'
),
),
) );
diff --git a/includes/forminputs/PF_TextAreaInput.php 
b/includes/forminputs/PF_TextAreaInput.php
index 3cdf39c..14be782 100644
--- a/includes/forminputs/PF_TextAreaInput.php
+++ b/includes/forminputs/PF_TextAreaInput.php
@@ -50,7 +50,7 @@
if (
array_key_exists( 'editor', $this->mOtherArgs ) &&
$this->mOtherArgs['editor'] == 'wikieditor' &&
-   in_array( 'jquery.wikiEditor', 
$wgOut->getResourceLoader()->getModuleNames() ) &&
+   in_array( 'ext.wikiEditor', 
$wgOut->getResourceLoader()->getModuleNames() ) &&
class_exists( 'WikiEditorHooks' )
) {
$this->mEditor = 'wikieditor';

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f5713c78362c302c5718ed8cf2279ae67f155eb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Changed forminput autocompletion to always be remote

2017-11-26 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393518 )

Change subject: Changed forminput autocompletion to always be remote
..


Changed forminput autocompletion to always be remote

Local autocompletion sometimes didn't work, apparently due to caching.

Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
---
M includes/PF_ParserFunctions.php
1 file changed, 7 insertions(+), 10 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/PF_ParserFunctions.php b/includes/PF_ParserFunctions.php
index 02017cf..be102d1 100644
--- a/includes/PF_ParserFunctions.php
+++ b/includes/PF_ParserFunctions.php
@@ -303,16 +303,13 @@
$inputID = 'input_' . $input_num;
$formInputAttrs['id'] = $inputID;
$formInputAttrs['class'] = 'autocompleteInput 
createboxInput formInput';
-   global $wgPageFormsMaxLocalAutocompleteValues;
-   $autocompletion_values = 
PFValuesUtils::getAutocompleteValues( $inAutocompletionSource, 
$autocompletionType );
-   if ( count( $autocompletion_values ) > 
$wgPageFormsMaxLocalAutocompleteValues ) {
-   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
-   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
-   } else {
-   global $wgPageFormsAutocompleteValues;
-   $wgPageFormsAutocompleteValues[$inputID] = 
$autocompletion_values;
-   $formInputAttrs['autocompletesettings'] = 
$inputID;
-   }
+   // This code formerly only used remote autocompletion
+   // when the number of autocompletion values was above
+   // a certain limit - as happens in regular forms -
+   // but local autocompletion didn't always work,
+   // apparently due to page caching.
+   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
+   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
}
 
// The value has already been HTML-encoded as a parameter,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Changed forminput autocompletion to always be remote

2017-11-26 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393518 )

Change subject: Changed forminput autocompletion to always be remote
..

Changed forminput autocompletion to always be remote

Local autocompletion sometimes didn't work, apparently due to caching.

Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
---
M includes/PF_ParserFunctions.php
1 file changed, 7 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/18/393518/2

diff --git a/includes/PF_ParserFunctions.php b/includes/PF_ParserFunctions.php
index 02017cf..be102d1 100644
--- a/includes/PF_ParserFunctions.php
+++ b/includes/PF_ParserFunctions.php
@@ -303,16 +303,13 @@
$inputID = 'input_' . $input_num;
$formInputAttrs['id'] = $inputID;
$formInputAttrs['class'] = 'autocompleteInput 
createboxInput formInput';
-   global $wgPageFormsMaxLocalAutocompleteValues;
-   $autocompletion_values = 
PFValuesUtils::getAutocompleteValues( $inAutocompletionSource, 
$autocompletionType );
-   if ( count( $autocompletion_values ) > 
$wgPageFormsMaxLocalAutocompleteValues ) {
-   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
-   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
-   } else {
-   global $wgPageFormsAutocompleteValues;
-   $wgPageFormsAutocompleteValues[$inputID] = 
$autocompletion_values;
-   $formInputAttrs['autocompletesettings'] = 
$inputID;
-   }
+   // This code formerly only used remote autocompletion
+   // when the number of autocompletion values was above
+   // a certain limit - as happens in regular forms -
+   // but local autocompletion didn't always work,
+   // apparently due to page caching.
+   $formInputAttrs['autocompletesettings'] = 
$inAutocompletionSource;
+   $formInputAttrs['autocompletedatatype'] = 
$autocompletionType;
}
 
// The value has already been HTML-encoded as a parameter,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic44fac5ded23ebf4cc5511260d7c9ffe019fc6e0
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Fix namespace names for Spanish

2017-11-22 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/392887 )

Change subject: Fix namespace names for Spanish
..


Fix namespace names for Spanish

Using consistent naming across installations.

Change-Id: Ifcfe47fbe86ea84f92ad19c250167d3c1194cc3c
---
M languages/PF_Namespaces.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/languages/PF_Namespaces.php b/languages/PF_Namespaces.php
index b38537b..67ca3ca 100644
--- a/languages/PF_Namespaces.php
+++ b/languages/PF_Namespaces.php
@@ -64,7 +64,7 @@
 
 $namespaceNames['es'] = array(
PF_NS_FORM   => 'Formulario',
-   PF_NS_FORM_TALK  => 'DiscusiĆ³n_formulario'
+   PF_NS_FORM_TALK  => 'Formulario_discusiĆ³n'
 );
 
 /**

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifcfe47fbe86ea84f92ad19c250167d3c1194cc3c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: MarcoAurelio 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added quoting of field names for drilldown

2017-11-17 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392049 )

Change subject: Added quoting of field names for drilldown
..

Added quoting of field names for drilldown

Change-Id: I1ba85ab7bdd988feb16f256b988ef604d7ae574b
---
M drilldown/CargoAppliedFilter.php
M drilldown/CargoFilter.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/49/392049/2

diff --git a/drilldown/CargoAppliedFilter.php b/drilldown/CargoAppliedFilter.php
index 1849506..353ed55 100644
--- a/drilldown/CargoAppliedFilter.php
+++ b/drilldown/CargoAppliedFilter.php
@@ -59,7 +59,7 @@
$fieldTableName = $this->filter->tableName . '__' . 
$this->filter->name;
$value_field = CargoUtils::escapedFieldName( $cdb, 
$fieldTableName, '_value' );
} else {
-   $value_field = $this->filter->name;
+   $value_field = $cdb->addIdentifierQuotes( 
$this->filter->name );
}
$sql = "(";
if ( $this->search_terms != null ) {
@@ -193,7 +193,7 @@
}
 
$cdb = CargoUtils::getDB();
-   $res = $cdb->select( $tableName, "DISTINCT " . $value_field );
+   $res = $cdb->select( $tableName, "DISTINCT " . 
$cdb->addIdentifierQuotes( $value_field ) );
while ( $row = $cdb->fetchRow( $res ) ) {
$possible_values[] = $row[$value_field];
}
diff --git a/drilldown/CargoFilter.php b/drilldown/CargoFilter.php
index 760dc89..1612930 100644
--- a/drilldown/CargoFilter.php
+++ b/drilldown/CargoFilter.php
@@ -232,7 +232,7 @@
$fieldName = CargoUtils::escapedFieldName( $cdb, 
$fieldTableName, '_value' );
$joinConds[$fieldTableName] = 
CargoUtils::joinOfMainAndFieldTable( $cdb, $this->tableName, $fieldTableName );
} else {
-   $fieldName = $this->name;
+   $fieldName = $cdb->addIdentifierQuotes( $this->name );
}
 
if ( $this->searchableFiles ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ba85ab7bdd988feb16f256b988ef604d7ae574b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Version 1.5

2017-11-16 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391843 )

Change subject: Version 1.5
..

Version 1.5

Change-Id: Ibb1a80d82a4eff4082be48aaf82f1651092d
---
M Cargo.hooks.php
M Cargo.php
M README
M extension.json
4 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/43/391843/2

diff --git a/Cargo.hooks.php b/Cargo.hooks.php
index 54cb1d3..8f210b2 100644
--- a/Cargo.hooks.php
+++ b/Cargo.hooks.php
@@ -11,7 +11,7 @@
public static function registerExtension() {
global $cgScriptPath, $wgScriptPath, $wgCargoFieldTypes, 
$wgGroupPermissions;
 
-   define( 'CARGO_VERSION', '1.4' );
+   define( 'CARGO_VERSION', '1.5' );
 
// Script path.
$cgScriptPath = $wgScriptPath . '/extensions/Cargo';
diff --git a/Cargo.php b/Cargo.php
index ded706e..be5e8cb 100644
--- a/Cargo.php
+++ b/Cargo.php
@@ -25,7 +25,7 @@
 
 // All the rest is for backward compatibility, for MW 1.26 and lower.
 
-define( 'CARGO_VERSION', '1.4' );
+define( 'CARGO_VERSION', '1.5' );
 
 $wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
diff --git a/README b/README
index 9b41295..160de63 100644
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
 Cargo extension
 
-Version 1.4
+Version 1.5
 Yaron Koren
 
 This is free software licensed under the GNU General Public License. Please
diff --git a/extension.json b/extension.json
index 92c5ead..af542fa 100644
--- a/extension.json
+++ b/extension.json
@@ -1,7 +1,7 @@
 {
"name": "Cargo",
"namemsg": "cargo-extensionname",
-   "version": "1.4",
+   "version": "1.5",
"author": "Yaron Koren",
"url": "https://www.mediawiki.org/wiki/Extension:Cargo;,
"descriptionmsg": "cargo-desc",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb1a80d82a4eff4082be48aaf82f1651092d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for 315d8e223df1

2017-11-15 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391621 )

Change subject: Fix for 315d8e223df1
..

Fix for 315d8e223df1

Change-Id: Ib0120ee8fb00bc289aed103f07944f26dd6a0352
---
M formats/CargoDynamicTableFormat.php
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/21/391621/2

diff --git a/formats/CargoDynamicTableFormat.php 
b/formats/CargoDynamicTableFormat.php
index c98106f..ad182e2 100644
--- a/formats/CargoDynamicTableFormat.php
+++ b/formats/CargoDynamicTableFormat.php
@@ -55,11 +55,13 @@
// class won't do it that way.
$dataOrderString = "data-order='" . 
json_encode( $dataTableOrderByParams ) . "'";
}
+   }
 
-   if ( array_key_exists( 'rows per page', $displayParams 
) ) {
-   // See above for why it's done this way.
-   $pageLengthString = 'data-page-length="' . 
$displayParams['rows per page'] . '"';
-   }
+   if ( array_key_exists( 'rows per page', $displayParams ) ) {
+   // See $dataOrderString above for why it's done this 
way.
+   $pageLengthString = 'data-page-length="' . 
$displayParams['rows per page'] . '"';
+   } else {
+   $pageLengthString = '';
}
 
$text = <

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Enabled "button panel" for datepicker

2017-11-15 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391609 )

Change subject: Enabled "button panel" for datepicker
..

Enabled "button panel" for datepicker

This seems to work fine across different jQuery versions.

Change-Id: I8af3ce481176a3c789d1034e482562d3612992bb
---
M libs/PF_datepicker.js
1 file changed, 1 insertion(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/09/391609/2

diff --git a/libs/PF_datepicker.js b/libs/PF_datepicker.js
index aebddfb..6e5f851 100644
--- a/libs/PF_datepicker.js
+++ b/libs/PF_datepicker.js
@@ -54,10 +54,7 @@
'changeMonth': true,
'changeYear': true,
'altFormat': 'yy/mm/dd',
-   // Today button does not work 
(http://dev.jqueryui.com/ticket/4045)
-   // do not show button panel for now
-   // TODO: show date picker button panel when bug is fixed
-   'showButtonPanel': false,
+   'showButtonPanel': true,
'firstDay': params.firstDay,
'dateFormat': params.dateFormat,
'beforeShowDay': function ( date ) {return 
PF_DP_checkDate( '#' + input_id + '_show', date );}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8af3ce481176a3c789d1034e482562d3612992bb
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Added _lastUploadDate, _numPages fields to _fileData table

2017-11-15 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391561 )

Change subject: Added _lastUploadDate, _numPages fields to _fileData table
..

Added _lastUploadDate, _numPages fields to _fileData table

Change-Id: I7d4761ce536893ec71e04cadb7749056337c521a
---
M includes/CargoFileData.php
1 file changed, 32 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/61/391561/2

diff --git a/includes/CargoFileData.php b/includes/CargoFileData.php
index 7f4012a..5fae9ea 100644
--- a/includes/CargoFileData.php
+++ b/includes/CargoFileData.php
@@ -21,8 +21,14 @@
if ( in_array( 'path', $wgCargoFileDataColumns ) ) {
$fieldTypes['_path'] = array( 'String', false );
}
+   if ( in_array( 'lastUploadDate', $wgCargoFileDataColumns ) ) {
+   $fieldTypes['_lastUploadDate'] = array( 'Date', false );
+   }
if ( in_array( 'fullText', $wgCargoFileDataColumns ) ) {
$fieldTypes['_fullText'] = array( 'Searchtext', false );
+   }
+   if ( in_array( 'numPages', $wgCargoFileDataColumns ) ) {
+   $fieldTypes['_numPages'] = array( 'Integer', false );
}
 
$tableSchema = new CargoTableSchema();
@@ -75,11 +81,15 @@
$fileDataValues['_path'] = $file->getLocalRefPath();
}
 
+   if ( in_array( 'lastUploadDate', $wgCargoFileDataColumns ) ) {
+   $fileDataValues['_lastUploadDate'] = 
$file->getTimestamp();
+   }
+
if ( in_array( 'fullText', $wgCargoFileDataColumns ) ) {
global $wgCargoPDFToText;
 
if ( $wgCargoPDFToText == '' ) {
-   // Display an error message/
+   // Display an error message?
} elseif ( $file->getMimeType() != 'application/pdf' ) {
// We only handle PDF files.
} else {
@@ -96,6 +106,27 @@
}
}
 
+   if ( in_array( 'numPages', $wgCargoFileDataColumns ) ) {
+   global $wgCargoPDFInfo;
+   if ( $wgCargoPDFInfo == '' ) {
+   // Display an error message?
+   } elseif ( $file->getMimeType() != 'application/pdf' ) {
+   // We only handle PDF files.
+   } else {
+   $filePath = $file->getLocalRefPath();
+   $cmd = wfEscapeShellArg( $wgCargoPDFInfo ) . ' 
'. wfEscapeShellArg( $filePath );
+   $retval = '';
+   $txt = wfShellExec( $cmd, $retval );
+   if ( $retval == 0 ) {
+   $lines = explode( PHP_EOL, $txt );
+   $matched = preg_grep( '/^Pages\:/', 
$lines );
+   foreach ( $matched as $line ) {
+   $fileDataValues['_numPages'] = 
intval( trim( substr( $line, 7 ) ) );
+   }
+   }
+   }
+   }
+
CargoStore::storeAllData( $title, '_fileData', $fileDataValues, 
$tableSchemas['_fileData'] );
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7d4761ce536893ec71e04cadb7749056337c521a
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for bcadef37f8d7 - added quoting of field names

2017-11-14 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391471 )

Change subject: Fix for bcadef37f8d7 - added quoting of field names
..

Fix for bcadef37f8d7 - added quoting of field names

Change-Id: Iab2b2bc1207c60c9fc10a198994a18f592998e3d
---
M includes/parserfunctions/CargoStore.php
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/71/391471/2

diff --git a/includes/parserfunctions/CargoStore.php 
b/includes/parserfunctions/CargoStore.php
index 6dd0932..78c1b4f 100644
--- a/includes/parserfunctions/CargoStore.php
+++ b/includes/parserfunctions/CargoStore.php
@@ -301,10 +301,11 @@
continue;
}
if ( $fieldDescription->mIsList || 
$fieldDescription->mType == 'Coordinates' ) {
-   $tableFieldValuesForCheck[$fieldName . 
'__full'] = $tableFieldValues[$fieldName];
+   $quotedFieldName = $cdb->addIdentifierQuotes( 
$fieldName . '__full' );
} else {
-   $tableFieldValuesForCheck[$fieldName] = 
$tableFieldValues[$fieldName];
+   $quotedFieldName = $cdb->addIdentifierQuotes( 
$fieldName );
}
+   $tableFieldValuesForCheck[$quotedFieldName] = 
$tableFieldValues[$fieldName];
}
$res = $cdb->select( $tableName, 'COUNT(*)', 
$tableFieldValuesForCheck );
$row = $cdb->fetchRow( $res );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab2b2bc1207c60c9fc10a198994a18f592998e3d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Changed addModuleStyles() + ...Scripts() to just addModules()

2017-11-14 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391282 )

Change subject: Changed addModuleStyles() + ...Scripts() to just addModules()
..

Changed addModuleStyles() + ...Scripts() to just addModules()

The two separately seem to no longer work in all cases.

Change-Id: Ic1762cda259bd673bee66448e7c7f73e5822ccef
---
M includes/forminputs/PF_FormInput.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/82/391282/2

diff --git a/includes/forminputs/PF_FormInput.php 
b/includes/forminputs/PF_FormInput.php
index 961a98f..e2e129b 100644
--- a/includes/forminputs/PF_FormInput.php
+++ b/includes/forminputs/PF_FormInput.php
@@ -335,8 +335,7 @@
 
// Register modules for the input.
if ( $modules !== null ) {
-   $output->addModuleStyles( $modules );
-   $output->addModuleScripts( $modules );
+   $output->addModules( $modules );
}
 
if ( $this->getJsInitFunctionData() || 
$this->getJsValidationFunctionData() ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1762cda259bd673bee66448e7c7f73e5822ccef
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added CSS for datepicker

2017-11-14 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391272 )

Change subject: Added CSS for datepicker
..

Added CSS for datepicker

Change-Id: Ib84a0562aa2e7a7fa966b80ca04b2dcb00a3b143
---
M skins/PF_jquery_ui_overrides.css
1 file changed, 175 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/72/391272/2

diff --git a/skins/PF_jquery_ui_overrides.css b/skins/PF_jquery_ui_overrides.css
index 49195d9..3e38996 100644
--- a/skins/PF_jquery_ui_overrides.css
+++ b/skins/PF_jquery_ui_overrides.css
@@ -37,3 +37,178 @@
 }
 */
 
+.ui-datepicker {
+   width: 17em;
+   padding: .2em .2em 0;
+   display: none;
+}
+.ui-datepicker .ui-datepicker-header {
+   position: relative;
+   padding: .2em 0;
+}
+.ui-datepicker .ui-datepicker-prev,
+.ui-datepicker .ui-datepicker-next {
+   position: absolute;
+   top: 2px;
+   width: 1.8em;
+   height: 1.8em;
+}
+.ui-datepicker .ui-datepicker-prev-hover,
+.ui-datepicker .ui-datepicker-next-hover {
+   top: 1px;
+}
+.ui-datepicker .ui-datepicker-prev {
+   left: 2px;
+}
+.ui-datepicker .ui-datepicker-next {
+   right: 2px;
+}
+.ui-datepicker .ui-datepicker-prev-hover {
+   left: 1px;
+}
+.ui-datepicker .ui-datepicker-next-hover {
+   right: 1px;
+}
+.ui-datepicker .ui-datepicker-prev span,
+.ui-datepicker .ui-datepicker-next span {
+   display: block;
+   position: absolute;
+   left: 50%;
+   margin-left: -8px;
+   top: 50%;
+   margin-top: -8px;
+}
+.ui-datepicker .ui-datepicker-title {
+   margin: 0 2.3em;
+   line-height: 1.8em;
+   text-align: center;
+}
+.ui-datepicker .ui-datepicker-title select {
+   font-size: 1em;
+   margin: 1px 0;
+}
+.ui-datepicker select.ui-datepicker-month,
+.ui-datepicker select.ui-datepicker-year {
+   width: 45%;
+}
+.ui-datepicker table {
+   width: 100%;
+   font-size: .9em;
+   border-collapse: collapse;
+   margin: 0 0 .4em;
+}
+.ui-datepicker th {
+   padding: .7em .3em;
+   text-align: center;
+   font-weight: bold;
+   border: 0;
+}
+.ui-datepicker td {
+   border: 0;
+   padding: 1px;
+}
+.ui-datepicker td span,
+.ui-datepicker td a {
+   display: block;
+   padding: .2em;
+   text-align: right;
+   text-decoration: none;
+}
+.ui-datepicker .ui-datepicker-buttonpane {
+   background-image: none;
+   margin: .7em 0 0 0;
+   padding: 0 .2em;
+   border-left: 0;
+   border-right: 0;
+   border-bottom: 0;
+}
+.ui-datepicker .ui-datepicker-buttonpane button {
+   float: right;
+   margin: .5em .2em .4em;
+   cursor: pointer;
+   padding: .2em .6em .3em .6em;
+   width: auto;
+   overflow: visible;
+}
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
+   float: left;
+}
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi {
+   width: auto;
+}
+.ui-datepicker-multi .ui-datepicker-group {
+   float: left;
+}
+.ui-datepicker-multi .ui-datepicker-group table {
+   width: 95%;
+   margin: 0 auto .4em;
+}
+.ui-datepicker-multi-2 .ui-datepicker-group {
+   width: 50%;
+}
+.ui-datepicker-multi-3 .ui-datepicker-group {
+   width: 33.3%;
+}
+.ui-datepicker-multi-4 .ui-datepicker-group {
+   width: 25%;
+}
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
+   border-left-width: 0;
+}
+.ui-datepicker-multi .ui-datepicker-buttonpane {
+   clear: left;
+}
+.ui-datepicker-row-break {
+   clear: both;
+   width: 100%;
+   font-size: 0;
+}
+
+/* RTL support */
+.ui-datepicker-rtl {
+   direction: rtl;
+}
+.ui-datepicker-rtl .ui-datepicker-prev {
+   right: 2px;
+   left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next {
+   left: 2px;
+   right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-prev:hover {
+   right: 1px;
+   left: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-next:hover {
+   left: 1px;
+   right: auto;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane {
+   clear: right;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button {
+   float: left;
+}
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
+.ui-datepicker-rtl .ui-datepicker-group {
+   float: right;
+}
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
+   border-right-width: 0;
+   border-left-width: 1px;
+}
+
+/* Icons */
+.ui-datepicker .ui-icon {
+   display: block;
+   text-indent: -9px;
+   overflow: hidden;
+   background-repeat: no-repeat;
+   left: .5em;
+   top: .3em;
+}
\ No newline at end of file

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Modified select2.js to allow for tab to be used as value cho...

2017-11-13 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391154 )

Change subject: Modified select2.js to allow for tab to be used as value chooser
..

Modified select2.js to allow for tab to be used as value chooser

Change-Id: Iba546b12180ff33b68783464fbc92c1f2c5a320d
---
M libs/select2.js
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/54/391154/2

diff --git a/libs/select2.js b/libs/select2.js
index b85661e..70008bf 100644
--- a/libs/select2.js
+++ b/libs/select2.js
@@ -1381,6 +1381,15 @@
 close: function () {
 if (!this.opened()) return;
 
+// Modification, for Page Forms - prevent the "tab" key from 
moving on to the next form input,
+// for either tokens or combobox inputs, so that it can be used as 
a true value selector -
+// which is especially useful for tokens.
+// This modification may possibly become unnecessary if/when 
select2 is upgraded to a more
+// recent version, due to the "closeOnSelect" option that select2 
now has.
+if ( event.key  == 'Tab' ) {
+event.preventDefault();
+}
+
 var cid = this.containerId,
 scroll = "scroll." + cid,
 resize = "resize."+cid,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba546b12180ff33b68783464fbc92c1f2c5a320d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Re-add FullCalendar < 3 for use by MW < 1.30

2017-11-13 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/391110 )

Change subject: Re-add FullCalendar < 3 for use by MW < 1.30
..

Re-add FullCalendar < 3 for use by MW < 1.30

Change-Id: Ic49cfdc3e29b21700451edc3631cf61706135fa1
---
M Cargo.php
M extension.json
M formats/CargoCalendarFormat.php
A libs/FullCalendar/2.9.1/fullcalendar.css
A libs/FullCalendar/2.9.1/fullcalendar.js
A libs/FullCalendar/2.9.1/lang-all.js
R libs/FullCalendar/3.6.2/fullcalendar.css
R libs/FullCalendar/3.6.2/fullcalendar.js
R libs/FullCalendar/3.6.2/locale-all.js
A libs/FullCalendar/README
M libs/ext.cargo.calendar.js
11 files changed, 14,527 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/10/391110/2


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic49cfdc3e29b21700451edc3631cf61706135fa1
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Added "uploadable" support for tokens, combobox inputs

2017-11-12 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390941 )

Change subject: Added "uploadable" support for tokens, combobox inputs
..

Added "uploadable" support for tokens, combobox inputs

Change-Id: I6f02c0e35760403c92c44a7d83cc81b275cfdc1f
---
M includes/forminputs/PF_ComboBoxInput.php
M includes/forminputs/PF_TokensInput.php
2 files changed, 46 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/41/390941/2

diff --git a/includes/forminputs/PF_ComboBoxInput.php 
b/includes/forminputs/PF_ComboBoxInput.php
index 81843bc..0a2fc7e 100644
--- a/includes/forminputs/PF_ComboBoxInput.php
+++ b/includes/forminputs/PF_ComboBoxInput.php
@@ -83,9 +83,11 @@
list( $autocompleteSettings, $remoteDataType ) = 
self::setAutocompleteValues( $other_args );
}
 
+   $input_id = 'input_' . $wgPageFormsFieldNum;
+
$inputAttrs = array(
'type' => 'text',
-   'id' => "input_$wgPageFormsFieldNum",
+   'id' => $input_id,
'name' => $input_name,
'class' => $className,
'tabindex' => $wgPageFormsTabIndex,
@@ -111,6 +113,16 @@
}
 
$inputText = Html::rawElement( 'input', $inputAttrs);
+
+   if ( array_key_exists( 'uploadable', $other_args ) && 
$other_args['uploadable'] == true ) {
+   if ( array_key_exists( 'default filename', $other_args 
) ) {
+   $default_filename = $other_args['default 
filename'];
+   } else {
+   $default_filename = '';
+   }
+
+   $inputText .= PFTextInput::uploadableHTML( $input_id, 
$delimiter = null, $default_filename, $cur_value, $other_args );
+   }
 
$divClass = 'ui-widget';
if ( $is_mandatory ) {
@@ -165,6 +177,16 @@
'type' => 'boolean',
'description' => wfMessage( 
'pf_forminputs_existingvaluesonly' )->text()
);
+   $params[] = array(
+   'name' => 'uploadable',
+   'type' => 'boolean',
+   'description' => wfMessage( 'pf_forminputs_uploadable' 
)->text()
+   );
+   $params[] = array(
+   'name' => 'default filename',
+   'type' => 'string',
+   'description' => wfMessage( 
'pf_forminputs_defaultfilename' )->text()
+   );
return $params;
}
 
diff --git a/includes/forminputs/PF_TokensInput.php 
b/includes/forminputs/PF_TokensInput.php
index 2e860b8..e9db579 100644
--- a/includes/forminputs/PF_TokensInput.php
+++ b/includes/forminputs/PF_TokensInput.php
@@ -150,11 +150,21 @@
if ( array_key_exists( 'max values', $other_args ) ) {
$inputAttrs['maxvalues'] = $other_args['max values'];
}
-   if ( array_key_exists( 'namespace', $other_args ) ) {
-   $inputAttrs['data-namespace'] = 
$other_args['namespace'];
-   }
+   if ( array_key_exists( 'namespace', $other_args ) ) {
+   $inputAttrs['data-namespace'] = 
$other_args['namespace'];
+   }
 
$text = "\n\t" . Html::input( $input_name, $cur_value, 'text', 
$inputAttrs ) . "\n";
+
+   if ( array_key_exists( 'uploadable', $other_args ) && 
$other_args['uploadable'] == true ) {
+   if ( array_key_exists( 'default filename', $other_args 
) ) {
+   $default_filename = $other_args['default 
filename'];
+   } else {
+   $default_filename = '';
+   }
+
+   $text .= PFTextInput::uploadableHTML( $input_id, 
$delimiter, $default_filename, $cur_value, $other_args );
+   }
 
$spanClass = 'inputSpan';
if ( $is_mandatory ) {
@@ -189,6 +199,16 @@
'description' => wfMessage( 'pf_forminputs_maxvalues' 
)->text()
);
$params = array_merge( $params, 
PFTextWithAutocompleteInput::getAutocompletionParameters() );
+   $params[] = array(
+   'name' => 'uploadable',
+   'type' => 'boolean',
+   'description' => wfMessage( 'pf_forminputs_uploadable' 
)->text()
+   );
+   $params[] = array(
+   'name' => 'default filename',
+   'type' => 'string',
+   'description' => wfMessage( 

[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for e1643350cab8

2017-11-10 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390547 )

Change subject: Fix for e1643350cab8
..

Fix for e1643350cab8

Change-Id: I249e3a21051efd62be9299fb52eab59931585c6b
---
M formats/CargoCalendarFormat.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/47/390547/2

diff --git a/formats/CargoCalendarFormat.php b/formats/CargoCalendarFormat.php
index fb49a7e..df550cc 100644
--- a/formats/CargoCalendarFormat.php
+++ b/formats/CargoCalendarFormat.php
@@ -76,9 +76,9 @@
$view = $displayParams['view'];
// Enable simpler view names.
if ( $view == 'day' ) {
-   $view = 'basicDay';
+   $view = 'agendaDay';
} elseif ( $view == 'week' ) {
-   $view = 'basicWeek';
+   $view = 'agendaWeek';
}
$attrs['startview'] = $view;
} else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I249e3a21051efd62be9299fb52eab59931585c6b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for calendar display of date function

2017-11-10 Thread Yaron Koren (Code Review)
Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/390472 )

Change subject: Fix for calendar display of date function
..


Fix for calendar display of date function

Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
---
M specials/CargoExport.php
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/specials/CargoExport.php b/specials/CargoExport.php
index 3501d91..c642256 100644
--- a/specials/CargoExport.php
+++ b/specials/CargoExport.php
@@ -157,7 +157,16 @@
$startDateField = $dateFieldAliases[0];
$startDate = $queryResult[$startDateField];
$startDatePrecisionField = $startDateField . 
'__precision';
-   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   // There might not be a precision field, if,
+   // for instance, the date field is an SQL
+   // function. Ideally we would figure out
+   // the right precision, but for now just
+   // go with "DATE_ONLY" - seems safe.
+   if ( array_key_exists( 
$startDatePrecisionField, $queryResult ) ) {
+   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   } else {
+   $startDatePrecision = 
CargoStore::DATE_ONLY;
+   }
$curEvent = array(
// Get first field for the title - not
// necessarily the page name.

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for calendar display of date function

2017-11-10 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390472 )

Change subject: Fix for calendar display of date function
..

Fix for calendar display of date function

Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
---
M specials/CargoExport.php
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/72/390472/2

diff --git a/specials/CargoExport.php b/specials/CargoExport.php
index 3501d91..c642256 100644
--- a/specials/CargoExport.php
+++ b/specials/CargoExport.php
@@ -157,7 +157,16 @@
$startDateField = $dateFieldAliases[0];
$startDate = $queryResult[$startDateField];
$startDatePrecisionField = $startDateField . 
'__precision';
-   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   // There might not be a precision field, if,
+   // for instance, the date field is an SQL
+   // function. Ideally we would figure out
+   // the right precision, but for now just
+   // go with "DATE_ONLY" - seems safe.
+   if ( array_key_exists( 
$startDatePrecisionField, $queryResult ) ) {
+   $startDatePrecision = 
$queryResult[$startDatePrecisionField];
+   } else {
+   $startDatePrecision = 
CargoStore::DATE_ONLY;
+   }
$curEvent = array(
// Get first field for the title - not
// necessarily the page name.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80650636ecfdbb054241a13bd4cd9f79a9cc545e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Fix for HTML-encoded strings when delimiter is ;

2017-11-10 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390407 )

Change subject: Fix for HTML-encoded strings when delimiter is ;
..

Fix for HTML-encoded strings when delimiter is ;

Change-Id: Id56cb5411137fed6fea73bd3273acca4adc290ce
---
M includes/CargoQueryDisplayer.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/07/390407/2

diff --git a/includes/CargoQueryDisplayer.php b/includes/CargoQueryDisplayer.php
index f37bc7c..9b2dc04 100644
--- a/includes/CargoQueryDisplayer.php
+++ b/includes/CargoQueryDisplayer.php
@@ -105,6 +105,8 @@
// There's probably an easier way to do
// this, using array_map().
$delimiter = 
$fieldDescription->getDelimiter();
+   // We need to decode it in case the 
delimiter is ;
+   $value = html_entity_decode( $value );
$fieldValues = explode( $delimiter, 
$value );
foreach ( $fieldValues as $i => 
$fieldValue ) {
if ( trim( $fieldValue ) == '' 
) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id56cb5411137fed6fea73bd3273acca4adc290ce
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Fix for handling of free text between section tags

2017-11-09 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390285 )

Change subject: Fix for handling of free text between section tags
..

Fix for handling of free text between section tags

Change-Id: I5f35d2c7fbdbd9c874c3a24b678f3470d3c8ffea
---
M includes/PF_FormPrinter.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/85/390285/2

diff --git a/includes/PF_FormPrinter.php b/includes/PF_FormPrinter.php
index e2bc5ca..ed30c87 100644
--- a/includes/PF_FormPrinter.php
+++ b/includes/PF_FormPrinter.php
@@ -1271,12 +1271,12 @@
}
}
 
-   if ( $section_end_loc === -1 ) {
-   $section_text = 
$existing_page_content;
-   $existing_page_content 
= '';
+   if ( $section_end_loc === -1 || 
$section_end_loc == null ) {
+   $section_text = substr( 
$existing_page_content, $section_start_loc );
+   $existing_page_content 
= substr( $existing_page_content, 0, $section_start_loc );
} else {
$section_text = substr( 
$existing_page_content, $section_start_loc, $section_end_loc - 
$section_start_loc );
-   $existing_page_content 
= substr( $existing_page_content, $section_end_loc );
+   $existing_page_content 
= substr( $existing_page_content, 0, $section_start_loc ) . substr( 
$existing_page_content, $section_end_loc );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f35d2c7fbdbd9c874c3a24b678f3470d3c8ffea
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...Cargo[master]: Made calendar display more detailed

2017-11-09 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390257 )

Change subject: Made calendar display more detailed
..

Made calendar display more detailed

Changed "basic" displays to "agenda" displays, added "list week" display,
added automatic display of end time (if there is one).

Change-Id: I69d766520039176924bbc0bbb708ad1dc47b661c
---
M libs/ext.cargo.calendar.js
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Cargo 
refs/changes/57/390257/2

diff --git a/libs/ext.cargo.calendar.js b/libs/ext.cargo.calendar.js
index c8de6f9..f6b46f7 100644
--- a/libs/ext.cargo.calendar.js
+++ b/libs/ext.cargo.calendar.js
@@ -11,10 +11,11 @@
header: {
left: 'today prev,next',
center: 'title',
-   right: 'month,basicWeek,basicDay'
+   right: 'month,agendaWeek,agendaDay,listWeek'
},
defaultView: startView,
defaultDate: startDate,
+   displayEventEnd: true,
// Ideally, the translations should all move into
// the Cargo extension, instead of staying in
// FullCalendar, in order to support more languages -

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I69d766520039176924bbc0bbb708ad1dc47b661c
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Removed jquery.ui.button, .widget dependencies (not directly...

2017-11-09 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390253 )

Change subject: Removed jquery.ui.button, .widget dependencies (not directly 
used)
..

Removed jquery.ui.button, .widget dependencies (not directly used)

Change-Id: I1a549df77fd72a01198f6061a48debf6fd57d177
---
M PageForms.php
M extension.json
2 files changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/53/390253/2

diff --git a/PageForms.php b/PageForms.php
index 9a2b9f2..f5bacc2 100644
--- a/PageForms.php
+++ b/PageForms.php
@@ -259,9 +259,7 @@
'dependencies' => array(
'jquery.ui.core',
'jquery.ui.autocomplete',
-   'jquery.ui.button',
'jquery.ui.sortable',
-   'jquery.ui.widget',
'ext.pageforms.fancybox',
'ext.pageforms.autogrow',
'mediawiki.util',
diff --git a/extension.json b/extension.json
index 1d4c864..1748b82 100644
--- a/extension.json
+++ b/extension.json
@@ -161,9 +161,7 @@
"dependencies": [
"jquery.ui.core",
"jquery.ui.autocomplete",
-   "jquery.ui.button",
"jquery.ui.sortable",
-   "jquery.ui.widget",
"ext.pageforms.fancybox",
"ext.pageforms.autogrow",
"mediawiki.util",

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a549df77fd72a01198f6061a48debf6fd57d177
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Fixed handling of WikiEditor, "placeholder" for section tags

2017-11-09 Thread Yaron Koren (Code Review)
Yaron Koren has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/390250 )

Change subject: Fixed handling of WikiEditor, "placeholder" for section tags
..

Fixed handling of WikiEditor, "placeholder" for section tags

Change-Id: I28837e6b68142ba0cd509340a5769e6490fe42ee
---
M includes/PF_FormPrinter.php
M includes/PF_PageSection.php
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/50/390250/2

diff --git a/includes/PF_FormPrinter.php b/includes/PF_FormPrinter.php
index 551e748..e2bc5ca 100644
--- a/includes/PF_FormPrinter.php
+++ b/includes/PF_FormPrinter.php
@@ -1303,7 +1303,7 @@
if ( $page_section_in_form->isHidden() 
) {
$form_section_text = 
Html::hidden( $input_name, $section_text );
} else {
-   $sectionInput = new 
PFTextAreaInput( $input_number = null, $section_text, $input_name, ( 
$form_is_disabled || $page_section_in_form->isRestricted() ), $other_args );
+   $sectionInput = new 
PFTextAreaInput( $wgPageFormsFieldNum, $section_text, $input_name, ( 
$form_is_disabled || $page_section_in_form->isRestricted() ), $other_args );
$sectionInput->addJavaScript();
$form_section_text = 
$sectionInput->getHtmlText();
}
diff --git a/includes/PF_PageSection.php b/includes/PF_PageSection.php
index 34a405f..0a36eca 100644
--- a/includes/PF_PageSection.php
+++ b/includes/PF_PageSection.php
@@ -25,8 +25,6 @@
}
 
static function newFromFormTag( $tag_components ) {
-   global $wgUser;
-
$ps = new PFPageSection();
$ps->mSectionName = trim( $tag_components[1] );
 
@@ -40,6 +38,7 @@
} elseif ( $component === 'hidden' ) {
$ps->mIsHidden = true;
} elseif ( $component === 'restricted' ) {
+   global $wgUser;
$ps->mIsRestricted = !( $wgUser && 
$wgUser->isAllowed( 'editrestrictedfields' ) );
} elseif ( $component === 'autogrow' ) {
$ps->mSectionArgs['autogrow'] = true;
@@ -58,6 +57,7 @@
case 'cols':
case 'class':
case 'editor':
+   case 'placeholder':
$ps->mSectionArgs[$sub_components[0]] = 
$sub_components[1];
break;
default:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I28837e6b68142ba0cd509340a5769e6490fe42ee
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren 
Gerrit-Reviewer: jenkins-bot <>

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


  1   2   3   4   5   6   7   8   9   10   >