Ljonka has uploaded a new change for review.

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

Change subject: InsertFile: make compatible with mw1.27
......................................................................

InsertFile: make compatible with mw1.27

this is a quickfix

Change-Id: Iad64e7a0f4299f72fae7b830021f7d4347cc53e6
---
M InsertFile/InsertFile.setup.php
M InsertFile/resources/BS.InsertFile/UploadPanel.js
2 files changed, 21 insertions(+), 2 deletions(-)


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

diff --git a/InsertFile/InsertFile.setup.php b/InsertFile/InsertFile.setup.php
index 6a5960b..83e87ae 100644
--- a/InsertFile/InsertFile.setup.php
+++ b/InsertFile/InsertFile.setup.php
@@ -1,2 +1,7 @@
 <?php
-wfLoadExtension( 'BlueSpiceExtensions/InsertFile' );
\ No newline at end of file
+wfLoadExtension( 'BlueSpiceExtensions/InsertFile' );
+
+$wgHooks['BeforePageDisplay'][] = function( OutputPage &$oOut ) {
+       global $wgFileExtensions;
+       $oOut->addJsConfigVars( "wgFileExtensions", $wgFileExtensions );
+};
\ No newline at end of file
diff --git a/InsertFile/resources/BS.InsertFile/UploadPanel.js 
b/InsertFile/resources/BS.InsertFile/UploadPanel.js
index b36b9e9..660390e 100644
--- a/InsertFile/resources/BS.InsertFile/UploadPanel.js
+++ b/InsertFile/resources/BS.InsertFile/UploadPanel.js
@@ -226,7 +226,7 @@
                var formattedNamespaces = 
mw.config.get('wgFormattedNamespaces');
                for( var i = 0; i < categories.length; i++ ) {
                        var categoryLink = new bs.wikiText.Link({
-                               title: $.ucFirst( categories[i] ),
+                               title: this.ucFirst( categories[i] ),
                                nsText: formattedNamespaces[bs.ns.NS_CATEGORY],
                                link: false //TDOD: fix this in 
"bs.wikiText.Link"
                        });
@@ -269,6 +269,20 @@
                );
        },
 
+       ucFirst: function ucfirst( str ) {
+               //  discuss at: http://locutus.io/php/ucfirst/
+               // original by: Kevin van Zonneveld (http://kvz.io)
+               // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
+               // improved by: Brett Zamir (http://brett-zamir.me)
+               //   example 1: ucfirst('kevin van zonneveld')
+               //   returns 1: 'Kevin van zonneveld'
+
+               str += ''
+               var f = str.charAt( 0 )
+                               .toUpperCase();
+               return f + str.substr( 1 );
+       },
+
        onUploadSuccess: function( response, action ) {
                this.getEl().unmask();
                this.cbLicences.enable();

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad64e7a0f4299f72fae7b830021f7d4347cc53e6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Ljonka <[email protected]>

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

Reply via email to