From d6cef5c7877d4cd9f885c1597e42361977d60958 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 14 Jun 2014 01:12:00 +0200 Subject: [PATCH] Refactor. --- src/_h5ai/client/js/inc/info.js | 73 +++++++++++++++------------------ src/_h5ai/index.html.jade | 2 +- 2 files changed, 34 insertions(+), 41 deletions(-) diff --git a/src/_h5ai/client/js/inc/info.js b/src/_h5ai/client/js/inc/info.js index e1c4d0fb..b3022373 100644 --- a/src/_h5ai/client/js/inc/info.js +++ b/src/_h5ai/client/js/inc/info.js @@ -2,14 +2,15 @@ modulejs.define('info', ['$', 'config'], function ($, config) { var template = '
  • ' + - '' + - '' + - '
    ' + - '
  • ', + '' + + '' + + '
    ' + + '', - $tests = $('#tests'), + setup = config.setup, + $tests = $("#tests"), - addTestResult = function (label, info, passed, result) { + addTest = function (label, info, passed, result) { $(template) .find('.label') @@ -25,66 +26,58 @@ modulejs.define('info', ['$', 'config'], function ($, config) { .appendTo($tests); }, - init = function () { + addTests = function () { - var setup = config.setup; - - $('.idx-file .value').text(setup.INDEX_HREF); - - addTestResult( - 'PHP version', - 'PHP version >= 5.3.0', - setup.HAS_PHP_VERSION, - setup.PHP_VERSION + addTest( + 'PHP version', 'PHP version >= 5.3.0', + setup.HAS_PHP_VERSION, setup.PHP_VERSION ); - addTestResult( - 'Cache directory', - 'Web server has write access', + addTest( + 'Cache directory', 'Web server has write access', setup.HAS_WRITABLE_CACHE ); - addTestResult( - 'Image thumbs', - 'PHP GD extension with JPEG support available', + addTest( + 'Image thumbs', 'PHP GD extension with JPEG support available', setup.HAS_PHP_JPG ); - addTestResult( - 'Use EXIF thumbs', - 'PHP EXIF extension available', + addTest( + 'Use EXIF thumbs', 'PHP EXIF extension available', setup.HAS_PHP_EXIF ); - addTestResult( - 'Movie thumbs', - 'Command line program ffmpeg or avconv available', + addTest( + 'Movie thumbs', 'Command line program ffmpeg or avconv available', setup.HAS_CMD_FFMPEG || setup.HAS_CMD_AVCONV ); - addTestResult( - 'PDF thumbs', - 'Command line program convert available', + addTest( + 'PDF thumbs', 'Command line program convert available', setup.HAS_CMD_CONVERT ); - addTestResult( - 'Shell tar', - 'Command line program tar available', + addTest( + 'Shell tar', 'Command line program tar available', setup.HAS_CMD_TAR ); - addTestResult( - 'Shell zip', - 'Command line program zip available', + addTest( + 'Shell zip', 'Command line program zip available', setup.HAS_CMD_ZIP ); - addTestResult( - 'Folder sizes', - 'Command line program du available', + addTest( + 'Folder sizes', 'Command line program du available', setup.HAS_CMD_DU ); + }, + + init = function () { + + $('.idx-file .value').text(setup.INDEX_HREF); + addTests(); }; init(); diff --git a/src/_h5ai/index.html.jade b/src/_h5ai/index.html.jade index 235d3c30..54861f33 100644 --- a/src/_h5ai/index.html.jade +++ b/src/_h5ai/index.html.jade @@ -20,7 +20,7 @@ html.no-js.browser( lang="en" ) body#h5ai-info h1 - a( href="http://larsjung.de/h5ai/" ) {{pkg.name}} + a( href="{{pkg.url}}" ) {{pkg.name}} span.build-version version {{pkg.version}} span.build-stamp {{stamp}} span.idx-file Index: