mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[js:core] bugfix of registration of fm.decodeRawString by fm.options.rawStringDecoder
This commit is contained in:
@@ -50,15 +50,14 @@
|
||||
function(fm, extraObj) {
|
||||
// `init` event callback function
|
||||
fm.bind('init', function() {
|
||||
// Optional for Japanese decoder "extras/encoding-japanese.min"
|
||||
delete fm.options.rawStringDecoder;
|
||||
// Optional for Japanese decoder "encoding-japanese.js"
|
||||
if (fm.lang === 'jp') {
|
||||
fm.loadScript(
|
||||
[ fm.baseUrl + 'js/extras/encoding-japanese.min.js' ],
|
||||
[ '//cdn.rawgit.com/polygonplanet/encoding.js/master/encoding.min.js' ],
|
||||
function() {
|
||||
if (window.Encoding && Encoding.convert) {
|
||||
fm.options.rawStringDecoder = function(s) {
|
||||
return Encoding.convert(s,{to:'UNICODE',type:'string'});
|
||||
return Encoding.convert(s, {to:'UNICODE',type:'string'});
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
+6
-1
@@ -3554,7 +3554,7 @@ var elFinder = function(node, opts, bootCallback) {
|
||||
* @param String str
|
||||
* @return String
|
||||
*/
|
||||
this.decodeRawString = $.isFunction(this.options.rawStringDecoder)? this.options.rawStringDecoder : function(str) {
|
||||
this.decodeRawString = function(str) {
|
||||
var charCodes = function(str) {
|
||||
var i, len, arr;
|
||||
for (i=0,len=str.length,arr=[]; i<len; i++) {
|
||||
@@ -4676,6 +4676,11 @@ var elFinder = function(node, opts, bootCallback) {
|
||||
},
|
||||
toChkTh = {};
|
||||
|
||||
// regist decodeRawString function
|
||||
if (self.options.rawStringDecoder && $.isFunction(self.options.rawStringDecoder)) {
|
||||
self.decodeRawString = self.options.rawStringDecoder;
|
||||
}
|
||||
|
||||
// re-calculate elFinder node z-index
|
||||
self.zIndexCalc();
|
||||
|
||||
|
||||
Vendored
-35
File diff suppressed because one or more lines are too long
+6
-6
@@ -62,15 +62,14 @@
|
||||
function(fm, extraObj) {
|
||||
// `init` event callback function
|
||||
fm.bind('init', function() {
|
||||
// Optional for Japanese decoder "extras/encoding-japanese.min"
|
||||
delete fm.options.rawStringDecoder;
|
||||
// Optional for Japanese decoder "encoding-japanese"
|
||||
if (fm.lang === 'jp') {
|
||||
require(
|
||||
[ 'extras/encoding-japanese.min' ],
|
||||
[ 'encoding-japanese' ],
|
||||
function(Encoding) {
|
||||
if (Encoding.convert) {
|
||||
if (Encoding && Encoding.convert) {
|
||||
fm.options.rawStringDecoder = function(s) {
|
||||
return Encoding.convert(s,{to:'UNICODE',type:'string'});
|
||||
return Encoding.convert(s, {to:'UNICODE',type:'string'});
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -111,7 +110,8 @@
|
||||
paths : {
|
||||
'jquery' : '//cdnjs.cloudflare.com/ajax/libs/jquery/'+(ie8? '1.12.4' : jqver)+'/jquery.min',
|
||||
'jquery-ui': '//cdnjs.cloudflare.com/ajax/libs/jqueryui/'+uiver+'/jquery-ui.min',
|
||||
'elfinder' : 'elfinder.min'
|
||||
'elfinder' : 'elfinder.min',
|
||||
'encoding-japanese': '//cdn.rawgit.com/polygonplanet/encoding.js/master/encoding.min'
|
||||
},
|
||||
waitSeconds : 10 // optional
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user