Siebrand has submitted this change and it was merged.

Change subject: Convert i18n to JSON
......................................................................


Convert i18n to JSON

* Remove "translations" which are identical to English
* TODO: Please add message documentation
* Convert line ending to UNIX format

Change-Id: I8c9eb5669727fce860a0e6fa23a081a1599da1ca
---
M README.TXT
M css/mscatselect.css
A i18n/cs.json
A i18n/de.json
A i18n/en.json
A i18n/es.json
A i18n/nl.json
M js/mscatselect.js
M mscatselect.body.php
M mscatselect.i18n.php
M mscatselect.php
11 files changed, 766 insertions(+), 743 deletions(-)

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



diff --git a/README.TXT b/README.TXT
index 4e07d44..8800d95 100644
--- a/README.TXT
+++ b/README.TXT
@@ -1,30 +1,30 @@
-############################################################
-#Author:
-#Martin Schwindl, [email protected]
-#
-#Icons: 
-#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/
-#
-#Usage:
-#LocalSettings.php:
-#
-#//Start------------------------MsCatSelect
-#$wgMSCS_WarnNoCat = false;
-#$wgMSCS_MaxSubcategories = 500;
-#$wgMSCS_MainCategories = array("Category1","Category2");
-#require_once("$IP/extensions/MsCatSelect/mscatselect.php");
-#//End--------------------------MsCatSelect
-#
-#
-#
+############################################################
+#Author:
+#Martin Schwindl, [email protected]
+#
+#Icons: 
+#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/
+#
+#Usage:
+#LocalSettings.php:
+#
+#//Start------------------------MsCatSelect
+#$wgMSCS_WarnNoCat = false;
+#$wgMSCS_MaxSubcategories = 500;
+#$wgMSCS_MainCategories = array("Category1","Category2");
+#require_once("$IP/extensions/MsCatSelect/mscatselect.php");
+#//End--------------------------MsCatSelect
+#
+#
+#
 ############################################################
\ No newline at end of file
diff --git a/css/mscatselect.css b/css/mscatselect.css
index e2bc988..db8257d 100644
--- a/css/mscatselect.css
+++ b/css/mscatselect.css
@@ -1,144 +1,144 @@
-#MsCatSelect{
-    width: 98%;
-    padding: .5em;
-    background: #ddd;
-    margin: 5px 0px;
-    clear:both;
-}
-
-#MsCatSelect div.row{
-       vertical-align:middle;
-       padding:5px;
-}
-
-#MsCatSelect .row2{
-       clear:both;     
-}
-
-
-#MsCatSelect .row1 .subcat{
-       float:left;
-}
-
-#MsCatSelect .label{   
-       font-weight:bold;
-       margin-right:10px;
-}
-
-#MsCatSelect .maincat{
-       float:left;
-}
-
-#MsCatSelect .chzn-container{
-       float:left;
-}
-
-#MsCatSelect .row1 select{
-       float:left;
-}
-
-#MsCatSelect .chzn-container-single .chzn-single span{
-       text-overflow: clip;
-}
-
-#MsCatSelect .addcat {
-       
-       background: #d8d8d8; /* Old browsers */
-       background: -moz-linear-gradient(top,  #d8d8d8 20%, #d3d3d3 50%, 
#bfbfbf 52%, #cecece 100%); /* FF3.6+ */
-       background: -webkit-gradient(linear, left top, left bottom, 
color-stop(20%,#d8d8d8), color-stop(50%,#d3d3d3), color-stop(52%,#bfbfbf), 
color-stop(100%,#cecece)); /* Chrome,Safari4+ */
-       background: -webkit-linear-gradient(top,  #d8d8d8 20%,#d3d3d3 
50%,#bfbfbf 52%,#cecece 100%); /* Chrome10+,Safari5.1+ */
-       background: -o-linear-gradient(top,  #d8d8d8 20%,#d3d3d3 50%,#bfbfbf 
52%,#cecece 100%); /* Opera 11.10+ */
-       background: -ms-linear-gradient(top,  #d8d8d8 20%,#d3d3d3 50%,#bfbfbf 
52%,#cecece 100%); /* IE10+ */
-       background: linear-gradient(to bottom,  #d8d8d8 20%,#d3d3d3 50%,#bfbfbf 
52%,#cecece 100%); /* W3C */
-       filter: progid:DXImageTransform.Microsoft.gradient( 
startColorstr='#d8d8d8', endColorstr='#cecece',GradientType=0 ); /* IE6-9 */
-  -webkit-border-radius: 5px;
-  -moz-border-radius   : 5px;
-  border-radius        : 5px;
-  -moz-background-clip   : padding;
-  -webkit-background-clip: padding-box;
-  background-clip        : padding-box;
-  border: 1px solid #aaaaaa;
-  -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
-  -moz-box-shadow   : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
-  box-shadow        : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
-  display: inline-block;
-  position: relative;
-  height: 20px;
-  line-height: 22px;
-  padding: 1px 8px 2px 8px;
-  color: #444444;
-  text-decoration: none;
-  margin-left:10px;
-  cursor: pointer;
-
-}
-
-#MsCatSelect .row1 .addcat{
-       float:left;
-}
-
-#MsCatSelect .addcat:hover {
-       color: #000000;
-       border: 1px solid #5897FB;
-}
-
-#MsCatSelect .node, #MsCatSelect .no-node{     
-       background: url('../img/node.png') no-repeat 8px 5px;
-       padding:12px 15px;
-       float:left;
-}
-
-#MsCatSelect .no-node{ 
-       background: url('../img/node-no.png') no-repeat 8px 5px;
-}
-
-#MsCatSelect .subcat_dd select{        
-   background: transparent;
-   border: 0;
-}
-
-#MsCatSelect .row2 input{
-       padding: 3px;  
-    outline: none;  
-    background: #eeeeee; /* Old browsers */
-       background: -moz-linear-gradient(top, #eeeeee 0%, #ffffff 23%); /* 
FF3.6+ */
-       background: -webkit-gradient(linear, left top, left bottom, 
color-stop(0%,#eeeeee), color-stop(23%,#ffffff)); /* Chrome,Safari4+ */
-       background: -webkit-linear-gradient(top, #eeeeee 0%,#ffffff 23%); /* 
Chrome10+,Safari5.1+ */
-       background: -o-linear-gradient(top, #eeeeee 0%,#ffffff 23%); /* Opera 
11.10+ */
-       background: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 23%); /* IE10+ 
*/
-       background: linear-gradient(to bottom, #eeeeee 0%,#ffffff 23%); /* W3C 
*/
-       filter: progid:DXImageTransform.Microsoft.gradient( 
startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
-    -webkit-border-radius: 3px;  
-    -moz-border-radius: 3px;  
-    border-radius: 3px;  
-    border: 1px solid #aaaaaa;  
-    
-}
-
-
-#MsCatSelect .untercat_hinw{
-       margin-left: 10px;
-       color:#aaaaaa;
-}
-
-#MsCatSelect .row3 .label{
-       margin-bottom:8px;
-       display: block;
-}
-
-#WarnNoCat{
-    padding: .5em 0em;
-    color: red;
-    font-size:1.35em;
-}
-
-#MsCatSelect #mscs_added .img_sortkey{
-       background: url('../img/sortkey.png') no-repeat 0px 0px;
-       height: 5px;
-       width:10px;
-       padding: 0px 6px 0px 6px;
-       position:relative; 
-       left:4px;
-       cursor: pointer;
-}
-
+#MsCatSelect{
+    width: 98%;
+    padding: .5em;
+    background: #ddd;
+    margin: 5px 0px;
+    clear:both;
+}
+
+#MsCatSelect div.row{
+       vertical-align:middle;
+       padding:5px;
+}
+
+#MsCatSelect .row2{
+       clear:both;     
+}
+
+
+#MsCatSelect .row1 .subcat{
+       float:left;
+}
+
+#MsCatSelect .label{   
+       font-weight:bold;
+       margin-right:10px;
+}
+
+#MsCatSelect .maincat{
+       float:left;
+}
+
+#MsCatSelect .chzn-container{
+       float:left;
+}
+
+#MsCatSelect .row1 select{
+       float:left;
+}
+
+#MsCatSelect .chzn-container-single .chzn-single span{
+       text-overflow: clip;
+}
+
+#MsCatSelect .addcat {
+       
+       background: #d8d8d8; /* Old browsers */
+       background: -moz-linear-gradient(top,  #d8d8d8 20%, #d3d3d3 50%, 
#bfbfbf 52%, #cecece 100%); /* FF3.6+ */
+       background: -webkit-gradient(linear, left top, left bottom, 
color-stop(20%,#d8d8d8), color-stop(50%,#d3d3d3), color-stop(52%,#bfbfbf), 
color-stop(100%,#cecece)); /* Chrome,Safari4+ */
+       background: -webkit-linear-gradient(top,  #d8d8d8 20%,#d3d3d3 
50%,#bfbfbf 52%,#cecece 100%); /* Chrome10+,Safari5.1+ */
+       background: -o-linear-gradient(top,  #d8d8d8 20%,#d3d3d3 50%,#bfbfbf 
52%,#cecece 100%); /* Opera 11.10+ */
+       background: -ms-linear-gradient(top,  #d8d8d8 20%,#d3d3d3 50%,#bfbfbf 
52%,#cecece 100%); /* IE10+ */
+       background: linear-gradient(to bottom,  #d8d8d8 20%,#d3d3d3 50%,#bfbfbf 
52%,#cecece 100%); /* W3C */
+       filter: progid:DXImageTransform.Microsoft.gradient( 
startColorstr='#d8d8d8', endColorstr='#cecece',GradientType=0 ); /* IE6-9 */
+  -webkit-border-radius: 5px;
+  -moz-border-radius   : 5px;
+  border-radius        : 5px;
+  -moz-background-clip   : padding;
+  -webkit-background-clip: padding-box;
+  background-clip        : padding-box;
+  border: 1px solid #aaaaaa;
+  -webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
+  -moz-box-shadow   : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
+  box-shadow        : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
+  display: inline-block;
+  position: relative;
+  height: 20px;
+  line-height: 22px;
+  padding: 1px 8px 2px 8px;
+  color: #444444;
+  text-decoration: none;
+  margin-left:10px;
+  cursor: pointer;
+
+}
+
+#MsCatSelect .row1 .addcat{
+       float:left;
+}
+
+#MsCatSelect .addcat:hover {
+       color: #000000;
+       border: 1px solid #5897FB;
+}
+
+#MsCatSelect .node, #MsCatSelect .no-node{     
+       background: url('../img/node.png') no-repeat 8px 5px;
+       padding:12px 15px;
+       float:left;
+}
+
+#MsCatSelect .no-node{ 
+       background: url('../img/node-no.png') no-repeat 8px 5px;
+}
+
+#MsCatSelect .subcat_dd select{        
+   background: transparent;
+   border: 0;
+}
+
+#MsCatSelect .row2 input{
+       padding: 3px;  
+    outline: none;  
+    background: #eeeeee; /* Old browsers */
+       background: -moz-linear-gradient(top, #eeeeee 0%, #ffffff 23%); /* 
FF3.6+ */
+       background: -webkit-gradient(linear, left top, left bottom, 
color-stop(0%,#eeeeee), color-stop(23%,#ffffff)); /* Chrome,Safari4+ */
+       background: -webkit-linear-gradient(top, #eeeeee 0%,#ffffff 23%); /* 
Chrome10+,Safari5.1+ */
+       background: -o-linear-gradient(top, #eeeeee 0%,#ffffff 23%); /* Opera 
11.10+ */
+       background: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 23%); /* IE10+ 
*/
+       background: linear-gradient(to bottom, #eeeeee 0%,#ffffff 23%); /* W3C 
*/
+       filter: progid:DXImageTransform.Microsoft.gradient( 
startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
+    -webkit-border-radius: 3px;  
+    -moz-border-radius: 3px;  
+    border-radius: 3px;  
+    border: 1px solid #aaaaaa;  
+    
+}
+
+
+#MsCatSelect .untercat_hinw{
+       margin-left: 10px;
+       color:#aaaaaa;
+}
+
+#MsCatSelect .row3 .label{
+       margin-bottom:8px;
+       display: block;
+}
+
+#WarnNoCat{
+    padding: .5em 0em;
+    color: red;
+    font-size:1.35em;
+}
+
+#MsCatSelect #mscs_added .img_sortkey{
+       background: url('../img/sortkey.png') no-repeat 0px 0px;
+       height: 5px;
+       width:10px;
+       padding: 0px 6px 0px 6px;
+       position:relative; 
+       left:4px;
+       cursor: pointer;
+}
+
diff --git a/i18n/cs.json b/i18n/cs.json
new file mode 100644
index 0000000..95aa64c
--- /dev/null
+++ b/i18n/cs.json
@@ -0,0 +1,14 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Neřeknu   <[email protected]>"
+               ]
+       },
+       "mscs-title": "Hlavní kategorie",
+       "mscs-untercat": "Nová podkategorie",
+       "mscs-untercat-hinw": "bude vytvořena ve výše uvedené kategorii",
+       "mscs-warnnocat": "UPOZORNĚNÍ: Tato stránka není zařazena do žádné 
kategorie. Prosím zvolte nějakou kategorii!",
+       "mscs-cats": "Již přiřazené kategorie",
+       "mscs-add": "přidat",
+       "mscs-go": "vytvořit"
+}
diff --git a/i18n/de.json b/i18n/de.json
new file mode 100644
index 0000000..87f7788
--- /dev/null
+++ b/i18n/de.json
@@ -0,0 +1,18 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Martin Schwindl  <[email protected]>",
+                       "Kghbln"
+               ]
+       },
+       "mscs-desc": "Ermöglicht das Zuweisen einer Seite zu einer bestehenden 
oder neu erstellbaren Kategorie über ein Dropdown-Listenfeld",
+       "mscs-title": "Oberkategorie auswählen:",
+       "mscs-untercat": "Neue Unterkategorie:",
+       "mscs-untercat-hinw": "wird in vorrausgewählter Oberkategorie erstellt",
+       "mscs-warnnocat": "VORSICHT: Diese Seite enthält noch keine Kategorie. 
Bitte fügen Sie zuerst eine Kategorie hinzu!",
+       "mscs-cats": "Bereits vergebene Kategorien:",
+       "mscs-add": "hinzufügen",
+       "mscs-go": "erstellen",
+       "mscs-created": "Neue Kategorie erfolgreich erstellt",
+       "mscs-sortkey": "Hier bitte den Sortierschlüssel eingeben. Der 
Sortierschlüssel ist für die Sortierung in der Kategorieübersicht relevant."
+}
diff --git a/i18n/en.json b/i18n/en.json
new file mode 100644
index 0000000..b2fbcd2
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,18 @@
+{
+       "@metadata": {
+               "authors": [
+                       "GabMaster",
+                       "Kghbln"
+               ]
+       },
+       "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",
+       "mscs-warnnocat": "WARNING: This page does not belong to any category. 
Please select a category.',
+       "mscs-cats": "Assigned categories",
+       "mscs-add": "Add",
+       "mscs-go": "Create",
+       "mscs-created": "New category successfully created",
+       "mscs-sortkey": "Please add the default sortkey here. It is used for 
sorting within the category overview pages."
+}
diff --git a/i18n/es.json b/i18n/es.json
new file mode 100644
index 0000000..18e64f5
--- /dev/null
+++ b/i18n/es.json
@@ -0,0 +1,17 @@
+{
+       "@metadata": {
+               "authors": [
+                       "Ángel J. Vico"
+               ]
+       },
+       "mscs-desc": "Esta extensión permite asignar categorías y subcategorías 
a una página escogiéndolas de una lista desplegable. También permite crear 
nuevas categorías desde la página de edición.",
+       "mscs-title": "Categoría principal",
+       "mscs-untercat": "Nueva subcategoría",
+       "mscs-untercat-hinw": "se creará en la categoría seleccionada arriba",
+       "mscs-warnnocat": "ADVERTENCIA: Esta página no pertenece a ninguna 
categoría. Por favor, seleccione una categoría.",
+       "mscs-cats": "Categorías asignadas",
+       "mscs-add": "Agregar",
+       "mscs-go": "Crear",
+       "mscs-created": "Nueva categoría creada con éxito",
+       "mscs-sortkey": "Por favor introduce el criterio de ordenación. La 
clave de ordenación se utiliza para clasificar el contenido de la categoría."
+}
diff --git a/i18n/nl.json b/i18n/nl.json
new file mode 100644
index 0000000..4deac96
--- /dev/null
+++ b/i18n/nl.json
@@ -0,0 +1,14 @@
+{
+       "@metadata": {
+               "authors": [
+                       "hrh"
+               ]
+       },
+       "mscs-title": "Categorie",
+       "mscs-untercat": "Nieuwe subcategorie",
+       "mscs-untercat-hinw": "Nieuwe categorie wordt aangemaakt in 
bovenstaande categorie, tenzij --- is geselecteerd",
+       "selectcategory-warnnocat": "Deze pagina heeft nog geen categorie. 
Definieer een nieuwe of bestaande categorie.",
+       "mscs-cats": "Toegewezen categorieën",
+       "mscs-add": "Toevoegen",
+       "mscs-go": "Aanmaken"
+}
diff --git a/js/mscatselect.js b/js/mscatselect.js
index 33d2fd3..9a56a17 100644
--- a/js/mscatselect.js
+++ b/js/mscatselect.js
@@ -1,307 +1,307 @@
-var selected_cat = '';
-var latest_dd = '';
-var chosen_dd = true;
-
-$(document).ready(function () {
-       chosen_dd = true ? mscs_vars.UseNiceDropdown : false;
-       if ($.browser.msie && parseInt($.browser.version) < 10) { chosen_dd = 
false; }
-       mscs_create_area();
-});
-
-function mscs_create_area(){
-       
-       var mscs_div = 
$(document.createElement("div")).attr('id','MsCatSelect').insertBefore('.editButtons');
 
-       
-       var row1 = $(document.createElement("div")).attr('class','row 
row1').appendTo(mscs_div);
-       var row2 = $(document.createElement("div")).attr('class','row 
row2').appendTo(mscs_div);
-       var row3 = $(document.createElement("div")).attr('class','row 
row3').appendTo(mscs_div);
-       
-       $(document.createElement("span")).attr('class','label 
maincat').text(mw.msg('mscs-title')).appendTo(row1);
-       
-       dd = mscs_create_dd("",0).appendTo(row1);
-       
-       if(mscs_vars.MainCategories != null && chosen_dd){
-               $('#mscs_dd_0').chosen();
-               //$(".chzn-container").css("width", "+=10");    
-        //$(".chzn-drop").css("width", "+=10");
-       }
-       
-       
$(document.createElement("div")).attr('id','mscs_subcat_0').attr('class','subcat').appendTo(row1);
-
-       
$(document.createElement("div")).attr('id','mscs_add').attr('class','addcat').click(function(e){
-               mscs_add_cat(selected_cat,'');
-       }).text(mw.msg('mscs-add')).appendTo(row1);
-       
-       
$(document.createElement("span")).attr('class','label').text(mw.msg('mscs-untercat')).appendTo(row2);
-       var new_cat_input = 
$(document.createElement("input")).attr('class','input').attr('type','text').attr('id','new_cat_input').attr('size','30').appendTo(row2);
-       
$(document.createElement("div")).attr('id','mscs_add_untercat').attr('class','addcat').click(function(e){
-
-               mscs_create_new_cat(new_cat_input.val(),selected_cat);
-               
-       }).text(mw.msg('mscs-go')).appendTo(row2);
-       
-       
$(document.createElement("span")).attr('class','untercat_hinw').text('('+mw.msg('mscs-untercat-hinw')+')').appendTo(row2);
-       
-       
-       
$(document.createElement("span")).attr('class','label').text(mw.msg('mscs-cats')).appendTo(row3);
 
-       $(document.createElement("div")).attr('id','mscs_added').appendTo(row3);
-       
-       mscs_get_pagecats(mw.config.get('wgArticleId'));
-}
-
-function mscs_create_dd(maincat,ebene){
-
-       var dd = 
$(document.createElement("select")).attr('id','mscs_dd_'+ebene).change(function 
() {
-               
-               latest_dd = ebene;
-               container = $('#mscs_subcat_'+ebene).empty();
-               
-               if($(this).val() != 0) { //not ---
-                       selected_cat = $("option:selected",this).text();
-                       mscs_get_subcats(selected_cat,ebene,container);
-               } else if (ebene==0) { //--- and nothing
-                       selected_cat = ''; //zuruecksetzen
-               } else { //---
-                       selected_cat = $("#MsCatSelect 
option:selected:eq("+(ebene-1)+")").text();
-                       //console.log(selected_cat);
-               }
-       });
-
-       $("<option />", {value: '0', text: '---'}).appendTo(dd);
-       
-       if(ebene == 0 && maincat == ""){ //first dd
-               if(mscs_vars.MainCategories == null){
-                       mscs_get_uncategorizedcats(dd);         
-               } else {
-                       $.each(mscs_vars.MainCategories, function(dd_index, 
dd_value) {
-                       $("<option />", {value: dd_index+1, text: 
dd_value}).appendTo(dd);
-                       });
-               }
-       }       
-       return dd;
-}
-
-function mscs_add_cat(new_cat,new_sortkey){
-       
-       if(new_cat != '' && $("#mscs_added 
.mscs_entry[category='"+new_cat+"']").length == 0){ //new cat
-               
-               if(new_sortkey == ''){new_sortkey = wgTitle} //standard sortkey 
is the pagetitle
-                       
-        var entry = $(document.createElement("div")).attr({
-          'class':'mscs_entry',
-          category:new_cat,
-          sortkey:new_sortkey,
-        }).text(new_cat).appendTo($("#mscs_added"));   
-        
-        $(document.createElement("input")).attr({
-          'class':'mscs_checkbox',
-          type:'checkbox',
-          name:'SelectCategoryList[]',
-          value:new_cat+'|'+new_sortkey,
-          'checked': true
-        }).prependTo(entry);
-       
-               
$(document.createElement("span")).attr("class","img_sortkey").attr("title",new_sortkey).click(function(e)
 { //click
-                                       
-                       userInput = 
prompt(unescape(mw.msg('mscs-sortkey')),$(this).attr("title"));
-                   if (userInput != '' && userInput != null && userInput!= 
new_sortkey) {
-                            sortkey = userInput;
-                            console.log(sortkey);
-                            entry.attr("sortkey",sortkey);
-                            
entry.children('.mscs_checkbox').attr("value",new_cat+'|'+sortkey); 
-                            $(this).attr("title",sortkey);
-                   }                   
-           }).appendTo(entry);
-        
-        
-       }
-}
-
-function mscs_get_pagecats(pageId){
-       
-       //api.php?action=query&titles=Albert%20Einstein&prop=categories
-       $.ajax({
-        url: mw.util.wikiScript( 'api' ),
-        data: {
-                       format: 'json',
-            action: 'query',
-            titles: mw.config.get('wgPageName'),
-            prop: 'categories',
-            clprop: 'sortkey',
-            cllimit: 500
-        },
-        dataType: 'json',
-        type: 'GET',
-        success: function( data ) {
-            if ( data && data.query && data.query.pages && 
data.query.pages[pageId]) {
-                // ... success ...
-                if(data.query.pages[pageId].categories){
-                //console.log(data.query.pages[pageId].categories[0].title);
-                $.each(data.query.pages[pageId].categories, 
function(index,value){
-                       
-                       titles = value.title.split(":",2);
-                       mscs_add_cat(titles[1],value.sortkeyprefix);
-                       
-                });
-                } else {console.log( 'No Subcats' );}
-                
-            } else if ( data && data.error ) {
-                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
-            } else {
-                console.log( 'Error: Unknown result from API.' );
-            }
-        },
-        error: function( xhr ) {
-            console.log('Error');
-        }
-    });
-       
-       return true;
-}
-
-function mscs_get_uncategorizedcats(dd){
-       
-       $.ajax({
-        url: mw.util.wikiScript( 'api' ),
-        data: {
-                       format: 'json',
-            action: 'query',
-            list: 'querypage',
-            qppage: 'Uncategorizedcategories',
-            qplimit: '500',
-        },
-        dataType: 'json',
-        type: 'GET',
-        success: function( data ) {
-            if ( data && data.query && data.query.querypage ) {
-                // ... success ...
-                $.each(data.query.querypage.results, function(index,val){
-                       $("<option />", {value: index+1, text: 
val.value.replace(/_/g," ")}).appendTo(dd);
-                });
-                               if (chosen_dd){
-                                       dd.chosen({disable_search_threshold: 
6});
-                               $("#mscs_dd_0_chzn").width(dd.width()+20);      
-                               }  
-            } else if ( data && data.error ) {
-                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
-            } else {
-                console.log( 'Error: Unknown result from API.' );
-            }
-        },
-        error: function( xhr ) {
-            console.log('Error');
-        }
-    });
-       
-       return true;
-
-}
-
-function mscs_get_subcats(maincat,ebene,container){
-       
-       $.ajax({
-        url: mw.util.wikiScript( 'api' ),
-        data: {
-                       format: 'json',
-            action: 'query',
-            list: 'categorymembers',
-            cmtitle: 'Category:' + maincat,
-            cmtype: 'subcat',
-            cmlimit: mscs_vars.MaxSubcategories
-        },
-        dataType: 'json',
-        type: 'GET',
-        success: function( data ) {
-            if ( data && data.query && data.query.categorymembers ) {
-                // ... success ...
-                if(data.query.categorymembers.length > 0){
-                       //console.log(data.query.categorymembers.length);
-                       
$(document.createElement("div")).attr('class','node').prependTo(container);
-                                       dd = 
mscs_create_dd(selected_cat,ebene+1).appendTo(container);
-                                       
$(document.createElement("div")).attr('id','mscs_subcat_'+(ebene+1)).attr('class','subcat').appendTo(container);
-               
-                       $.each(data.query.categorymembers, function(index,val){
-                               list_element = val.title.split(":",2);
-                               $("<option />", {value: index+1, text: 
list_element[1]}).appendTo(dd);
-                       });
-                       if(chosen_dd){
-                               dd.chosen({disable_search_threshold: 6});
-                               
$("#mscs_dd_"+(ebene+1)+"_chzn").width(dd.width()+20);  
-                       }
-               } else { //no subcats
-                               
$(document.createElement("div")).attr('class','no-node').prependTo($('#mscs_subcat_'+ebene));
-               }
-                
-            } else if ( data && data.error ) {
-                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
-            } else {
-                console.log( 'Error: Unknown result from API.' );
-            }
-        },
-        error: function( xhr ) {
-            console.log('Error');
-        }
-    });
-       
-       return true;
-}
-
-
-function mscs_create_new_cat(new_cat,old_cat){
-       
-       if(old_cat == ""){
-               cat_content = "";
-       } else {
-               cat_content = 
"[["+mw.config.get('wgFormattedNamespaces')[14]+":"+old_cat+"]]";
-       }
-       
-       cat_title = mw.config.get('wgFormattedNamespaces')[14]+":"+new_cat;
-       
-       $.ajax({
-        url: mw.util.wikiScript( 'api' ),
-        data: {
-            format: 'json',
-            action: 'edit',
-            title: cat_title,
-            section: 'new',
-            //summary: 'MsCatSelect',
-            text: cat_content,
-            token: mw.user.tokens.get( 'editToken' ),
-            createonly: true
-        },
-        dataType: 'json',
-        type: 'POST',
-        success: function( data ) {
-            if ( data && data.edit && data.edit.result == 'Success' ) {
-                //console.log(data.edit.result);
-                alert(mw.msg('mscs-created'));
-                $('#MsCatSelect #new_cat_input').val('');
-                
-                created_cat = data.edit.title.split(":",2); //mw macht ersten 
Buchstaben groß
-                //console.log(latest_dd);
-                var dd_next = $('#mscs_dd_'+(latest_dd+1));
-                
-                $("<option />", {value: 99, text: 
created_cat[1]}).appendTo(dd_next);
-                $('#mscs_subcat_'+latest_dd+' .node').removeClass('no-node');
-                if(chosen_dd){
-                       dd_next.chosen(); //wenn dropdown noch nicht existiert
-                       dd_next.trigger("liszt:updated");
-                }
-                mscs_add_cat(created_cat[1],"");
-            } else if ( data && data.error ) {
-                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
-                if(data.error.code == "articleexists"){
-                       alert(data.error.info);
-                       $('#MsCatSelect #new_cat_input').val('');
-                }
-            } else {
-                console.log( 'Error: Unknown result from API.' );
-            }
-        },
-        error: function( xhr ) {
-            console.log( 'Error: Request failed.' );
-        }
-    });
-       
-       
+var selected_cat = '';
+var latest_dd = '';
+var chosen_dd = true;
+
+$(document).ready(function () {
+       chosen_dd = true ? mscs_vars.UseNiceDropdown : false;
+       if ($.browser.msie && parseInt($.browser.version) < 10) { chosen_dd = 
false; }
+       mscs_create_area();
+});
+
+function mscs_create_area(){
+       
+       var mscs_div = 
$(document.createElement("div")).attr('id','MsCatSelect').insertBefore('.editButtons');
 
+       
+       var row1 = $(document.createElement("div")).attr('class','row 
row1').appendTo(mscs_div);
+       var row2 = $(document.createElement("div")).attr('class','row 
row2').appendTo(mscs_div);
+       var row3 = $(document.createElement("div")).attr('class','row 
row3').appendTo(mscs_div);
+       
+       $(document.createElement("span")).attr('class','label 
maincat').text(mw.msg('mscs-title')).appendTo(row1);
+       
+       dd = mscs_create_dd("",0).appendTo(row1);
+       
+       if(mscs_vars.MainCategories != null && chosen_dd){
+               $('#mscs_dd_0').chosen();
+               //$(".chzn-container").css("width", "+=10");    
+        //$(".chzn-drop").css("width", "+=10");
+       }
+       
+       
$(document.createElement("div")).attr('id','mscs_subcat_0').attr('class','subcat').appendTo(row1);
+
+       
$(document.createElement("div")).attr('id','mscs_add').attr('class','addcat').click(function(e){
+               mscs_add_cat(selected_cat,'');
+       }).text(mw.msg('mscs-add')).appendTo(row1);
+       
+       
$(document.createElement("span")).attr('class','label').text(mw.msg('mscs-untercat')).appendTo(row2);
+       var new_cat_input = 
$(document.createElement("input")).attr('class','input').attr('type','text').attr('id','new_cat_input').attr('size','30').appendTo(row2);
+       
$(document.createElement("div")).attr('id','mscs_add_untercat').attr('class','addcat').click(function(e){
+
+               mscs_create_new_cat(new_cat_input.val(),selected_cat);
+               
+       }).text(mw.msg('mscs-go')).appendTo(row2);
+       
+       
$(document.createElement("span")).attr('class','untercat_hinw').text('('+mw.msg('mscs-untercat-hinw')+')').appendTo(row2);
+       
+       
+       
$(document.createElement("span")).attr('class','label').text(mw.msg('mscs-cats')).appendTo(row3);
 
+       $(document.createElement("div")).attr('id','mscs_added').appendTo(row3);
+       
+       mscs_get_pagecats(mw.config.get('wgArticleId'));
+}
+
+function mscs_create_dd(maincat,ebene){
+
+       var dd = 
$(document.createElement("select")).attr('id','mscs_dd_'+ebene).change(function 
() {
+               
+               latest_dd = ebene;
+               container = $('#mscs_subcat_'+ebene).empty();
+               
+               if($(this).val() != 0) { //not ---
+                       selected_cat = $("option:selected",this).text();
+                       mscs_get_subcats(selected_cat,ebene,container);
+               } else if (ebene==0) { //--- and nothing
+                       selected_cat = ''; //zuruecksetzen
+               } else { //---
+                       selected_cat = $("#MsCatSelect 
option:selected:eq("+(ebene-1)+")").text();
+                       //console.log(selected_cat);
+               }
+       });
+
+       $("<option />", {value: '0', text: '---'}).appendTo(dd);
+       
+       if(ebene == 0 && maincat == ""){ //first dd
+               if(mscs_vars.MainCategories == null){
+                       mscs_get_uncategorizedcats(dd);         
+               } else {
+                       $.each(mscs_vars.MainCategories, function(dd_index, 
dd_value) {
+                       $("<option />", {value: dd_index+1, text: 
dd_value}).appendTo(dd);
+                       });
+               }
+       }       
+       return dd;
+}
+
+function mscs_add_cat(new_cat,new_sortkey){
+       
+       if(new_cat != '' && $("#mscs_added 
.mscs_entry[category='"+new_cat+"']").length == 0){ //new cat
+               
+               if(new_sortkey == ''){new_sortkey = wgTitle} //standard sortkey 
is the pagetitle
+                       
+        var entry = $(document.createElement("div")).attr({
+          'class':'mscs_entry',
+          category:new_cat,
+          sortkey:new_sortkey,
+        }).text(new_cat).appendTo($("#mscs_added"));   
+        
+        $(document.createElement("input")).attr({
+          'class':'mscs_checkbox',
+          type:'checkbox',
+          name:'SelectCategoryList[]',
+          value:new_cat+'|'+new_sortkey,
+          'checked': true
+        }).prependTo(entry);
+       
+               
$(document.createElement("span")).attr("class","img_sortkey").attr("title",new_sortkey).click(function(e)
 { //click
+                                       
+                       userInput = 
prompt(unescape(mw.msg('mscs-sortkey')),$(this).attr("title"));
+                   if (userInput != '' && userInput != null && userInput!= 
new_sortkey) {
+                            sortkey = userInput;
+                            console.log(sortkey);
+                            entry.attr("sortkey",sortkey);
+                            
entry.children('.mscs_checkbox').attr("value",new_cat+'|'+sortkey); 
+                            $(this).attr("title",sortkey);
+                   }                   
+           }).appendTo(entry);
+        
+        
+       }
+}
+
+function mscs_get_pagecats(pageId){
+       
+       //api.php?action=query&titles=Albert%20Einstein&prop=categories
+       $.ajax({
+        url: mw.util.wikiScript( 'api' ),
+        data: {
+                       format: 'json',
+            action: 'query',
+            titles: mw.config.get('wgPageName'),
+            prop: 'categories',
+            clprop: 'sortkey',
+            cllimit: 500
+        },
+        dataType: 'json',
+        type: 'GET',
+        success: function( data ) {
+            if ( data && data.query && data.query.pages && 
data.query.pages[pageId]) {
+                // ... success ...
+                if(data.query.pages[pageId].categories){
+                //console.log(data.query.pages[pageId].categories[0].title);
+                $.each(data.query.pages[pageId].categories, 
function(index,value){
+                       
+                       titles = value.title.split(":",2);
+                       mscs_add_cat(titles[1],value.sortkeyprefix);
+                       
+                });
+                } else {console.log( 'No Subcats' );}
+                
+            } else if ( data && data.error ) {
+                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
+            } else {
+                console.log( 'Error: Unknown result from API.' );
+            }
+        },
+        error: function( xhr ) {
+            console.log('Error');
+        }
+    });
+       
+       return true;
+}
+
+function mscs_get_uncategorizedcats(dd){
+       
+       $.ajax({
+        url: mw.util.wikiScript( 'api' ),
+        data: {
+                       format: 'json',
+            action: 'query',
+            list: 'querypage',
+            qppage: 'Uncategorizedcategories',
+            qplimit: '500',
+        },
+        dataType: 'json',
+        type: 'GET',
+        success: function( data ) {
+            if ( data && data.query && data.query.querypage ) {
+                // ... success ...
+                $.each(data.query.querypage.results, function(index,val){
+                       $("<option />", {value: index+1, text: 
val.value.replace(/_/g," ")}).appendTo(dd);
+                });
+                               if (chosen_dd){
+                                       dd.chosen({disable_search_threshold: 
6});
+                               $("#mscs_dd_0_chzn").width(dd.width()+20);      
+                               }  
+            } else if ( data && data.error ) {
+                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
+            } else {
+                console.log( 'Error: Unknown result from API.' );
+            }
+        },
+        error: function( xhr ) {
+            console.log('Error');
+        }
+    });
+       
+       return true;
+
+}
+
+function mscs_get_subcats(maincat,ebene,container){
+       
+       $.ajax({
+        url: mw.util.wikiScript( 'api' ),
+        data: {
+                       format: 'json',
+            action: 'query',
+            list: 'categorymembers',
+            cmtitle: 'Category:' + maincat,
+            cmtype: 'subcat',
+            cmlimit: mscs_vars.MaxSubcategories
+        },
+        dataType: 'json',
+        type: 'GET',
+        success: function( data ) {
+            if ( data && data.query && data.query.categorymembers ) {
+                // ... success ...
+                if(data.query.categorymembers.length > 0){
+                       //console.log(data.query.categorymembers.length);
+                       
$(document.createElement("div")).attr('class','node').prependTo(container);
+                                       dd = 
mscs_create_dd(selected_cat,ebene+1).appendTo(container);
+                                       
$(document.createElement("div")).attr('id','mscs_subcat_'+(ebene+1)).attr('class','subcat').appendTo(container);
+               
+                       $.each(data.query.categorymembers, function(index,val){
+                               list_element = val.title.split(":",2);
+                               $("<option />", {value: index+1, text: 
list_element[1]}).appendTo(dd);
+                       });
+                       if(chosen_dd){
+                               dd.chosen({disable_search_threshold: 6});
+                               
$("#mscs_dd_"+(ebene+1)+"_chzn").width(dd.width()+20);  
+                       }
+               } else { //no subcats
+                               
$(document.createElement("div")).attr('class','no-node').prependTo($('#mscs_subcat_'+ebene));
+               }
+                
+            } else if ( data && data.error ) {
+                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
+            } else {
+                console.log( 'Error: Unknown result from API.' );
+            }
+        },
+        error: function( xhr ) {
+            console.log('Error');
+        }
+    });
+       
+       return true;
+}
+
+
+function mscs_create_new_cat(new_cat,old_cat){
+       
+       if(old_cat == ""){
+               cat_content = "";
+       } else {
+               cat_content = 
"[["+mw.config.get('wgFormattedNamespaces')[14]+":"+old_cat+"]]";
+       }
+       
+       cat_title = mw.config.get('wgFormattedNamespaces')[14]+":"+new_cat;
+       
+       $.ajax({
+        url: mw.util.wikiScript( 'api' ),
+        data: {
+            format: 'json',
+            action: 'edit',
+            title: cat_title,
+            section: 'new',
+            //summary: 'MsCatSelect',
+            text: cat_content,
+            token: mw.user.tokens.get( 'editToken' ),
+            createonly: true
+        },
+        dataType: 'json',
+        type: 'POST',
+        success: function( data ) {
+            if ( data && data.edit && data.edit.result == 'Success' ) {
+                //console.log(data.edit.result);
+                alert(mw.msg('mscs-created'));
+                $('#MsCatSelect #new_cat_input').val('');
+                
+                created_cat = data.edit.title.split(":",2); //mw macht ersten 
Buchstaben groß
+                //console.log(latest_dd);
+                var dd_next = $('#mscs_dd_'+(latest_dd+1));
+                
+                $("<option />", {value: 99, text: 
created_cat[1]}).appendTo(dd_next);
+                $('#mscs_subcat_'+latest_dd+' .node').removeClass('no-node');
+                if(chosen_dd){
+                       dd_next.chosen(); //wenn dropdown noch nicht existiert
+                       dd_next.trigger("liszt:updated");
+                }
+                mscs_add_cat(created_cat[1],"");
+            } else if ( data && data.error ) {
+                console.log( 'Error: API returned error code "' + 
data.error.code + '": ' + data.error.info );
+                if(data.error.code == "articleexists"){
+                       alert(data.error.info);
+                       $('#MsCatSelect #new_cat_input').val('');
+                }
+            } else {
+                console.log( 'Error: Unknown result from API.' );
+            }
+        },
+        error: function( xhr ) {
+            console.log( 'Error: Request failed.' );
+        }
+    });
+       
+       
 }
\ No newline at end of file
diff --git a/mscatselect.body.php b/mscatselect.body.php
index a4e9ca9..54552da 100644
--- a/mscatselect.body.php
+++ b/mscatselect.body.php
@@ -1,83 +1,83 @@
-<?php
-
-/**
- * Functions file for extension MsCatSelect.
- *  
- * @author Martin Schwindl  <[email protected]> 
- * @copyright © 2014 by Martin Schwindl
- *
- * @licence GNU General Public Licence 2.0 or later
- */
-
-if( !defined( 'MEDIAWIKI' ) ) {
-  echo( "This file is an extension to the MediaWiki software and cannot be 
used standalone.\n" );
-  die();
-}
- 
- 
-## Entry point for the hook and main worker function for editing the page:
-function fnSelectCategoryShowHook( $m_isUpload = false, $m_pageObj ) {
-         
-  fnCleanTextbox($m_pageObj); #clean the textbox
-  return true;
-}
-
-## Entry point for the hook and main worker function for saving the page:
-function fnSelectCategorySaveHook( $m_isUpload, $m_pageObj ) {
-  global $wgContLang;
-  global $wgTitle;
-
-    # Get localised namespace string:
-    $m_catString = $wgContLang->getNsText( NS_CATEGORY );
-
-    # default sort key is page name with stripped namespace name,
-    # otherwise sorting is ugly.
-    if ($wgTitle->getNamespace() == NS_MAIN) {
-      $default_sortkey = "";
-    } else {
-      #$default_sortkey = "|{{PAGENAME}}"; macht bei dateien probleme (anderer 
NS)
-    }
-    $m_text = "\n";
-
-    # Iterate through all selected category entries:
-    if (array_key_exists('SelectCategoryList', $_POST)) {
-      foreach( $_POST['SelectCategoryList'] as $m_cat ) {
-        $m_text .= "\n[[".$m_catString.":".$m_cat."]]";
-      }
-    }
-    # If it is an upload we have to call a different method:
-    if ( $m_isUpload ) {
-      $m_pageObj->mUploadDescription .= $m_text;
-    } else{
-      $m_pageObj->textbox1 .= $m_text;
-    }
-
-  # Return to the let MediaWiki do the rest of the work:
-  return true;
-}
-
-
-##removes the old category tag from the text the user views in the editbox.
-function fnCleanTextbox( $m_pageObj ) {
-
-  global $wgContLang;
-  # Get page contents:
-  $m_pageText = $m_pageObj->textbox1;
-  # Get localised namespace string:
-  $m_catString = strtolower( $wgContLang->getNsText( NS_CATEGORY ) );
-  # The regular expression to find the category links:
-  $m_pattern = 
"\[\[({$m_catString}|category|Category):([^\|\]]*)(\|[^\|\]]*)?\]\]";
-  $m_replace = "$2";
-  # The container to store the processed text:
-  $m_cleanText = '';
-
-  # Check linewise for category links:
-  foreach( explode( "\n", $m_pageText ) as $m_textLine ) {
-    # Filter line through pattern and store the result:
-    $m_cleanText .= preg_replace( "/{$m_pattern}/i", "", $m_textLine ) . "\n";
-  }
-  # Place the cleaned text into the text box:
-  $m_pageObj->textbox1 = trim( $m_cleanText );
-
-  return true;
-}
+<?php
+
+/**
+ * Functions file for extension MsCatSelect.
+ *  
+ * @author Martin Schwindl  <[email protected]> 
+ * @copyright © 2014 by Martin Schwindl
+ *
+ * @licence GNU General Public Licence 2.0 or later
+ */
+
+if( !defined( 'MEDIAWIKI' ) ) {
+  echo( "This file is an extension to the MediaWiki software and cannot be 
used standalone.\n" );
+  die();
+}
+ 
+ 
+## Entry point for the hook and main worker function for editing the page:
+function fnSelectCategoryShowHook( $m_isUpload = false, $m_pageObj ) {
+         
+  fnCleanTextbox($m_pageObj); #clean the textbox
+  return true;
+}
+
+## Entry point for the hook and main worker function for saving the page:
+function fnSelectCategorySaveHook( $m_isUpload, $m_pageObj ) {
+  global $wgContLang;
+  global $wgTitle;
+
+    # Get localised namespace string:
+    $m_catString = $wgContLang->getNsText( NS_CATEGORY );
+
+    # default sort key is page name with stripped namespace name,
+    # otherwise sorting is ugly.
+    if ($wgTitle->getNamespace() == NS_MAIN) {
+      $default_sortkey = "";
+    } else {
+      #$default_sortkey = "|{{PAGENAME}}"; macht bei dateien probleme (anderer 
NS)
+    }
+    $m_text = "\n";
+
+    # Iterate through all selected category entries:
+    if (array_key_exists('SelectCategoryList', $_POST)) {
+      foreach( $_POST['SelectCategoryList'] as $m_cat ) {
+        $m_text .= "\n[[".$m_catString.":".$m_cat."]]";
+      }
+    }
+    # If it is an upload we have to call a different method:
+    if ( $m_isUpload ) {
+      $m_pageObj->mUploadDescription .= $m_text;
+    } else{
+      $m_pageObj->textbox1 .= $m_text;
+    }
+
+  # Return to the let MediaWiki do the rest of the work:
+  return true;
+}
+
+
+##removes the old category tag from the text the user views in the editbox.
+function fnCleanTextbox( $m_pageObj ) {
+
+  global $wgContLang;
+  # Get page contents:
+  $m_pageText = $m_pageObj->textbox1;
+  # Get localised namespace string:
+  $m_catString = strtolower( $wgContLang->getNsText( NS_CATEGORY ) );
+  # The regular expression to find the category links:
+  $m_pattern = 
"\[\[({$m_catString}|category|Category):([^\|\]]*)(\|[^\|\]]*)?\]\]";
+  $m_replace = "$2";
+  # The container to store the processed text:
+  $m_cleanText = '';
+
+  # Check linewise for category links:
+  foreach( explode( "\n", $m_pageText ) as $m_textLine ) {
+    # Filter line through pattern and store the result:
+    $m_cleanText .= preg_replace( "/{$m_pattern}/i", "", $m_textLine ) . "\n";
+  }
+  # Place the cleaned text into the text box:
+  $m_pageObj->textbox1 = trim( $m_cleanText );
+
+  return true;
+}
diff --git a/mscatselect.i18n.php b/mscatselect.i18n.php
index 83fe96c..d61449f 100644
--- a/mscatselect.i18n.php
+++ b/mscatselect.i18n.php
@@ -1,94 +1,35 @@
-<?php
-/**
- * Internationalisation file for extension MsCatSelect.
- *  
- * @author Martin Schwindl  <[email protected]> 
- *
- * @licence GNU General Public Licence 2.0 or later
- */
-
-$messages = array();
-
-/** German (Deutsch)
- * @author Martin Schwindl  <[email protected]>
- * @author Kghbln
- */
-$messages['de'] = array(
-        'mscs-desc' => 'Ermöglicht das Zuweisen einer Seite zu einer 
bestehenden oder neu erstellbaren Kategorie über ein Dropdown-Listenfeld',
-        'mscs-title' => 'Oberkategorie auswählen:',
-        'mscs-untercat' => 'Neue Unterkategorie:',
-        'mscs-untercat-hinw' => 'wird in vorrausgewählter Oberkategorie 
erstellt',
-        'mscs-warnnocat' => 'VORSICHT: Diese Seite enthält noch keine 
Kategorie. Bitte fügen Sie zuerst eine Kategorie hinzu!',
-        'mscs-cats' => 'Bereits vergebene Kategorien:', 
-        'mscs-add' => 'hinzufügen',
-        'mscs-go' => 'erstellen', 
-        'mscs-created' => 'Neue Kategorie erfolgreich erstellt',
-        'mscs-sortkey' => 'Hier bitte den Sortierschlüssel eingeben. Der 
Sortierschlüssel ist für die Sortierung in der Kategorieübersicht relevant.'    
-);
-
-/** Czech (Česky) 1.0
- * @author Neřeknu   <[email protected]>
- */
-$messages['cs'] = array(
-          'mscs-desc' => 'Mit dieser Extension kann eine Seite einer 
bestehenden oder neuen Kategorie per DropDown zugewiesen werden oder auch neue 
Unterkategorien erstellt werden.',
-       'mscs-title' => 'Hlavní kategorie',
-       'mscs-untercat' => 'Nová podkategorie',
-       'mscs-untercat-hinw' => 'bude vytvořena ve výše uvedené kategorii',
-       'mscs-warnnocat' => 'UPOZORNĚNÍ: Tato stránka není zařazena do žádné 
kategorie. Prosím zvolte nějakou kategorii!',
-       'mscs-cats' => 'Již přiřazené kategorie',
-       'mscs-add' => 'přidat',
-       'mscs-go' => 'vytvořit',
-       'mscs-created' => 'Neue Kategorie erfolgreich erstellt',
-       'mscs-sortkey' => 'Hier bitte den Sortierschlüssel eingeben. Der 
Sortierschlüssel ist für die Sortierung in der Kategorieübersicht relevant.'
-);
-
-/** English
- * @author GabMaster
- * @author Kghbln
- * Note: Warning messages are still defined in German (in "mscatselect.js").
- */
-$messages['en'] = array(
-       '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',
-       'mscs-warnnocat' => 'WARNING: This page does not belong to any 
category. Please select a category!',
-       'mscs-cats' => 'Assigned categories',
-       'mscs-add' => 'Add',
-       'mscs-go' => 'Create',
-       'mscs-created' => 'New category successfully created',
-       'mscs-sortkey' => 'Please add the default sortkey here. It is used for 
sorting within the category overview pages.'
-);
-
-/** Nederlands
- * @author hrh 
- */
-$messages['nl'] = array(
-        'mscs-desc' => 'Allows  to add a page to an existing or newly 
creatable category via a drop-down list',
-        'mscs-title' => 'Categorie',
-        'mscs-untercat' => 'Nieuwe subcategorie',
-        'mscs-untercat-hinw' => 'Nieuwe categorie wordt aangemaakt in 
bovenstaande categorie, tenzij --- is geselecteerd',
-        'selectcategory-warnnocat' => 'Deze pagina heeft nog geen categorie. 
Definieer een nieuwe of bestaande categorie.',
-        'mscs-cats' => 'Toegewezen categorieën', 
-        'mscs-add' => 'Toevoegen',
-        'mscs-go' => 'Aanmaken',   
-        'mscs-created' => 'New category successfully created',
-        'mscs-sortkey' => 'Please add the default sortkey here. It is used for 
sorting within the category overview pages.'
-);    
-
-
-/** Spanish (Español)
- * @author Ángel J. Vico 
- */
-$messages['es'] = array(
-       'mscs-desc' => 'Esta extensión permite asignar categorías y 
subcategorías a una página escogiéndolas de una lista desplegable. También 
permite crear nuevas categorías desde la página de edición.',
-       'mscs-title' => 'Categoría principal',
-       'mscs-untercat' => 'Nueva subcategoría',
-       'mscs-untercat-hinw' => 'se creará en la categoría seleccionada arriba',
-       'mscs-warnnocat' => 'ADVERTENCIA: Esta página no pertenece a ninguna 
categoría. Por favor, seleccione una categoría.',
-       'mscs-cats' => 'Categorías asignadas',
-       'mscs-add' => 'Agregar',
-       'mscs-go' => 'Crear',
-       'mscs-created' => 'Nueva categoría creada con éxito',
-       'mscs-sortkey' => 'Por favor introduce el criterio de ordenación. La 
clave de ordenación se utiliza para clasificar el contenido de la categoría.'
-);
\ No newline at end of file
+<?php
+/**
+ * This is a backwards-compatibility shim, generated by:
+ * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
+ *
+ * Beginning with MediaWiki 1.23, translation strings are stored in json files,
+ * and the EXTENSION.i18n.php file only exists to provide compatibility with
+ * older releases of MediaWiki. For more information about this migration, see:
+ * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
+ *
+ * This shim maintains compatibility back to MediaWiki 1.17.
+ */
+$messages = array();
+if ( !function_exists( 'wfJsonI18nShim71de45b0e695cd9c' ) ) {
+       function wfJsonI18nShim71de45b0e695cd9c( $cache, $code, &$cachedData ) {
+               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
+               foreach ( $codeSequence as $csCode ) {
+                       $fileName = dirname( __FILE__ ) . 
"/./i18n/$csCode.json";
+                       if ( is_readable( $fileName ) ) {
+                               $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
+                               foreach ( array_keys( $data ) as $key ) {
+                                       if ( $key === '' || $key[0] === '@' ) {
+                                               unset( $data[$key] );
+                                       }
+                               }
+                               $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
+                       }
+
+                       $cachedData['deps'][] = new FileDependency( $fileName );
+               }
+               return true;
+       }
+
+       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShim71de45b0e695cd9c';
+}
diff --git a/mscatselect.php b/mscatselect.php
index c98526b..4be286f 100644
--- a/mscatselect.php
+++ b/mscatselect.php
@@ -1,87 +1,88 @@
-<?php
-############################################################
-#Author:
-#Martin Schwindl, [email protected]
-#
-#Icons: 
-#Some icons by Yusuke Kamiyamane. All rights reserved. Licensed under a 
Creative Commons Attribution 3.0 License.
-#http://p.yusukekamiyamane.com
-#
-#
-#Usage:
-#LocalSettings.php:
-#
-#//Start------------------------MsCatSelect
-#$wgMSCS_WarnNoCat = false;
-#$wgMSCS_MaxSubcategories = 500;
-#$wgMSCS_MainCategories = array("Category1","Category2");
-#require_once("$IP/extensions/MsCatSelect/mscatselect.php");
-#//End--------------------------MsCatSelect
-#
-#
-############################################################
-
-# Setup and Hooks for the MsCatSelect extension
-if( !defined( 'MEDIAWIKI' ) ) {
-        echo( "This file is an extension to the MediaWiki software and cannot 
be used standalone.\n" );
-        die();
-}
-
-## Register extension setup hook and credits:
-$wgExtensionCredits['parserhook'][] = array(
-        'name'           => 'MsCatSelect',
-        'url'  => 'http://www.mediawiki.org/wiki/Extension:MsCatSelect',
-        'version'        => '5.3',
-        'author' => '[mailto:[email protected] [email protected]] | 
[http://www.ratin.de/mscatselect.html Ratin]',
-        'descriptionmsg' => 'mscs-desc',
-);
-
-$dir = dirname(__FILE__) . '/';
-$wgExtensionMessagesFiles['mscatselect'] = $dir . 'mscatselect.i18n.php';
-
-# Hook when starting editing:
-$wgHooks['EditPage::showEditForm:initial'][] = array( 
'fnSelectCategoryShowHook', false );
-# Hook when saving page:
-$wgHooks['EditPage::attemptSave'][] = array( 'fnSelectCategorySaveHook', false 
);
-# Hook when Editor gets initialized:
-$wgHooks['EditPage::showEditForm:initial'][] = 'MsCatSelectSetup';
-
-require_once($dir.'mscatselect.body.php');
-
-
-$wgResourceModules['ext.MsCatSelect'] = array(
-        // JavaScript and CSS styles.
-        'scripts' => array( 'js/mscatselect.js' ),
-        'styles' => array( 'css/mscatselect.css' ),
-        // When your module is loaded, these messages will be available 
through mw.msg()
-        'messages' => array( 'mscs-title', 'mscs-untercat', 
'mscs-untercat-hinw', 'mscs-warnnocat', 'mscs-cats', 'mscs-add', 'mscs-go', 
'mscs-created', 'mscs-sortkey' ),
-        'dependencies' => array( 'jquery.chosen'),
-        // subdir relative to "/extensions"
-        'localBasePath' => dirname( __FILE__ ),
-        'remoteExtPath' => 'MsCatSelect'
-);
-
-
-
-function MsCatSelectSetup() {
-  global $wgOut, $wgJsMimeType, $wgMSCS_MainCategories, $wgMSCS_WarnNoCat, 
$wgMSCS_MaxSubcategories;
-  
-  //load module
-  $wgOut->addModules( 'ext.MsCatSelect' );
-  $wgMSCS_WarnNoCat = $wgMSCS_WarnNoCat ? "true" : "false";
-  if (is_null($wgMSCS_MaxSubcategories)){ $wgMSCS_MaxSubcategories = 10;} 
//default max subcats
-
-  $mscs_vars = array(
-               'WarnNoCat' => $wgMSCS_WarnNoCat,
-       'MainCategories' => $wgMSCS_MainCategories,
-       'MaxSubcategories' => $wgMSCS_MaxSubcategories,
-       'UseNiceDropdown' => true //$wgMSCS_UseNiceDropdown
-       );
-       
-  $mscs_vars = json_encode($mscs_vars,true);
-  $wgOut->addScript( "<script type=\"{$wgJsMimeType}\">var mscs_vars = 
$mscs_vars;</script>\n" );
-
-  return true;
-}
-
-
+<?php
+############################################################
+#Author:
+#Martin Schwindl, [email protected]
+#
+#Icons: 
+#Some icons by Yusuke Kamiyamane. All rights reserved. Licensed under a 
Creative Commons Attribution 3.0 License.
+#http://p.yusukekamiyamane.com
+#
+#
+#Usage:
+#LocalSettings.php:
+#
+#//Start------------------------MsCatSelect
+#$wgMSCS_WarnNoCat = false;
+#$wgMSCS_MaxSubcategories = 500;
+#$wgMSCS_MainCategories = array("Category1","Category2");
+#require_once("$IP/extensions/MsCatSelect/mscatselect.php");
+#//End--------------------------MsCatSelect
+#
+#
+############################################################
+
+# Setup and Hooks for the MsCatSelect extension
+if( !defined( 'MEDIAWIKI' ) ) {
+        echo( "This file is an extension to the MediaWiki software and cannot 
be used standalone.\n" );
+        die();
+}
+
+## Register extension setup hook and credits:
+$wgExtensionCredits['parserhook'][] = array(
+        'name'           => 'MsCatSelect',
+        'url'            => 
'https://www.mediawiki.org/wiki/Extension:MsCatSelect',
+        'version'        => '5.3.1',
+        'author'         => '[mailto:[email protected] 
[email protected]] | [http://www.ratin.de/mscatselect.html Ratin]',
+        'descriptionmsg' => 'mscs-desc',
+);
+
+$dir = dirname(__FILE__) . '/';
+$wgExtensionMessagesFiles['MsCatSelect'] = $dir . 'mscatselect.i18n.php';
+$wgMessagesDirs['MsCatSelect'] = $dir . 'i18n';
+
+# Hook when starting editing:
+$wgHooks['EditPage::showEditForm:initial'][] = array( 
'fnSelectCategoryShowHook', false );
+# Hook when saving page:
+$wgHooks['EditPage::attemptSave'][] = array( 'fnSelectCategorySaveHook', false 
);
+# Hook when Editor gets initialized:
+$wgHooks['EditPage::showEditForm:initial'][] = 'MsCatSelectSetup';
+
+require_once($dir.'mscatselect.body.php');
+
+
+$wgResourceModules['ext.MsCatSelect'] = array(
+        // JavaScript and CSS styles.
+        'scripts' => array( 'js/mscatselect.js' ),
+        'styles' => array( 'css/mscatselect.css' ),
+        // When your module is loaded, these messages will be available 
through mw.msg()
+        'messages' => array( 'mscs-title', 'mscs-untercat', 
'mscs-untercat-hinw', 'mscs-warnnocat', 'mscs-cats', 'mscs-add', 'mscs-go', 
'mscs-created', 'mscs-sortkey' ),
+        'dependencies' => array( 'jquery.chosen'),
+        // subdir relative to "/extensions"
+        'localBasePath' => dirname( __FILE__ ),
+        'remoteExtPath' => 'MsCatSelect'
+);
+
+
+
+function MsCatSelectSetup() {
+  global $wgOut, $wgJsMimeType, $wgMSCS_MainCategories, $wgMSCS_WarnNoCat, 
$wgMSCS_MaxSubcategories;
+  
+  //load module
+  $wgOut->addModules( 'ext.MsCatSelect' );
+  $wgMSCS_WarnNoCat = $wgMSCS_WarnNoCat ? "true" : "false";
+  if (is_null($wgMSCS_MaxSubcategories)){ $wgMSCS_MaxSubcategories = 10;} 
//default max subcats
+
+  $mscs_vars = array(
+               'WarnNoCat' => $wgMSCS_WarnNoCat,
+       'MainCategories' => $wgMSCS_MainCategories,
+       'MaxSubcategories' => $wgMSCS_MaxSubcategories,
+       'UseNiceDropdown' => true //$wgMSCS_UseNiceDropdown
+       );
+       
+  $mscs_vars = json_encode($mscs_vars,true);
+  $wgOut->addScript( "<script type=\"{$wgJsMimeType}\">var mscs_vars = 
$mscs_vars;</script>\n" );
+
+  return true;
+}
+
+

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c9eb5669727fce860a0e6fa23a081a1599da1ca
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MsCatSelect
Gerrit-Branch: master
Gerrit-Owner: Raimond Spekking <[email protected]>
Gerrit-Reviewer: Ratin <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>

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

Reply via email to