[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Adds ignorewarnings to SimpleUpload

2017-07-28 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368539 )

Change subject: Adds ignorewarnings to SimpleUpload
..

Adds ignorewarnings to SimpleUpload

Change-Id: Iad8967ef5f97aaae35f28152a9e342d87b79d22d
---
M libs/PF_simpleupload.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/39/368539/1

diff --git a/libs/PF_simpleupload.js b/libs/PF_simpleupload.js
index 1da6ee2..e22c922 100644
--- a/libs/PF_simpleupload.js
+++ b/libs/PF_simpleupload.js
@@ -38,6 +38,7 @@
var formdata = new FormData(); //see 
https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
formdata.append("action", "upload");
formdata.append("format", "json");
+   formdata.append("ignorewarnings", "true");
formdata.append("filename", fileName);
formdata.append("token", mw.user.tokens.get( 'editToken' ) );
formdata.append("file", fileToUpload);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad8967ef5f97aaae35f28152a9e342d87b79d22d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 

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


[MediaWiki-commits] [Gerrit] mediawiki...PageForms[master]: Simple upload feature for uploadable fields.

2016-12-27 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/329332 )

Change subject: Simple upload feature for uploadable fields.
..

Simple upload feature for uploadable fields.

Instead of going for the Upload window that current uploadable field
provides this feature enables a simple upload dialog with provision to
preview the image and change or remove it.

This feature currently only supports fields with a single value (image)

Note: This feature is disabled by default and can be turned on by
setting $wgPageFormsSimpleUpload to true.

Change-Id: Icdd76c1e826cb6e7286669c283981c5e7aee5e1a
---
M PageForms.php
M extension.json
M includes/PF_Utils.php
M includes/forminputs/PF_TextInput.php
A libs/PF_simpleupload.js
5 files changed, 88 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms 
refs/changes/32/329332/1

diff --git a/PageForms.php b/PageForms.php
index fa02a12..1a3b7ff 100644
--- a/PageForms.php
+++ b/PageForms.php
@@ -372,6 +372,11 @@
),
'styles' => 'skins/jquery.rateyo.css',
),
+   'ext.pageforms.simpleupload' => $wgPageFormsResourceTemplate + array(
+   'scripts' => array(
+   'libs/PF_simpleupload.js'
+   ),
+   ),
'ext.pageforms.select2' => $wgPageFormsResourceTemplate + array(
'scripts' => array(
'libs/select2.js',
diff --git a/extension.json b/extension.json
index 30b2532..8c28f6e 100644
--- a/extension.json
+++ b/extension.json
@@ -296,6 +296,11 @@
],
"styles": "skins/jquery.rateyo.css"
},
+   "ext.pageforms.simpleupload": {
+   "scripts": [
+   "libs/PF_simpleupload.js"
+   ]
+   },
"ext.pageforms.select2": {
"scripts": [
"libs/select2.js",
diff --git a/includes/PF_Utils.php b/includes/PF_Utils.php
index 7910e39..1dd9204 100644
--- a/includes/PF_Utils.php
+++ b/includes/PF_Utils.php
@@ -200,7 +200,8 @@
'ext.pageforms.autogrow',
'ext.pageforms.checkboxes',
'ext.pageforms.select2',
-   'ext.pageforms.rating'
+   'ext.pageforms.rating',
+   'ext.pageforms.simpleupload'
);
 
$output->addModules( $mainModules );
diff --git a/includes/forminputs/PF_TextInput.php 
b/includes/forminputs/PF_TextInput.php
index 083cfa5..1aaa4dc 100644
--- a/includes/forminputs/PF_TextInput.php
+++ b/includes/forminputs/PF_TextInput.php
@@ -144,6 +144,15 @@
}
 
