mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-25 12:34:47 -04:00
Fix some JS hints.
This commit is contained in:
parent
8c6afea314
commit
98f6611a7a
3 changed files with 27 additions and 19 deletions
|
@ -3,7 +3,7 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor
|
||||||
|
|
||||||
var settings = _.extend({
|
var settings = _.extend({
|
||||||
enabled: true
|
enabled: true
|
||||||
}, allsettings['preview']),
|
}, allsettings.preview),
|
||||||
|
|
||||||
template = '<div id="pv-overlay" class="noSelection">' +
|
template = '<div id="pv-overlay" class="noSelection">' +
|
||||||
'<div id="pv-content"/>' +
|
'<div id="pv-content"/>' +
|
||||||
|
|
|
@ -77,15 +77,19 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
||||||
xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
||||||
yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
||||||
// numeric, hex or date detection
|
// numeric, hex or date detection
|
||||||
xD = parseInt(x.match(hre), 10) || (xN.length != 1 && x.match(dre) && Date.parse(x)),
|
xD = parseInt(x.match(hre), 10) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),
|
||||||
yD = parseInt(y.match(hre), 10) || xD && y.match(dre) && Date.parse(y) || null,
|
yD = parseInt(y.match(hre), 10) || xD && y.match(dre) && Date.parse(y) || null,
|
||||||
oFxNcL, oFyNcL;
|
oFxNcL, oFyNcL;
|
||||||
// first try and sort Hex codes or Dates
|
// first try and sort Hex codes or Dates
|
||||||
if (yD)
|
if (yD) {
|
||||||
if ( xD < yD ) return -1;
|
if (xD < yD) {
|
||||||
else if ( xD > yD ) return 1;
|
return -1;
|
||||||
|
} else if (xD > yD) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
// natural sorting through split numeric strings and default strings
|
// natural sorting through split numeric strings and default strings
|
||||||
for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
|
for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc += 1) {
|
||||||
// find floats not starting with '0', string or 0 if not defined (Clint Priest)
|
// find floats not starting with '0', string or 0 if not defined (Clint Priest)
|
||||||
oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
|
oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[cLoc] || 0;
|
||||||
oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
|
oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc]) || yN[cLoc] || 0;
|
||||||
|
@ -96,8 +100,12 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
||||||
oFxNcL += '';
|
oFxNcL += '';
|
||||||
oFyNcL += '';
|
oFyNcL += '';
|
||||||
}
|
}
|
||||||
if (oFxNcL < oFyNcL) return -1;
|
if (oFxNcL < oFyNcL) {
|
||||||
if (oFxNcL > oFyNcL) return 1;
|
return -1;
|
||||||
|
}
|
||||||
|
if (oFxNcL > oFyNcL) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,15 +4,15 @@ modulejs.define('info', ['$', 'config'], function ($, config) {
|
||||||
var map = function (setup) {
|
var map = function (setup) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'php_version': setup['HAS_PHP_VERSION'],
|
'php_version': setup.HAS_PHP_VERSION,
|
||||||
'cache_dir': setup['HAS_WRITABLE_CACHE'],
|
'cache_dir': setup.HAS_WRITABLE_CACHE,
|
||||||
'image_thumbs': setup['HAS_PHP_JPG'],
|
'image_thumbs': setup.HAS_PHP_JPG,
|
||||||
'exif_thumbs': setup['HAS_PHP_EXIF'],
|
'exif_thumbs': setup.HAS_PHP_EXIF,
|
||||||
'movie_thumbs': setup['HAS_CMD_FFMPEG'] || setup['HAS_CMD_AVCONV'],
|
'movie_thumbs': setup.HAS_CMD_FFMPEG || setup.HAS_CMD_AVCONV,
|
||||||
'pdf_thumbs': setup['HAS_CMD_CONVERT'],
|
'pdf_thumbs': setup.HAS_CMD_CONVERT,
|
||||||
'shell_tar': setup['HAS_CMD_TAR'],
|
'shell_tar': setup.HAS_CMD_TAR,
|
||||||
'shell_zip': setup['HAS_CMD_ZIP'],
|
'shell_zip': setup.HAS_CMD_ZIP,
|
||||||
'folder_sizes': setup['HAS_CMD_DU']
|
'folder_sizes': setup.HAS_CMD_DU
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ modulejs.define('info', ['$', 'config'], function ($, config) {
|
||||||
setValue(this, values[$(this).data('id')]);
|
setValue(this, values[$(this).data('id')]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.idx-file .value').text(setup['INDEX_HREF']);
|
$('.idx-file .value').text(setup.INDEX_HREF);
|
||||||
$('.test.php .result').text(setup['PHP_VERSION']);
|
$('.test.php .result').text(setup.PHP_VERSION);
|
||||||
};
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue