Luis Felipe Schenone has submitted this change and it was merged.

Change subject: Finishing update
......................................................................


Finishing update

Change-Id: I65ce5c392a345de33d3e292f9b499e16f4fcd253
---
M MsCatSelect.body.php
M MsCatSelect.js
M MsCatSelect.php
D README.TXT
A README.md
M i18n/en.json
6 files changed, 51 insertions(+), 39 deletions(-)

Approvals:
  Luis Felipe Schenone: Verified; Looks good to me, approved



diff --git a/MsCatSelect.body.php b/MsCatSelect.body.php
index 64f9574..841a8ac 100755
--- a/MsCatSelect.body.php
+++ b/MsCatSelect.body.php
@@ -3,20 +3,20 @@
 class MsCatSelect {
 
        static function start() {
-               global $wgOut, $wgJsMimeType, $wgMSCS_MainCategories, 
$wgMSCS_UseNiceDropdown, $wgMSCS_WarnNoCategories;
+               global $wgOut, $wgMSCS_MainCategories, $wgMSCS_UseNiceDropdown, 
$wgMSCS_WarnNoCategories, $wgMSCS_WarnNoCategoriesException;
 
                // Load module
                $wgOut->addModules( 'ext.MsCatSelect' );
 
-               // Make the configuration available to JavaScript
+               // Make the configuration variables available to JavaScript
                $mscsVars = array(
                        'MainCategories' => $wgMSCS_MainCategories,
                        'UseNiceDropdown' => $wgMSCS_UseNiceDropdown,
                        'WarnNoCategories' => $wgMSCS_WarnNoCategories,
+                       'WarnNoCategoriesException' => 
$wgMSCS_WarnNoCategoriesException,
                );
                $mscsVars = json_encode( $mscsVars, true );
-               $wgOut->addScript( "<script type=\"{$wgJsMimeType}\">var 
mscsVars = $mscsVars;</script>\n" );
-
+               $wgOut->addScript( "<script>var mscsVars = $mscsVars;</script>" 
);
                return true;
        }
 
diff --git a/MsCatSelect.js b/MsCatSelect.js
index b909f39..51031be 100755
--- a/MsCatSelect.js
+++ b/MsCatSelect.js
@@ -246,7 +246,7 @@
 }
 
 function mscsCheckCategories() {
-       if ( mscsVars.WarnNoCategories === true && jQuery( '#mscs-added 
input[type="checkbox"]:checked' ).length === 0 ) {
+       if ( mscsVars.WarnNoCategories === true && jQuery( '#mscs-added 
input[type="checkbox"]:checked' ).length === 0 && jQuery.inArray( 
mw.config.get( 'wgNamespaceNumber' ), mscsVars.WarnNoCategoriesException ) === 
-1 ) {
                return confirm( mediaWiki.msg( 'mscs-warnnocat' ) );
        }
        return true;
diff --git a/MsCatSelect.php b/MsCatSelect.php
index 0825191..491ee80 100755
--- a/MsCatSelect.php
+++ b/MsCatSelect.php
@@ -3,10 +3,10 @@
 $wgExtensionCredits['parserhook'][] = array(
        'name' => 'MsCatSelect',
        'url' => 'http://www.mediawiki.org/wiki/Extension:MsCatSelect',
-       'version' => 6,
-       'license-name' => 'GPLv2+',
-       'author' => array( '[mailto:[email protected] Martin Schwindl]', 
'[https://www.mediawiki.org/wiki/User:Luis_Felipe_Schenone Luis Felipe 
Schenone]' ),
+       'version' => '6.0',
        'descriptionmsg' => 'mscs-desc',
+       'license-name' => 'GPLv2+',
+       'author' => array( '[mailto:[email protected] Martin Schwindl]', 
'[mailto:[email protected] Martin Keyler]', 
'[https://www.mediawiki.org/wiki/User:Luis_Felipe_Schenone Luis Felipe 
Schenone]' ),
 );
 
 $wgResourceModules['ext.MsCatSelect'] = array(
@@ -37,7 +37,8 @@
 $wgHooks['EditPage::showEditForm:initial'][] = 'MsCatSelect::showHook';
 $wgHooks['EditPage::attemptSave'][] = 'MsCatSelect::saveHook';
 
-//Configuration defaults
+// Default configuration
 $wgMSCS_MainCategories = null;
 $wgMSCS_UseNiceDropdown = true;
-$wgMSCS_WarnNoCategories = true;
\ No newline at end of file
+$wgMSCS_WarnNoCategories = true;
+$wgMSCS_WarnNoCategoriesException = array();
\ No newline at end of file
diff --git a/README.TXT b/README.TXT
deleted file mode 100755
index 6bf36ef..0000000
--- a/README.TXT
+++ /dev/null
@@ -1,28 +0,0 @@
-############################################################
-#
-# Author: Martin Schwindl, [email protected]
-#
-# Updated, debugged and normalised by Luis Felipe Schenone 
([email protected]) in 2014
-#
-# Some icons by Yusuke Kamiyamane. All rights reserved. Licensed under a 
Creative Commons Attribution 3.0 License.
-# http://p.yusukekamiyamane.com
-# 
-# Chosen, a Select Box Enhancer for jQuery and Protoype
-# by Patrick Filler for Harvest
-# Available for use under the MIT License
-# Copyright (c) 2011-2013 by Harvest
-# Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:
-# The above copyright notice and this permission notice shall be included in 
all copies or substantial portions of the Software.
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
-# http://harvesthq.github.com/chosen/
-#
-# To install, add the following to your LocalSettings.php:
-#
-# #Start------------------------MsCatSelect
-# require_once "$IP/extensions/MsCatSelect/MsCatSelect.php";
-# $wgMSCS_WarnNoCategories = false; //Default 'true'
-# $wgMSCS_MainCategories = array( 'Category1', 'Category2' ); //Defaults 'null'
-# $wgGroupPermissions['*']['apihighlimits'] = true; //Regular users will only 
be shown 500 subcategories by default, with this switch enabled all 
subcategories will be shown.
-# #End--------------------------MsCatSelect
-#
-############################################################
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100755
index 0000000..7738d50
--- /dev/null
+++ b/README.md
@@ -0,0 +1,39 @@
+MsCatSelect
+===========
+MsCatSelect is a MediaWiki extension that provides a visual interface to the 
edit form for adding or removing categories to a page.
+
+Installation
+------------
+To install MsCatSelect, add the following to your LocalSettings.php:
+
+require_once "$IP/extensions/MsCatSelect/MsCatSelect.php";
+
+Usage
+-----
+Once the extension is installed, edit a page and scroll to the bottom to see 
the visual interface for adding or removing categories. Select the categories 
you want from the dropdown menus and save the changes to add the page to those 
categories.
+
+Configuration
+-------------
+$wgMSCS_WarnNoCategories = false; // Defaults to 'true'
+
+$wgMSCS_WarnNoCategoriesException = array( NS_TALK, NS_FILE, NS_FILE_TALK ); 
// Defaults to an empty array
+
+$wgMSCS_MainCategories = array( 'Category1', 'Category2' ); // Defaults to 
'null'
+
+$wgGroupPermissions['*']['apihighlimits'] = true; // By default, regular users 
will be shown a maximum of 500 subcategories. With this set to true, all 
subcategories will be shown.
+
+Credits
+-------
+* Developed and coded by Martin Schwindl ([email protected])
+* Idea, project management and bug fixing by Martin Keyler 
([email protected])
+* Updated, debugged and enhanced by Luis Felipe Schenone ([email protected])
+* Some icons by Yusuke Kamiyamane (http://p.yusukekamiyamane.com). All rights 
reserved. Licensed under a Creative Commons Attribution 3.0 License.
+
+Chosen, a Select Box Enhancer for jQuery and Protoype
+by Patrick Filler for Harvest
+Available for use under the MIT License
+Copyright (c) 2011-2013 by Harvest
+Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
+http://harvesthq.github.com/chosen/
\ No newline at end of file
diff --git a/i18n/en.json b/i18n/en.json
index 92d2360..09d1739 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -5,7 +5,7 @@
                        "Kghbln\r"
                ]
        },
-       "mscs-desc": "Allows  to add a page to an existing or newly creatable 
category via a drop-down list",
+       "mscs-desc": "Allows to add a page to an existing or newly creatable 
category via a drop-down list",
        "mscs-title": "Main Category",
        "mscs-untercat": "New subcategory",
        "mscs-untercat-hinw": "will be created in the category selected above",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I65ce5c392a345de33d3e292f9b499e16f4fcd253
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MsCatSelect
Gerrit-Branch: master
Gerrit-Owner: Luis Felipe Schenone <[email protected]>
Gerrit-Reviewer: Luis Felipe Schenone <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to