public static function uploadableHTML( $input_id, $delimiter = null, 
$default_filename = null, $cur_value = '', $other_args = array() ) {
+   global $wgPageFormsSimpleUpload;
+   if ($wgPageFormsSimpleUpload) {
+   $text = <<
+
+
+END;
+   return $text;
+   }
$upload_window_page = SpecialPageFactory::getPage( 
'UploadWindow' );
$query_string = "pfInputID=$input_id";
if ( $delimiter != null ) {
diff --git a/libs/PF_simpleupload.js b/libs/PF_simpleupload.js
new file mode 100644
index 000..6aefdc5
--- /dev/null
+++ b/libs/PF_simpleupload.js
@@ -0,0 +1,67 @@
+( function( $, mw, pf ) {
+   $(".simpleupload_btn").each(function(){
+   _this = $(this);
+   input = _this.parent().find('#' + _this.data('id'));
+   input.hide();
+   if (input.val() != '') {
+   _this.val("Change Image");
+   $('').insertAfter(input);
+   _this.parent().find('.simpleupload_rmv_btn').show();
+   }
+   });
+
+   $(".simpleupload_rmv_btn").click(function () {
+   _this = $(this);
+   input = _this.parent().find('#' + _this.data('id'));
+   _this.parent().find('img').remove();
+   input.val('');
+   _this.hide();
+   _this.parent().find('.simpleupload_btn').val("Upload Image");
+   });
+
+   $(".simpleupload_btn").click(function () {
+   $(this).parent().find("input[type='file']").trigger('click');
+   });
+
+   $("input[type='file'].simpleupload").change(function(event) {
+   _this = $(this);
+   input = _this.parent().find('#' + _this.data('id'));
+   var fileToUpload = event.target.files[0]; // get (first) File 
+   var fileName = event.target.files[0].name;
+
+   formdata = new FormData(); //see 

[MediaWiki-commits] [Gerrit] Bug 70732 change inspect diff to show diff - change (mediawiki...RecentActivityFeed)

2014-09-29 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Bug 70732  change inspect diff to show diff
..


Bug 70732  change inspect diff to show diff

Change-Id: Ia48b3851375fc2b4c6b75e8cf72bbf11edc64a88
---
M modules/ext.inlinediff.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Ragesoss: Looks good to me, but someone else must approve
  Nischayn22: Verified; Looks good to me, approved



diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
index 6ccb086..7c2a95c 100644
--- a/modules/ext.inlinediff.js
+++ b/modules/ext.inlinediff.js
@@ -8,7 +8,7 @@
 
 diffRequestLocked = f;
 if (typeof inspectText == undefined) {
-   inspectText = inspect diff;
+   inspectText = show diff;
 }
 if (typeof showText == undefined) {
showText = show diff;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia48b3851375fc2b4c6b75e8cf72bbf11edc64a88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: AndyRussG andrew.green...@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Ragesoss rages...@gmail.com

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


[MediaWiki-commits] [Gerrit] Log entries in RecentActivityFeed have formatting problem - change (mediawiki...RecentActivityFeed)

2014-09-29 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Log entries in RecentActivityFeed have formatting problem
..

Log entries in RecentActivityFeed have formatting problem

Bug 70730 - Log entries in RecentActivityFeed have formatting problem

Change-Id: I2f8d4c6c15c80580ed6e75b573737f7f6adc645e
---
M SpecialRecentActivityFeed.php
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RecentActivityFeed 
refs/changes/93/163593/1

diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 0e26ae2..35dcc42 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -436,12 +436,14 @@
if ( $rc-mAttribs['rc_log_type'] ) {
$logtitle = SpecialPage::getTitleFor( 'Log', 
$rc-mAttribs['rc_log_type'] );
$list-insertLog( $s, $logtitle, 
$rc-mAttribs['rc_log_type'] );
+   $s .= '; ';
// Log entries (old format) or log targets, and special pages
} elseif ( $rc-mAttribs['rc_namespace'] == NS_SPECIAL ) {
list( $name, $subpage ) = 
SpecialPageFactory::resolveAlias( $rc-mAttribs['rc_title'] );
if ( $name == 'Log' ) {
$list-insertLog( $s, $rc-getTitle(), $subpage 
);
}
+   $s .= '; ';
// Regular entries
} else {
$list-insertDiffHist( $s, $rc, $unpatrolled );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f8d4c6c15c80580ed6e75b573737f7f6adc645e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Log entries in RecentActivityFeed have formatting problem - change (mediawiki...RecentActivityFeed)

2014-09-29 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Log entries in RecentActivityFeed have formatting problem
..


Log entries in RecentActivityFeed have formatting problem

Bug 70730 - Log entries in RecentActivityFeed have formatting problem

Change-Id: I2f8d4c6c15c80580ed6e75b573737f7f6adc645e
---
M SpecialRecentActivityFeed.php
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 0e26ae2..35dcc42 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -436,12 +436,14 @@
if ( $rc-mAttribs['rc_log_type'] ) {
$logtitle = SpecialPage::getTitleFor( 'Log', 
$rc-mAttribs['rc_log_type'] );
$list-insertLog( $s, $logtitle, 
$rc-mAttribs['rc_log_type'] );
+   $s .= '; ';
// Log entries (old format) or log targets, and special pages
} elseif ( $rc-mAttribs['rc_namespace'] == NS_SPECIAL ) {
list( $name, $subpage ) = 
SpecialPageFactory::resolveAlias( $rc-mAttribs['rc_title'] );
if ( $name == 'Log' ) {
$list-insertLog( $s, $rc-getTitle(), $subpage 
);
}
+   $s .= '; ';
// Regular entries
} else {
$list-insertDiffHist( $s, $rc, $unpatrolled );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2f8d4c6c15c80580ed6e75b573737f7f6adc645e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Bug 70732 change inspect diff to show diff - change (mediawiki...RecentActivityFeed)

2014-09-25 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Bug 70732  change inspect diff to show diff
..

Bug 70732  change inspect diff to show diff

Change-Id: Ia48b3851375fc2b4c6b75e8cf72bbf11edc64a88
---
M modules/ext.inlinediff.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
index 6ccb086..7c2a95c 100644
--- a/modules/ext.inlinediff.js
+++ b/modules/ext.inlinediff.js
@@ -8,7 +8,7 @@
 
 diffRequestLocked = f;
 if (typeof inspectText == undefined) {
-   inspectText = inspect diff;
+   inspectText = show diff;
 }
 if (typeof showText == undefined) {
showText = show diff;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia48b3851375fc2b4c6b75e8cf72bbf11edc64a88
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove usage of innerHTML - change (mediawiki...RecentActivityFeed)

2014-09-21 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Remove usage of innerHTML
..

Remove usage of innerHTML

As per https://bugzilla.wikimedia.org/show_bug.cgi?id=69798#c1
removed usage of innerHTML

Change-Id: I9f9624c6adea59b1eee54c0c62855ecb175c4753
---
M modules/ext.inlinediff.js
1 file changed, 20 insertions(+), 28 deletions(-)


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

diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
index 6ccb086..58648c9 100644
--- a/modules/ext.inlinediff.js
+++ b/modules/ext.inlinediff.js
@@ -25,34 +25,28 @@
findString = 'a:contains(diff)';
}
 
-   var regex;
-
-   if (mw.config.get('wgCanonicalSpecialPageName') == Contributions) {
-   regex = /oldid=(\d+)$/;
-
-   } else {
-   regex = /diff=(\d+)oldid=/;
-   }
+   var regex = /diff=(\d+)oldid=/;
var diffLink = $(element).find(findString);
+
if (diffLink.length  0  !(/(\.js|\.css)/.test(diffLink[0].href))) {
var regexResult = regex.exec(diffLink[0].href);
if (regexResult != null  regexResult.length = 2) {
var diffID = regexResult[1];
var inlineDiffButton;
if (typeof inlineDiffBigUI === undefined) {
-   inlineDiffButton = document.createElement(a);
-   inlineDiffButton.href = #;
-   inlineDiffButton.innerHTML = 'bspan 
style=color:black; [/spanspan style=color:#339900;' + inspectText + 
'/spanspan style=color:black;] /span/b';
+   inlineDiffButton = $('a')
+   .attr('href', '#')
+   .html('bspan style=color:black; [/spanspan 
style=color:#339900;' + inspectText + '/spanspan style=color:black;] 
/span/b');
} else {
-   inlineDiffButton = document.createElement(input);
-   inlineDiffButton.type = button;
-   inlineDiffButton.value = Inspect edit;
+   inlineDiffButton = $('input')
+   .attr('type', 'button')
+   .value('inspect edit');
}
-   inlineDiffButton.id = diffID;
-   $(inlineDiffButton).click(function() {
-   return inspectWatchlistDiff(this);
-   });
-   $(element).find('.comment').append(inlineDiffButton);
+   inlineDiffButton.attr( 'id', diffID)
+   .click(function() {
+   return inspectWatchlistDiff(this);
+   });
+   $(element).find('br').before(inlineDiffButton);
}
}
 }
@@ -61,7 +55,7 @@
 
 
var entries = $(#mw-content-text table.mw-enhanced-rc);
-   if (entries.length == 0) {
+   if ( entries.length == 0 ) {
$(.mw-changeslist).each(function(ind, el) {
$(el).children(div).each(inspectionEachHelper);
});
@@ -84,7 +78,6 @@
diffRequestLocked = f;
return false;
}
-
var diffString = 
response.query.pages[Object.keys(response.query.pages)[0]].revisions[0].diff[*];
 
if (diffString == null) {
@@ -93,17 +86,16 @@
return false;
}
 
-   var newTable = document.createElement(table);
-   newTable.className = diff;
-   $(newTable).html('colgroupcol class=diff-markercol 
class=diff-contentcol class=diff-markercol 
class=diff-content/colgroup');
-
-   $(newTable).append(diffString);
+   var newTable = $('table')
+   .attr('class', diff)
+   .html('colgroupcol class=diff-markercol 
class=diff-contentcol class=diff-markercol 
class=diff-content/colgroup')
+   .append(diffString);
if ($(# + button.id).parent(td).length  0  !($(# + 
button.id).parent(td).hasClass(mw-enhanced-rc-nested))) {
$(# + 
button.id).parents(table.mw-enhanced-rc:first).after(newTable);
} else {
-   $(newTable).insertAfter(# + button.id);
+   newTable.insertAfter(# + button.id);
}
-   newTable.id = button.id + display;
+   newTable.attr('id', button.id + display);
 
$(button).unbind(click);
if (typeof inlineDiffBigUI === undefined) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f9624c6adea59b1eee54c0c62855ecb175c4753
Gerrit-PatchSet: 1

[MediaWiki-commits] [Gerrit] Added lot of comments and fixed some styling. - change (mediawiki...RecentActivityFeed)

2014-09-10 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Added lot of comments and fixed some styling.
..

Added lot of comments and fixed some styling.

Also added licenses

Change-Id: I04e790cea577163785519418ccc6fe6c3cefaafd
---
M RecentActivityFeed.alias.php
M RecentActivityFeed.php
M SpecialRecentActivityFeed.php
M modules/ext.inlinediff.js
4 files changed, 90 insertions(+), 31 deletions(-)


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

diff --git a/RecentActivityFeed.alias.php b/RecentActivityFeed.alias.php
index 29eff4c..3bc50e9 100644
--- a/RecentActivityFeed.alias.php
+++ b/RecentActivityFeed.alias.php
@@ -1,9 +1,6 @@
 ?php
 /**
- * Aliases for myextension
- *
- * @file
- * @ingroup Extensions
+ * Aliases for RecentActivityFeed
  */
  
 $specialPageAliases = array();
@@ -12,6 +9,6 @@
  * @author nischayn22
  */
 $specialPageAliases[ 'en' ] = array(
-'RecentActivityFeed' = array( 'RecentActivityFeed'),
+'RecentActivityFeed' = array( 'RecentActivityFeed' ),
 );
  
\ No newline at end of file
diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index cba6cd4..f23cd29 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -1,5 +1,18 @@
 ?php
 
+/**
+ * RecentActivityFeed extension for MediaWiki
+ *
+ * For more info see 
https://www.mediawiki.org/wiki/Extension:RecentActivityFeed
+ *
+ * This file loads everything needed for the RecentActivityFeed extension to 
function.
+ *
+ * @file
+ * @ingroup Extensions
+ * @license The MIT License
+ */
+
+
 # Alert the user that this is not a valid access point to MediaWiki if they 
try to access the special pages file directly.
 if ( !defined( 'MEDIAWIKI' ) ) {
echo EOT
@@ -8,14 +21,15 @@
 EOT;
exit( 1 );
 }
- 
+
 $wgExtensionCredits[ 'specialpage' ][] = array(
-   'path' = __FILE__,
-   'name' = 'RecentActivityFeed',
-   'author' = 'Nischay Nahata',
-   'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
-   'descriptionmsg' = 'recentactivityfeed-desc',
-   'version' = '0.0.0',
+'path' = __FILE__,
+'name' = 'RecentActivityFeed',
+'author' = 'Nischay Nahata',
+'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
+'descriptionmsg' = 'recentactivityfeed-desc',
+'version' = '1.0',
+'license-name' = 'MIT',
 );
 
 $wgAutoloadClasses[ 'SpecialRecentActivityFeed' ] = __DIR__ . 
'/SpecialRecentActivityFeed.php'; # Location of the SpecialRecentActivityFeed 
class (Tell MediaWiki to load this file)
@@ -25,11 +39,10 @@
 
 
 $wgResourceModules['ext.RecentActivityFeed.inlinediff'] = array(
-  'scripts' = 
'modules/ext.inlinediff.js',
-  'styles' = array(),
-  'messages' = array(
- ),
- 'dependencies' = array(),
- 'localBasePath' = __DIR__,
- 'remoteExtPath' = 'RecentActivityFeed',
+   'scripts' = 
'modules/ext.inlinediff.js',
+   'styles' = array(),
+   'messages' = array(),
+   'dependencies' = 
array(),
+   'localBasePath' = 
__DIR__,
+   'remoteExtPath' = 
'RecentActivityFeed',
 );
diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 3e23db4..0e26ae2 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -19,41 +19,73 @@
  *
  * @file
  * @ingroup SpecialPage
+ * @ingroup RecentActivityFeed
  */
 
-/**
- * A special page that lists last changes made to the wiki by certain users
- *
- * @ingroup SpecialPage
- */
 class SpecialRecentActivityFeed extends ChangesListSpecialPage {
 
+   /**
+*  @var array $defaultParams: an array of default params
+*  Usage: Used by other extensions like EP
+*  Examples:  $recentActivityFeed-setParams(array('action' = 
'epcourseactivity'))
+*/
protected $defaultParams = array();
+
+   /**
+*  @var string $customDesc: Customizable description of the page
+*  Examples: $recentActivityFeed-setCustomDescription( 'Activity for 
course ' . $courseTitle );
+*/
protected $customDesc;
+
+
+   /**
+*  @var array $additionalConds: 

[MediaWiki-commits] [Gerrit] Added lot of comments and fixed some styling. - change (mediawiki...RecentActivityFeed)

2014-09-10 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Added lot of comments and fixed some styling.
..


Added lot of comments and fixed some styling.

Also added licenses

Change-Id: I04e790cea577163785519418ccc6fe6c3cefaafd
---
M RecentActivityFeed.alias.php
M RecentActivityFeed.php
M SpecialRecentActivityFeed.php
M modules/ext.inlinediff.js
4 files changed, 90 insertions(+), 31 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/RecentActivityFeed.alias.php b/RecentActivityFeed.alias.php
index 29eff4c..3bc50e9 100644
--- a/RecentActivityFeed.alias.php
+++ b/RecentActivityFeed.alias.php
@@ -1,9 +1,6 @@
 ?php
 /**
- * Aliases for myextension
- *
- * @file
- * @ingroup Extensions
+ * Aliases for RecentActivityFeed
  */
  
 $specialPageAliases = array();
@@ -12,6 +9,6 @@
  * @author nischayn22
  */
 $specialPageAliases[ 'en' ] = array(
-'RecentActivityFeed' = array( 'RecentActivityFeed'),
+'RecentActivityFeed' = array( 'RecentActivityFeed' ),
 );
  
\ No newline at end of file
diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index cba6cd4..f23cd29 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -1,5 +1,18 @@
 ?php
 
+/**
+ * RecentActivityFeed extension for MediaWiki
+ *
+ * For more info see 
https://www.mediawiki.org/wiki/Extension:RecentActivityFeed
+ *
+ * This file loads everything needed for the RecentActivityFeed extension to 
function.
+ *
+ * @file
+ * @ingroup Extensions
+ * @license The MIT License
+ */
+
+
 # Alert the user that this is not a valid access point to MediaWiki if they 
try to access the special pages file directly.
 if ( !defined( 'MEDIAWIKI' ) ) {
echo EOT
@@ -8,14 +21,15 @@
 EOT;
exit( 1 );
 }
- 
+
 $wgExtensionCredits[ 'specialpage' ][] = array(
-   'path' = __FILE__,
-   'name' = 'RecentActivityFeed',
-   'author' = 'Nischay Nahata',
-   'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
-   'descriptionmsg' = 'recentactivityfeed-desc',
-   'version' = '0.0.0',
+'path' = __FILE__,
+'name' = 'RecentActivityFeed',
+'author' = 'Nischay Nahata',
+'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
+'descriptionmsg' = 'recentactivityfeed-desc',
+'version' = '1.0',
+'license-name' = 'MIT',
 );
 
 $wgAutoloadClasses[ 'SpecialRecentActivityFeed' ] = __DIR__ . 
'/SpecialRecentActivityFeed.php'; # Location of the SpecialRecentActivityFeed 
class (Tell MediaWiki to load this file)
@@ -25,11 +39,10 @@
 
 
 $wgResourceModules['ext.RecentActivityFeed.inlinediff'] = array(
-  'scripts' = 
'modules/ext.inlinediff.js',
-  'styles' = array(),
-  'messages' = array(
- ),
- 'dependencies' = array(),
- 'localBasePath' = __DIR__,
- 'remoteExtPath' = 'RecentActivityFeed',
+   'scripts' = 
'modules/ext.inlinediff.js',
+   'styles' = array(),
+   'messages' = array(),
+   'dependencies' = 
array(),
+   'localBasePath' = 
__DIR__,
+   'remoteExtPath' = 
'RecentActivityFeed',
 );
diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 3e23db4..0e26ae2 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -19,41 +19,73 @@
  *
  * @file
  * @ingroup SpecialPage
+ * @ingroup RecentActivityFeed
  */
 
-/**
- * A special page that lists last changes made to the wiki by certain users
- *
- * @ingroup SpecialPage
- */
 class SpecialRecentActivityFeed extends ChangesListSpecialPage {
 
+   /**
+*  @var array $defaultParams: an array of default params
+*  Usage: Used by other extensions like EP
+*  Examples:  $recentActivityFeed-setParams(array('action' = 
'epcourseactivity'))
+*/
protected $defaultParams = array();
+
+   /**
+*  @var string $customDesc: Customizable description of the page
+*  Examples: $recentActivityFeed-setCustomDescription( 'Activity for 
course ' . $courseTitle );
+*/
protected $customDesc;
+
+
+   /**
+*  @var array $additionalConds: additional conditions to be passed to 
filter the result
+*  Examples: 

[MediaWiki-commits] [Gerrit] jsbeautified using jsbeautify.com - change (mediawiki...RecentActivityFeed)

2014-09-10 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: jsbeautified using jsbeautify.com
..


jsbeautified using jsbeautify.com

Change-Id: I7808507bd22cf405503b6c91edaf66192e300170
---
M modules/ext.inlinediff.js
1 file changed, 147 insertions(+), 168 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
index 0c18106..6ccb086 100644
--- a/modules/ext.inlinediff.js
+++ b/modules/ext.inlinediff.js
@@ -4,188 +4,167 @@
  * Author: Writ Keeper
  * Author: Nischayn22
  */
+(function($) {
 
-(function( $ ) {
-
-diffRequestLocked = f;
-if(typeof inspectText == undefined)
-{
-  inspectText = inspect diff;
-}
-if(typeof showText == undefined)
-{
-  showText = show diff;
-}
-if(typeof hideText == undefined)
-{
-  hideText = hide diff;
-}
-  function inspectionEachHelper(index, element)
-  {
-var findString;
-if( mw.config.get( 'wgAction' )== history || 
$(element).hasClass(mw-enhanced-rc-nested))
-{
-  findString = 'a:contains(prev)';
+diffRequestLocked = f;
+if (typeof inspectText == undefined) {
+   inspectText = inspect diff;
 }
-else
-{
-  findString = 'a:contains(diff)';
+if (typeof showText == undefined) {
+   showText = show diff;
+}
+if (typeof hideText == undefined) {
+   hideText = hide diff;
 }
 
-var regex;
+function inspectionEachHelper(index, element) {
+   var findString;
+   if (mw.config.get('wgAction') == history || 
$(element).hasClass(mw-enhanced-rc-nested)) {
+   findString = 'a:contains(prev)';
+   } else {
+   findString = 'a:contains(diff)';
+   }
 
-if( mw.config.get( 'wgCanonicalSpecialPageName' ) == Contributions)
-{
-  regex = /oldid=(\d+)$/;
+   var regex;
 
+   if (mw.config.get('wgCanonicalSpecialPageName') == Contributions) {
+   regex = /oldid=(\d+)$/;
+
+   } else {
+   regex = /diff=(\d+)oldid=/;
+   }
+   var diffLink = $(element).find(findString);
+   if (diffLink.length  0  !(/(\.js|\.css)/.test(diffLink[0].href))) {
+   var regexResult = regex.exec(diffLink[0].href);
+   if (regexResult != null  regexResult.length = 2) {
+   var diffID = regexResult[1];
+   var inlineDiffButton;
+   if (typeof inlineDiffBigUI === undefined) {
+   inlineDiffButton = document.createElement(a);
+   inlineDiffButton.href = #;
+   inlineDiffButton.innerHTML = 'bspan 
style=color:black; [/spanspan style=color:#339900;' + inspectText + 
'/spanspan style=color:black;] /span/b';
+   } else {
+   inlineDiffButton = document.createElement(input);
+   inlineDiffButton.type = button;
+   inlineDiffButton.value = Inspect edit;
+   }
+   inlineDiffButton.id = diffID;
+   $(inlineDiffButton).click(function() {
+   return inspectWatchlistDiff(this);
+   });
+   $(element).find('.comment').append(inlineDiffButton);
+   }
+   }
 }
-else
-{
-  regex = /diff=(\d+)oldid=/;
+
+function addWatchlistInspectionBoxes() {
+
+
+   var entries = $(#mw-content-text table.mw-enhanced-rc);
+   if (entries.length == 0) {
+   $(.mw-changeslist).each(function(ind, el) {
+   $(el).children(div).each(inspectionEachHelper);
+   });
+   } else {
+   entries.each(inspectionEachHelper);
+   $(td.mw-enhanced-rc-nested).each(inspectionEachHelper);
+   }
+   mw.loader.load('mediawiki.action.history.diff');
 }
-var diffLink = $(element).find(findString);
-if(diffLink.length  0  !(/(\.js|\.css)/.test(diffLink[0].href)))
-{
-  var regexResult = regex.exec(diffLink[0].href);
-  if(regexResult != null  regexResult.length = 2)
-  {
-var diffID = regexResult[1];
-var inlineDiffButton;
-if(typeof inlineDiffBigUI === undefined)
-{
-  inlineDiffButton = document.createElement(a);
-  inlineDiffButton.href = #;
-  inlineDiffButton.innerHTML = 'bspan style=color:black; 
[/spanspan style=color:#339900;'+inspectText+'/spanspan 
style=color:black;] /span/b';
-}
-else
-{
-  inlineDiffButton = document.createElement(input);
-  inlineDiffButton.type = button;
-  inlineDiffButton.value = Inspect edit;
-}
-inlineDiffButton.id = diffID;
-$(inlineDiffButton).click(function(){ return 
inspectWatchlistDiff(this);});
-$(element).find('.comment').append(inlineDiffButton);
-  }
+
+function inspectWatchlistDiff(button) {
+   if (diffRequestLocked === t) {
+   alert(An old request is still being processed, please 

[MediaWiki-commits] [Gerrit] jsbeautified using jsbeautify.com - change (mediawiki...RecentActivityFeed)

2014-09-10 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: jsbeautified using jsbeautify.com
..

jsbeautified using jsbeautify.com

Change-Id: I7808507bd22cf405503b6c91edaf66192e300170
---
M modules/ext.inlinediff.js
1 file changed, 147 insertions(+), 168 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RecentActivityFeed 
refs/changes/35/159535/1

diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
index 0c18106..6ccb086 100644
--- a/modules/ext.inlinediff.js
+++ b/modules/ext.inlinediff.js
@@ -4,188 +4,167 @@
  * Author: Writ Keeper
  * Author: Nischayn22
  */
+(function($) {
 
-(function( $ ) {
-
-diffRequestLocked = f;
-if(typeof inspectText == undefined)
-{
-  inspectText = inspect diff;
-}
-if(typeof showText == undefined)
-{
-  showText = show diff;
-}
-if(typeof hideText == undefined)
-{
-  hideText = hide diff;
-}
-  function inspectionEachHelper(index, element)
-  {
-var findString;
-if( mw.config.get( 'wgAction' )== history || 
$(element).hasClass(mw-enhanced-rc-nested))
-{
-  findString = 'a:contains(prev)';
+diffRequestLocked = f;
+if (typeof inspectText == undefined) {
+   inspectText = inspect diff;
 }
-else
-{
-  findString = 'a:contains(diff)';
+if (typeof showText == undefined) {
+   showText = show diff;
+}
+if (typeof hideText == undefined) {
+   hideText = hide diff;
 }
 
-var regex;
+function inspectionEachHelper(index, element) {
+   var findString;
+   if (mw.config.get('wgAction') == history || 
$(element).hasClass(mw-enhanced-rc-nested)) {
+   findString = 'a:contains(prev)';
+   } else {
+   findString = 'a:contains(diff)';
+   }
 
-if( mw.config.get( 'wgCanonicalSpecialPageName' ) == Contributions)
-{
-  regex = /oldid=(\d+)$/;
+   var regex;
 
+   if (mw.config.get('wgCanonicalSpecialPageName') == Contributions) {
+   regex = /oldid=(\d+)$/;
+
+   } else {
+   regex = /diff=(\d+)oldid=/;
+   }
+   var diffLink = $(element).find(findString);
+   if (diffLink.length  0  !(/(\.js|\.css)/.test(diffLink[0].href))) {
+   var regexResult = regex.exec(diffLink[0].href);
+   if (regexResult != null  regexResult.length = 2) {
+   var diffID = regexResult[1];
+   var inlineDiffButton;
+   if (typeof inlineDiffBigUI === undefined) {
+   inlineDiffButton = document.createElement(a);
+   inlineDiffButton.href = #;
+   inlineDiffButton.innerHTML = 'bspan 
style=color:black; [/spanspan style=color:#339900;' + inspectText + 
'/spanspan style=color:black;] /span/b';
+   } else {
+   inlineDiffButton = document.createElement(input);
+   inlineDiffButton.type = button;
+   inlineDiffButton.value = Inspect edit;
+   }
+   inlineDiffButton.id = diffID;
+   $(inlineDiffButton).click(function() {
+   return inspectWatchlistDiff(this);
+   });
+   $(element).find('.comment').append(inlineDiffButton);
+   }
+   }
 }
-else
-{
-  regex = /diff=(\d+)oldid=/;
+
+function addWatchlistInspectionBoxes() {
+
+
+   var entries = $(#mw-content-text table.mw-enhanced-rc);
+   if (entries.length == 0) {
+   $(.mw-changeslist).each(function(ind, el) {
+   $(el).children(div).each(inspectionEachHelper);
+   });
+   } else {
+   entries.each(inspectionEachHelper);
+   $(td.mw-enhanced-rc-nested).each(inspectionEachHelper);
+   }
+   mw.loader.load('mediawiki.action.history.diff');
 }
-var diffLink = $(element).find(findString);
-if(diffLink.length  0  !(/(\.js|\.css)/.test(diffLink[0].href)))
-{
-  var regexResult = regex.exec(diffLink[0].href);
-  if(regexResult != null  regexResult.length = 2)
-  {
-var diffID = regexResult[1];
-var inlineDiffButton;
-if(typeof inlineDiffBigUI === undefined)
-{
-  inlineDiffButton = document.createElement(a);
-  inlineDiffButton.href = #;
-  inlineDiffButton.innerHTML = 'bspan style=color:black; 
[/spanspan style=color:#339900;'+inspectText+'/spanspan 
style=color:black;] /span/b';
-}
-else
-{
-  inlineDiffButton = document.createElement(input);
-  inlineDiffButton.type = button;
-  inlineDiffButton.value = Inspect edit;
-}
-inlineDiffButton.id = diffID;
-$(inlineDiffButton).click(function(){ return 
inspectWatchlistDiff(this);});
-$(element).find('.comment').append(inlineDiffButton);
-  }
+
+function inspectWatchlistDiff(button) {
+   if 

[MediaWiki-commits] [Gerrit] Added mw.config.get instead of directly using global vars be... - change (mediawiki...RecentActivityFeed)

2014-09-04 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Added mw.config.get instead of directly using global vars 
because $wgLegacyJavaScriptGlobals = true is discouraged.
..

Added mw.config.get instead of directly using global vars because
$wgLegacyJavaScriptGlobals = true is discouraged.

Change-Id: I402af35a797b0a24cb5833036d5f65a10d43dd23
---
M modules/ext.inlinediff.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RecentActivityFeed 
refs/changes/18/158418/1

diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
index 865eecb..06d6c6d 100644
--- a/modules/ext.inlinediff.js
+++ b/modules/ext.inlinediff.js
@@ -20,7 +20,7 @@
   function inspectionEachHelper(index, element)
   {
 var findString;
-if(wgAction == history || $(element).hasClass(mw-enhanced-rc-nested))
+if( mw.config.get( 'wgAction' )== history || 
$(element).hasClass(mw-enhanced-rc-nested))
 {
   findString = 'a:contains(prev)';
 }
@@ -31,7 +31,7 @@
 
 var regex;
 
-if(wgCanonicalSpecialPageName == Contributions)
+if( mw.config.get( 'wgCanonicalSpecialPageName' ) == Contributions)
 {
   regex = /oldid=(\d+)$/;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I402af35a797b0a24cb5833036d5f65a10d43dd23
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added mw.config.get instead of directly using global vars - change (mediawiki...RecentActivityFeed)

2014-09-04 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Added mw.config.get instead of directly using global vars
..


Added mw.config.get instead of directly using global vars


Added mw.config.get instead of directly using global vars because
$wgLegacyJavaScriptGlobals = true is discouraged.

Change-Id: I402af35a797b0a24cb5833036d5f65a10d43dd23
---
M modules/ext.inlinediff.js
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
index 865eecb..06d6c6d 100644
--- a/modules/ext.inlinediff.js
+++ b/modules/ext.inlinediff.js
@@ -20,7 +20,7 @@
   function inspectionEachHelper(index, element)
   {
 var findString;
-if(wgAction == history || $(element).hasClass(mw-enhanced-rc-nested))
+if( mw.config.get( 'wgAction' )== history || 
$(element).hasClass(mw-enhanced-rc-nested))
 {
   findString = 'a:contains(prev)';
 }
@@ -31,7 +31,7 @@
 
 var regex;
 
-if(wgCanonicalSpecialPageName == Contributions)
+if( mw.config.get( 'wgCanonicalSpecialPageName' ) == Contributions)
 {
   regex = /oldid=(\d+)$/;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I402af35a797b0a24cb5833036d5f65a10d43dd23
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added inline diffs - change (mediawiki...RecentActivityFeed)

2014-09-03 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Added inline diffs
..

Added inline diffs

Change-Id: Iadd5a56f1dec9eaf2a91a80a6eaaafd03dcb376d
---
A .gitignore
M RecentActivityFeed.php
M SpecialRecentActivityFeed.php
A modules/ext.inlinediff.js
4 files changed, 204 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RecentActivityFeed 
refs/changes/58/158058/1

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..e4e5f6c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~
\ No newline at end of file
diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index b2cf20d..cba6cd4 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -21,4 +21,15 @@
 $wgAutoloadClasses[ 'SpecialRecentActivityFeed' ] = __DIR__ . 
'/SpecialRecentActivityFeed.php'; # Location of the SpecialRecentActivityFeed 
class (Tell MediaWiki to load this file)
 $wgMessagesDirs[ 'RecentActivityFeed' ] = __DIR__ . /i18n; # Location of 
localisation files (Tell MediaWiki to load them)
 $wgExtensionMessagesFiles[ 'RecentActivityFeedAlias' ] = __DIR__ . 
'/RecentActivityFeed.alias.php';
-$wgSpecialPages[ 'RecentActivityFeed' ] = 'SpecialRecentActivityFeed'; # Tell 
MediaWiki about the new special page and its class name
\ No newline at end of file
+$wgSpecialPages[ 'RecentActivityFeed' ] = 'SpecialRecentActivityFeed'; # Tell 
MediaWiki about the new special page and its class name
+
+
+$wgResourceModules['ext.RecentActivityFeed.inlinediff'] = array(
+  'scripts' = 
'modules/ext.inlinediff.js',
+  'styles' = array(),
+  'messages' = array(
+ ),
+ 'dependencies' = array(),
+ 'localBasePath' = __DIR__,
+ 'remoteExtPath' = 'RecentActivityFeed',
+);
diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 5f3e980..3e23db4 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -249,6 +249,9 @@
} else {
$this-getOutput()-addHTML( $rclistOutput );
}
+
+// Too less code to move to a different function yet.
+$this-getOutput()-addModules( 
'ext.RecentActivityFeed.inlinediff' );
}
 
 
diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
new file mode 100644
index 000..865eecb
--- /dev/null
+++ b/modules/ext.inlinediff.js
@@ -0,0 +1,188 @@
+/*
+ * Borrowed from 
https://en.wikipedia.org/wiki/User:Writ_Keeper/Scripts/commonHistory.js
+ * as per http://www.mediawiki.org/wiki/Editor_campaigns/Activity_feed
+ */
+(function( $ ) {
+
+diffRequestLocked = f;
+if(typeof inspectText == undefined)
+{
+  inspectText = inspect diff;
+}
+if(typeof showText == undefined)
+{
+  showText = show diff;
+}
+if(typeof hideText == undefined)
+{
+  hideText = hide diff;
+}
+  function inspectionEachHelper(index, element)
+  {
+var findString;
+if(wgAction == history || $(element).hasClass(mw-enhanced-rc-nested))
+{
+  findString = 'a:contains(prev)';
+}
+else
+{
+  findString = 'a:contains(diff)';
+}
+
+var regex;
+
+if(wgCanonicalSpecialPageName == Contributions)
+{
+  regex = /oldid=(\d+)$/;
+
+}
+else
+{
+  regex = /diff=(\d+)oldid=/;
+}
+var diffLink = $(element).find(findString);
+if(diffLink.length  0  !(/(\.js|\.css)/.test(diffLink[0].href)))
+{
+  var regexResult = regex.exec(diffLink[0].href);
+  if(regexResult != null  regexResult.length = 2)
+  {
+var diffID = regexResult[1];
+var inlineDiffButton;
+if(typeof inlineDiffBigUI === undefined)
+{
+  inlineDiffButton = document.createElement(a);
+  inlineDiffButton.href = #;
+  inlineDiffButton.innerHTML = 'bspan style=color:black; 
[/spanspan style=color:#339900;'+inspectText+'/spanspan 
style=color:black;] /span/b';
+}
+else
+{
+  inlineDiffButton = document.createElement(input);
+  inlineDiffButton.type = button;
+  inlineDiffButton.value = Inspect edit;
+}
+inlineDiffButton.id = diffID;
+$(inlineDiffButton).click(function(){ return 
inspectWatchlistDiff(this);});
+$(element).find('.comment').append(inlineDiffButton);
+  }
+}
+  }
+  function addWatchlistInspectionBoxes() {
+
+
+var entries = $(#mw-content-text table.mw-enhanced-rc);
+if(entries.length == 0)
+{
+  $(.mw-changeslist).each(function(ind, el)
+{
+  
$(el).children(div).each(inspectionEachHelper);
+});
+}
+

[MediaWiki-commits] [Gerrit] Added inline diffs - change (mediawiki...RecentActivityFeed)

2014-09-03 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Added inline diffs
..


Added inline diffs

Change-Id: Iadd5a56f1dec9eaf2a91a80a6eaaafd03dcb376d
---
A .gitignore
M RecentActivityFeed.php
M SpecialRecentActivityFeed.php
A modules/ext.inlinediff.js
4 files changed, 204 insertions(+), 1 deletion(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..e4e5f6c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~
\ No newline at end of file
diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index b2cf20d..cba6cd4 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -21,4 +21,15 @@
 $wgAutoloadClasses[ 'SpecialRecentActivityFeed' ] = __DIR__ . 
'/SpecialRecentActivityFeed.php'; # Location of the SpecialRecentActivityFeed 
class (Tell MediaWiki to load this file)
 $wgMessagesDirs[ 'RecentActivityFeed' ] = __DIR__ . /i18n; # Location of 
localisation files (Tell MediaWiki to load them)
 $wgExtensionMessagesFiles[ 'RecentActivityFeedAlias' ] = __DIR__ . 
'/RecentActivityFeed.alias.php';
-$wgSpecialPages[ 'RecentActivityFeed' ] = 'SpecialRecentActivityFeed'; # Tell 
MediaWiki about the new special page and its class name
\ No newline at end of file
+$wgSpecialPages[ 'RecentActivityFeed' ] = 'SpecialRecentActivityFeed'; # Tell 
MediaWiki about the new special page and its class name
+
+
+$wgResourceModules['ext.RecentActivityFeed.inlinediff'] = array(
+  'scripts' = 
'modules/ext.inlinediff.js',
+  'styles' = array(),
+  'messages' = array(
+ ),
+ 'dependencies' = array(),
+ 'localBasePath' = __DIR__,
+ 'remoteExtPath' = 'RecentActivityFeed',
+);
diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 5f3e980..3e23db4 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -249,6 +249,9 @@
} else {
$this-getOutput()-addHTML( $rclistOutput );
}
+
+// Too less code to move to a different function yet.
+$this-getOutput()-addModules( 
'ext.RecentActivityFeed.inlinediff' );
}
 
 
diff --git a/modules/ext.inlinediff.js b/modules/ext.inlinediff.js
new file mode 100644
index 000..865eecb
--- /dev/null
+++ b/modules/ext.inlinediff.js
@@ -0,0 +1,188 @@
+/*
+ * Borrowed from 
https://en.wikipedia.org/wiki/User:Writ_Keeper/Scripts/commonHistory.js
+ * as per http://www.mediawiki.org/wiki/Editor_campaigns/Activity_feed
+ */
+(function( $ ) {
+
+diffRequestLocked = f;
+if(typeof inspectText == undefined)
+{
+  inspectText = inspect diff;
+}
+if(typeof showText == undefined)
+{
+  showText = show diff;
+}
+if(typeof hideText == undefined)
+{
+  hideText = hide diff;
+}
+  function inspectionEachHelper(index, element)
+  {
+var findString;
+if(wgAction == history || $(element).hasClass(mw-enhanced-rc-nested))
+{
+  findString = 'a:contains(prev)';
+}
+else
+{
+  findString = 'a:contains(diff)';
+}
+
+var regex;
+
+if(wgCanonicalSpecialPageName == Contributions)
+{
+  regex = /oldid=(\d+)$/;
+
+}
+else
+{
+  regex = /diff=(\d+)oldid=/;
+}
+var diffLink = $(element).find(findString);
+if(diffLink.length  0  !(/(\.js|\.css)/.test(diffLink[0].href)))
+{
+  var regexResult = regex.exec(diffLink[0].href);
+  if(regexResult != null  regexResult.length = 2)
+  {
+var diffID = regexResult[1];
+var inlineDiffButton;
+if(typeof inlineDiffBigUI === undefined)
+{
+  inlineDiffButton = document.createElement(a);
+  inlineDiffButton.href = #;
+  inlineDiffButton.innerHTML = 'bspan style=color:black; 
[/spanspan style=color:#339900;'+inspectText+'/spanspan 
style=color:black;] /span/b';
+}
+else
+{
+  inlineDiffButton = document.createElement(input);
+  inlineDiffButton.type = button;
+  inlineDiffButton.value = Inspect edit;
+}
+inlineDiffButton.id = diffID;
+$(inlineDiffButton).click(function(){ return 
inspectWatchlistDiff(this);});
+$(element).find('.comment').append(inlineDiffButton);
+  }
+}
+  }
+  function addWatchlistInspectionBoxes() {
+
+
+var entries = $(#mw-content-text table.mw-enhanced-rc);
+if(entries.length == 0)
+{
+  $(.mw-changeslist).each(function(ind, el)
+{
+  
$(el).children(div).each(inspectionEachHelper);
+});
+}
+else
+{
+  entries.each(inspectionEachHelper);
+  

[MediaWiki-commits] [Gerrit] Added spaces. - change (mediawiki...RecentActivityFeed)

2014-09-02 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Added spaces.
..

Added spaces.

This change is basically to check if I can push :P

Change-Id: If463b332dbeb8014f1b41f95bfc0d9e9aa71c169
---
M SpecialRecentActivityFeed.php
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RecentActivityFeed 
refs/changes/47/158047/1

diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 1f216db..542851d 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -36,7 +36,7 @@
parent::__construct( $name, $restriction );
}
 
-   public function setAdditionalConds($conds){
+   public function setAdditionalConds( $conds ){
   $this-additionalConds = $conds;
}
 
@@ -428,4 +428,4 @@
return $s br/;
}
 
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If463b332dbeb8014f1b41f95bfc0d9e9aa71c169
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added spaces. - change (mediawiki...RecentActivityFeed)

2014-09-02 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Added spaces.
..


Added spaces.

This change is basically to check if I can push :P

Change-Id: If463b332dbeb8014f1b41f95bfc0d9e9aa71c169
---
M SpecialRecentActivityFeed.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 1f216db..542851d 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -36,7 +36,7 @@
parent::__construct( $name, $restriction );
}
 
-   public function setAdditionalConds($conds){
+   public function setAdditionalConds( $conds ){
   $this-additionalConds = $conds;
}
 
@@ -428,4 +428,4 @@
return $s br/;
}
 
-}
\ No newline at end of file
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If463b332dbeb8014f1b41f95bfc0d9e9aa71c169
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Style changes - change (mediawiki...RecentActivityFeed)

2014-09-02 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: Style changes
..

Style changes

Change-Id: I92ccb4ff702e3d85aa4a248f4185a67973f8cbea
---
M RecentActivityFeed.php
M SpecialRecentActivityFeed.php
2 files changed, 38 insertions(+), 38 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/RecentActivityFeed 
refs/changes/48/158048/1

diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index 2f3ee86..bd50c3b 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -3,19 +3,19 @@
 # Alert the user that this is not a valid access point to MediaWiki if they 
try to access the special pages file directly.
 if ( !defined( 'MEDIAWIKI' ) ) {
echo EOT
-To install my extension, put the following line in LocalSettings.php:
-require_once( \$IP/extensions/MyExtension/Recentactivityfeed.php );
+To install RecentActivityFeed, put the following line in LocalSettings.php:
+require_once( \$IP/extensions/RecentActivityFeed/Recentactivityfeed.php );
 EOT;
exit( 1 );
 }
  
 $wgExtensionCredits[ 'specialpage' ][] = array(
-'path' = __FILE__,
-'name' = 'RecentActivityFeed',
-'author' = 'Nischay Nahata',
-'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
-'descriptionmsg' = 'recentactivityfeed-desc',
-'version' = '0.0.0',
+   'path' = __FILE__,
+   'name' = 'RecentActivityFeed',
+   'author' = 'Nischay Nahata',
+   'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
+   'descriptionmsg' = 'recentactivityfeed-desc',
+   'version' = '0.0.0',
 );
 
 $wgAutoloadClasses[ 'SpecialRecentActivityFeed' ] = __DIR__ . 
'/SpecialRecentActivityFeed.php'; # Location of the SpecialRecentActivityFeed 
class (Tell MediaWiki to load this file)
diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 542851d..5f3e980 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -28,7 +28,7 @@
  */
 class SpecialRecentActivityFeed extends ChangesListSpecialPage {
 
-protected $defaultParams = array();
+   protected $defaultParams = array();
protected $customDesc;
protected $additionalConds = array();
 
@@ -37,20 +37,20 @@
}
 
public function setAdditionalConds( $conds ){
-  $this-additionalConds = $conds;
+   $this-additionalConds = $conds;
}
 
-   public function setParams($params){
-  $this-defaultParams = $params;
+   public function setParams( $params ){
+   $this-defaultParams = $params;
}
 
-   public function setCustomDescription($description){
-  $this-customDesc = $description;   
+   public function setCustomDescription( $description ){
+   $this-customDesc = $description;
}
 
-   public function getPageTitle($subpage = false){
-  if ($this-mName != 'RecentActivityFeed')
-   return Title::newFromText( $this-mName );
+   public function getPageTitle( $subpage = false ){
+   if ( $this-mName != 'RecentActivityFeed' )
+   return Title::newFromText( $this-mName );
 
return parent::getPageTitle();
}
@@ -66,7 +66,7 @@
 */
function getDescription() {
if( $this-customDesc ) {
-   return $this-customDesc;
+   return $this-customDesc;
}
return $this-msg( strtolower( $this-mName ) )-text();
}
@@ -156,7 +156,7 @@
}
 
public function doMainQuery( $conds, $opts ) {
-  $conds +=  $this-additionalConds;
+   $conds +=  $this-additionalConds;
$tables = array( 'recentchanges' );
$fields = RecentChange::selectFields();
$query_options = array( 'ORDER BY' = 'rc_timestamp DESC' );
@@ -211,30 +211,30 @@
}
$rc = RecentChange::newFromRow( $obj );
if ($order == 'article'){
-  $ordered_rc[$rc-getTitle()-getFullText()][] = $rc;
+   $ordered_rc[$rc-getTitle()-getFullText()][] = 
$rc;
} else {
-  $ordered_rc[$rc-getPerformer()-getName()][] = $rc;
+   $ordered_rc[$rc-getPerformer()-getName()][] = 
$rc;
}
--$limit;
}
 
-   foreach($ordered_rc as $key = $rc_list) {
+   foreach( $ordered_rc as $key = $rc_list ) {
$heading = 

[MediaWiki-commits] [Gerrit] Style changes - change (mediawiki...RecentActivityFeed)

2014-09-02 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Style changes
..


Style changes

Change-Id: I92ccb4ff702e3d85aa4a248f4185a67973f8cbea
---
M RecentActivityFeed.php
M SpecialRecentActivityFeed.php
2 files changed, 38 insertions(+), 38 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index 2f3ee86..bd50c3b 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -3,19 +3,19 @@
 # Alert the user that this is not a valid access point to MediaWiki if they 
try to access the special pages file directly.
 if ( !defined( 'MEDIAWIKI' ) ) {
echo EOT
-To install my extension, put the following line in LocalSettings.php:
-require_once( \$IP/extensions/MyExtension/Recentactivityfeed.php );
+To install RecentActivityFeed, put the following line in LocalSettings.php:
+require_once( \$IP/extensions/RecentActivityFeed/Recentactivityfeed.php );
 EOT;
exit( 1 );
 }
  
 $wgExtensionCredits[ 'specialpage' ][] = array(
-'path' = __FILE__,
-'name' = 'RecentActivityFeed',
-'author' = 'Nischay Nahata',
-'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
-'descriptionmsg' = 'recentactivityfeed-desc',
-'version' = '0.0.0',
+   'path' = __FILE__,
+   'name' = 'RecentActivityFeed',
+   'author' = 'Nischay Nahata',
+   'url' = 
'https://www.mediawiki.org/wiki/Extension:RecentActivityFeed',
+   'descriptionmsg' = 'recentactivityfeed-desc',
+   'version' = '0.0.0',
 );
 
 $wgAutoloadClasses[ 'SpecialRecentActivityFeed' ] = __DIR__ . 
'/SpecialRecentActivityFeed.php'; # Location of the SpecialRecentActivityFeed 
class (Tell MediaWiki to load this file)
diff --git a/SpecialRecentActivityFeed.php b/SpecialRecentActivityFeed.php
index 542851d..5f3e980 100644
--- a/SpecialRecentActivityFeed.php
+++ b/SpecialRecentActivityFeed.php
@@ -28,7 +28,7 @@
  */
 class SpecialRecentActivityFeed extends ChangesListSpecialPage {
 
-protected $defaultParams = array();
+   protected $defaultParams = array();
protected $customDesc;
protected $additionalConds = array();
 
@@ -37,20 +37,20 @@
}
 
public function setAdditionalConds( $conds ){
-  $this-additionalConds = $conds;
+   $this-additionalConds = $conds;
}
 
-   public function setParams($params){
-  $this-defaultParams = $params;
+   public function setParams( $params ){
+   $this-defaultParams = $params;
}
 
-   public function setCustomDescription($description){
-  $this-customDesc = $description;   
+   public function setCustomDescription( $description ){
+   $this-customDesc = $description;
}
 
-   public function getPageTitle($subpage = false){
-  if ($this-mName != 'RecentActivityFeed')
-   return Title::newFromText( $this-mName );
+   public function getPageTitle( $subpage = false ){
+   if ( $this-mName != 'RecentActivityFeed' )
+   return Title::newFromText( $this-mName );
 
return parent::getPageTitle();
}
@@ -66,7 +66,7 @@
 */
function getDescription() {
if( $this-customDesc ) {
-   return $this-customDesc;
+   return $this-customDesc;
}
return $this-msg( strtolower( $this-mName ) )-text();
}
@@ -156,7 +156,7 @@
}
 
public function doMainQuery( $conds, $opts ) {
-  $conds +=  $this-additionalConds;
+   $conds +=  $this-additionalConds;
$tables = array( 'recentchanges' );
$fields = RecentChange::selectFields();
$query_options = array( 'ORDER BY' = 'rc_timestamp DESC' );
@@ -211,30 +211,30 @@
}
$rc = RecentChange::newFromRow( $obj );
if ($order == 'article'){
-  $ordered_rc[$rc-getTitle()-getFullText()][] = $rc;
+   $ordered_rc[$rc-getTitle()-getFullText()][] = 
$rc;
} else {
-  $ordered_rc[$rc-getPerformer()-getName()][] = $rc;
+   $ordered_rc[$rc-getPerformer()-getName()][] = 
$rc;
}
--$limit;
}
 
-   foreach($ordered_rc as $key = $rc_list) {
+   foreach( $ordered_rc as $key = $rc_list ) {
$heading = '';
-   if ($order == 'user'){
-  

[MediaWiki-commits] [Gerrit] spelling fix - change (mediawiki...RecentActivityFeed)

2014-09-02 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: spelling fix
..

spelling fix

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


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

diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index bd50c3b..b2cf20d 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -4,7 +4,7 @@
 if ( !defined( 'MEDIAWIKI' ) ) {
echo EOT
 To install RecentActivityFeed, put the following line in LocalSettings.php:
-require_once( \$IP/extensions/RecentActivityFeed/Recentactivityfeed.php );
+require_once( \$IP/extensions/RecentActivityFeed/RecentActivityFeed.php );
 EOT;
exit( 1 );
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I67833af2a4ddb9c6eb5d39645651a25f8893ec24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] spelling fix - change (mediawiki...RecentActivityFeed)

2014-09-02 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: spelling fix
..


spelling fix

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

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/RecentActivityFeed.php b/RecentActivityFeed.php
index bd50c3b..b2cf20d 100644
--- a/RecentActivityFeed.php
+++ b/RecentActivityFeed.php
@@ -4,7 +4,7 @@
 if ( !defined( 'MEDIAWIKI' ) ) {
echo EOT
 To install RecentActivityFeed, put the following line in LocalSettings.php:
-require_once( \$IP/extensions/RecentActivityFeed/Recentactivityfeed.php );
+require_once( \$IP/extensions/RecentActivityFeed/RecentActivityFeed.php );
 EOT;
exit( 1 );
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I67833af2a4ddb9c6eb5d39645651a25f8893ec24
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/RecentActivityFeed
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] RecentActivityFeed changes needed - change (mediawiki...EducationProgram)

2014-08-11 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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

Change subject: RecentActivityFeed changes needed
..

RecentActivityFeed changes needed

if the RAF extension is available display for epcourseactivity action should
be done by using RAF's interface.

Change-Id: Ib7da89942627c0e13b32fe57ec55765ac71d2f4b
---
M includes/CourseActivityView.php
1 file changed, 21 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram 
refs/changes/21/153421/1

diff --git a/includes/CourseActivityView.php b/includes/CourseActivityView.php
index 97891ce..2c243ab 100644
--- a/includes/CourseActivityView.php
+++ b/includes/CourseActivityView.php
@@ -60,10 +60,27 @@
}
 
if ( isset( $course ) ) {
-   $this-displayForCourseId(
-   $course-getId(),
-   $maxAgeInSeconds
-   );
+
+  if ( class_exists('SpecialRecentActivityFeed') ) {
+ $recentActivityFeed = new \SpecialRecentActivityFeed( 
'Education Program:' . $courseTitle );
+ $recentActivityFeed-setCustomDescription( 'Activity for 
course ' . $courseTitle );
+ $recentActivityFeed-setParams(array('action' = 
'epcourseactivity'));
+
+ $students = $course-getStudents();
+ $users = array();
+ foreach($students as $student){
+   $users[] = $student-getUser()-getId();
+ }
+
+ $recentActivityFeed-setAdditionalConds( array('rc_user' 
= $users ) );
+ $recentActivityFeed-execute('');
+ return;
+  }
+
+  $this-displayForCourseId(
+   $course-getId(),
+   $maxAgeInSeconds
+  );
}
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7da89942627c0e13b32fe57ec55765ac71d2f4b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/EducationProgram
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Merge branch 'master' of https://gerrit.wikimedia.org/r/p/me... - change (mediawiki...SemanticDrilldown)

2014-01-06 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Merge branch 'master' of 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticDrilldown
..

Merge branch 'master' of 
https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticDrilldown

Conflicts:
specials/SD_BrowseData.php

Change-Id: Iaba6a38db496953fede169e929092f4073ddb7bb
---
M specials/SD_BrowseData.php
1 file changed, 2 insertions(+), 13 deletions(-)


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

diff --git a/specials/SD_BrowseData.php b/specials/SD_BrowseData.php
index 15cdc0c..e370088 100644
--- a/specials/SD_BrowseData.php
+++ b/specials/SD_BrowseData.php
@@ -127,19 +127,8 @@
}
 
$wgOut-addHTML( \ndiv 
class=\drilldown-results\\n );
- HEAD   (b7f778 [WIP]Adding support for DataVisualizer)
$rep = new SDBrowseDataPage( $category, $subcategory, 
$applied_filters, $remaining_filters, $offset, $limit, $requested_filter );
-   // Handling changed in MW version 1.18.
-   if ( method_exists( $rep, 'execute' ) ) {
-   $num = $rep-execute( $query );
-   } else {
-   $num = $rep-doQuery( $offset, $limit );
-   }
-
-===
-   $rep = new SDBrowseDataPage( $category, $subcategory, 
$applied_filters, $remaining_filters, $offset, $limit );
$num = $rep-execute( $query );
- BRANCH (453632 Localisation updates from https://translatewiki.net.)
$wgOut-addHTML( \n/div !-- 
drilldown-results --\n );
 
// This has to be set last, because otherwise the QueryPage
@@ -163,7 +152,7 @@
/**
 * Initialize the variables of this page
 */
- HEAD   (b7f778 [WIP]Adding support for DataVisualizer)
+ HEAD
function __construct( $category, $subcategory, $applied_filters, 
$remaining_filters, $offset, $limit, $requested_filter ) {
// Backwards compatibility for pre-version 1.18
if ( $this instanceof SpecialPage ) {
@@ -173,7 +162,7 @@
function __construct( $category, $subcategory, $applied_filters, 
$remaining_filters, $offset, $limit ) {
parent::__construct( 'BrowseData' );
 
- BRANCH (453632 Localisation updates from https://translatewiki.net.)
+ 4536324ad9a44502857be7e3abd2cefefa0509f8
$this-category = $category;
$this-subcategory = $subcategory;
$this-applied_filters = $applied_filters;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaba6a38db496953fede169e929092f4073ddb7bb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticDrilldown
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] [WIP]Adding support for DataVisualizer - change (mediawiki...SemanticDrilldown)

2013-12-01 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: [WIP]Adding support for DataVisualizer
..

[WIP]Adding support for DataVisualizer

Change-Id: I2239d8dd9ffb474ea47ddb8517826cd6110ba7f7
---
M specials/SD_BrowseData.php
1 file changed, 20 insertions(+), 0 deletions(-)


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

diff --git a/specials/SD_BrowseData.php b/specials/SD_BrowseData.php
index ceabaf8..bd7d727 100644
--- a/specials/SD_BrowseData.php
+++ b/specials/SD_BrowseData.php
@@ -599,6 +599,26 @@
}
 
function printUnappliedFilterValues( $cur_url, $f, $filter_values ) {
+   if( class_exists( DataVisualizerAPI ) ){
+
+   $children = array();
+   foreach($filter_values as $value = $size ){
+   $filter_url = $cur_url . urlencode( 
str_replace( ' ', '_', $f-name ) ) . '=' . urlencode( str_replace( ' ', '_', 
$value ) );
+   $children[] = array(
+   'name' = $value,
+   'size' = $size,
+   'link' = $filter_url,
+   );
+   }
+
+   $data = array(
+   'name' = $f-name,
+   'children'= $children,
+   );
+
+   return DataVisualizerAPI::getHTMLForTree($data);
+   }
+
global $sdgFiltersSmallestFontSize, $sdgFiltersLargestFontSize;
 
$results_line = ;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2239d8dd9ffb474ea47ddb8517826cd6110ba7f7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticDrilldown
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added checks and updated README - change (mediawiki...PageCreationNotif)

2013-11-23 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Added checks and updated README
..

Added checks and updated README

added an extra check, otherwise a NOTICE would show on user creation.
Updated readme to add missing step: update.php

Change-Id: I0dcf6a5ee489c4b9c7e834fbb9cccd0ab895e70d
---
M PageCreationNotif.hooks.php
M README
2 files changed, 16 insertions(+), 11 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageCreationNotif 
refs/changes/57/97357/1

diff --git a/PageCreationNotif.hooks.php b/PageCreationNotif.hooks.php
index 0131d92..20a0e9c 100644
--- a/PageCreationNotif.hooks.php
+++ b/PageCreationNotif.hooks.php
@@ -46,17 +46,19 @@
public static function onUserSaveOptions( User $user, array $options ) 
{
$dbw = wfGetDB( DB_MASTER );
 
-   $dbw-replace(
-   'pcn_users',
-   array(
-   'pcn_user_id'
-   ),
-   array(
-   'pcn_user_id' = $user-getId(),
-   'pcn_notify' = $options['page_creation_notif'] 
? 1 : 0
-   ),
-   __METHOD__
-   );
+   if ( $user  isset( $options['page_creation_notif'] ) ) {
+   $dbw-replace(
+   'pcn_users',
+   array(
+   'pcn_user_id'
+   ),
+   array(
+   'pcn_user_id' = $user-getId(),
+   'pcn_notify' = 
$options['page_creation_notif'] ? 1 : 0
+   ),
+   __METHOD__
+   );
+   }
 
return true;
 
diff --git a/README b/README
index 69e1ded..aea1d64 100644
--- a/README
+++ b/README
@@ -33,6 +33,9 @@
 
include_once($IP/extensions/PageCreationNotif/PageCreationNotif.php);
 
+Then run the update script:
+   php maintenance/update.php
+
 == 4. Configuration ==
 
 The behaviour of the extension can be tweaked using configuration

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0dcf6a5ee489c4b9c7e834fbb9cccd0ab895e70d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageCreationNotif
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added checks and updated README - change (mediawiki...PageCreationNotif)

2013-11-23 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Added checks and updated README
..


Added checks and updated README

added an extra check, otherwise a NOTICE would show on user creation.
Updated readme to add missing step: update.php

Change-Id: I0dcf6a5ee489c4b9c7e834fbb9cccd0ab895e70d
---
M PageCreationNotif.hooks.php
M README
2 files changed, 16 insertions(+), 11 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/PageCreationNotif.hooks.php b/PageCreationNotif.hooks.php
index 0131d92..20a0e9c 100644
--- a/PageCreationNotif.hooks.php
+++ b/PageCreationNotif.hooks.php
@@ -46,17 +46,19 @@
public static function onUserSaveOptions( User $user, array $options ) 
{
$dbw = wfGetDB( DB_MASTER );
 
-   $dbw-replace(
-   'pcn_users',
-   array(
-   'pcn_user_id'
-   ),
-   array(
-   'pcn_user_id' = $user-getId(),
-   'pcn_notify' = $options['page_creation_notif'] 
? 1 : 0
-   ),
-   __METHOD__
-   );
+   if ( $user  isset( $options['page_creation_notif'] ) ) {
+   $dbw-replace(
+   'pcn_users',
+   array(
+   'pcn_user_id'
+   ),
+   array(
+   'pcn_user_id' = $user-getId(),
+   'pcn_notify' = 
$options['page_creation_notif'] ? 1 : 0
+   ),
+   __METHOD__
+   );
+   }
 
return true;
 
diff --git a/README b/README
index 69e1ded..aea1d64 100644
--- a/README
+++ b/README
@@ -33,6 +33,9 @@
 
include_once($IP/extensions/PageCreationNotif/PageCreationNotif.php);
 
+Then run the update script:
+   php maintenance/update.php
+
 == 4. Configuration ==
 
 The behaviour of the extension can be tweaked using configuration

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0dcf6a5ee489c4b9c7e834fbb9cccd0ab895e70d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageCreationNotif
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Make GENDER support on page-creation-email-subject explicit - change (mediawiki...PageCreationNotif)

2013-08-05 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Make GENDER support on page-creation-email-subject explicit
..


Make GENDER support on page-creation-email-subject explicit

Also fix punctuation and case.
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Page-creation-email-subject/en

Change-Id: I6f50270a8bcb55256e48d5dacc556a053bf47c2b
---
M PageCreationNotif.i18n.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/PageCreationNotif.i18n.php b/PageCreationNotif.i18n.php
index 5f8a68f..ecfaa06 100644
--- a/PageCreationNotif.i18n.php
+++ b/PageCreationNotif.i18n.php
@@ -15,10 +15,10 @@
 $messages['en'] = array(
'page-creation-notif-desc'  = 'Sends e-mail notification when new 
pages are created',
'page-creation-notification' = 'E-mail me when a new page is created',
-   'page-creation-email-subject' = 'New page - $1 created on $2 by $3',
+   'page-creation-email-subject' = 'New page – $1 {{GENDER:$3|created}} 
on $2 by $3',
'page-creation-email-body'  = 'Dear $1,
 
-This is a notification from {{SITENAME}} that a new page $2 has been 
{{Gender:$3|created}} by user $3.
+This is a notification from {{SITENAME}} that a new page $2 has been 
{{GENDER:$3|created}} by user $3.
 
 You can see it at
 $4

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6f50270a8bcb55256e48d5dacc556a053bf47c2b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageCreationNotif
Gerrit-Branch: master
Gerrit-Owner: Nemo bis federicol...@tiscali.it
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] Fix regression for categories more require-looking - change (mediawiki...UploadWizard)

2013-06-30 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Fix regression for categories more require-looking
..

Fix regression for categories more require-looking

Caused by I72ed4a357d09d7ba5b1ebf5cb6e19f580f4860ea

Bug: 50352
Change-Id: I7daccfcf65105d86363eb2f54c3f28aaba3196b2
---
M resources/mw.UploadWizardDetails.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/77/71277/1

diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 58e4162..537e70e 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -693,7 +693,7 @@
 */
necessaryFilled: function( cb ) {
// check for empty category input
-   if ( this.div.find( '.categoryInput' ).val() !== '' ) {
+   if ( this.div.find( '.categoryInput' ).val() !== '' || 
this.div.find( '.cat-list' ).find( 'li' ).length  0 ) {
cb();
}
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7daccfcf65105d86363eb2f54c3f28aaba3196b2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Alex Monk kren...@gmail.com
Gerrit-Reviewer: Kaldari rkald...@wikimedia.org
Gerrit-Reviewer: MarkTraceur mtrac...@member.fsf.org
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: Yuvipanda yuvipa...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Added CSS to properly color links - change (mediawiki/core)

2013-06-26 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Added CSS to properly color links
..

Added CSS to properly color links

Background: While using jQuery dialog the CSS from this theme is getting
higher precedence and thus a redlink is appearing blue in I0930a

Change-Id: I5554f407ddb9bf7fd622103cae714888435e4f99
---
M resources/jquery.ui/themes/vector/jquery.ui.theme.css
1 file changed, 2 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/70589/1

diff --git a/resources/jquery.ui/themes/vector/jquery.ui.theme.css 
b/resources/jquery.ui/themes/vector/jquery.ui.theme.css
index e39371d..39ef2fe 100644
--- a/resources/jquery.ui/themes/vector/jquery.ui.theme.css
+++ b/resources/jquery.ui/themes/vector/jquery.ui.theme.css
@@ -15,6 +15,8 @@
 .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { 
font-family: sans-serif; font-size: 1em; }
 .ui-widget-content { border: 1px solid #cc; /* @embed */ background: 
#f2f5f7 url(images/ui-bg_highlight-hard_100_f2f5f7_1x100.png) 50% top repeat-x; 
color: #362b36; }
 .ui-widget-content a { color: #362b36; }
+.ui-widget-content a.new { color: #ba; }
+.ui-widget-content a.new:visited { color: #a55858; }
 .ui-widget-header { border-bottom: 1px solid #bb; line-height: 1em; /* 
@embed */ background: #ff 
url(images/ui-bg_highlight-soft_100_ff_1x100.png) 50% 50% repeat-x; color: 
#22; font-weight: bold; }
 .ui-widget-header a { color: #22; }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5554f407ddb9bf7fd622103cae714888435e4f99
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Show a disabled form for users without permissions. - change (mediawiki...UploadWizard)

2013-06-22 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Show a disabled form for users without permissions.
..

Show a disabled form for users without permissions.

* This is a bit hacky
* How to still show the permissions error but not as an exception

Bug: 36914
Change-Id: I1f65a4bb6eadc0696b8aa8c3b4e8972b299b8db8
---
M includes/specials/SpecialUploadCampaign.php
1 file changed, 39 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/27/70027/1

diff --git a/includes/specials/SpecialUploadCampaign.php 
b/includes/specials/SpecialUploadCampaign.php
index f7009e9..e9514bd 100644
--- a/includes/specials/SpecialUploadCampaign.php
+++ b/includes/specials/SpecialUploadCampaign.php
@@ -45,14 +45,34 @@
}
 
/**
+* Handles user permissions by disabling fields
+*
 * @see parent::execute
 *
 * @param string $subPage
 */
public function execute( $subPage ) {
-   parent::execute( $subPage );
+   $this-setHeaders();
+   $this-outputHeader();
+   $form = $this-getForm();
+   if ( $form-show() ) {
+   $this-onSuccess();
+   }
 
$this-getOutput()-addModules( 'ext.uploadWizard.campaign' );
+   }
+
+   /**
+* Disables HTMLFormFields if use doesn't have permissions
+*
+* @param array form fields
+*/
+   protected function checkDisabledFields( $fields ) {
+   if ( !$this-userCanExecute( $this-getUser() ) ) {
+   foreach( $fields as $field ) {
+   $field += array( 'disabled' = 'disabled' );
+   }
+   }
}
 
/**
@@ -62,18 +82,25 @@
protected function getForm() {
$form = parent::getForm();
 
-   $attribs = array(
-   'onclick' = 'window.location=' . 
SpecialPage::getTitleFor( 'UploadCampaigns' )-getFullURL() . ';return false;'
-   );
+   // If user can't execute don't show submit button else show 
cancel button as well
+   // TODO Use a less hacky solution
+   if ( !$this-userCanExecute( $this-getUser() ) ) {
+   $form-suppressDefaultSubmit();
+   } else {
 
-   $attribs += Linker::tooltipAndAccesskeyAttribs( 
'cancel-upload-campaign' );
+   $attribs = array(
+   'onclick' = 'window.location=' . 
SpecialPage::getTitleFor( 'UploadCampaigns' )-getFullURL() . ';return false;'
+   );
 
-   $form-addButton(
-   'cancelEdit',
-   $this-msg( 'cancel' )-text(),
-   'cancelEdit',
-   $attribs
-   );
+   $attribs += Linker::tooltipAndAccesskeyAttribs( 
'cancel-upload-campaign' );
+
+   $form-addButton(
+   'cancelEdit',
+   $this-msg( 'cancel' )-text(),
+   'cancelEdit',
+   $attribs
+   );
+   }
 
return $form;
}
@@ -110,6 +137,7 @@
$fields[$name] = $data;
}
 
+   $this-checkDisabledFields( $fields );
return $fields;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f65a4bb6eadc0696b8aa8c3b4e8972b299b8db8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Use statistics from the stats table not Count() - change (mediawiki...SemanticMediaWiki)

2013-06-20 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Use statistics from the stats table not Count()
..

Use statistics from the stats table not Count()

Change-Id: I3966cae3efe3b9dc64b1f89b4c818430dbea5348
---
M includes/storage/SQLStore/StatisticsCollector.php
1 file changed, 8 insertions(+), 13 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticMediaWiki 
refs/changes/68/69668/1

diff --git a/includes/storage/SQLStore/StatisticsCollector.php 
b/includes/storage/SQLStore/StatisticsCollector.php
index aca0c46..fa59b69 100644
--- a/includes/storage/SQLStore/StatisticsCollector.php
+++ b/includes/storage/SQLStore/StatisticsCollector.php
@@ -7,7 +7,6 @@
 use SMW\DIProperty;
 use SMW\Settings;
 use SMW\Store;
-
 use DatabaseBase;
 
 /**
@@ -254,7 +253,7 @@
}
 
/**
-* Count property uses by counting rows in property tables
+* Count property uses by summing up property statistics table
 *
 * @note subproperties that are part of container values are counted
 * individually and it does not seem to be important to filter them by
@@ -267,17 +266,13 @@
public function getPropertyUsageCount() {
wfProfileIn( __METHOD__ );
 
-   $count = 0;
-   foreach ( $this-store-getPropertyTables() as $propertyTable ) 
{
-   $res = $this-dbConnection-select(
-   $propertyTable-getName(),
-   'COUNT(*) AS count',
-   array(),
-   __METHOD__
-   );
-   $row = $this-dbConnection-fetchObject( $res );
-   $count += $row-count;
-   }
+   $row = $this-dbConnection-selectRow(
+   array( \SMWSQLStore3::PROPERTY_STATISTICS_TABLE ),
+   'SUM( usage_count ) AS count',
+   array(),
+   __METHOD__
+   );
+   $count = $row-count;
 
wfProfileOut( __METHOD__ );
return (int)$count;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3966cae3efe3b9dc64b1f89b4c818430dbea5348
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add a way to make categories more require-looking - change (mediawiki...UploadWizard)

2013-06-18 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Add a way to make categories more require-looking
..

Add a way to make categories more require-looking

Bug: 49710
Change-Id: I72ed4a357d09d7ba5b1ebf5cb6e19f580f4860ea
---
M UploadWizard.i18n.php
M UploadWizardHooks.php
M resources/mw.UploadWizard.js
M resources/mw.UploadWizardDetails.js
4 files changed, 52 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/84/69284/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index fbbc76d..1e8cb8c 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -246,6 +246,9 @@
'mwe-upwiz-file-too-large-ok' = 'OK',
'mwe-upwiz-file-too-large-text' = 'You can only upload files with a 
size of up to $1. You tried to upload a file that is $2.',
'mwe-upwiz-file-too-large' = 'File too large.',
+   'mwe-upwiz-necessary-confirm' = 'It is recommended that you fill in a 
category for your uploads. Do you want to continue without filling all the 
fields?',
+   'mwe-upwiz-dialog-yes' = 'Yes',
+   'mwe-upwiz-dialog-no' = 'No',
 
/* LICENSES  combinations of licenses */
/* may be a good idea to shift to WikimediaLicenseTexts? */
@@ -759,6 +762,9 @@
 * $1 is the maximum file size;
 * $2 is the size of the file they tried to upload.',
'mwe-upwiz-file-too-large' = 'Error dialog title',
+   'mwe-upwiz-necessary-confirm' = 'Confirmation box suggesting that it 
is recommended to fill in a category for uploads and asking the uploader 
whether they want to continue without them',
+   'mwe-upwiz-dialog-yes' = 'Yes',
+   'mwe-upwiz-dialog-no' = 'No',
'mwe-upwiz-license-cc-by-sa-3.0' = 
'{{CreativeCommonsLicense|by-sa|3.0}}
 For more information, see https://www.mediawiki.org/wiki/UploadWizard',
'mwe-upwiz-license-cc-by-sa-3.0-at' = 
'{{CreativeCommonsLicense|by-sa|3.0|at}}
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 7dc6fbf..58d55a1 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -450,6 +450,9 @@
'mwe-upwiz-file-too-large-ok',
'mwe-upwiz-file-too-large-text',
'mwe-upwiz-file-too-large',
+   'mwe-upwiz-necessary-confirm',
+   'mwe-upwiz-dialog-yes',
+   'mwe-upwiz-dialog-no',
'prefs-uploads',
'prefs-upwiz-interface',
'colon-separator',
diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 1c7a638..a540c1b 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -1038,9 +1038,10 @@
 * @return boolean
 */
detailsValid: function(cb, cberr) {
-   var _this = this;
-   var valid = 0;
-   var total = 0;
+   var _this = this,
+   valid = 0,
+   necessary = 0,
+   total = 0;
$j.each( _this.uploads, function(i, upload) {
if ( upload === undefined ) {
return;
@@ -1049,9 +1050,35 @@
upload.details.valid( function () {
valid += 1;
});
+   upload.details.necessaryFilled( function () {
+   necessary += 1;
+   });
});
-   if ( valid == total ) {
+
+   // Set up buttons for dialog box. We have to do it the hard way 
since the json keys are localized
+   var buttons = {};
+   buttons[ mw.msg( 'mwe-upwiz-dialog-yes' ) ] = function() {
+   $( this ).dialog( close );
cb();
+   };
+   buttons[ mw.msg( 'mwe-upwiz-dialog-no' ) ] = function() {
+   $( this ).dialog( close );
+   };
+   var confirmationDialog = $j( 'div/div' )
+   .html( mw.msg( 'mwe-upwiz-necessary-confirm' ) )
+   .dialog( {
+   width: 500,
+   zIndex: 20,
+   autoOpen: false,
+   modal: true,
+   buttons: buttons
+   } );
+   if ( valid == total ) {
+   if ( necessary == total ) {
+   cb();
+   } else {
+   confirmationDialog.dialog( 'open' );
+   }
} else {

[MediaWiki-commits] [Gerrit] Adds support for sorting Special:Properties by usage - change (mediawiki...SemanticMediaWiki)

2013-06-18 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Adds support for sorting Special:Properties by usage
..

Adds support for sorting Special:Properties by usage

This needs more work and has the following problems
* No UI
* Only works for SQLStore3

Change-Id: I2b0dfab74c9a35af54eb65c83362e8665afc1b56
---
M includes/SMW_QueryPage.php
M includes/specials/SMW_SpecialProperties.php
M includes/storage/SQLStore/SMW_SQLStore3_SpecialPageHandlers.php
3 files changed, 17 insertions(+), 32 deletions(-)


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

diff --git a/includes/SMW_QueryPage.php b/includes/SMW_QueryPage.php
index a479d96..c3a5931 100644
--- a/includes/SMW_QueryPage.php
+++ b/includes/SMW_QueryPage.php
@@ -46,13 +46,14 @@
 * @param $offset database query offset
 * @param $limit database query limit
 */
-   function doQuery( $offset = false, $limit = false ) {
+   function doQuery( $offset = false, $limit = false, $sort_by = '' ) {
$out = $this-getOutput();
$sk  = $this-getSkin();
 
$options = new SMWRequestOptions();
$options-limit = $limit;
$options-offset = $offset;
+   $options-sort_by = $sort_by;
$options-sort = true;
$res = $this-getResults( $options );
$num = count( $res );
diff --git a/includes/specials/SMW_SpecialProperties.php 
b/includes/specials/SMW_SpecialProperties.php
index f24899f..2896f07 100644
--- a/includes/specials/SMW_SpecialProperties.php
+++ b/includes/specials/SMW_SpecialProperties.php
@@ -27,7 +27,8 @@
$rep = new SMWPropertiesPage();
 
list( $limit, $offset ) = wfCheckLimits();
-   $rep-doQuery( $offset, $limit );
+   $sort_by = $this-getRequest()-getText( 'sort_by' );
+   $rep-doQuery( $offset, $limit, $sort_by );
 
// Ensure locally collected output data is pushed to the output!
SMWOutputs::commitToOutputPage( $wgOut );
diff --git a/includes/storage/SQLStore/SMW_SQLStore3_SpecialPageHandlers.php 
b/includes/storage/SQLStore/SMW_SQLStore3_SpecialPageHandlers.php
index cc1492f..d38dadc 100644
--- a/includes/storage/SQLStore/SMW_SQLStore3_SpecialPageHandlers.php
+++ b/includes/storage/SQLStore/SMW_SQLStore3_SpecialPageHandlers.php
@@ -61,6 +61,9 @@
$options['LIMIT'] = $requestoptions-limit;
$options['OFFSET'] = max( 
$requestoptions-offset, 0 );
}
+   if ( $requestoptions-sort_by !== '' ) {
+   $options['ORDER BY'] = $requestoptions-sort_by;
+   }
}
 
$conds = array(
@@ -70,33 +73,16 @@
 
if ( $unusedProperties ) {
$conds['usage_count'] = 0;
-
-   $res = $dbr-select(
-   array( SMWSql3SmwIds::tableName, 
SMWSQLStore3::PROPERTY_STATISTICS_TABLE ),
-   array( 'smw_title', 'usage_count' ),
-   $conds,
-   __METHOD__,
-   $options,
-   array( SMWSql3SmwIds::tableName = array( 
'INNER JOIN', array( 'smw_id=p_id' ) ) )
-   );
-   } else {
-   $res = $dbr-select(
-   SMWSql3SmwIds::tableName,
-   array( 'smw_id', 'smw_title' ),
-   $conds,
-   __METHOD__,
-   $options
-   );
-
-   $propertyIds = array();
-
-   foreach ( $res as $row ) {
-   $propertyIds[] = (int)$row-smw_id;
-   }
-
-   $statsTable = new 
\SMW\SQLStore\PropertyStatisticsTable( SMWSQLStore3::PROPERTY_STATISTICS_TABLE, 
$dbr );
-   $usageCounts = $statsTable-getUsageCounts( 
$propertyIds );
}
+
+   $res = $dbr-select(
+   array( SMWSql3SmwIds::tableName, 
SMWSQLStore3::PROPERTY_STATISTICS_TABLE ),
+   array( 'smw_title', 'usage_count' ),
+   $conds,
+   __METHOD__,
+   $options,
+   array( SMWSql3SmwIds::tableName = array( 'INNER JOIN', 
array( 'smw_id=p_id' ) ) )
+   );
 
$result = array();
foreach ( $res as $row ) {
@@ -112,10 +98,7 @@
if ( $unusedProperties){
$result[] = $property;

[MediaWiki-commits] [Gerrit] Use edit summaries when posting to user talk pages. - change (mediawiki...PageTriage)

2013-06-17 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Use edit summaries when posting to user talk pages.
..

Use edit summaries when posting to user talk pages.

No edit summaries was used when posting notes to user talk pages after a
page was reviewed.

Bug: 49631
Change-Id: Ic5855c8a5fd2282cbf6d825d959f49b8a3b9bf41
---
M PageTriage.i18n.php
M PageTriage.php
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
3 files changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/PageTriage.i18n.php b/PageTriage.i18n.php
index b910172..412ecf6 100644
--- a/PageTriage.i18n.php
+++ b/PageTriage.i18n.php
@@ -326,6 +326,7 @@
// Misc. Curation Toolbar messages
'pagetriage-tags-edit-summary' = 'Added tags to the page using $1 
($2)',
'pagetriage-tags-note-edit-summary' = 'Added comments regarding 
[[$1]]',
+   'pagetriage-mark-edit-summary' = 'Reviewed page [[$1]]',
'pagetriage-del-edit-summary' = 'Nominated page for deletion using $1 
($2)',
'pagetriage-del-tags-param-discussion-label' = 'Please explain why 
this article should be deleted, and provide links to the relevant policies 
wherever possible',
'pagetriage-info-title' = 'Page info',
@@ -813,6 +814,7 @@
 *$1 is a link to the local wiki page about the Curation Toolbar with 
{{msg-mw|pagetriage-pagecuration}} as the link text.
 *$2 is the list of tags added to the article.',
'pagetriage-tags-note-edit-summary' = 'The edit summary that is used 
when someone leaves a note for the author of the article. $1 is the title of 
the article.',
+   'pagetriage-mark-edit-summary' = 'The edit summary that is used when 
someone reviewes a page and leaves a note for the author of the article. $1 is 
the title of the article.',
'pagetriage-del-edit-summary' = 'The edit summary that is posted when 
someone nominates an article for deletion with the Curation Toolbar in 
PageTriage.
 * $1 - a link to the local wiki page about the Curation Toolbar with 
{{msg-mw|pagetriage-pagecuration}} as the link text
 * $2 - the list of deletion tags added to the article',
diff --git a/PageTriage.php b/PageTriage.php
index 15c0af7..6901079 100644
--- a/PageTriage.php
+++ b/PageTriage.php
@@ -723,6 +723,7 @@
'pagetriage-categories',
'pagetriage-add-tag-confirmation',
'pagetriage-tags-note-edit-summary',
+   'pagetriage-mark-edit-summary',
'pagetriage-del-talk-page-notify-summary',
'pagetriage-tag-deletion-error',
'pagetriage-toolbar-close',
diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js 
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
index f247d10..f51e722 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
@@ -129,6 +129,7 @@
title: talkPageTitle.getPrefixedText(),
appendtext: \n + note,
token: mw.user.tokens.get( 'editToken' 
),
+   summary: mw.msg( 
'pagetriage-mark-edit-summary', pageTitle ),
format: 'json'
},
success: function( data ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic5855c8a5fd2282cbf6d825d959f49b8a3b9bf41
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] SMW\SQLStore\PropertyTableDefinitionBuilder (fixedProperties... - change (mediawiki...SemanticMediaWiki)

2013-06-17 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: SMW\SQLStore\PropertyTableDefinitionBuilder (fixedProperties to 
Settings)
..


SMW\SQLStore\PropertyTableDefinitionBuilder (fixedProperties to Settings)

Code coverage: 100%
CRAP: 17

* Move getPropertyTables() into SMW\SQLStore\PropertyTableDefinitionBuilder 
class
* Add SMW\Test\PropertyTableDefinitionBuilderTest
* Add SMW\Test\SQLStore\SQLStoreTest to cover getPropertyTables()
* Add 'SMWSQLStore3Table' class alias 'SMW\SQLStore\TableDefinition'
* SMWPropertyTables was renamed to SMW::SQLStore::PropertyTableDefinition [1]

[1] 
https://www.semantic-mediawiki.org/wiki/Hooks:SMW::SQLStore::PropertyTableDefinition

Bug: 48841

Change-Id: Ia0416782494ae1310bd949d17c52902d4afe7c45
---
M SemanticMediaWiki.settings.php
M includes/Settings.php
M includes/Setup.php
A includes/storage/SQLStore/PropertyTableDefinitionBuilder.php
M includes/storage/SQLStore/SMW_SQLStore3.php
M includes/storage/SQLStore/SMW_SQLStore3Table.php
A tests/phpunit/includes/storage/sqlstore/PropertyTableDefinitionBuilderTest.php
A tests/phpunit/includes/storage/sqlstore/SQLStoreTest.php
8 files changed, 548 insertions(+), 69 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/SemanticMediaWiki.settings.php b/SemanticMediaWiki.settings.php
index 8fe8a98..220faf3 100644
--- a/SemanticMediaWiki.settings.php
+++ b/SemanticMediaWiki.settings.php
@@ -568,4 +568,41 @@
 # Number of seconds before the statistics cache expires
 ##
 $smwgStatisticsCacheExpiry = 3600;
-##
\ No newline at end of file
+##
+
+##
+# These are fixed properties, i.e. user defined properties having a
+# dedicated table for them. Entries in this array have the following format:
+#
+#  property_key = property_type.
+#
+# The 'property_key' is the title of the property (with underscores instead
+# of _ and capital first letter).
+# The 'property_type' denotes the type of the property and has to be one of 
the following:
+#  SMWDataItem::TYPE_BLOB
+#  SMWDataItem::TYPE_URI
+#  SMWDataItem::TYPE_WIKIPAGE
+#  SMWDataItem::TYPE_NUMBER
+#  SMWDataItem::TYPE_TIME
+#  SMWDataItem::TYPE_BOOLEAN
+#  SMWDataItem::TYPE_CONTAINER
+#  SMWDataItem::TYPE_GEO
+#  SMWDataItem::TYPE_CONCEPT
+#  SMWDataItem::TYPE_PROPERTY
+#
+# A run of setup using SMWAdmin is needed to create these tables. If an 
already used property is assigned a new table all old data for this property 
will
+# become inaccessible for SMW. This can be repaired by either migrating it to 
the new table (repair data) or will eventually be updated on page edits.
+#
+# Example: If you have a property named 'Age' which is of type 'Number' then 
add in LocalSettings:
+#
+#  $smwgFixedProperties = array(
+#  'Age' = SMWDataItem::TYPE_NUMBER
+#  );
+#
+# @see http://semantic-mediawiki.org/wiki/Fixed_properties
+#
+# @since 1.9
+#
+# @var array
+##
+$smwgFixedProperties = array();
diff --git a/includes/Settings.php b/includes/Settings.php
index c7945c9..3095e42 100644
--- a/includes/Settings.php
+++ b/includes/Settings.php
@@ -154,7 +154,8 @@
'smwgMasterStore' = $GLOBALS['smwgMasterStore'],
'smwgIQRunningNumber' = 
$GLOBALS['smwgIQRunningNumber'],
'smwgStatisticsCache' = 
$GLOBALS['smwgStatisticsCache'],
-   'smwgStatisticsCacheExpiry' = 
$GLOBALS['smwgStatisticsCacheExpiry']
+   'smwgStatisticsCacheExpiry' = 
$GLOBALS['smwgStatisticsCacheExpiry'],
+   'smwgFixedProperties' = 
$GLOBALS['smwgFixedProperties'],
);
 
if ( self::$instance === null ) {
diff --git a/includes/Setup.php b/includes/Setup.php
index 1392b6e..5a0d69a 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -306,11 +306,14 @@
$wgAutoloadClasses['SMW\SQLStore\PropertyStatisticsTable']  
= $stoDirSQL . 'PropertyStatisticsTable.php';
$wgAutoloadClasses['SMW\SQLStore\SimplePropertyStatisticsRebuilder']
= $stoDirSQL . 'SimplePropertyStatisticsRebuilder.php';
$wgAutoloadClasses['SMW\SQLStore\StatisticsCollector']  
= $stoDirSQL . 'StatisticsCollector.php';
+   $wgAutoloadClasses['SMW\SQLStore\PropertyTableDefinitionBuilder']   
= $stoDirSQL . 'PropertyTableDefinitionBuilder.php';
+
+   $wgAutoloadClasses['SMWSQLStore3Table']= $stoDirSQL . 
'SMW_SQLStore3Table.php'; // Please fix me ...
+   $wgAutoloadClasses['SMW\SQLStore\TableDefinition'] = $stoDirSQL . 
'SMW_SQLStore3Table.php';
 
$wgAutoloadClasses['SMWSQLStore3'] = $stoDirSQL . 
'SMW_SQLStore3.php';
$wgAutoloadClasses['SMWSql3StubSemanticData']  = 

[MediaWiki-commits] [Gerrit] Adds signature to talk page messages - change (mediawiki...PageTriage)

2013-06-16 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Adds signature to talk page messages
..

Adds signature to talk page messages

Bug: 49632
Change-Id: Icf5f7f7e813f6b4ba58c9ea8b5a79e9420198b61
---
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js 
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
index f247d10..724dffb 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
@@ -93,7 +93,7 @@
note = '{{subst:' + 
mw.config.get( 'wgTalkPageNoteTemplate' )['UnMark']['note']
+ '|' + pageTitle
+ '|' + mw.config.get( 
'wgUserName' )
-   + '|' + note + '}}';
+   + '|' + note + ' ' 
+ '}}';
} else {
note = '{{subst:' + 
mw.config.get( 'wgTalkPageNoteTemplate' )['UnMark']['nonote']
+ '|' + mw.config.get( 
'wgUserName' )
@@ -118,7 +118,7 @@
note = '{{subst:' + mw.config.get( 
'wgTalkPageNoteTemplate' )['Mark']
+ '|' + pageTitle
+ '|' + mw.config.get( 'wgUserName' )
-   + '|' + note + '}}';
+   + '|' + note + ' ' + '}}';
}
 
$.ajax( {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf5f7f7e813f6b4ba58c9ea8b5a79e9420198b61
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Correct email validation - change (mediawiki...SemanticSignup)

2013-06-13 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Correct email validation
..

Correct email validation

Change-Id: I84f55012e7f7a102b4218966f0395936540dc06e
---
M includes/SES_UserAccountDataChecker.php
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/includes/SES_UserAccountDataChecker.php 
b/includes/SES_UserAccountDataChecker.php
index 2c88744..7ee84ce 100644
--- a/includes/SES_UserAccountDataChecker.php
+++ b/includes/SES_UserAccountDataChecker.php
@@ -96,8 +96,9 @@
public function checkEmailValidity()
{
global $wgEnableEmail;
-   if ( $wgEnableEmail  !User::isValidEmailAddr( $this-mEmail ) 
)
+   if ( $wgEnableEmail  $this-mEmail !== ''  
!Sanitizer::validateEmail( $this-mEmail ) ) {
$this-error( wfMsg( 'invalidemailaddress' ) );
+   }
}
 
public function __construct()

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84f55012e7f7a102b4218966f0395936540dc06e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticSignup
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Correct tabIndexes - change (mediawiki...SemanticSignup)

2013-06-12 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Correct tabIndexes
..

Correct tabIndexes

The tabIndexes were wrong; correcting them by simple imcrements and  also
incrementing global $sfgTabIndex as needed.

Change-Id: Ic29a0eaedc6970d5e78a5992bb902c638ccab84a
---
M includes/SES_SignupFields.php
1 file changed, 12 insertions(+), 9 deletions(-)


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

diff --git a/includes/SES_SignupFields.php b/includes/SES_SignupFields.php
index e2825ac..4340fa1 100644
--- a/includes/SES_SignupFields.php
+++ b/includes/SES_SignupFields.php
@@ -7,8 +7,8 @@
  * Borrowed from standard UsercreateTemplate. Some minor changes have been made
  */
 
-class CreateUserFieldsTemplate extends QuickTemplate
-{
+class CreateUserFieldsTemplate extends QuickTemplate {
+
function addInputItem( $name, $value, $type, $msg ) {
$this-data['extraInput'][] = array(
'name' = $name,
@@ -19,6 +19,8 @@
}
 
function execute() {
+   global $sfgTabIndex;
+   $tabIndex = 1;
 
?
 div id=userlogin style=float:none;
@@ -32,7 +34,7 @@
td class=mw-labellabel for='wpName2'?php 
$this-msg( 'yourname' ) ?/label/td
td class=mw-input
input type='text' class='loginText' 
name=wpName id=wpName2
-   tabindex=1
+   tabindex=?php echo $tabIndex++; ?
size='20' /
/td
/tr
@@ -40,7 +42,7 @@
td class=mw-labellabel for='wpPassword2'?php 
$this-msg( 'yourpassword' ) ?/label/td
td class=mw-input
input type='password' class='loginPassword' 
name=wpPassword id=wpPassword2
-   tabindex=2
+   tabindex=?php echo $tabIndex++; ?
value= size='20' /
/td
/tr
@@ -54,7 +56,7 @@
td class=mw-label?php $this-msg( 'yourdomainname' 
) ?/td
td class=mw-input
select name=wpDomain value=?php 
$this-text( 'domain' ) ?
-   tabindex=3
+   tabindex=?php echo $tabIndex++; ?
?php echo $doms ?
/select
/td
@@ -64,7 +66,7 @@
td class=mw-labellabel for='wpRetype'?php 
$this-msg( 'yourpasswordagain' ) ?/label/td
td class=mw-input
input type='password' class='loginPassword' 
name=wpRetype id=wpRetype
-   tabindex=4
+   tabindex=?php echo $tabIndex++; ?
value=
size='20' /
/td
@@ -74,7 +76,7 @@
td class=mw-labellabel for='wpEmail'?php 
$this-msg( 'youremail' ) ?/label/td
td class=mw-input
input type='text' class='loginText' 
name=wpEmail id=wpEmail
-   tabindex=5
+   tabindex=?php echo 
$tabIndex++; ?
value=?php $this-text( 
'email' ) ? size='20' /
div class=prefsectiontip
?php if ( 
$this-data['emailrequired'] ) {
@@ -91,7 +93,7 @@
td class=mw-labellabel 
for='wpRealName'?php $this-msg( 'yourrealname' ) ?/label/td
td class=mw-input
input type='text' 
class='loginText' name=wpRealName id=wpRealName
-   tabindex=6
+   tabindex=?php echo 
$tabIndex++; ?
size='20' /
/td
?php } ?
@@ -100,7 +102,6 @@
td/td
/tr
 ?php
-   $tabIndex = 8;
if ( isset( $this-data['extraInput'] )  is_array( 
$this-data['extraInput'] ) ) {
foreach ( $this-data['extraInput'] as $inputItem ) { ?
tr
@@ -150,6 +151,8 @@
 div id=signupend?php $this-msgWiki( 'signupend' ); ?/div
 ?php
 
+  

[MediaWiki-commits] [Gerrit] Login user after Signup - change (mediawiki...SemanticSignup)

2013-06-12 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Login user after Signup
..

Login user after Signup

Change-Id: I0728f0a6c41d10fdb0407d335c88bacaf119fd31
---
M includes/SES_Special.php
1 file changed, 8 insertions(+), 1 deletion(-)


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

diff --git a/includes/SES_Special.php b/includes/SES_Special.php
index 0d82174..5a8d546 100644
--- a/includes/SES_Special.php
+++ b/includes/SES_Special.php
@@ -118,6 +118,13 @@
wfRunHooks( 'AddNewAccount', array( $user ) );
}
 
+   private function userLogin() {
+   $user = $this-mUserDataChecker-mUser;
+   $user-saveSettings();
+   $user-invalidateCache();
+   $user-setCookies();
+   }
+
private function createUserPage() {
$form_title = Title::newFromText( SemanticSignupSettings::get( 
'formName' ), SF_NS_FORM );
$form = new Article( $form_title );
@@ -190,7 +197,7 @@
try {
$this-userSignup();
$this-createUserPage();
-
+   $this-userLogin();
$wgOut-redirect( $this-mUserPageUrl );
}
catch ( Exception $e ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0728f0a6c41d10fdb0407d335c88bacaf119fd31
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticSignup
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added support for Captcha - change (mediawiki...SemanticSignup)

2013-06-03 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Added support for Captcha
..

Added support for Captcha

Change-Id: I2578b83f120320d9ceef9233e451caf0dca1a411
---
M INSTALL
M RELEASE-NOTES
M ROADMAP
M SemanticSignup.settings.php
M includes/SES_SignupFields.php
5 files changed, 13 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticSignup 
refs/changes/82/66382/1

diff --git a/INSTALL b/INSTALL
index 8be2f7c..40de149 100644
--- a/INSTALL
+++ b/INSTALL
@@ -66,3 +66,9 @@
 Default: $egSemanticSignupSettings['botName'] = '';
 
 Example: $egSemanticSignupSettings['botName'] = 'Admin';
+
+=== Enable Captcha ===
+
+If captcha should be enabled (requires ConfirmEdit extension to be installed) ?
+
+Default: $egSemanticSignupSettings['useCaptcha'] = true;
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index fe925df..f29f6c0 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -7,7 +7,7 @@
 === Version 0.4 ===
 2011-xx-xx
 
-* 
+* Added compatibility with ConfirmEdit
 
 === Version 0.3 ===
 2011-08-15
diff --git a/ROADMAP b/ROADMAP
index e175f01..f51f2c3 100644
--- a/ROADMAP
+++ b/ROADMAP
@@ -6,5 +6,4 @@
 
 == Version 0.4 ==
 
-* Fix compatibility with Confirm Edit and other captcha extensions.
 * Fix loading of obsolete JavaScript and CSS files.
diff --git a/SemanticSignup.settings.php b/SemanticSignup.settings.php
index 33306c2..21f9060 100644
--- a/SemanticSignup.settings.php
+++ b/SemanticSignup.settings.php
@@ -22,6 +22,7 @@
'requireName' = false,
'formName' = '',
'botName' = '',
+   'useCaptcha' = true,
);
}
 
diff --git a/includes/SES_SignupFields.php b/includes/SES_SignupFields.php
index 39775a9..b26246c 100644
--- a/includes/SES_SignupFields.php
+++ b/includes/SES_SignupFields.php
@@ -162,8 +162,6 @@
 
$template = new CreateUserFieldsTemplate();
 
-   $template-set( 'header', '' );
-
global $wgEnableEmail, $wgAllowRealName, $wgEmailConfirmToEdit, 
$wgAuth, $wgUser;
 
$template-set( 'link', '' ); // TODO
@@ -185,6 +183,11 @@
$type = 'signup';
$wgAuth-modifyUITemplate( $template, $type );
 
+   if( SemanticSignupSettings::get( 'useCaptcha' )  isset( 
$GLOBALS['wgCaptchaClass'] ) ) {
+   $captchaObject = new $GLOBALS['wgCaptchaClass'];
+   $captchaObject-injectUserCreate( $template );
+   }
+
ob_start();
$template-execute();
$text = ob_get_clean();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2578b83f120320d9ceef9233e451caf0dca1a411
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticSignup
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Removed inherited float:left so it aligns properly - change (mediawiki...SemanticSignup)

2013-05-28 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Removed inherited float:left so it aligns properly
..

Removed inherited float:left so it aligns properly

using float:left generates a weird display with rest of the SF form
displying on the right and wrapping at the end of the login form.

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


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

diff --git a/includes/SES_SignupFields.php b/includes/SES_SignupFields.php
index 39775a9..b15a5b4 100644
--- a/includes/SES_SignupFields.php
+++ b/includes/SES_SignupFields.php
@@ -21,7 +21,7 @@
function execute() {
 
?
-div id=userlogin
+div id=userlogin style=float:none;
 
h2?php $this-msg( 'createaccount' ) ?/h2
p id=userloginlink?php $this-html( 'link' ) ?/p

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d8732aa6e6b172ccbf821c046b2ff97c516ec60
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticSignup
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix invalid URL to SemanticWatchlist in credits - change (mediawiki...SemanticSignup)

2013-05-28 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Fix invalid URL to SemanticWatchlist in credits
..

Fix invalid URL to SemanticWatchlist in credits

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


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticSignup 
refs/changes/67/65767/1

diff --git a/SemanticSignup.php b/SemanticSignup.php
index e5cb785..d8f17ad 100644
--- a/SemanticSignup.php
+++ b/SemanticSignup.php
@@ -50,7 +50,7 @@
'Serg Kutny',
'[http://www.mediawiki.org/wiki/User:Jeroen_De_Dauw Jeroen De 
Dauw]',
),
-   'url' = 'https://www.mediawiki.org/wiki/Extension:Semantic_Watchlist',
+   'url' = 'https://www.mediawiki.org/wiki/Extension:SemanticSignup',
'descriptionmsg' = 'ses-desc'
 );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5978bc36057e133006615886ece5040ec222e40d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticSignup
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Move fixedProperties to Settings - change (mediawiki...SemanticMediaWiki)

2013-05-27 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Move fixedProperties to Settings
..

Move fixedProperties to Settings

Bug: 48841
Change-Id: Ia0416782494ae1310bd949d17c52902d4afe7c45
---
M SemanticMediaWiki.settings.php
M includes/Settings.php
M includes/storage/SQLStore/SMW_SQLStore3.php
3 files changed, 39 insertions(+), 19 deletions(-)


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

diff --git a/SemanticMediaWiki.settings.php b/SemanticMediaWiki.settings.php
index 36fc19c..b441928 100644
--- a/SemanticMediaWiki.settings.php
+++ b/SemanticMediaWiki.settings.php
@@ -557,3 +557,40 @@
 ##
 $smwgAutoRefreshOnPageMove = true;
 ##
+
+
+/**
+* These are fixed properties, i.e. user defined properties having a
+* dedicated table for them. Entries in this array have the following format:
+*
+*  property_key = property_type.
+*
+* The 'property_key' is the title of the property (with underscores instead
+* of _ and capital first letter).
+* The 'property_type' denotes the type of the property and has to be one of 
the following:
+*  SMWDataItem::TYPE_BLOB
+*  SMWDataItem::TYPE_URI
+*  SMWDataItem::TYPE_WIKIPAGE
+*  SMWDataItem::TYPE_NUMBER
+*  SMWDataItem::TYPE_TIME
+*  SMWDataItem::TYPE_BOOLEAN
+*  SMWDataItem::TYPE_CONTAINER
+*  SMWDataItem::TYPE_GEO
+*  SMWDataItem::TYPE_CONCEPT
+*  SMWDataItem::TYPE_PROPERTY
+*
+* A run of setup using SMWAdmin is needed to create these tables. If an 
already used property is assigned a new table all old data for this property 
will
+* become inaccessible for SMW. This can be repaired by either migrating it to 
the new table (repair data) or will eventually be updated on page edits.
+*
+* Example: If you have a property named 'Age' which is of type 'Number' then 
add in LocalSettings:
+*
+*  $smwgFixedProperties = array(
+   'Age' = SMWDataItem::TYPE_NUMBER
+*  );
+*
+* See also http://semantic-mediawiki.org/wiki/Fixed_properties
+*
+* @since 1.9
+* @var array
+*/
+$smwgFixedProperties = array();
diff --git a/includes/Settings.php b/includes/Settings.php
index c000102..5635087 100644
--- a/includes/Settings.php
+++ b/includes/Settings.php
@@ -150,6 +150,7 @@
'smwgNamespace' = $GLOBALS['smwgNamespace'],
'smwgMasterStore' = $GLOBALS['smwgMasterStore'],
'smwgIQRunningNumber' = 
$GLOBALS['smwgIQRunningNumber'],
+   'smwgFixedProperties' = 
$GLOBALS['smwgFixedProperties'],
);
 
return self::newFromArray( $settings );
diff --git a/includes/storage/SQLStore/SMW_SQLStore3.php 
b/includes/storage/SQLStore/SMW_SQLStore3.php
index d35b65a..e9354af 100644
--- a/includes/storage/SQLStore/SMW_SQLStore3.php
+++ b/includes/storage/SQLStore/SMW_SQLStore3.php
@@ -190,24 +190,6 @@
);
 
/**
-   * These are fixed properties, i.e. user defined tables having a
-   * dedicated table for them. Entries in this array have the format
-   * property key = property DI type. The key is a DB key (title with
-   * underscores instead of _ and capital first letter). The DI type is
-   * one of the types declared in SMWDataItem, e.g.,
-   * SMWDataItem::TYPE_DATE. The correct DI type for common datatypes
-   * can be found in SMWDataValueFactory.
-   *
-   * See also http://semantic-mediawiki.org/wiki/Fixed_properties
-   *
-   * @todo Move these to somewhere else?
-   *
-   * @since 1.8
-   * @var array
-   */
-   public static $fixedProperties = array();
-
-   /**
 * Constructor.
 *
 * @since 1.8
@@ -824,7 +806,7 @@
 
// Get all the tables for the properties that are declared as 
fixed
// (overly used and thus having separate tables)
-   foreach( self::$fixedProperties as $propertyKey = $tableDIType 
){
+   foreach( SMW\Settings::newFromGlobals()-get( 
'smwgFixedProperties' ) as $propertyKey = $tableDIType ){
$tableName = 'smw_fpt_' . md5( $propertyKey );
$propertyTables[$tableName] = new SMWSQLStore3Table( 
$tableDIType, $tableName, $propertyKey );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0416782494ae1310bd949d17c52902d4afe7c45
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticMediaWiki
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list

[MediaWiki-commits] [Gerrit] adds MsUpload support - change (mediawiki...SemanticForms)

2013-05-26 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: adds MsUpload support
..

adds MsUpload support

This needs more work from some SF expert

Change-Id: I93c661f01f45a33da23026fd2af337801213e835
---
M libs/SF_wikieditor.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticForms 
refs/changes/85/65485/1

diff --git a/libs/SF_wikieditor.js b/libs/SF_wikieditor.js
index 0dae2fe..9546972 100644
--- a/libs/SF_wikieditor.js
+++ b/libs/SF_wikieditor.js
@@ -35,6 +35,7 @@
 
}
});
+   mediaWiki.loader.load( 'ext.MsUpload' );
}
});
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I93c661f01f45a33da23026fd2af337801213e835
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticForms
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Stop uploading if maxLimit reached - change (mediawiki...UploadWizard)

2013-05-25 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Stop uploading if maxLimit reached
..

Stop uploading if maxLimit reached

Bug: 40158
Change-Id: If0a0362f988d1b9a235c36120d4e07b05755ca77
---
M UploadWizard.i18n.php
M resources/mw.UploadWizardUpload.js
M resources/mw.UploadWizardUploadInterface.js
3 files changed, 17 insertions(+), 19 deletions(-)


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

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index f420c46..ffc6d8f 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -241,7 +241,7 @@
'mwe-upwiz-error-license-wikitext-invalid' = 'This does not seem to be 
valid wikitext, or does not contain a license.',
'mwe-upwiz-details-error-count' = 'There {{PLURAL:$1|is one error|are 
$1 errors}} with the {{PLURAL:$2|form|forms}} above. Correct the 
{{PLURAL:$1|error|errors}}, and try submitting again.',
'mwe-upwiz-too-many-files-ok' = 'OK',
-   'mwe-upwiz-too-many-files-text' = 'You can only upload $1 
{{PLURAL:$1|file|files}} at once. You tried to upload $2 
{{PLURAL:$2|file|files}} in total, so $3 {{PLURAL:$3|file has|files have}} been 
removed.',
+   'mwe-upwiz-too-many-files-text' = 'You can only upload $1 
{{PLURAL:$1|file|files}} at once but you tried to upload $2 
{{PLURAL:$2|file|files}} in total. Please try again with lesser number of 
files!',
'mwe-upwiz-too-many-files' = 'Too many files.',
'mwe-upwiz-file-too-large-ok' = 'OK',
'mwe-upwiz-file-too-large-text' = 'You can only upload files with a 
size of up to $1. You tried to upload a file that is $2.',
diff --git a/resources/mw.UploadWizardUpload.js 
b/resources/mw.UploadWizardUpload.js
index c37d105..d475876 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -351,9 +351,9 @@
 * @param {Array} of Files.  usually one, can be more for multi-file 
select.
 * @param {Function()} callback when ok, and upload object is ready
 * @param {Function(String, Mixed)} callback when filename or contents 
in error. Signature of string code, mixed info
+* @param {Function()} callback when resetting FileInput
 */
-   checkFile: function( filename, files, fileNameOk, fileNameErr ) {
-
+   checkFile: function( filename, files, fileNameOk, fileNameErr, 
resetFileInput ) {
var _this = this;
var fileErrors = {};
 
@@ -368,6 +368,13 @@
// Check if filename is acceptable
// TODO sanitize filename
var basename = mw.UploadWizardUtil.getBasename( filename );
+
+   var tooManyFiles = files.length + _this.wizard.uploads.length  
mw.UploadWizard.config.maxUploads;
+   if ( tooManyFiles ) {
+   _this.showTooManyFilesWarning( files.length );
+   resetFileInput();
+   return;
+   }
 
if ( files.length  1 ) {
 
@@ -514,16 +521,7 @@
 
// Now that first file has been 
prepared, process remaining files
// in case of a multi-file upload.
-   var tooManyFiles = files.length + 
_this.wizard.uploads.length  mw.UploadWizard.config.maxUploads;
-
-   if ( tooManyFiles ) {
-   var remainingFiles = 
mw.UploadWizard.config.maxUploads - _this.wizard.uploads.length;
-   _this.showTooManyFilesWarning( 
files.length - remainingFiles );
-   files = remainingFiles  1 ? 
files.slice( 1, remainingFiles ) : [];
-   } else {
-   files = files.slice( 1 );
-   }
-
+   files = files.slice( 1 );
if ( files.length  0 ) {
$j.each( files, function( i, 
file ) {
 
@@ -579,14 +577,14 @@
/**
 * Shows an error dialog informing the user that some uploads have been 
omitted
 * since they went over the max files limit.
-* @param filesIgnored integer - the number of files that have been 
omitted
+* @param filesUploaded integer - the number of files that have been 
attempted to upload
 */
-   showTooManyFilesWarning: function( filesIgnored ) {
+   showTooManyFilesWarning: function( filesUploaded ) {
var buttons = [
{
text: mw.msg( 'mwe-upwiz-too-many-files-ok' ),
click: 

[MediaWiki-commits] [Gerrit] Remove data on blanking category input. - change (mediawiki...UploadWizard)

2013-05-24 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Remove data on blanking category input.
..

Remove data on blanking category input.

Bug: 48654
Change-Id: I31cb4c51a900a5f4c429c3876d63fe52bf1a0265
---
M resources/jquery/jquery.mwCoolCats.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/55/65355/1

diff --git a/resources/jquery/jquery.mwCoolCats.js 
b/resources/jquery/jquery.mwCoolCats.js
index c304c38..6b0bde2 100644
--- a/resources/jquery/jquery.mwCoolCats.js
+++ b/resources/jquery/jquery.mwCoolCats.js
@@ -31,6 +31,7 @@
 
var text = _stripText( $input.val() );
if ( text === '' ) {
+   $input.removeData( 'title' );
return;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I31cb4c51a900a5f4c429c3876d63fe52bf1a0265
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] fix regression from I84641dd92581de5bb546663ec60652d60f82cf65 - change (mediawiki...UploadWizard)

2013-05-23 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: fix regression from I84641dd92581de5bb546663ec60652d60f82cf65
..

fix regression from I84641dd92581de5bb546663ec60652d60f82cf65

Change-Id: Ib4c2577e36b5d7443aae43ab6a80b42232e04066
---
M resources/mw.UploadWizardUploadInterface.js
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index 43d9768..7c13c14 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -261,7 +261,7 @@
msgKey = 'api-error-unknown-warning';
args = $j.makeArray( info );
} else {
-   msgKey =  = 'api-error-unknown-code';
+   msgKey = 'api-error-unknown-code';
args = [code].concat( $j.makeArray( info ) );
}
this.setStatus( msgKey, args );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4c2577e36b5d7443aae43ab6a80b42232e04066
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] fix regression from I84641dd92581de5bb546663ec60652d60f82cf65 - change (mediawiki...UploadWizard)

2013-05-23 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: fix regression from I84641dd92581de5bb546663ec60652d60f82cf65
..


fix regression from I84641dd92581de5bb546663ec60652d60f82cf65

Change-Id: Ib4c2577e36b5d7443aae43ab6a80b42232e04066
---
M resources/mw.UploadWizardUploadInterface.js
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index 43d9768..7c13c14 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -261,7 +261,7 @@
msgKey = 'api-error-unknown-warning';
args = $j.makeArray( info );
} else {
-   msgKey =  = 'api-error-unknown-code';
+   msgKey = 'api-error-unknown-code';
args = [code].concat( $j.makeArray( info ) );
}
this.setStatus( msgKey, args );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4c2577e36b5d7443aae43ab6a80b42232e04066
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] hook to intercept upload_by_url - change (mediawiki/core)

2013-05-23 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: hook to intercept upload_by_url
..

hook to intercept upload_by_url

This is planned to be used to intercepted by UW for Flickr blacklisting.

Bug: 42397
Change-Id: Ia3daaeba1ce5e69e751ffc2ae5afd5e449cf4aa7
---
M includes/api/ApiUpload.php
M includes/upload/UploadFromUrl.php
2 files changed, 16 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/02/65102/1

diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index 5563087..a6cb6c1 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -396,6 +396,10 @@
$this-dieUsageMsg( 'copyuploadbaddomain' );
}
 
+   if ( !UploadFromUrl::isAllowedUrl( 
$this-mParams['url'] ) ) {
+   $this-dieUsageMsg( 'copyuploadbaddomain' );
+   }
+
$async = false;
if ( $this-mParams['asyncdownload'] ) {
$this-checkAsyncDownloadEnabled();
diff --git a/includes/upload/UploadFromUrl.php 
b/includes/upload/UploadFromUrl.php
index c99feef..0a9d1f0 100644
--- a/includes/upload/UploadFromUrl.php
+++ b/includes/upload/UploadFromUrl.php
@@ -105,6 +105,18 @@
}
 
/**
+* Checks whether the URL is not allowed.
+*
+* @param $url string
+* @return bool
+*/
+   public static function isAllowedUrl( $url ) {
+   $allowed = true;
+   wfRunHooks( 'UploadFromUrl', array( $url, $allowed ) );
+   return $allowed;
+   }
+
+   /**
 * Entry point for API upload
 *
 * @param $name string

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3daaeba1ce5e69e751ffc2ae5afd5e449cf4aa7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] adds blacklisting feature for flickr in backend - change (mediawiki...UploadWizard)

2013-05-23 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: adds blacklisting feature for flickr in backend
..

adds blacklisting feature for flickr in backend

Bug: 42307
Change-Id: I97f8be973e942a732b9873c3b05f2e7790940503
---
M UploadWizard.config.php
M UploadWizard.php
M UploadWizardHooks.php
A api/ApiFlickrBlacklist.php
4 files changed, 127 insertions(+), 0 deletions(-)


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

diff --git a/UploadWizard.config.php b/UploadWizard.config.php
index e6cf743..0cde07f 100644
--- a/UploadWizard.config.php
+++ b/UploadWizard.config.php
@@ -76,6 +76,7 @@
// Flickr details
'flickrApiUrl' = 'http://api.flickr.com/services/rest/?',
'flickrApiKey' = '',
+   'flickrBlacklistPage' = 'FlickrBlacklistPage',
 
// Categories to automatically (and silently) add all uploaded images 
into.
'autoCategories' = array(),
diff --git a/UploadWizard.php b/UploadWizard.php
index 7f690eb..7ede4e0 100644
--- a/UploadWizard.php
+++ b/UploadWizard.php
@@ -43,6 +43,7 @@
'UploadWizardHooks' = $wgUpwizDir,
'ApiUploadCampaign' = $wgUpwizDir . '/api',
'ApiDeleteUploadCampaign' = $wgUpwizDir . '/api',
+   'ApiFlickrBlacklist' = $wgUpwizDir . '/api',
'UploadWizardConfig' = $wgUpwizDir . '/includes',
'UploadWizardTutorial' = $wgUpwizDir . '/includes',
'UploadWizardCampaign' = $wgUpwizDir . '/includes',
@@ -69,6 +70,7 @@
 
 $wgAPIModules['uploadcampaign'] = 'ApiUploadCampaign';
 $wgAPIModules['deleteuploadcampaign'] = 'ApiDeleteUploadCampaign';
+$wgAPIModules['flickrblacklist'] = 'ApiFlickrBlacklist';
 
 if ( array_key_exists( 'ApiQueryORM', $wgAutoloadLocalClasses ) ) { // 
Backwards-compatibility with MW 1.20
$wgAutoloadClasses['ApiQueryUploadCampaigns'] = $wgUpwizDir . 
'/api/ApiQueryUploadCampaigns.php';
@@ -80,6 +82,7 @@
 $wgHooks['CanonicalNamespaces'][] = 'UploadWizardHooks::canonicalNamespaces';
 $wgHooks['LoadExtensionSchemaUpdates'][] = 'UploadWizardHooks::onSchemaUpdate';
 $wgHooks['GetPreferences'][] = 'UploadWizardHooks::onGetPreferences';
+$wgHooks['UploadFromUrl'][] = 'UploadWizardHooks::onUploadFromUrl';
 
 $wgAvailableRights[] = 'upwizcampaigns';
 
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 7dc6fbf..d05be2a 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -645,4 +645,32 @@
}
}
 
+   /**
+* Hook to blacklist flickr images by intercepting upload from url
+*/
+   public static function onUploadFromUrl( $url, $allowed ) {
+   global $wgRequest;
+
+   $api = new ApiMain(
+   new DerivativeRequest(
+   $wgRequest,
+   array(
+   'action' = 'flickrblacklist',
+   'url' = $url
+   ),
+   false // was posted?
+   ),
+   true // enable write?
+   );
+
+   $api-execute();
+   $data = $api-getResultData();
+   $status = $data['flickrblacklist']['result'];
+   if ( $status !== 'ok' ) {
+   $allowed = false;
+   }
+
+   return true;
+   }
+
 }
diff --git a/api/ApiFlickrBlacklist.php b/api/ApiFlickrBlacklist.php
new file mode 100644
index 000..dbf6956
--- /dev/null
+++ b/api/ApiFlickrBlacklist.php
@@ -0,0 +1,95 @@
+?php
+
+/**
+ * API module to fetch blacklisting details of a flickr image
+ *
+ * @since 1.2
+ *
+ * @file ApiFlickrBlacklist.php
+ * @ingroup Upload
+ * @ingroup API
+ *
+ * @licence GNU GPL v2+
+ * @author Nischay Nahata nischay...@gmail.com
+ */
+class ApiFlickrBlacklist extends ApiBase {
+
+   public function __construct( $query, $moduleName ) {
+   parent::__construct( $query, $moduleName );
+   }
+
+   public function execute() {
+   global $wgRequest;
+
+   $params = $this-extractRequestParams();
+   $staticFlickrUrl = $params['url'];
+
+   // apply some magical regex here on the url
+   $flickrPhotoId = '147426941';
+   $nsid = $this-getNsidFromPhotoId( $flickrPhotoId );
+   $blacklistPage = 
UploadWizardConfig::getConfig()['flickrBlacklistPage'];
+
+   $api = new ApiMain(
+   new DerivativeRequest(
+   $wgRequest,
+   array(
+   'action' = 'parse',
+   'page' = $blacklistPage
+   ),
+   

[MediaWiki-commits] [Gerrit] Fieldset legends is broken. - change (mediawiki/core)

2013-05-21 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Fieldset legends is broken.
..

Fieldset legends is broken.

HTMLForm constructor didn't use messagePrefix if context is null.

Bug: 48650
Change-Id: I26367bd597f873838c8cf45d75800661d37c0f95
---
M includes/HTMLForm.php
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/82/64782/1

diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php
index 7adbfc8..2ff598d 100644
--- a/includes/HTMLForm.php
+++ b/includes/HTMLForm.php
@@ -200,12 +200,12 @@
$this-setContext( $context );
$this-mTitle = false; // We don't need them to set a 
title
$this-mMessagePrefix = $messagePrefix;
-   } else {
+   } elseif ( is_null( $context )  $messagePrefix !== '' ) {
+   $this-mMessagePrefix = $messagePrefix;
+   } elseif ( is_string( $context )  $messagePrefix === '' ) {
// B/C since 1.18
-   if ( is_string( $context )  $messagePrefix === '' ) {
-   // it's actually $messagePrefix
-   $this-mMessagePrefix = $context;
-   }
+   // it's actually $messagePrefix
+   $this-mMessagePrefix = $context;
}
 
// Expand out into a tree.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I26367bd597f873838c8cf45d75800661d37c0f95
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] disable multiple file upload on Safari - change (mediawiki...UploadWizard)

2013-05-21 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: disable multiple file upload on Safari
..

disable multiple file upload on Safari

Bug: 44772
Change-Id: Ib60dd151965310d0a567c7d888b4638cc48a696d
---
M UploadWizardPage.js
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/51/64851/1

diff --git a/UploadWizardPage.js b/UploadWizardPage.js
index 85d51a1..4d1792b 100644
--- a/UploadWizardPage.js
+++ b/UploadWizardPage.js
@@ -16,6 +16,11 @@
mw.log.level = mw.log.NONE;
}
 
+   // hack for Safari bug, see 
https://bugzilla.wikimedia.org/show_bug.cgi?id=44772
+   if ( navigator.userAgent.indexOf( Safari )  -1 ) {
+   config.enableMultipleFiles = false;
+   }
+
var uploadWizard = new mw.UploadWizard( config );
uploadWizard.createInterface( '#upload-wizard' );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib60dd151965310d0a567c7d888b4638cc48a696d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] hide flickr upload if multiple upload is disabled - change (mediawiki...UploadWizard)

2013-05-21 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: hide flickr upload if multiple upload is disabled
..

hide flickr upload if multiple upload is disabled

Hides flickr upload button if enableMultipleFiles is false and one file is
already uploading.

Change-Id: Ifcf4c016be25be2edebc20b6d575de1a914e33b8
---
M resources/mw.UploadWizard.js
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/55/64855/1

diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index e6005d8..b61bb87 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -952,6 +952,7 @@
_this.$addFile.hide();
_this.$fileInput = this.$fileInput || $j( 
'.mwe-upwiz-file-input' );
_this.$fileInput.hide();
+   $j( '#mwe-upwiz-upload-ctrl-flickr-container, 
#mwe-upwiz-flickr-select-list-container' ).hide();
}
 
// add the styling to the filelist, so it has rounded 
corners and is visible and all.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifcf4c016be25be2edebc20b6d575de1a914e33b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove br / as its not supported by jQueryMsg - change (mediawiki...UploadWizard)

2013-05-20 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Remove br / as its not supported by jQueryMsg
..

Remove br / as its not supported by jQueryMsg

Bug: 47132
Change-Id: I42fb4a8d86f2955e1daf35f919b7581425cbf4e6
---
M UploadWizard.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/51/64551/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index 6d87015..580e9f0 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -265,7 +265,7 @@
'mwe-upwiz-license-cc-by-2.5' = 'Creative Commons Attribution 2.5 ([$2 
legal code])',
'mwe-upwiz-license-cc-by-sa-2.0' = 'Creative Commons Attribution 
ShareAlike 2.0 ([$2 legal code])',
'mwe-upwiz-license-cc-by-2.0' = 'Creative Commons Attribution 2.0 ([$2 
legal code])',
-   'mwe-upwiz-license-cc-zero' = 'Creative Commons CC0 Waiver br 
/(release all rights, like public domain: [$2 legal code])',
+   'mwe-upwiz-license-cc-zero' = 'Creative Commons CC0 Waiver (release 
all rights, like public domain: [$2 legal code])',
'mwe-upwiz-license-custom' = 'The license is described by the 
following wikitext (must contain a valid [$2 copyright tag]):',
'mwe-upwiz-license-custom-url' = 
'//commons.wikimedia.org/wiki/Commons:Copyright_tags',
'mwe-upwiz-license-fal' = 'Free Art License',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I42fb4a8d86f2955e1daf35f919b7581425cbf4e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Properly center arrowheads text - change (mediawiki/core)

2013-05-20 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Properly center arrowheads text
..

Properly center arrowheads text

Code that depends on size of arrows should be inside window.load

Bug: 37109
Change-Id: Ide468a5259dd81bfbd1ca8117b091b4e9cfee7ce
---
M resources/jquery/jquery.arrowSteps.js
1 file changed, 6 insertions(+), 4 deletions(-)


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

diff --git a/resources/jquery/jquery.arrowSteps.js 
b/resources/jquery/jquery.arrowSteps.js
index a1fd679..b5364bc 100644
--- a/resources/jquery/jquery.arrowSteps.js
+++ b/resources/jquery/jquery.arrowSteps.js
@@ -54,10 +54,12 @@
// Every step except the last one has an arrow pointing forward:
// at the right hand side in LTR languages, and at the left 
hand side in RTL.
// Also add in the padding for the calculated arrow width.
-   arrowWidth = parseInt( this.outerHeight(), 10 );
-   $steps.filter( ':not(:last-child)' ).addClass( 'arrow' )
- .find( 'div' ).css( paddingSide, arrowWidth.toString() + 
'px' );
-
+   $stepDiv = $steps.filter( ':not(:last-child)' ).addClass( 
'arrow' ).find( 'div' );
+   _this = this;
+   $(window).load(function() { // executes when complete page is 
fully loaded, including all frames, objects and images
+   arrowWidth = parseInt( _this.outerHeight(), 10 );
+   $stepDiv.css( paddingSide, arrowWidth.toString() + 'px' 
);
+   });
this.data( 'arrowSteps', $steps );
return this;
};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide468a5259dd81bfbd1ca8117b091b4e9cfee7ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Code style improvements - change (mediawiki...UploadWizard)

2013-05-19 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Code style improvements
..

Code style improvements

Change-Id: I273a14da7a02fe08f38f1660c24121660f20bb55
---
M resources/mw.UploadWizardUpload.js
1 file changed, 25 insertions(+), 26 deletions(-)


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

diff --git a/resources/mw.UploadWizardUpload.js 
b/resources/mw.UploadWizardUpload.js
index 34cc779..c37d105 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -394,7 +394,7 @@
}
} );
 
-   if( duplicate ) {
+   if ( duplicate ) {
fileErrors.dup = true;
fileNameErr( 'dup', basename, fileErrors );
}
@@ -412,7 +412,7 @@
fileErrors.noext = true;
fileNameErr( 'noext', null, fileErrors );
} else {
-   if ( $j.inArray( extension.toLowerCase(), 
mw.UploadWizard.config[ 'fileExtensions' ] ) === -1 ) {
+   if ( $j.inArray( extension.toLowerCase(), 
mw.UploadWizard.config.fileExtensions ) === -1 ) {
fileErrors.ext = true;
fileNameErr( 'ext', extension, fileErrors );
}
@@ -451,7 +451,7 @@
 
// make sure the file isn't too large
// XXX need a way to find the size of 
the Flickr image
-   if( !_this.fromURL ){
+   if ( !_this.fromURL ){
this.transportWeight = 
this.file.size;
if ( this.transportWeight  
actualMaxSize ) {

_this.showMaxSizeWarning( this.transportWeight, actualMaxSize );
@@ -471,11 +471,11 @@
//
// TODO: This should be refactored.
 
-   if( this.file.type === 'image/jpeg' ) {
+   if ( this.file.type === 'image/jpeg' ) {
var binReader = new 
FileReader();
binReader.onload = function() {
var binStr;
-   if ( typeof 
binReader.result == 'string' ) {
+   if ( typeof 
binReader.result === 'string' ) {
binStr = 
binReader.result;
} else {
// Array 
buffer; convert to binary string for the library.
@@ -514,15 +514,14 @@
 
// Now that first file has been 
prepared, process remaining files
// in case of a multi-file upload.
-   var tooManyFiles = files.length + 
_this.wizard.uploads.length  mw.UploadWizard.config[ 'maxUploads' ];
+   var tooManyFiles = files.length + 
_this.wizard.uploads.length  mw.UploadWizard.config.maxUploads;
 
if ( tooManyFiles ) {
-   var remainingFiles = 
mw.UploadWizard.config[ 'maxUploads' ] - _this.wizard.uploads.length;
+   var remainingFiles = 
mw.UploadWizard.config.maxUploads - _this.wizard.uploads.length;
_this.showTooManyFilesWarning( 
files.length - remainingFiles );
-   var files = remainingFiles  1 
? files.slice( 1, remainingFiles ) : [];
-   }
-   else {
-   var files = files.slice( 1 );
+   files = remainingFiles  1 ? 
files.slice( 1, remainingFiles ) : [];
+   } else {
+   files = files.slice( 1 );
}
 
if ( files.length  0 ) {
@@ -594,8 +593,8 @@
$j( 'div/div' )
.msg(
'mwe-upwiz-too-many-files-text',
-   mw.UploadWizard.config[ 'maxUploads' ],
-   

[MediaWiki-commits] [Gerrit] fixing opera bug - change (mediawiki...UploadWizard)

2013-05-19 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: fixing opera bug
..

fixing opera bug

Change-Id: I0e96e29796054fe758fc33bee6bf3501f3893448
---
M UploadWizard.php
M UploadWizardHooks.php
M includes/specials/SpecialUploadWizard.php
3 files changed, 66 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/20/64520/1

diff --git a/UploadWizard.php b/UploadWizard.php
index 7f690eb..c116373 100644
--- a/UploadWizard.php
+++ b/UploadWizard.php
@@ -80,6 +80,7 @@
 $wgHooks['CanonicalNamespaces'][] = 'UploadWizardHooks::canonicalNamespaces';
 $wgHooks['LoadExtensionSchemaUpdates'][] = 'UploadWizardHooks::onSchemaUpdate';
 $wgHooks['GetPreferences'][] = 'UploadWizardHooks::onGetPreferences';
+$wgHooks['MakeGlobalVariablesScript'][] = 
'UploadWizardHooks::onMakeGlobalVariablesScript';
 
 $wgAvailableRights[] = 'upwizcampaigns';
 
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 7dc6fbf..3152e71 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -645,4 +645,66 @@
}
}
 
+   public static function onMakeGlobalVariablesScript( $vars, $out ) {
+   global $wgSitename, $wgRequest;
+
+   $specialUW = new SpecialUploadWizard( $wgRequest );
+   $config = UploadWizardConfig::getConfig( $specialUW-campaign );
+
+   $labelPageContent = $specialUW-getPageContent( 
$config['idFieldLabelPage'] );
+   if ( $labelPageContent !== false ) {
+   $config['idFieldLabel'] = $labelPageContent;
+   }
+   // UploadFromUrl parameter set to true only if the user is 
allowed to upload a file from a URL which we need to check in our Javascript 
implementation.
+   if ( UploadFromUrl::isEnabled()  UploadFromUrl::isAllowed( 
$specialUW-getUser() ) === true ) {
+   $config['UploadFromUrl'] = true;
+   } else {
+   $config['UploadFromUrl'] = false;
+   }
+
+   $config['thanksLabel'] = $specialUW-getPageContent( 
$config['thanksLabelPage'], true );
+
+   // Get the user's default license. This will usually be 
'default', but
+   // can be a specific license like 'ownwork-cc-zero'.
+   $userDefaultLicense = $specialUW-getUser()-getOption( 
'upwiz_deflicense' );
+
+   if ( $userDefaultLicense !== 'default' ) {
+   $licenseParts = explode( '-', $userDefaultLicense, 2 );
+   $userLicenseType = $licenseParts[0];
+   $userDefaultLicense = $licenseParts[1];
+
+   // Determine if the user's default license is valid for 
this campaign
+   switch ( $config['ownWorkOption'] ) {
+   case own:
+   $defaultInAllowedLicenses = in_array( 
$userDefaultLicense, $config['licensesOwnWork']['licenses'] );
+   break;
+   case notown:
+   $defaultInAllowedLicenses = in_array( 
$userDefaultLicense, UploadWizardConfig::getThirdPartyLicenses() );
+   break;
+   case choice:
+   $defaultInAllowedLicenses = ( in_array( 
$userDefaultLicense, $config['licensesOwnWork']['licenses'] ) ||
+   in_array( $userDefaultLicense, 
UploadWizardConfig::getThirdPartyLicenses() ) );
+   break;
+   }
+
+   if ( $defaultInAllowedLicenses ) {
+   if ( $userLicenseType === 'ownwork' ) {
+   $userLicenseGroup = 'licensesOwnWork';
+   } else {
+   $userLicenseGroup = 
'licensesThirdParty';
+   }
+   $config[$userLicenseGroup]['defaults'] = array( 
$userDefaultLicense );
+   $config['defaultLicenseType'] = 
$userLicenseType;
+   }
+   }
+
+   if ( $config['enableChunked'] === 'opt-in' ) {
+   // Respect individual user's opt-in settings
+   $config['enableChunked'] = 
(bool)$specialUW-getUser()-getOption( 'upwiz-chunked' );
+   }
+
+   $vars['UploadWizardConfig'] = $config;
+   $vars['wgSiteName'] = $wgSitename;
+   return true;
+   }
 }
diff --git a/includes/specials/SpecialUploadWizard.php 
b/includes/specials/SpecialUploadWizard.php
index 1e5125d..27bdd1a 100644
--- 

[MediaWiki-commits] [Gerrit] updated ROADMAP with current issues. - change (mediawiki...SemanticSignup)

2013-05-19 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: updated ROADMAP with current issues.
..

updated ROADMAP with current issues.

JS and CSS loaded from SF needs to be fixed.

Change-Id: Ic0a7b24663274337e3c65f709ab5249d8c3a7f06
---
M ROADMAP
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticSignup 
refs/changes/32/64532/1

diff --git a/ROADMAP b/ROADMAP
index e175f01..7f16dae 100644
--- a/ROADMAP
+++ b/ROADMAP
@@ -6,5 +6,6 @@
 
 == Version 0.4 ==
 
+* Fix compatibility with latest SemanticForms
 * Fix compatibility with Confirm Edit and other captcha extensions.
 * Fix loading of obsolete JavaScript and CSS files.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0a7b24663274337e3c65f709ab5249d8c3a7f06
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticSignup
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add a mandatory reason for the Disputed tag. - change (mediawiki...PageTriage)

2013-05-16 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Add a mandatory reason for the Disputed tag.
..

Add a mandatory reason for the Disputed tag.

Bug: 48417
Change-Id: I14d6e5d8e353ac68123dc1e3544f2ebc1d062493
---
M modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/48/64048/1

diff --git 
a/modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js
 
b/modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js
index 18b0fe9..3206324 100644
--- 
a/modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js
+++ 
b/modules/ext.pageTriage.defaultTagsOptions/ext.pageTriage.defaultTagsOptions.js
@@ -372,7 +372,8 @@
tag: 'disputed',
desc: mw.msg( 'pagetriage-tags-disputed-desc' ),
params: {
-   'date': param.date
+   'date': param.date,
+   'reason': $.extend( true, {}, 
param.reason )
},
position: 'top',
multiple: true

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14d6e5d8e353ac68123dc1e3544f2ebc1d062493
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Check protection status of titles in details step - change (mediawiki...UploadWizard)

2013-05-16 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Check protection status of titles in details step
..


Check protection status of titles in details step

Improved version of I3d8e170f90e03a9. Thanks to TheDJ for that patch.

Bug: 37107
Change-Id: Ic951851ddb46b5a80af0ef4ce248a3fdb46ea1b4
---
M resources/mw.DestinationChecker.js
M resources/mw.UploadWizardDetails.js
2 files changed, 23 insertions(+), 11 deletions(-)

Approvals:
  Rasel160: Looks good to me, but someone else must approve
  Nischayn22: Verified; Looks good to me, approved
  TheDJ: Verified; Looks good to me, but someone else must approve



diff --git a/resources/mw.DestinationChecker.js 
b/resources/mw.DestinationChecker.js
index 38a43ba..a49d844 100644
--- a/resources/mw.DestinationChecker.js
+++ b/resources/mw.DestinationChecker.js
@@ -208,7 +208,8 @@
// XXX do not use iiurlwidth as it will create a thumbnail
var params = {
'titles': title,
-   'prop':  'imageinfo',
+   'prop':  'info|imageinfo',
+   'inprop': 'protection',
'iiprop': 'url|mime|size',
'iiurlwidth': 150
};
@@ -236,9 +237,20 @@
// If file found on another repository, such as when 
the wiki is using InstantCommons: page with a key of -1, plus imageinfo
// If file found on this repository: page with some 
positive numeric key
if ( data.query.pages[-1]  
!data.query.pages[-1].imageinfo ) {
-   // No conflict found on any repository this 
wiki uses
-   result = { isUnique: true };
-
+   var protection = 
data.query.pages[-1].protection;
+   if ( protection  protection.length  0 ) {
+   $.each( protection, function( i, val ) {
+   if ( $.inArray( val.level, 
mw.config.get( 'wgUserGroups' ) ) === -1 ) {
+   result = {
+   isUnique: true,
+   isProtected: 
true
+   };
+   }
+   } );
+   } else {
+   // No conflict found on any repository 
this wiki uses
+   result = { isUnique: true };
+   }
} else {
 
for ( var page_id in data.query.pages ) {
@@ -275,7 +287,6 @@
break;
}
}
-
_this.cachedResult[title] = result;
callback( { 'unique': result } );
};
diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index e1859bf..921c87d 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -739,7 +739,7 @@
var _this = this;
var $errorEl = _this.$form.find( 'label[for=' + _this.titleId + 
'].errorTitleUnique' );
 
-   if ( result.unique.isUnique  result.blacklist.notBlacklisted 
) {
+   if ( result.unique.isUnique  result.blacklist.notBlacklisted 
 !result.unique.isProtected ) {
$j( _this.titleInput ).data( 'valid', true );
$errorEl.hide().empty();
_this.ignoreWarningsInput = undefined;
@@ -767,11 +767,13 @@
errHtml = mw.msg( 
'mwe-upwiz-fileexists-replace-no-link', titleString );
}
 
-   $errorEl.html( errHtml ).show();
+   $errorEl.text( errHtml );
+   } else if ( result.unique.isProtected ) {
+   errHtml = mw.msg( 'mwe-upwiz-error-title-protected' );
+   $errorEl.text( errHtml );
} else {
errHtml = mw.msg( 'mwe-upwiz-blacklisted', titleString 
);
-
-   $errorEl.html( errHtml );
+   $errorEl.text( errHtml );
 
var completeErrorLink = $j( 'span 
class=contentSubLink/span' ).msg(
'mwe-upwiz-feedback-blacklist-info-prompt',
@@ -805,9 +807,8 @@
 
$errorEl.append( 'nbsp;middot;nbsp;' 
).append( feedbackLink );
}
-
-   $errorEl.show();
}
+   $errorEl.show();
  

[MediaWiki-commits] [Gerrit] Use type 'api' for lastuse preferences - change (mediawiki...PageTriage)

2013-04-29 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Use type 'api' for lastuse preferences
..

Use type 'api' for lastuse preferences

Bug: 47805
Change-Id: I5a36d8b1abe11436ace9188bb6ad45e27fc54be8
---
M PageTriage.hooks.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/PageTriage.hooks.php b/PageTriage.hooks.php
index 7a46b23..4f2ac4b 100644
--- a/PageTriage.hooks.php
+++ b/PageTriage.hooks.php
@@ -223,7 +223,7 @@
 */
public static function onGetPreferences( $user, $preferences ) {
$preferences['pagetriage-lastuse'] = array(
-   'type' = 'hidden',
+   'type' = 'api',
);
 
return true;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a36d8b1abe11436ace9188bb6ad45e27fc54be8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] use mw.Api() instead of ajax - change (mediawiki...PageTriage)

2013-04-29 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: use mw.Api() instead of ajax
..

use mw.Api() instead of ajax

Change-Id: I1f2eaba7229afb19d849549bb987d26bbb3d1a83
---
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.toolbarView.js
4 files changed, 93 insertions(+), 140 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageTriage 
refs/changes/51/61351/1

diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js 
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
index 9bdd929..30902f7 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
@@ -574,19 +574,16 @@
}
 
// Applying deletion tags should automatically mark the 
page as reviewed
-   apiRequest = {
-   'action': 'pagetriageaction',
-   'pageid': mw.config.get( 'wgArticleId' ),
-   'reviewed': '1',
-   'token': mw.user.tokens.get( 'editToken' ),
-   'format': 'json',
-   'skipnotif': '1'
-   };
-   $.ajax( {
-   type: 'post',
-   url: mw.util.wikiScript( 'api' ),
-   data: apiRequest,
-   success: function( data ) {
+   var api = new mw.Api(),
+   apiRequest = {
+   'action': 'pagetriageaction',
+   'pageid': mw.config.get( 'wgArticleId' 
),
+   'reviewed': '1',
+   'token': mw.user.tokens.get( 
'editToken' ),
+   'format': 'json',
+   'skipnotif': '1'
+   },
+   success = function ( data ) {
if ( data.error ) {
_this.handleError( mw.msg( 
'pagetriage-mark-as-reviewed-error', data.error.info ) );
} else {
@@ -606,9 +603,8 @@
}
_this.tagPage();
}
-   },
-   dataType: 'json'
-   } );
+   };
+   api.post( apiRequest ).done( success );
},
 
/**
@@ -667,10 +663,8 @@
text = '{{' + 
$.pageTriageDeletionTagsMultiple.tag + '|' + tagText + paramsText + '}}';
}
 
-   $.ajax( {
-   type: 'post',
-   url: mw.util.wikiScript( 'api' ),
-   data: {
+   var api = new mw.Api(),
+   apiRequest = {
'action': 'pagetriagetagging',
'pageid': mw.config.get( 'wgArticleId' 
),
'token': 
mw.user.tokens.get('editToken'),
@@ -679,7 +673,7 @@
'deletion': 1,
'taglist': tagList.join( '|' )
},
-   success: function( data ) {
+   success = function ( data ) {
if ( data.pagetriagetagging  
data.pagetriagetagging.result === 'success' ) {
_this.notifyUser( count, key );
} else {
@@ -689,9 +683,8 @@
_this.handleError( 
mw.msg( 'pagetriage-tagging-error' ) );
}
}
-   },
-   dataType: 'json'
-   } );
+   };
+   api.post( apiRequest ).done( success );
},
 
/**
@@ -713,10 +706,8 @@
if ( this.model.get( 'user_name' ) ) {
var title = new mw.Title( this.model.get( 

[MediaWiki-commits] [Gerrit] Use $.each() instead of for loop - change (mediawiki...UploadWizard)

2013-04-27 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Use $.each() instead of for loop
..

Use $.each() instead of for loop

Bug: 47771
Change-Id: I583dbb8e196b7b87137ac9de2c4747d1e99405fc
---
M resources/mw.UploadWizardDetails.js
1 file changed, 2 insertions(+), 3 deletions(-)


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

diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index e1859bf..29cf093 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -626,11 +626,10 @@
}
}
];
-   for ( var mx in msgs ) {
-   var msg = msgs[mx];
+   $.each( msgs, function( index, msg ) {
var $lbl = $( 'label[for=' + msg.title + ']' );
$lbl.text( mw.msg( msg.title, msg.counter() ) );
-   }
+   } );
$lbl = $( '.mwe-upwiz-details-copy-metadata a', _this.$form );
$lbl.text( mw.msg( 'mwe-upwiz-copy-metadata', 
_this.upload.wizard.uploads.length - 1 ) );
},

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I583dbb8e196b7b87137ac9de2c4747d1e99405fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Improve footer separator - change (mediawiki...Echo)

2013-04-21 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Improve footer separator
..

Improve footer separator

Bug: 47303
Change-Id: I5baed5e936dfaa9ef1fe11c900ee1ce94ccb748a
---
M Echo.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/86/60186/1

diff --git a/Echo.i18n.php b/Echo.i18n.php
index 258b71b..2865b30 100644
--- a/Echo.i18n.php
+++ b/Echo.i18n.php
@@ -158,7 +158,7 @@
'notification-page-linked-bundle' = '$2 was {{GENDER:$1|linked}} from 
$3 and $4 other {{PLURAL:$5|page|pages}}. [[Special:WhatLinksHere/$2|See all 
links to this page]]',
 
// Email batch
-   'echo-email-batch-separator' = 
'', # only translate this 
message to other languages if you have to change it
+   'echo-email-batch-separator' = '-- ', # only translate this message to 
other languages if you have to change it
'echo-email-batch-bullet' = '•', # only translate this message to 
other languages if you have to change it
'echo-email-batch-subject-daily' = 'You have $1 
{{PLURAL:$2|notification|notifications}} today',
'echo-email-batch-subject-weekly' = 'You have $1 
{{PLURAL:$2|notification|notifications}} this week',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5baed5e936dfaa9ef1fe11c900ee1ce94ccb748a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Fix CSS issue with Chrome. - change (mediawiki...PageTriage)

2013-04-21 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Fix CSS issue with Chrome.
..

Fix CSS issue with Chrome.

The sort by text overflowed and was hidden in Chrome

Change-Id: I2f3a2b53efd3ea8823d73184f595f3ed8d03d117
---
M SpecialNewPagesFeed.php
1 file changed, 6 insertions(+), 6 deletions(-)


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

diff --git a/SpecialNewPagesFeed.php b/SpecialNewPagesFeed.php
index fb5fe41..a762883 100644
--- a/SpecialNewPagesFeed.php
+++ b/SpecialNewPagesFeed.php
@@ -107,6 +107,12 @@
script type=text/template 
id=listControlNavTemplate
span 
class=mwe-pt-control-labelb%= mw.msg( 'pagetriage-showing' ) %/b span 
id=mwe-pt-filter-status/span/span
span 
class=mwe-pt-control-label-right id=mwe-pt-control-stats/spanbr/
+   span 
class=mwe-pt-control-label-rightb%= mw.msg( 'pagetriage-sort-by' ) %/b
+   span id=mwe-pt-sort-buttons
+   input type=radio 
id=mwe-pt-sort-newest name=sort /label for=mwe-pt-sort-newest%= 
mw.msg( 'pagetriage-newest' ) %/label
+   input type=radio 
id=mwe-pt-sort-oldest name=sort /label for=mwe-pt-sort-oldest%= 
mw.msg( 'pagetriage-oldest' ) %/label
+   /span
+   /span
span 
id=mwe-pt-filter-dropdown-control class=mwe-pt-control-label
b
%= mw.msg( 
'pagetriage-filter-list-prompt' ) %
@@ -176,12 +182,6 @@
/div
/form
/div
-   /span
-   span 
class=mwe-pt-control-label-rightb%= mw.msg( 'pagetriage-sort-by' ) %/b
-   span id=mwe-pt-sort-buttons
-   input type=radio 
id=mwe-pt-sort-newest name=sort /label for=mwe-pt-sort-newest%= 
mw.msg( 'pagetriage-newest' ) %/label
-   input type=radio 
id=mwe-pt-sort-oldest name=sort /label for=mwe-pt-sort-oldest%= 
mw.msg( 'pagetriage-oldest' ) %/label
-   /span
/span
/script
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2f3a2b53efd3ea8823d73184f595f3ed8d03d117
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Adding files downloaded from author's site. - change (mediawiki...MsLinks)

2013-04-20 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Adding files downloaded from author's site.
..

Adding files downloaded from author's site.

Change-Id: I8cebe790465ea37cd8546eb4cde240fb59dd4af4
---
A README.TXT
A images/Wiki-Editor-Buttons_Li.png
A images/broken_icon.png
A images/code__red_icon.png
A images/code_icon.png
A images/delete_icon.png
A images/doc_icon.png
A images/exe_icon.png
A images/image_ai_icon.png
A images/image_icon.png
A images/image_ps_icon.png
A images/movie_flash_icon.png
A images/movie_icon.png
A images/music_icon.png
A images/no_icon.png
A images/pdf_icon.png
A images/php_icon.png
A images/pps_icon.png
A images/txt_icon.png
A images/xls_icon.png
A images/zip_icon.png
A mslinks.js
A mslinks.php
A mslinks_body.php
24 files changed, 293 insertions(+), 0 deletions(-)


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

diff --git a/README.TXT b/README.TXT
new file mode 100644
index 000..b019254
--- /dev/null
+++ b/README.TXT
@@ -0,0 +1,54 @@
+
+# Author:
+#Martin Schwindl, i...@ratin.de
+#
+# Icons: 
+#Silk icon set
+#famfamfam.com, Mark James, a web developer from Birmingham, UK. 
+#
+# Usage:
+#{{#l:dlink|Testfile.zip|Description|right}}
+#{{#l:Testfile.zip}}
+#
+# LocalSettings.php:
+#require_once($IP/extensions/MsLinks/mslinks.php);
+#$wgMSL_FileTypes = array(
+#  no = no_icon.png,
+#  jpg = image_icon.png, 
+#  gif = image_icon.png, 
+#  bmp = image_icon.png, 
+#  png = image_icon.png, 
+#  tiff = image_icon.png, 
+#  tif = image_icon.png, 
+#  ai = image_ai_icon.png,
+#  psd = image_ps_icon.png, 
+#  pdf = pdf_icon.png, 
+#  pps = pps_icon.png, 
+#  ppt = pps_icon.png, 
+#  pptx = pps_icon.png, 
+#  xls = xls_icon.png,
+#  xlsx = xls_icon.png, 
+#  doc = doc_icon.png, 
+#  docx = doc_icon.png,
+#  dot = doc_icon.png,
+#  dotx = doc_icon.png,
+#  rtf = doc_icon.png,
+#  txt = txt_icon.png,
+#  html = code_icon.png,
+#  php = php_icon.png,
+#  exe = exe_icon.gif,
+#  asc = txt_icon.png,
+#  zip = zip_icon.png,
+#  mov  = movie_icon.png,
+#  mpeg  = movie_icon.png,
+#  mpg  = movie_icon.png,
+#  wmv  = movie_icon.png,
+#  avi  = movie_icon.png,
+#  mp4  = movie_icon.png,
+#  flv  = movie_flash_icon.png,
+#  wma  = music_icon.png,
+#  mp3  = music_icon.png,
+#  wav  = music_icon.png,
+#  mid  = music_icon.png
+#   );
+
\ No newline at end of file
diff --git a/images/Wiki-Editor-Buttons_Li.png 
b/images/Wiki-Editor-Buttons_Li.png
new file mode 100644
index 000..07967bb
--- /dev/null
+++ b/images/Wiki-Editor-Buttons_Li.png
Binary files differ
diff --git a/images/broken_icon.png b/images/broken_icon.png
new file mode 100644
index 000..9fc5a0a
--- /dev/null
+++ b/images/broken_icon.png
Binary files differ
diff --git a/images/code__red_icon.png b/images/code__red_icon.png
new file mode 100644
index 000..87a6914
--- /dev/null
+++ b/images/code__red_icon.png
Binary files differ
diff --git a/images/code_icon.png b/images/code_icon.png
new file mode 100644
index 000..0c76bd1
--- /dev/null
+++ b/images/code_icon.png
Binary files differ
diff --git a/images/delete_icon.png b/images/delete_icon.png
new file mode 100644
index 000..af1ecaf
--- /dev/null
+++ b/images/delete_icon.png
Binary files differ
diff --git a/images/doc_icon.png b/images/doc_icon.png
new file mode 100644
index 000..834cdfa
--- /dev/null
+++ b/images/doc_icon.png
Binary files differ
diff --git a/images/exe_icon.png b/images/exe_icon.png
new file mode 100644
index 000..106f5aa
--- /dev/null
+++ b/images/exe_icon.png
Binary files differ
diff --git a/images/image_ai_icon.png b/images/image_ai_icon.png
new file mode 100644
index 000..23a37b8
--- /dev/null
+++ b/images/image_ai_icon.png
Binary files differ
diff --git a/images/image_icon.png b/images/image_icon.png
new file mode 100644
index 000..4a158fe
--- /dev/null

[MediaWiki-commits] [Gerrit] Adding files downloaded from author's site. - change (mediawiki...MsLinks)

2013-04-20 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: Adding files downloaded from author's site.
..


Adding files downloaded from author's site.

Change-Id: I8cebe790465ea37cd8546eb4cde240fb59dd4af4
---
A README.TXT
A images/Wiki-Editor-Buttons_Li.png
A images/broken_icon.png
A images/code__red_icon.png
A images/code_icon.png
A images/delete_icon.png
A images/doc_icon.png
A images/exe_icon.png
A images/image_ai_icon.png
A images/image_icon.png
A images/image_ps_icon.png
A images/movie_flash_icon.png
A images/movie_icon.png
A images/music_icon.png
A images/no_icon.png
A images/pdf_icon.png
A images/php_icon.png
A images/pps_icon.png
A images/txt_icon.png
A images/xls_icon.png
A images/zip_icon.png
A mslinks.js
A mslinks.php
A mslinks_body.php
24 files changed, 293 insertions(+), 0 deletions(-)

Approvals:
  Nischayn22: Verified; Looks good to me, approved



diff --git a/README.TXT b/README.TXT
new file mode 100644
index 000..b019254
--- /dev/null
+++ b/README.TXT
@@ -0,0 +1,54 @@
+
+# Author:
+#Martin Schwindl, i...@ratin.de
+#
+# Icons: 
+#Silk icon set
+#famfamfam.com, Mark James, a web developer from Birmingham, UK. 
+#
+# Usage:
+#{{#l:dlink|Testfile.zip|Description|right}}
+#{{#l:Testfile.zip}}
+#
+# LocalSettings.php:
+#require_once($IP/extensions/MsLinks/mslinks.php);
+#$wgMSL_FileTypes = array(
+#  no = no_icon.png,
+#  jpg = image_icon.png, 
+#  gif = image_icon.png, 
+#  bmp = image_icon.png, 
+#  png = image_icon.png, 
+#  tiff = image_icon.png, 
+#  tif = image_icon.png, 
+#  ai = image_ai_icon.png,
+#  psd = image_ps_icon.png, 
+#  pdf = pdf_icon.png, 
+#  pps = pps_icon.png, 
+#  ppt = pps_icon.png, 
+#  pptx = pps_icon.png, 
+#  xls = xls_icon.png,
+#  xlsx = xls_icon.png, 
+#  doc = doc_icon.png, 
+#  docx = doc_icon.png,
+#  dot = doc_icon.png,
+#  dotx = doc_icon.png,
+#  rtf = doc_icon.png,
+#  txt = txt_icon.png,
+#  html = code_icon.png,
+#  php = php_icon.png,
+#  exe = exe_icon.gif,
+#  asc = txt_icon.png,
+#  zip = zip_icon.png,
+#  mov  = movie_icon.png,
+#  mpeg  = movie_icon.png,
+#  mpg  = movie_icon.png,
+#  wmv  = movie_icon.png,
+#  avi  = movie_icon.png,
+#  mp4  = movie_icon.png,
+#  flv  = movie_flash_icon.png,
+#  wma  = music_icon.png,
+#  mp3  = music_icon.png,
+#  wav  = music_icon.png,
+#  mid  = music_icon.png
+#   );
+
\ No newline at end of file
diff --git a/images/Wiki-Editor-Buttons_Li.png 
b/images/Wiki-Editor-Buttons_Li.png
new file mode 100644
index 000..07967bb
--- /dev/null
+++ b/images/Wiki-Editor-Buttons_Li.png
Binary files differ
diff --git a/images/broken_icon.png b/images/broken_icon.png
new file mode 100644
index 000..9fc5a0a
--- /dev/null
+++ b/images/broken_icon.png
Binary files differ
diff --git a/images/code__red_icon.png b/images/code__red_icon.png
new file mode 100644
index 000..87a6914
--- /dev/null
+++ b/images/code__red_icon.png
Binary files differ
diff --git a/images/code_icon.png b/images/code_icon.png
new file mode 100644
index 000..0c76bd1
--- /dev/null
+++ b/images/code_icon.png
Binary files differ
diff --git a/images/delete_icon.png b/images/delete_icon.png
new file mode 100644
index 000..af1ecaf
--- /dev/null
+++ b/images/delete_icon.png
Binary files differ
diff --git a/images/doc_icon.png b/images/doc_icon.png
new file mode 100644
index 000..834cdfa
--- /dev/null
+++ b/images/doc_icon.png
Binary files differ
diff --git a/images/exe_icon.png b/images/exe_icon.png
new file mode 100644
index 000..106f5aa
--- /dev/null
+++ b/images/exe_icon.png
Binary files differ
diff --git a/images/image_ai_icon.png b/images/image_ai_icon.png
new file mode 100644
index 000..23a37b8
--- /dev/null
+++ b/images/image_ai_icon.png
Binary files differ
diff --git a/images/image_icon.png b/images/image_icon.png
new file mode 100644
index 000..4a158fe
--- /dev/null
+++ b/images/image_icon.png
Binary files differ
diff --git 

[MediaWiki-commits] [Gerrit] RTL tweak for All notifications and Preferences - change (mediawiki...Echo)

2013-04-10 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: RTL tweak for All notifications and Preferences
..

RTL tweak for All notifications and Preferences

Some thanks to the following blog post
http://snook.ca/archives/html_and_css/background-position-x-y

Tested on Chrome and FF latest. Please test on more browsers!

Bug: 46215
Change-Id: I0b92b04f3a48dbd85c7e871a75a6973ea9760367
---
R modules/icons/NotificationsPage-ltr.png
A modules/icons/NotificationsPage-rtl.png
M modules/overlay/ext.echo.overlay.css
3 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/59/58659/1

diff --git a/modules/icons/NotificationsPage.png 
b/modules/icons/NotificationsPage-ltr.png
similarity index 100%
rename from modules/icons/NotificationsPage.png
rename to modules/icons/NotificationsPage-ltr.png
Binary files differ
diff --git a/modules/icons/NotificationsPage-rtl.png 
b/modules/icons/NotificationsPage-rtl.png
new file mode 100644
index 000..0937002
--- /dev/null
+++ b/modules/icons/NotificationsPage-rtl.png
Binary files differ
diff --git a/modules/overlay/ext.echo.overlay.css 
b/modules/overlay/ext.echo.overlay.css
index 0701ec0..513ccc6 100644
--- a/modules/overlay/ext.echo.overlay.css
+++ b/modules/overlay/ext.echo.overlay.css
@@ -77,9 +77,9 @@
min-height: 14px;
font-size: 13px;
/* @embed */
-   background-image: url(../icons/NotificationsPage.png);
+   background-image: url(../icons/NotificationsPage-ltr.png);
background-repeat: no-repeat;
-   background-position: 12px 15px;
+   background-position: 5% 50%;
 }
 
 #mw-echo-overlay-pref-link {
@@ -93,7 +93,7 @@
/* @embed */
background-image: url(../icons/Settings.png);
background-repeat: no-repeat;
-   background-position: 12px 15px;
+   background-position: 5% 50%;
 }
 
 #pt-notifications {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b92b04f3a48dbd85c7e871a75a6973ea9760367
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Threads moved to a watched page don't trigger notif. - change (mediawiki...LiquidThreads)

2013-04-09 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Threads moved to a watched page don't trigger notif.
..

Threads moved to a watched page don't trigger notif.

The page moving is a bit confusing in lqt. when moving a page
the Message Controller is now invoked two times, once for the target
page(this change) and once for the old page.

If a user is watching both pages he will get notified twice.

Bug: 30698
Change-Id: Id9fb014ef20b42a3aae608fc31a1203659c3
---
M classes/Thread.php
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/85/58285/1

diff --git a/classes/Thread.php b/classes/Thread.php
index 640799b..d2a04ce 100644
--- a/classes/Thread.php
+++ b/classes/Thread.php
@@ -378,6 +378,8 @@
}
 
function moveToPage( $title, $reason, $leave_trace ) {
+   global $wgUser;
+
if ( !$this-isTopmostThread() )
throw new MWException( Attempt to move non-toplevel 
thread to another page );
 
@@ -417,6 +419,9 @@
 
$this-commitRevision( Threads::CHANGE_MOVED_TALKPAGE, null, 
$reason );
 
+   // Notifications
+   NewMessages::writeMessageStateForUpdatedThread( $this, 
$this-type, $wgUser );
+
if ( $leave_trace ) {
$this-leaveTrace( $reason, $oldTitle, $newTitle );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9fb014ef20b42a3aae608fc31a1203659c3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove invalid wikitext [[|New reply]] - change (mediawiki...LiquidThreads)

2013-04-08 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Remove invalid wikitext [[|New reply]]
..

Remove invalid wikitext [[|New reply]]

A bit hackish so feedback is welcome.
If Title doesn't exist we show a new message 'New reply created
(deleted)'.

Bug: 47006
Change-Id: I4ba3bf1c10860d4fe331f894f4b3a5de1ee52613
---
M classes/Thread.php
M classes/ThreadHistoryPager.php
M i18n/Lqt.i18n.php
3 files changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/96/58096/1

diff --git a/classes/Thread.php b/classes/Thread.php
index 640799b..7123138 100644
--- a/classes/Thread.php
+++ b/classes/Thread.php
@@ -1163,7 +1163,9 @@
 
// The 'root' is the page in the Thread namespace corresponding to this 
thread.
function root( ) {
-   if ( !$this-rootId ) return null;
+   if ( !$this-rootId ) {
+   return null;
+   }
if ( !$this-root ) {
if ( isset( self::$articleCacheById[$this-rootId] ) ) {
$this-root = 
self::$articleCacheById[$this-rootId];
@@ -1183,7 +1185,6 @@
$this-type = Threads::TYPE_DELETED;
}
}
-
if ( !$title ) {
return null;
}
diff --git a/classes/ThreadHistoryPager.php b/classes/ThreadHistoryPager.php
index 2dd72ce..6f9691f 100644
--- a/classes/ThreadHistoryPager.php
+++ b/classes/ThreadHistoryPager.php
@@ -96,7 +96,6 @@
$args = array();
$revision = ThreadRevision::loadFromRow( $this-mCurrentRow );
$changeObject = $revision-getChangeObject();
-
if ( $revision  $revision-prev() ) {
$lastChangeObject = 
$revision-prev()-getChangeObject();
}
@@ -129,6 +128,11 @@
$args[] = '';
}
break;
+   case Threads::CHANGE_REPLY_CREATED:
+   if ( !$changeObject || !$changeObject-title() 
) {
+   $msg = wfMessage( 
'lqt_hist_reply_created_deleted' )-parse();
+   }
+   break;
}
 
$content = wfMsgReplaceArgs( $msg, $args );
diff --git a/i18n/Lqt.i18n.php b/i18n/Lqt.i18n.php
index f322e0e..efdd2fe 100644
--- a/i18n/Lqt.i18n.php
+++ b/i18n/Lqt.i18n.php
@@ -40,6 +40,7 @@
'lqt_hist_comment_edited' = 'Comment text [$2 edited]',
'lqt_hist_summary_changed' = 'Summary changed',
'lqt_hist_reply_created' = '[[$1|New reply]] created',
+   'lqt_hist_reply_created_deleted' = 'New reply created (deleted)',
'lqt_hist_thread_created' = 'New thread created',
'lqt_hist_deleted' = 'Deleted',
'lqt_hist_undeleted' = 'Undeleted',
@@ -392,6 +393,7 @@
 
 Parameters:
 * $1 is the text for a wiki link to the new reply,
+   'lqt_hist_reply_created_deleted' = 'Same as 
{{msg-mw|{{msg-mw|lqt_hist_reply_created but when the reply has been 
deleted',
'lqt_hist_thread_created' = Summary for 'activity' in thread history, 
see 
[http://translatewiki.net/w/i.php?title=Thread:Support/Payflowpro_gateway-select-dollar-amountlqt_method=thread_history
 example],
'lqt_hist_deleted' = '{{Identical|Deleted}}',
'lqt_hist_moved_talkpage' = '{{Identical|Move}}',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ba3bf1c10860d4fe331f894f4b3a5de1ee52613
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Change Mark as read to 'Remove' - change (mediawiki...LiquidThreads)

2013-04-07 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Change Mark as read to 'Remove'
..

Change Mark as read to 'Remove'

Modified the confusing message to sound better. The tooltip explains the
rest.

Bug: 23031
Change-Id: I8f3bf198b8948c5b2db63189c7784b7812e3247a
---
M i18n/Lqt.i18n.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/31/57931/1

diff --git a/i18n/Lqt.i18n.php b/i18n/Lqt.i18n.php
index f322e0e..9bc5ef1 100644
--- a/i18n/Lqt.i18n.php
+++ b/i18n/Lqt.i18n.php
@@ -118,15 +118,15 @@
'lqt-title' = 'Title',
'lqt-summary' = 'Summary',
'lqt-searching' = 'Searching for threads',
-   'lqt-read-message' = 'Mark as read',
+   'lqt-read-message' = 'Remove',
'lqt-read-message-tooltip' = 'Remove this thread from new messages.
 It will still be visible on its original talk page.',
-   'lqt-read-all' = 'Mark all as read',
+   'lqt-read-all' = 'Remove all',
'lqt-read-all-tooltip' = 'Remove all threads from new messages.
 They will still be visible on their original talk pages.
 This operation is undoable.',
-   'lqt-marked-read' = 'Thread \'\'\'$1\'\'\' marked as read.',
-   'lqt-count-marked-read' = '$1 {{PLURAL:$1|message|messages}} marked as 
read.',
+   'lqt-marked-read' = 'Thread \'\'\'$1\'\'\' has been removed from new 
messages.',
+   'lqt-count-marked-read' = '$1 {{PLURAL:$1|message|messages}} removed 
from new messages.',
'lqt-email-undo' = 'Undo',
'lqt-no-new-messages' = 'There are no new messages for you.',
'lqt-new-messages' = 'There are new messages for you.',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f3bf198b8948c5b2db63189c7784b7812e3247a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Add a Signature to messages on creator's talk page - change (mediawiki...PageTriage)

2013-04-03 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Add a Signature to messages on creator's talk page
..

Add a Signature to messages on creator's talk page

automatically append  to any posted talkpage message.

Bug: 46842
Change-Id: I2ccaf7576c60955605040e7cc68247b46a9c7136
---
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
M modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
3 files changed, 6 insertions(+), 1 deletion(-)


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

diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js 
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
index 3065209..5caac98 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.delete.js
@@ -707,6 +707,8 @@
// use generic template for multiple deletion tag
var template = ( count  1 ) ? 
$.pageTriageDeletionTagsMultiple.talkpagenotiftpl : 
this.selectedTag[key].talkpagenotiftpl;
template = '{{subst:' + template + '|' + pageName + 
'}}';
+   // Appending signature
+   template += '';
 
if ( this.model.get( 'user_name' ) ) {
var title = new mw.Title( this.model.get( 
'user_name' ), mw.config.get( 'wgNamespaceIds' )['user_talk'] );
diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js 
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
index f247d10..9aa539f 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.mark.js
@@ -120,6 +120,8 @@
+ '|' + mw.config.get( 'wgUserName' )
+ '|' + note + '}}';
}
+   // Appending signature
+   note += '';
 
$.ajax( {
type: 'post',
diff --git a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js 
b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
index d7624d3..16b2b87 100644
--- a/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
+++ b/modules/ext.pageTriage.views.toolbar/ext.pageTriage.tags.js
@@ -601,7 +601,8 @@
note = '{{subst:' + mw.config.get( 
'wgTalkPageNoteTemplate' )['Tags']
+ '|' + pageName
+ '|' + mw.config.get( 'wgUserName' )
-   + '|' + note + '}}';
+   + '|' + note + '}}'
+   + ''; //Appending signature
 
$.ajax( {
type: 'post',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ccaf7576c60955605040e7cc68247b46a9c7136
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PageTriage
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Check protection status of titles in details step. - change (mediawiki...UploadWizard)

2013-03-28 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Check protection status of titles in details step.
..

Check protection status of titles in details step.

Improved version of https://gerrit.wikimedia.org/r/23007 Thanks to DJ for
that patch.

Note: This is still not verified, I have to find a way to protect certain
titles to test this yet.

Bug 37107

Change-Id: Ic951851ddb46b5a80af0ef4ce248a3fdb46ea1b4
---
M resources/mw.DestinationChecker.js
M resources/mw.UploadWizardDetails.js
2 files changed, 20 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/71/56371/1

diff --git a/resources/mw.DestinationChecker.js 
b/resources/mw.DestinationChecker.js
index 38a43ba..5880cdf 100644
--- a/resources/mw.DestinationChecker.js
+++ b/resources/mw.DestinationChecker.js
@@ -208,7 +208,8 @@
// XXX do not use iiurlwidth as it will create a thumbnail
var params = {
'titles': title,
-   'prop':  'imageinfo',
+   'prop':  'info|imageinfo',
+   'inprop': 'protection',
'iiprop': 'url|mime|size',
'iiurlwidth': 150
};
@@ -236,9 +237,20 @@
// If file found on another repository, such as when 
the wiki is using InstantCommons: page with a key of -1, plus imageinfo
// If file found on this repository: page with some 
positive numeric key
if ( data.query.pages[-1]  
!data.query.pages[-1].imageinfo ) {
-   // No conflict found on any repository this 
wiki uses
-   result = { isUnique: true };
-
+   if ( data.query.pages[-1].protection ) {
+   var protection = 
data.query.pages[-1].protection;
+   $.each( protection, function( 
i, val ) {
+   if ( !$.inArray( 
val.level, mw.config.get( 'wgUserGroups' ) ) ) {
+   result = {
+   
isUnique: true,
+   
isProtected: true
+   };
+   }
+   } );
+   } else {
+   // No conflict found on any repository 
this wiki uses
+   result = { isUnique: true };
+   }
} else {
 
for ( var page_id in data.query.pages ) {
diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 65956f4..d7771fd 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -733,7 +733,7 @@
var _this = this;
var $errorEl = _this.$form.find( 'label[for=' + _this.titleId + 
'].errorTitleUnique' );
 
-   if ( result.unique.isUnique  result.blacklist.notBlacklisted 
) {
+   if ( result.unique.isUnique  result.blacklist.notBlacklisted 
 !result.unique.isProtected ) {
$j( _this.titleInput ).data( 'valid', true );
$errorEl.hide().empty();
_this.ignoreWarningsInput = undefined;
@@ -762,6 +762,9 @@
}
 
$errorEl.html( errHtml ).show();
+   } else if ( result.unique.isProtected ) {
+   errHtml = mw.msg( 'mwe-upwiz-error-title-protected' );
+   $errorEl.html( errHtml );
} else {
errHtml = gM( 'mwe-upwiz-blacklisted', titleString );
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic951851ddb46b5a80af0ef4ce248a3fdb46ea1b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Added css class for hidden logs. - change (mediawiki...AbuseFilter)

2013-03-28 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Added css class for hidden logs.
..

Added css class for hidden logs.

Bug 28247

Change-Id: Icd58fce8f11308ba44abd403c150ebf27a25e0ca
---
M special/SpecialAbuseLog.php
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/special/SpecialAbuseLog.php b/special/SpecialAbuseLog.php
index 38a0f15..defcc52 100644
--- a/special/SpecialAbuseLog.php
+++ b/special/SpecialAbuseLog.php
@@ -547,6 +547,7 @@
if ( self::isHidden( $row ) === true ) {
$description .= ' '.
$this-msg( 'abusefilter-log-hidden' )-parse();
+   $description = 'div class=afl-hidden' . 
$description . '/div';
} elseif ( self::isHidden($row) === 'implicit' ) {
$description .= ' '.
$this-msg( 'abusefilter-log-hidden-implicit' 
)-parse();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd58fce8f11308ba44abd403c150ebf27a25e0ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Correct flickr url generation. - change (mediawiki...UploadWizard)

2013-03-26 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Correct flickr url generation.
..

Correct flickr url generation.

The urls for images in flickr was getting wrong setting it to the right
thing as per http://www.flickr.com/services/api/misc.urls.html

Note: Couldn't test this locally because of the curl error, so please test
before merging

Bug 46559

Change-Id: I57900feba9eafc5c4790b17459c857bccdf9e236
---
M resources/mw.FlickrChecker.js
1 file changed, 2 insertions(+), 2 deletions(-)


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

diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js
index 4f6b99d..012a04f 100644
--- a/resources/mw.FlickrChecker.js
+++ b/resources/mw.FlickrChecker.js
@@ -84,7 +84,7 @@
api_key: _this.apiKey,
photoset_id: albumIdMatches[1],
format: 'json',
-   extras: 'license, url_sq, owner_name, original_format, 
date_taken, geo, path_alias' },
+   extras: 'license, url_sq, owner_name, original_format, 
date_taken, geo' },
function( data ) {
if ( typeof data.photoset !== 'undefined' ) {
$.each( data.photoset.photo, function( 
i, item ){
@@ -100,7 +100,7 @@

fileName = item.title + '.jpg';
}
sourceURL = 
'http://www.flickr.com/photos/'
-   + 
item.pathalias + '/' + item.id + '/';
+   + 
data.photoset.owner + '/' + item.id + '/';
var 
flickrUpload = {
name: 
fileName,
url: '',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I57900feba9eafc5c4790b17459c857bccdf9e236
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 35520) Don't wikilink input that is already likely to b... - change (mediawiki...UploadWizard)

2013-03-23 Thread Nischayn22 (Code Review)
Nischayn22 has submitted this change and it was merged.

Change subject: (bug 35520) Don't wikilink input that is already likely to be 
wikicode
..


(bug 35520) Don't wikilink input that is already likely to be wikicode

The author field is normaly used as text for the wikilink to your
username. Many users, however, have their own ways to form their
attribution.

This will use raw wikicode for the author field if the user adds
'[' or '{' in the author field. If they don't, the field input
will still be used as the text for the wikilink to the username.

Change-Id: I0a6580e953754b290abd0844b2bb95e2f62c0333
---
M resources/mw.UploadWizardDeed.js
1 file changed, 5 insertions(+), 1 deletion(-)

Approvals:
  Matmarex: Looks good to me, but someone else must approve
  Nischayn22: Verified; Looks good to me, approved



diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js
index c4a274d..f61da0a 100644
--- a/resources/mw.UploadWizardDeed.js
+++ b/resources/mw.UploadWizardDeed.js
@@ -111,7 +111,11 @@
author = _this.$authorInput2.val();
}
 
-   return [[User: + mw.config.get( 'wgUserName' ) + '|' 
+ author + ']]';
+   if ( author.indexOf( '[' ) = 0 || author.indexOf( '{' 
) = 0 ) {
+   return author;
+   }
+
+   return '[[User:' + mw.config.get( 'wgUserName' ) + '|' 
+ author + ']]';
},
 
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0a6580e953754b290abd0844b2bb95e2f62c0333
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: Lupo lupo.bugzi...@gmail.com
Gerrit-Reviewer: Matmarex matma@gmail.com
Gerrit-Reviewer: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: TheDJ hartman.w...@gmail.com
Gerrit-Reviewer: jenkins-bot

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


[MediaWiki-commits] [Gerrit] Conditional operator with () returns false. - change (mediawiki...AbuseFilter)

2013-03-22 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Conditional operator with () returns false.
..

Conditional operator with () returns false.

Directly applying the patch given in the bug report. Thanks to orlodrim.
bug: 25373

Change-Id: I72b27e3dd22416288f3113e5a7c5a21ffbac01fb
---
M AbuseFilter.parser.php
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/53/55453/1

diff --git a/AbuseFilter.parser.php b/AbuseFilter.parser.php
index fa38d5d..dcb0f2a 100644
--- a/AbuseFilter.parser.php
+++ b/AbuseFilter.parser.php
@@ -926,12 +926,12 @@
 
$isTrue = $result-toBool();
 
-   if ( $isTrue ) {
+   if ( !$isTrue ) {
$scOrig = $this-mShortCircuit;
$this-mShortCircuit = $this-mAllowShort;
}
$this-doLevelConditions( $r1 );
-   if ( $isTrue ) {
+   if ( !$isTrue ) {
$this-mShortCircuit = $scOrig;
}
 
@@ -946,12 +946,12 @@
);
$this-move();
 
-   if ( !$isTrue ) {
+   if ( $isTrue ) {
$scOrig = $this-mShortCircuit;
$this-mShortCircuit = $this-mAllowShort;
}
$this-doLevelConditions( $r2 );
-   if ( !$isTrue ) {
+   if ( $isTrue ) {
$this-mShortCircuit = $scOrig;
}
 
@@ -981,12 +981,12 @@
 
$isTrue = $result-toBool();
 
-   if ( $isTrue ) {
+   if ( !$isTrue ) {
$scOrig = $this-mShortCircuit;
$this-mShortCircuit = 
$this-mAllowShort;
}
$this-doLevelConditions( $r1 );
-   if ( $isTrue ) {
+   if ( !$isTrue ) {
$this-mShortCircuit = $scOrig;
}
 
@@ -1001,12 +1001,12 @@
);
$this-move();
 
-   if ( !$isTrue ) {
+   if ( $isTrue ) {
$scOrig = $this-mShortCircuit;
$this-mShortCircuit = 
$this-mAllowShort;
}
$this-doLevelConditions( $r2 );
-   if ( !$isTrue ) {
+   if ( $isTrue ) {
$this-mShortCircuit = $scOrig;
}
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72b27e3dd22416288f3113e5a7c5a21ffbac01fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AbuseFilter
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 39929) copy metadata should update the view. - change (mediawiki...UploadWizard)

2013-03-21 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 39929) copy metadata should update the view.
..

(bug 39929) copy metadata should update the view.

Change-Id: Icc4fb07c6eecc600a9754e41a83d89d96adf1242
---
M resources/mw.UploadWizardDetails.js
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 65956f4..8fc2c9c 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -449,6 +449,12 @@
var firstValue = $j( firstId ).val();
$j( tag + '[id^=' + id + ']:not(' + firstId + ')' 
).each( function () {
$j( this ).val( firstValue );
+   if ( $j( this ).parents( '.mwe-more-details' 
).length === 1 ) {
+   var moreInfo = $( this ).parents( 
'.detailsForm' ).find( '.mwe-upwiz-details-more-options a' );
+   if ( !moreInfo.hasClass( 
mwe-upwiz-toggler-open ) ) {
+   moreInfo.click();
+   }
+   }
});
};
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc4fb07c6eecc600a9754e41a83d89d96adf1242
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Message Improvements for upload buttons. - change (mediawiki...UploadWizard)

2013-03-19 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Message Improvements for upload buttons.
..

Message Improvements for upload buttons.

* remove obsolete message
* make messages indicate multiple upload facility.

Change-Id: I70515d0af548a9716d933f17a2c82d008fff8445
---
M UploadWizard.i18n.php
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/88/54688/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index d53c5f4..9e03bcd 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -45,10 +45,9 @@
'mwe-upwiz-tutorial-error-cannot-transform' = 'Sorry, we could not get 
a scaled image of the tutorial to fit this screen. This may be a temporary 
problem with Wikimedia Commons; try again later.',
'mwe-upwiz-help-desk' = 'Help desk',
'mwe-upwiz-help-desk-url' = '{{ns:project}}:Help desk',
-   'mwe-upwiz-add-file-n' = 'Add another file',
-   'mwe-upwiz-add-file-0-free' = 'Select a media file to share',
-   'mwe-upwiz-upload-flickr' = 'Upload images from Flickr',
-   'mwe-upwiz-add-file-flickr' = 'Add images from Flickr',
+   'mwe-upwiz-add-file-n' = 'Add more files',
+   'mwe-upwiz-add-file-0-free' = 'Select one or several media files to 
share',
+   'mwe-upwiz-add-file-flickr' = 'Share images from Flickr',
'mwe-upwiz-add-file-flickr-n' = 'Add more images from Flickr',
'mwe-upwiz-add-flickr-or' = 'Or' ,
'mwe-upwiz-add-flickr' = 'Get from Flickr',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I70515d0af548a9716d933f17a2c82d008fff8445
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 36914) Make Special:UploadCampaigns visible to all. - change (mediawiki...UploadWizard)

2013-03-19 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 36914) Make Special:UploadCampaigns visible to all.
..

(bug 36914) Make Special:UploadCampaigns visible to all.

Show Special:UploadCampaigns to people without editing rights, just don't
show hide the edit and delete buttons from them.

* I know this is a dirty hack; but I couldn't think anything better.

Change-Id: Ifa970268a5a4e18200b4dc1fddfa45d27c74eac5
---
M includes/specials/SpecialUploadCampaigns.php
1 file changed, 63 insertions(+), 51 deletions(-)


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

diff --git a/includes/specials/SpecialUploadCampaigns.php 
b/includes/specials/SpecialUploadCampaigns.php
index 3cf24b9..197862c 100644
--- a/includes/specials/SpecialUploadCampaigns.php
+++ b/includes/specials/SpecialUploadCampaigns.php
@@ -46,19 +46,14 @@
$req = $this-getRequest();
$user = $this-getUser();
 
-   // If the user is authorized, display the page, if not, show an 
error.
-   if ( $this-userCanExecute( $user ) ) {
-   if ( $req-wasPosted()
-$user-matchEditToken( $req-getVal( 
'wpEditToken' ) )
-$req-getCheck( 'newcampaign' ) ) {
-   $this-getOutput()-redirect( 
SpecialPage::getTitleFor( 'UploadCampaign', $req-getVal( 'newcampaign' ) 
)-getLocalURL() );
-   }
-   else {
-   $this-displayUploadCamaigns();
-   }
+   if ( $req-wasPosted()
+$user-matchEditToken( $req-getVal( 'wpEditToken' ) 
)
+$req-getCheck( 'newcampaign' ) ) {
+   $this-getOutput()-redirect( 
SpecialPage::getTitleFor( 'UploadCampaign', $req-getVal( 'newcampaign' ) 
)-getLocalURL() );
} else {
-   $this-displayRestrictionError();
+   $this-displayUploadCamaigns();
}
+
}
 
/**
@@ -67,7 +62,9 @@
 * @since 1.2
 */
protected function displayUploadCamaigns() {
-   $this-displayAddNewControl();
+   if ( $this-userCanExecute( $this-getUser() ) ) {
+   $this-displayAddNewControl();
+   }
 
// If the refresh flag is set, fetch from the master.
// This is to ensure changes show up right away for the person 
that makes then
@@ -144,20 +141,36 @@
array( 'class' = 'wikitable sortable', 'style' = 
'width:400px' )
) );
 
-   $out-addHTML(
-   'theadtr' .
-   Html::element( 'th', array(), $this-msg( 
'mwe-upwiz-campaigns-name' )-text() ) .
-   Html::element( 'th', array(), $this-msg( 
'mwe-upwiz-campaigns-status' )-text() ) .
-   Html::element( 'th', array( 'class' = 
'unsortable' ), $this-msg( 'mwe-upwiz-campaigns-edit' )-text() ) .
-   Html::element( 'th', array( 'class' = 
'unsortable' ), $this-msg( 'mwe-upwiz-campaigns-delete' )-text() ) .
-   '/tr/thead'
-   );
+   $out-addHTML( $this-getTableHeadersHtml() );
 
$out-addHTML( 'tbody' );
 
foreach ( $campaigns as $campaign ) {
-   $out-addHTML(
-   'tr' .
+   $out-addHTML( $this-getTableContentsHtml( $campaign ) 
);
+   }
+
+   $out-addHTML( '/tbody' );
+   $out-addHTML( '/table' );
+
+   $out-addModules( 'ext.uploadWizard.campaigns' );
+   }
+
+   private function getTableHeadersHtml() {
+   $html = 'theadtr' .
+   Html::element( 'th', array(), 
$this-msg( 'mwe-upwiz-campaigns-name' )-text() ) .
+   Html::element( 'th', array(), 
$this-msg( 'mwe-upwiz-campaigns-status' )-text() );
+
+   if ( $this-userCanExecute( $this-getUser() ) ) {
+   $html = $html . Html::element( 'th', array( 'class' = 
'unsortable' ), $this-msg( 'mwe-upwiz-campaigns-edit' )-text() ) .
+   Html::element( 'th', array( 
'class' = 'unsortable' ), $this-msg( 'mwe-upwiz-campaigns-delete' )-text() );
+   }
+   $html = $html . '/tr/thead';
+
+   return $html;
+   }
+
+   private function getTableContentsHtml( $campaign ) {
+   $html = 'tr' .
'td' .
Html::element(
  

[MediaWiki-commits] [Gerrit] Make rtl support for select dropdowns - change (mediawiki/core)

2013-03-18 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Make rtl support for select dropdowns
..

Make rtl support for select dropdowns

Change-Id: Ic0fbe10933500252c78dbecf1c5cbd018eb35b06
---
M skins/common/shared.css
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/84/54484/1

diff --git a/skins/common/shared.css b/skins/common/shared.css
index 6e1c94f..01bf3b0 100644
--- a/skins/common/shared.css
+++ b/skins/common/shared.css
@@ -21,12 +21,14 @@
 
 /* Most input fields should be in site direction */
 .sitedir-ltr textarea,
-.sitedir-ltr input {
+.sitedir-ltr input,
+.sitedir-ltr select {
/* @noflip */
direction: ltr;
 }
 .sitedir-rtl textarea,
-.sitedir-rtl input {
+.sitedir-rtl input,
+.sitedir-rtl select {
/* @noflip */
direction: rtl;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0fbe10933500252c78dbecf1c5cbd018eb35b06
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 37302) Improve the progress bar's status - change (mediawiki...UploadWizard)

2013-03-16 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 37302) Improve the progress bar's status
..

(bug 37302) Improve the progress bar's status

The progress bar showed finished repeatedly because its beginTime was
always reset to NOW by the code for each file. This leaded to a very small
elapsedTime and a very fast rate of upload.

Corrected that by setting the beginTime only once for a upload.

Also some refactoring done.

Change-Id: I016d4dd58fb219a9d165fca53241f1fc4263ac2a
---
M resources/mw.GroupProgressBar.js
M resources/mw.UploadWizard.js
2 files changed, 67 insertions(+), 63 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/27/54127/1

diff --git a/resources/mw.GroupProgressBar.js b/resources/mw.GroupProgressBar.js
index e319bb8..036e561 100644
--- a/resources/mw.GroupProgressBar.js
+++ b/resources/mw.GroupProgressBar.js
@@ -1,7 +1,7 @@
 /**
  * this is a progress bar for monitoring multiple objects, giving summary view
  */
-mw.GroupProgressBar = function( selector, text, uploads, successStates, 
errorStates, progressProperty, weightProperty ) {
+mw.GroupProgressBar = function( selector, text, wizard, successStates, 
errorStates, progressProperty, weightProperty ) {
var _this = this;
 
// XXX need to figure out a way to put text inside bar
@@ -20,7 +20,7 @@
 
_this.$selector.find( '.mwe-upwiz-progress-bar' ).progressbar( { value 
: 0 } );
 
-   _this.uploads = uploads;
+   _this.wizard = wizard;
_this.successStates = successStates;
_this.errorStates = errorStates;
_this.progressProperty = progressProperty;
@@ -42,60 +42,64 @@
 * loop around the uploads, summing certain properties for a weighted 
total fraction
 */
start: function() {
-   var _this = this;
+   var _this = this,
+   totalWeight = 0.0;
 
-   var totalWeight = 0.0;
-   $j.each( _this.uploads, function( i, upload ) {
+   if ( typeof _this.beginTime == 'undefined' ) {
+   _this.setBeginTime();
+   }
+   $j.each( _this.wizard.uploads, function( i, upload ) {
if ( upload === undefined ) {
return;
}
totalWeight += upload[_this.weightProperty];
} );
 
-   _this.setBeginTime();
-   var shown = false;
-
-   var displayer = function() {
-   var fraction = 0.0;
-   var successStateCount = 0;
-   var errorStateCount = 0;
-   var hasData = false;
-   $j.each( _this.uploads, function( i, upload ) {
-   if ( upload === undefined ) {
-   return;
-   }
-   if ( $j.inArray( upload.state, 
_this.successStates ) !== -1 ) {
-   successStateCount++;
-   }
-   if ( $j.inArray( upload.state, 
_this.errorStates ) !== -1 ) {
-   errorStateCount++;
-   }
-   if (upload[_this.progressProperty] !== 
undefined) {
-   fraction += 
upload[_this.progressProperty] * ( upload[_this.weightProperty] / totalWeight );
-   if (upload[_this.progressProperty]  0 
) {
-   hasData = true;
+   var shown = false,
+   displayer = function() {
+   var fraction = 0.0;
+   var successStateCount = 0;
+   var errorStateCount = 0;
+   var hasData = false;
+   $j.each( _this.wizard.uploads, function( i, 
upload ) {
+   if ( upload === undefined ) {
+   return;
}
-   }
-   } );
+   if ( $j.inArray( upload.state, 
_this.successStates ) !== -1 ) {
+   successStateCount++;
+   }
+   if ( $j.inArray( upload.state, 
_this.errorStates ) !== -1 ) {
+   errorStateCount++;
+   }
+   if (upload[_this.progressProperty] !== 
undefined) {
+ 

[MediaWiki-commits] [Gerrit] (bug 43593) error for restricted flickr content. - change (mediawiki...UploadWizard)

2013-03-15 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 43593) error for restricted flickr content.
..

(bug 43593) error for restricted flickr content.

Restricted content from flickr needs authorization. Since currently there
is no way to find out if the content is restricted or invalid we try to
display a single error message for both conditions.

Change-Id: Id906ae3f205ed4742e2e03cc1faa49171e5d47c9
Todo: Find out a way to know if the flickr set is restricted and authorize 
users to fetch its content.
---
M UploadWizard.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/46/53946/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index ff383cc..6d82488 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -313,7 +313,7 @@
'mwe-upwiz-license-external' = 'This file is under the following 
license on $1: $2.',
'mwe-upwiz-license-external-invalid' = 'This file is under the 
following license on $1: $2. Unfortunately, this license is not appropriate for 
use on this site.',
'mwe-upwiz-license-photoset-invalid' = 'Unfortunately, no image in the 
photoset has a license appropriate to be used on this site.',
-   'mwe-upwiz-url-invalid' = 'The URL entered is not a valid $1 image or 
photoset URL.',
+   'mwe-upwiz-url-invalid' = 'The URL entered points to an invalid or 
restricted $1 image or photoset and cannot be used.',
'mwe-upwiz-categories' = 'Categories',
'mwe-upwiz-categories-add' = 'Add another category',
'mwe-upwiz-category-will-be-added' = 'This category is not in use 
yet.',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id906ae3f205ed4742e2e03cc1faa49171e5d47c9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 33607) remove unnecessary return statement. - change (mediawiki...UploadWizard)

2013-03-15 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 33607) remove unnecessary return statement.
..

(bug 33607) remove unnecessary return statement.

jQuery doesn't need an event handler to have a 'return this'

Change-Id: I4980fdf5a59bca8f696d28aee0c7251d3077a38f
---
M resources/mw.UploadWizard.js
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/78/53978/1

diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 39857df..33609a0 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -1443,7 +1443,6 @@
this.rows++;
}
}
-   return this;
};
 
this.addClass( 'mwe-grow-textarea' );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4980fdf5a59bca8f696d28aee0c7251d3077a38f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 45906) remove title attribute from description - change (mediawiki...UploadWizard)

2013-03-14 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 45906) remove title attribute from description
..

(bug 45906) remove title attribute from description

All other input types don't use the title attribute and all the help is
put in the tipsy it therefore makes sense for the description field to
follow the same.

Change-Id: I615433de761118c45756d37b72150296bb72107d
---
M resources/mw.UploadWizardDescription.js
1 file changed, 0 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/37/53737/1

diff --git a/resources/mw.UploadWizardDescription.js 
b/resources/mw.UploadWizardDescription.js
index 82a4a11..86f5c72 100644
--- a/resources/mw.UploadWizardDescription.js
+++ b/resources/mw.UploadWizardDescription.js
@@ -35,7 +35,6 @@
$j(_this.languageMenu).addClass( 'mwe-upwiz-desc-lang-select' );
 
_this.input = $j( 'textarea name=' + _this.id  + ' rows=2 
cols=36 class=mwe-upwiz-desc-lang-text/textarea' )
-   .attr( 'title', gM( 
'mwe-upwiz-tooltip-description' ) )
.growTextArea();
 
if ( initialValue !== undefined ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I615433de761118c45756d37b72150296bb72107d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Make Title.exists() call the api - change (mediawiki/core)

2013-03-13 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Make Title.exists() call the api
..

Make Title.exists() call the api

Cleanup and api call implementation

Change-Id: I76263cdcafaccab50df52e31271d1fc4398887f8
---
M resources/mediawiki/mediawiki.Title.js
1 file changed, 25 insertions(+), 11 deletions(-)


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

diff --git a/resources/mediawiki/mediawiki.Title.js 
b/resources/mediawiki/mediawiki.Title.js
index b86a14b..ffda713 100644
--- a/resources/mediawiki/mediawiki.Title.js
+++ b/resources/mediawiki/mediawiki.Title.js
@@ -186,16 +186,31 @@
 * @return {Mixed} Boolean true/false if the information is available. 
Otherwise null.
 */
Title.exists = function ( title ) {
-   var type = $.type( title ), obj = Title.exist.pages, match;
-   if ( type === 'string' ) {
-   match = obj[title];
-   } else if ( type === 'object'  title instanceof Title ) {
-   match = obj[title.toString()];
+   var pageName;
+   if ( typeof title === 'string' ) {
+   pageName = title;
+   } else if ( typeof title === 'object'  title instanceof Title 
) {
+   pageName = title.toString();
} else {
throw new Error( 'mw.Title.exists: title must be a 
string or an instance of Title' );
}
-   if ( typeof match === 'boolean' ) {
-   return match;
+
+   if ( !$.inArray( pageName, Title.exist.pages ) ) {
+   var api = new mw.Api( { async:true } );
+   api.get( {
+   action: 'query',
+   titles: pageName
+   } ).done( function ( data ) {
+   if ( $.inArray( -1, data.query.pages ) ) {
+   Title.exist.set( pageName, false );
+   } else {
+   Title.exist.set( pageName, true );
+   }
+   } );
+   }
+
+   if ( typeof Title.exist.pages[pageName] === 'boolean' ) {
+   return Title.exist.pages[pageName];
}
return null;
};
@@ -226,10 +241,9 @@
set: function ( titles, state ) {
titles = $.isArray( titles ) ? titles : [titles];
state = state === undefined ? true : !!state;
-   var pages = this.pages, i, len = titles.length;
-   for ( i = 0; i  len; i++ ) {
-   pages[ titles[i] ] = state;
-   }
+   $.each( titles, function ( index, value ) {
+   this.pages[ value ] = state;
+   } );
return true;
}
};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76263cdcafaccab50df52e31271d1fc4398887f8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Make Title.exists() call the api - change (mediawiki/core)

2013-03-13 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Make Title.exists() call the api
..

Make Title.exists() call the api

Cleanup and api call implementation

Change-Id: I45080a92322b36d3efb25e3ee6d47d5e7b0c6f69
---
M resources/mediawiki/mediawiki.Title.js
1 file changed, 26 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/74/53574/1

diff --git a/resources/mediawiki/mediawiki.Title.js 
b/resources/mediawiki/mediawiki.Title.js
index b86a14b..3616203 100644
--- a/resources/mediawiki/mediawiki.Title.js
+++ b/resources/mediawiki/mediawiki.Title.js
@@ -186,16 +186,31 @@
 * @return {Mixed} Boolean true/false if the information is available. 
Otherwise null.
 */
Title.exists = function ( title ) {
-   var type = $.type( title ), obj = Title.exist.pages, match;
-   if ( type === 'string' ) {
-   match = obj[title];
-   } else if ( type === 'object'  title instanceof Title ) {
-   match = obj[title.toString()];
+   var pageName;
+   if ( typeof title === 'string' ) {
+   pageName = title;
+   } else if ( typeof title === 'object'  title instanceof Title 
) {
+   pageName = title.toString();
} else {
throw new Error( 'mw.Title.exists: title must be a 
string or an instance of Title' );
}
-   if ( typeof match === 'boolean' ) {
-   return match;
+
+   if ( !( pageName in Title.exist.pages ) ) {
+   var api = new mw.Api( { ajax: { async: false } } );
+   api.get( {
+   action: 'query',
+   titles: pageName
+   } ).done( function ( data ) {
+   if ( -1 in data.query.pages ) {
+   Title.exist.set( pageName, false );
+   } else {
+   Title.exist.set( pageName, true );
+   }
+   } );
+   }
+
+   if ( typeof Title.exist.pages[pageName] === 'boolean' ) {
+   return Title.exist.pages[pageName];
}
return null;
};
@@ -226,10 +241,10 @@
set: function ( titles, state ) {
titles = $.isArray( titles ) ? titles : [titles];
state = state === undefined ? true : !!state;
-   var pages = this.pages, i, len = titles.length;
-   for ( i = 0; i  len; i++ ) {
-   pages[ titles[i] ] = state;
-   }
+   var pages = this.pages;
+   $.each( titles, function ( index, value ) {
+   pages[ value ] = state;
+   } );
return true;
}
};

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I45080a92322b36d3efb25e3ee6d47d5e7b0c6f69
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 40472) Link to custom copyright tags were wrong. - change (mediawiki...UploadWizard)

2013-03-10 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 40472) Link to custom copyright tags were wrong.
..

(bug 40472) Link to custom copyright tags were wrong.

deed.+language code was appended to all links instead of just creative
commons links.

Change-Id: I73ce916211a8fb5095a4ba90b48ab98a6e502de9
---
M resources/mw.UploadWizardLicenseInput.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/41/53041/1

diff --git a/resources/mw.UploadWizardLicenseInput.js 
b/resources/mw.UploadWizardLicenseInput.js
index 6f3b7fb..5ef2390 100644
--- a/resources/mw.UploadWizardLicenseInput.js
+++ b/resources/mw.UploadWizardLicenseInput.js
@@ -223,7 +223,10 @@
 
// The URL is optional, but if the message includes it as $2, 
we surface the fact
// that it's misisng.
-   var licenseURL = license.props['url'] === undefined ? '#missing 
license URL' : license.props.url + 'deed.' + languageCode;
+   var licenseURL = license.props['url'] === undefined ? '#missing 
license URL' : license.props.url;
+   if ( licenseURL.indexOf( 'creativecommons' ) != -1 ) {
+   licenseUrl = licenseURL + 'deed.' + languageCode;
+   }
var licenseLink = $j( 'a' ).attr( { 'target': '_blank', 
'href': licenseURL } );
var $icons = $j( 'span/span' );
if ( license.props['icons'] !== undefined ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I73ce916211a8fb5095a4ba90b48ab98a6e502de9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 31292) make category permanently visible. - change (mediawiki...UploadWizard)

2013-03-10 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 31292) make category permanently visible.
..

(bug 31292) make category permanently visible.

make category field permanently visible by removing it from below the more
options link.

Change-Id: Ibbf1d6f5b686ed4989daac39a619c3a960752359
---
M UploadWizard.i18n.php
M resources/mw.UploadWizardDetails.js
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/46/53046/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index b81e5d2..884a8c7 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -133,7 +133,7 @@
'mwe-upwiz-source-thirdparty-cases' = 'Now tell us why you are sure 
you have the right to publish {{PLURAL:$1|this work|these works}}:',
'mwe-upwiz-source-thirdparty-accept' = 'OK',
'mwe-upwiz-source-custom' = 'Provide copyright information for each 
file individually on the next page.',
-   'mwe-upwiz-more-options' = 'Add categories and more information ...',
+   'mwe-upwiz-more-options' = 'Add location and more information ...',
'mwe-upwiz-copy-metadata' = 'Copy information to {{PLURAL:$1|the other 
upload|all uploads}} below ...',
'mwe-upwiz-copy-metadata-button' = 'Copy',
'mwe-upwiz-copied-metadata-button' = 'Successfully Copied',
diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 65956f4..8af40a3 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -177,7 +177,6 @@
);
 
$j( moreDetailsDiv ).append(
-   $categoriesDiv,
locationDiv,
otherInformationDiv
);
@@ -190,7 +189,8 @@
_this.descriptionsDiv,
descriptionAdderDiv,
_this.copyrightInfoFieldset,
-   dateInputDiv
+   dateInputDiv,
+   $categoriesDiv
);
 
if ( mw.UploadWizard.config.idField ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbf1d6f5b686ed4989daac39a619c3a960752359
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 39607) user preference for maxSimultaneousUpload - change (mediawiki...UploadWizard)

2013-03-09 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 39607) user preference for maxSimultaneousUpload
..

(bug 39607) user preference for maxSimultaneousUpload

Consider the user preferences for maximum number of simultaneous uploads.
The user can select a value only lower than that set by the server-side
config.

Since the user set value is smaller than the server-side config the JS
only checks for the user setting.

Change-Id: I30cc9c0629c0d38a72bd04000b04579686f4f920
---
M UploadWizardHooks.php
M resources/mw.UploadWizard.js
2 files changed, 19 insertions(+), 1 deletion(-)


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

diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index e12c89f..c6f6eb2 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -562,6 +562,8 @@
 */
public static function onGetPreferences( User $user, array 
$preferences ) {
 
+   $config = UploadWizardConfig::getConfig();
+
// User preference to skip the licensing tutorial, provided 
it's not globally disabled
if ( UploadWizardConfig::getSetting( 'skipTutorial' ) == false 
) {
$preferences['upwiz_skiptutorial'] = array(
@@ -607,6 +609,22 @@
}
}
 
+   // Setting for maximum number of simultaneous uploads (always 
lower than the server-side config)
+   if( $config[ 'maxSimultaneousConnections' ]  1 ) {
+
+   // Hack to make the key and value the same otherwise 
options are added wrongly.
+   $range = range( 0, $config[ 
'maxSimultaneousConnections' ] );
+   unset( $range[0] );
+
+   $preferences['upwiz_maxsimultaneous'] = array(
+   'type' = 'select',
+   'label-message' = 'mwe-upwiz-sim',
+   'section' = 'uploads/upwiz-experimental',
+   'default' = $config[ 
'maxSimultaneousConnections' ],
+   'options' = $range
+   );
+   }
+
return true;
}
 
diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index e044053..623cf7a 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -15,7 +15,7 @@
 
// XXX need a robust way of defining default config
this.maxUploads = mw.UploadWizard.config[ 'maxUploads' ] || 10;
-   this.maxSimultaneousConnections = mw.UploadWizard.config[  
'maxSimultaneousConnections'  ] || 2;
+   this.maxSimultaneousConnections = mw.user.options.get( 
'upwiz_maxsimultaneous' ) || 1;
 
this.makePreviewsFlag = true;
this.showDeed = false;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I30cc9c0629c0d38a72bd04000b04579686f4f920
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Remove unused variables as per jsHint. - change (mediawiki...UploadWizard)

2013-03-08 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Remove unused variables as per jsHint.
..

Remove unused variables as per jsHint.

Change-Id: I4388f7707ef7e681f96aecfe0c3b523039ab272b
---
M resources/mw.UploadWizard.js
1 file changed, 0 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/78/52878/1

diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index e044053..f3a954c 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -199,8 +199,6 @@
// if returns false, you can assume there are 
notifications in the interface.
if ( _this.deedChooser.valid() ) {
 
-   var lastUploadIndex = 
_this.uploads.length - 1;
-
$j.each( _this.uploads, function ( i, 
upload ) {
if ( upload === undefined ) {
return;
@@ -458,9 +456,6 @@
$j( 'html, body' ).animate( { scrollTop: headScroll.top, 
scrollLeft: headScroll.left }, 'slow' );
$j.each( _this.stepNames, function(i, stepName) {
 
-   // the step indicator
-   var step = $j( '#mwe-upwiz-step-' + stepName );
-
// the step's contents
var stepDiv = $j( '#mwe-upwiz-stepdiv-' + stepName );
 
@@ -497,8 +492,6 @@
 */
resetFileStepUploads: function() {
if ( this.uploads.length === 0 ) {
-   // add one upload field to start (this is the big one 
that asks you to upload something)
-   var upload = this.newUpload();
// hide flickr uploading button if user doesn't have 
permissions
if ( !mw.UploadWizard.config.UploadFromUrl || 
mw.UploadWizard.config.flickrApiKey === '' ) {
$j( '#mwe-upwiz-upload-ctrl-flickr-container, 
#mwe-upwiz-flickr-select-list-container' ).hide();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4388f7707ef7e681f96aecfe0c3b523039ab272b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 38470) Better message for filename already in use. - change (mediawiki...UploadWizard)

2013-03-08 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 38470) Better message for filename already in use.
..

(bug 38470) Better message for filename already in use.

Guide the user to forward by suggesting how to solve the problem.

Change-Id: Ibb701fde88ed00a3ab6836a4dd2b2df1a13ea9b8
---
M UploadWizard.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index b81e5d2..ff6577e 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -179,7 +179,7 @@
'mwe-upwiz-fileexists' = 'A file with this name exists already.
 Please check $1 if you are not sure if you want to replace it.',
'mwe-upwiz-fileexists-replace-on-page' = 'A file with this name exists 
already. If you want to replace it, go to the page for [$2 $1] and replace it 
there.',
-   'mwe-upwiz-fileexists-replace-no-link' = 'A file with this name exists 
already.',
+   'mwe-upwiz-fileexists-replace-no-link' = 'Please choose a different 
filename, because this filename is already in use.',
'mwe-upwiz-blacklisted' = 'Please choose a different, descriptive 
title.',
'mwe-upwiz-thumbnail-more' = 'Enlarge',
'mwe-upwiz-overwrite' = 'Replace the file',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb701fde88ed00a3ab6836a4dd2b2df1a13ea9b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] Hide the 'Next' button until a license is chosen. - change (mediawiki...UploadWizard)

2013-03-07 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Hide the 'Next' button until a license is chosen.
..

Hide the 'Next' button until a license is chosen.

When uploading an image the 'Continue' button only appears after the
files have uploaded, it therefore makes sense to show the 'next' button in
the license step only after any deed is selected.

This removes the need for the NullDeed

Change-Id: Id9551311d833ace26abff4bec1ad136a84206168
---
M UploadWizard.i18n.php
M UploadWizardHooks.php
M includes/specials/SpecialUploadWizard.php
M resources/mw.UploadWizardDeed.js
4 files changed, 2 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/28/52628/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index 72ad625..f154a11 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -206,7 +206,6 @@
'mwe-upwiz-tooltip-location' = 'Coordinates of the location where this 
media file was created.',
'mwe-upwiz-tooltip-more-info' = 'Learn more.',
'mwe-upwiz-file-need-file' = 'Please add an upload first.',
-   'mwe-upwiz-deeds-need-deed' = 'Please explain where you got 
{{PLURAL:$1|this file|these files}} and how this site can use 
{{PLURAL:$1|it|them}}, by selecting one of the options.',
'mwe-upwiz-deeds-need-license' = 'Please select a license.',
'mwe-upwiz-license-show-all' = 'Use a different license',
'mwe-upwiz-license-show-recommended' = 'Use the recommended license',
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index e12c89f..87b5fbe 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -317,7 +317,6 @@
'mwe-upwiz-tooltip-location',
'mwe-upwiz-tooltip-more-info',
'mwe-upwiz-file-need-file',
-   'mwe-upwiz-deeds-need-deed',
'mwe-upwiz-deeds-need-license',
'mwe-upwiz-license-show-all',
'mwe-upwiz-license-show-recommended',
diff --git a/includes/specials/SpecialUploadWizard.php 
b/includes/specials/SpecialUploadWizard.php
index 30e9aaf..217ca29 100644
--- a/includes/specials/SpecialUploadWizard.php
+++ b/includes/specials/SpecialUploadWizard.php
@@ -452,7 +452,7 @@
.   'div id=mwe-upwiz-deeds 
class=ui-helper-clearfix/div'
.   'div id=mwe-upwiz-deeds-custom 
class=ui-helper-clearfix/div'
.   'div class=mwe-upwiz-buttons'
-   .  'button class=mwe-upwiz-button-next' . 
$this-msg( mwe-upwiz-next-deeds )-text()  . '/button'
+   .  'button class=mwe-upwiz-button-next 
style=display:none;' . $this-msg( mwe-upwiz-next-deeds )-text()  . 
'/button'
.   '/div'
. '/div'
 
diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js
index c4a274d..698eaf6 100644
--- a/resources/mw.UploadWizardDeed.js
+++ b/resources/mw.UploadWizardDeed.js
@@ -34,14 +34,6 @@
 
 };
 
-
-mw.UploadWizardNullDeed = $j.extend( new mw.UploadWizardDeed(), {
-   valid: function() {
-   return false;
-   }
-} );
-
-
 /**
  * Set up the form and deed object for the deed option that says these uploads 
are all the user's own work.
  * @param {Number} integer count of uploads that this deed refers to (useful 
for message pluralization)
@@ -416,10 +408,6 @@
 
// deselect all deeds
_this.deselectDeedInterface( this.$selector.find( '.mwe-upwiz-deed' ) );
-
-   // set the value to be the null deed; which will cause an error if 
the data is submitted.
-   _this.choose( mw.UploadWizardNullDeed );
-
 };
 
 
@@ -442,13 +430,6 @@
// otherwise, we can assume that the widgets have already added 
error messages.
if (valid) {
_this.hideError();
-   } else {
-   if ( _this.deed === mw.UploadWizardNullDeed ) {
-   _this.showError( gM( 
'mwe-upwiz-deeds-need-deed', _this.uploads.length ) );
-   $j( _this ).bind( 'chooseDeed', function() {
-   _this.hideError();
-   } );
-   }
}
return valid;
},
@@ -472,9 +453,7 @@
choose: function( deed ) {
var _this = this;
_this.deed = deed;
-   if ( deed !== mw.UploadWizardNullDeed ) {
-   $j( _this ).trigger( 'chooseDeed' );
-   }
+   $( '#mwe-upwiz-stepdiv-deeds .mwe-upwiz-button-next' ).show();
},
 
/**

-- 
To view, visit 

[MediaWiki-commits] [Gerrit] scroll to first error on clicking 'next' - change (mediawiki...UploadWizard)

2013-03-07 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: scroll to first error on clicking 'next'
..

scroll to first error on clicking 'next'

on clicking 'Next' we scroll to the topmost error, the user can click this
several times to go the next erorrs and so on.

bug: 30649
Change-Id: Ib0561f5f93f60ada0bd0206be742c6aad79d9e2f
---
M resources/mw.UploadWizard.js
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index e044053..44ccb20 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -1109,6 +1109,8 @@
var errorCount = $errorElements.length;
if ( errorCount  0 ) {
$( '#mwe-upwiz-details-error-count' ).msg( 
'mwe-upwiz-details-error-count', errorCount, this.uploads.length );
+   // Scroll to the first error
+   $( 'html,body' ).animate( { scrollTop: $( 
$errorElements[0] ).offset().top - 50 }, 'slow');
} else {
$( '#mwe-upwiz-details-error-count' ).empty();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib0561f5f93f60ada0bd0206be742c6aad79d9e2f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com
Gerrit-Reviewer: Eloquence e...@wikimedia.org
Gerrit-Reviewer: Kaldari rkald...@wikimedia.org

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


[MediaWiki-commits] [Gerrit] remove addHolder to addHolders as per change in AbuseFilter - change (mediawiki...MoodBar)

2013-03-06 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: remove addHolder to addHolders as per change in AbuseFilter
..

remove addHolder to addHolders as per change in AbuseFilter

https://gerrit.wikimedia.org/r/#q,Ia4f6a56f642242a04cf2973b74ce44d91fce00eb,n,z
tries to change addHolder to addHolders, this change is dependant on that.

Change-Id: If7934600ce8759814a0edddcb01d10f1972b6892
---
M include/MoodBarUtil.php
1 file changed, 2 insertions(+), 3 deletions(-)


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

diff --git a/include/MoodBarUtil.php b/include/MoodBarUtil.php
index 330a409..bf1401e 100644
--- a/include/MoodBarUtil.php
+++ b/include/MoodBarUtil.php
@@ -51,13 +51,12 @@
if ( class_exists( 'AbuseFilter' ) ) {
global $wgUser;
$vars = new AbuseFilterVariableHolder;
-   $vars-addHolder( AbuseFilter::generateUserVars( 
$wgUser ) );
-   $vars-addHolder( AbuseFilter::generateTitleVars( 
$title, 'MOODBAR' ) );
+   $vars-addHolders( AbuseFilter::generateUserVars( 
$wgUser ), AbuseFilter::generateTitleVars( $title, 'MOODBAR' ) );
$vars-setVar( 'SUMMARY', 'moodbar' );
$vars-setVar( 'ACTION', 'moodbar' );
$vars-setVar( 'old_wikitext', '' );
$vars-setVar( 'new_wikitext', $value );
-   $vars-addHolder( AbuseFilter::getEditVars( $title ) );
+   $vars-addHolders( AbuseFilter::getEditVars( $title ) );
$filterStatus = AbuseFilter::filterAction( $vars, 
$title );
return !$filterStatus-isOK();
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If7934600ce8759814a0edddcb01d10f1972b6892
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MoodBar
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] remove addHolder to addHolders as per change in AbuseFilter - change (mediawiki...ArticleFeedbackv5)

2013-03-06 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: remove addHolder to addHolders as per change in AbuseFilter
..

remove addHolder to addHolders as per change in AbuseFilter

Ia4f6a56f642242a04cf2973b74ce44d91fce00eb tries to change addHolder to
addHolders, this change is dependant on that.

Change-Id: I1d89f2b39c9a2f68a2d0cc2858a3f73d6847ba76
---
M api/ApiArticleFeedbackv5.php
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/api/ApiArticleFeedbackv5.php b/api/ApiArticleFeedbackv5.php
index 754af97..1e40b0f 100644
--- a/api/ApiArticleFeedbackv5.php
+++ b/api/ApiArticleFeedbackv5.php
@@ -326,8 +326,7 @@
// Set up variables
$title = Title::newFromID( $pageId );
$vars = new AbuseFilterVariableHolder;
-   $vars-addHolder( AbuseFilter::generateUserVars( 
$wgUser ) );
-   $vars-addHolder( AbuseFilter::generateTitleVars( 
$title , 'ARTICLE' ) );
+   $vars-addHolders( AbuseFilter::generateUserVars( 
$wgUser ), AbuseFilter::generateTitleVars( $title , 'ARTICLE' ) );
$vars-setVar( 'SUMMARY', 'Article Feedback 5' );
$vars-setVar( 'ACTION', 'feedback' );
$vars-setVar( 'new_wikitext', $value );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1d89f2b39c9a2f68a2d0cc2858a3f73d6847ba76
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] remove addHolder for addHolders. - change (mediawiki...AbuseFilter)

2013-03-05 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: remove addHolder for addHolders.
..

remove addHolder for addHolders.

lot of code was using ::merge() to create a new AbuseFilterVariableHolder
this is now simplified using a single addHolders method.

merge() still exists as its usful as a static function.

Change-Id: Ia4f6a56f642242a04cf2973b74ce44d91fce00eb
---
M AbuseFilter.class.php
M AbuseFilter.hooks.php
M AbuseFilter.parser.php
M AbuseFilterVariableHolder.php
4 files changed, 32 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter 
refs/changes/60/52360/1

diff --git a/AbuseFilter.class.php b/AbuseFilter.class.php
index 7f4e7b5..5c4b594 100644
--- a/AbuseFilter.class.php
+++ b/AbuseFilter.class.php
@@ -1860,7 +1860,7 @@
// Add user data if the account was created by a registered user
if ( $row-rc_user  $name != $row-rc_user_text ) {
$user = User::newFromName( $row-rc_user_text );
-   $vars-addHolder( self::generateUserVars( $user ) );
+   $vars-addHolders( self::generateUserVars( $user ) );
}
 
$vars-setVar( 'accountname', $name );
@@ -1882,9 +1882,8 @@
$user-setName( $row-rc_user_text );
}
 
-   $vars-addHolder( self::generateUserVars( $user ) );
+   $vars-addHolders( array( self::generateUserVars( $user ), 
self::generateTitleVars( $title, 'ARTICLE' ) ) );
 
-   $vars-addHolder( self::generateTitleVars( $title, 'ARTICLE' ) 
);
$vars-setVar( 'ACTION', 'edit' );
$vars-setVar( 'SUMMARY', $row-rc_comment );
$vars-setVar( 'minor_edit', $row-rc_minor );
@@ -1899,7 +1898,7 @@
$vars-setVar( 'old_wikitext', '' );
}
 
-   $vars-addHolder( self::getEditVars( $title ) );
+   $vars-addHolders( self::getEditVars( $title ) );
 
return $vars;
}
diff --git a/AbuseFilter.hooks.php b/AbuseFilter.hooks.php
index fed4512..1852ff4 100644
--- a/AbuseFilter.hooks.php
+++ b/AbuseFilter.hooks.php
@@ -114,8 +114,10 @@
return true;
}
 
-   $vars-addHolder( AbuseFilter::generateUserVars( $user ) );
-   $vars-addHolder( AbuseFilter::generateTitleVars( $title , 
'ARTICLE' ) );
+   $vars-addHolders( array(
+   AbuseFilter::generateUserVars( $user ), 
+   AbuseFilter::generateTitleVars( $title , 'ARTICLE' )
+   ) );
 
$vars-setVar( 'action', 'edit' );
$vars-setVar( 'summary', $summary );
@@ -126,7 +128,7 @@
 
// TODO: set old_content and new_content vars, use them
 
-   $vars-addHolder( AbuseFilter::getEditVars( $title, $page ) );
+   $vars-addHolders( AbuseFilter::getEditVars( $title, $page ) );
 
$filter_result = AbuseFilter::filterAction( $vars, $title );
 
@@ -243,8 +245,7 @@
$vars = new AbuseFilterVariableHolder;
 
global $wgUser;
-   $vars-addHolder(
-   AbuseFilterVariableHolder::merge(
+   $vars-addHolders( array(
AbuseFilter::generateUserVars( $wgUser ),
AbuseFilter::generateTitleVars( $oldTitle, 
'MOVED_FROM' ),
AbuseFilter::generateTitleVars( $newTitle, 
'MOVED_TO' )
@@ -271,8 +272,11 @@
$vars = new AbuseFilterVariableHolder;
 
global $wgUser;
-   $vars-addHolder( AbuseFilter::generateUserVars( $wgUser ) );
-   $vars-addHolder( AbuseFilter::generateTitleVars( 
$article-getTitle(), 'ARTICLE' ) );
+   $vars-addHolders( array(
+   AbuseFilter::generateUserVars( $wgUser ),
+   AbuseFilter::generateTitleVars( $article-getTitle(), 
'ARTICLE' )
+   ) );
+
$vars-setVar( 'SUMMARY', $reason );
$vars-setVar( 'ACTION', 'delete' );
 
@@ -303,7 +307,7 @@
// new users won't be exposed
global $wgUser;
if ( $wgUser-getId() ) {
-   $vars-addHolder( AbuseFilter::generateUserVars( 
$wgUser ) );
+   $vars-addHolders( AbuseFilter::generateUserVars( 
$wgUser ) );
}
 
$vars-setVar( 'ACTION', $autocreate ? 'autocreateaccount' : 
'createaccount' );
@@ -501,12 +505,10 @@
 
global $wgUser;
$title = Title::makeTitle( NS_FILE, $saveName );
-   $vars-addHolder(
-   AbuseFilterVariableHolder::merge(
-   

[MediaWiki-commits] [Gerrit] Watching and Unwatching made 'Change Subject' disappear. - change (mediawiki...LiquidThreads)

2013-03-02 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: Watching and Unwatching made 'Change Subject' disappear.
..

Watching and Unwatching made 'Change Subject' disappear.

instead of doing a .load() we try to cleverly build the html in client
side itself.

bug 45618

Change-Id: I78788348bf6b61cbb9e47ed3d2a2855c3ed54541
---
M lqt.js
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LiquidThreads 
refs/changes/34/51834/1

diff --git a/lqt.js b/lqt.js
index dfa164a..77955ac 100644
--- a/lqt.js
+++ b/lqt.js
@@ -790,15 +790,17 @@
// Check if we're watching or unwatching.
var action = '';
if ( button.hasClass( 'lqt-command-watch' ) ) {
-   button.removeClass( 'lqt-command-watch' );
+   button.removeClass( 'lqt-command-watch' ).addClass( 
'lqt-command-unwatch' );
+   button.find( 'a' ).attr( 'href', button.find( 'a' 
).attr( 'href' ).replace( 'watch', 'unwatch' ) ).html( mw.msg( 'unwatch' ) );
action = 'watch';
} else if ( button.hasClass( 'lqt-command-unwatch' ) ) {
-   button.removeClass( 'lqt-command-unwatch' );
+   button.removeClass( 'lqt-command-unwatch' ).addClass( 
'lqt-command-watch' );
action = 'unwatch';
+   button.find( 'a' ).attr( 'href', button.find( 'a' 
).attr( 'href' ).replace( 'unwatch', 'watch' ) ).html( mw.msg( 'watch' ) );
}
 
// Replace the watch link with a spinner
-   button.empty().addClass( 'mw-small-spinner' );
+   button.hide().after( $( 'li/' ).addClass( 'mw-small-spinner' 
) );
 
// Do the AJAX call.
var apiParams = {
@@ -814,8 +816,8 @@
 
$.post( mw.util.wikiScript( 'api' ), apiParams,
function () {
-   threadLevelCommands.load( 
window.location.href+' '+
-   
'#'+threadLevelCommands.attr('id')+'  *' );
+   button.show();
+   threadLevelCommands.find( '.mw-small-spinner' 
).remove();
}, 'json' );
 
e.preventDefault();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78788348bf6b61cbb9e47ed3d2a2855c3ed54541
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] readme should indicate dependancy - change (mediawiki...LiquidThreads)

2013-02-27 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: readme should indicate dependancy
..

readme should indicate dependancy

LT depends on WikiEditor.

Change-Id: Ic06e81a0bf6cebe428cbf3e6ab8d7576c391772e
---
M README
1 file changed, 4 insertions(+), 3 deletions(-)


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

diff --git a/README b/README
index b757fcc..b12a7da 100644
--- a/README
+++ b/README
@@ -8,9 +8,10 @@
 INSTALLATION:
 
 
-1. Rename this directory to extensions/LiquidThreads inside your
+1. This extension depends on WikiEditor, make sure you have the dependancy 
already installed.
+2. Rename this directory to extensions/LiquidThreads inside your
MediaWiki directory.
-2. Add database tables from lqt.sql using the sql.php MediaWiki tool.
+3. Add database tables from lqt.sql using the sql.php MediaWiki tool.
(On Unix, if the current directory is the MediaWiki root directory, you can
say php maintenance/sql.php extensions/LiquidThreads/lqt.sql.)
If you haven't created the AdminSettings.php file, you will have to do that
@@ -19,7 +20,7 @@
mysql -u $USER -p -e 'source lqt.sql' on Unix), but you might have to
edit it first, and replace the /*$wgDBprefix*/ and /*$wgDBTableOptions*/
strings with the corresponding settings.
-3. Add this line to the end of your LocalSettings.php:
+4. Add this line to the end of your LocalSettings.php:
require_once( $IP/extensions/LiquidThreads/LiquidThreads.php );
 
 Liquid Threads uses namespace numbers 90, 91, 92, and 93. If you are using

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic06e81a0bf6cebe428cbf3e6ab8d7576c391772e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LiquidThreads
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


[MediaWiki-commits] [Gerrit] (bug 43010) Make it explicit that the title cannot be modifi... - change (mediawiki...UploadWizard)

2013-02-26 Thread Nischayn22 (Code Review)
Nischayn22 has uploaded a new change for review.

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


Change subject: (bug 43010) Make it explicit that the title cannot be modified 
later on.
..

(bug 43010) Make it explicit that the title cannot be modified later on.

Change-Id: Ia6acd4b5118bf1a64f4248a3771b5e955c1ca6ae
---
M UploadWizard.i18n.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/37/50937/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index b04d705..6a4cab1 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -196,7 +196,7 @@
'mwe-upwiz-tooltip-source' = 'Where this digital file came from — 
could be a URL, or a book or publication.',
'mwe-upwiz-tooltip-sign' = 'You can use your wiki user name or your 
real name.
 In both cases, this will be linked to your wiki user page.',
-   'mwe-upwiz-tooltip-title' = 'A unique descriptive title for the file, 
which will serve as a filename. You may use plain language with spaces. Do not 
include the file extension.',
+   'mwe-upwiz-tooltip-title' = 'A unique descriptive title for the file, 
which will serve as a filename and cannot be modified later. You may use plain 
language with spaces. Do not include the file extension.',
'mwe-upwiz-tooltip-description' = 'Briefly describe everything notable 
about the work.
 For a photo, mention the main things that are depicted, the occasion, or the 
place.',
'mwe-upwiz-tooltip-date' = 'Date this work was created or first 
published (-MM-DD format).',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6acd4b5118bf1a64f4248a3771b5e955c1ca6ae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Nischayn22 nischay...@gmail.com

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


  1   2   3   >