diff --git a/src/_h5ai/client/js/inc/ext/preview.js b/src/_h5ai/client/js/inc/ext/preview.js index fa4cc1a3..19bd2a18 100644 --- a/src/_h5ai/client/js/inc/ext/preview.js +++ b/src/_h5ai/client/js/inc/ext/preview.js @@ -3,7 +3,7 @@ modulejs.define('ext/preview', ['_', '$', 'core/settings', 'core/resource', 'cor var settings = _.extend({ enabled: true - }, allsettings['preview']), + }, allsettings.preview), template = '
' + '
' + diff --git a/src/_h5ai/client/js/inc/ext/sort.js b/src/_h5ai/client/js/inc/ext/sort.js index 68a51795..9bd400a7 100644 --- a/src/_h5ai/client/js/inc/ext/sort.js +++ b/src/_h5ai/client/js/inc/ext/sort.js @@ -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'), yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'), // 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, oFxNcL, oFyNcL; // first try and sort Hex codes or Dates - if (yD) - if ( xD < yD ) return -1; - else if ( xD > yD ) return 1; + if (yD) { + if (xD < yD) { + return -1; + } else if (xD > yD) { + return 1; + } + } // 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) oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc]) || xN[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 += ''; oFyNcL += ''; } - if (oFxNcL < oFyNcL) return -1; - if (oFxNcL > oFyNcL) return 1; + if (oFxNcL < oFyNcL) { + return -1; + } + if (oFxNcL > oFyNcL) { + return 1; + } } return 0; }, diff --git a/src/_h5ai/client/js/inc/info.js b/src/_h5ai/client/js/inc/info.js index 9a6fbd33..5d033b32 100644 --- a/src/_h5ai/client/js/inc/info.js +++ b/src/_h5ai/client/js/inc/info.js @@ -4,15 +4,15 @@ modulejs.define('info', ['$', 'config'], function ($, config) { var map = function (setup) { return { - 'php_version': setup['HAS_PHP_VERSION'], - 'cache_dir': setup['HAS_WRITABLE_CACHE'], - 'image_thumbs': setup['HAS_PHP_JPG'], - 'exif_thumbs': setup['HAS_PHP_EXIF'], - 'movie_thumbs': setup['HAS_CMD_FFMPEG'] || setup['HAS_CMD_AVCONV'], - 'pdf_thumbs': setup['HAS_CMD_CONVERT'], - 'shell_tar': setup['HAS_CMD_TAR'], - 'shell_zip': setup['HAS_CMD_ZIP'], - 'folder_sizes': setup['HAS_CMD_DU'] + 'php_version': setup.HAS_PHP_VERSION, + 'cache_dir': setup.HAS_WRITABLE_CACHE, + 'image_thumbs': setup.HAS_PHP_JPG, + 'exif_thumbs': setup.HAS_PHP_EXIF, + 'movie_thumbs': setup.HAS_CMD_FFMPEG || setup.HAS_CMD_AVCONV, + 'pdf_thumbs': setup.HAS_CMD_CONVERT, + 'shell_tar': setup.HAS_CMD_TAR, + 'shell_zip': setup.HAS_CMD_ZIP, + 'folder_sizes': setup.HAS_CMD_DU }; }, @@ -37,8 +37,8 @@ modulejs.define('info', ['$', 'config'], function ($, config) { setValue(this, values[$(this).data('id')]); }); - $('.idx-file .value').text(setup['INDEX_HREF']); - $('.test.php .result').text(setup['PHP_VERSION']); + $('.idx-file .value').text(setup.INDEX_HREF); + $('.test.php .result').text(setup.PHP_VERSION); }; init();