From 71d2ff10dc773b526e2ce20ffa5db146626edf93 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 21 Jun 2014 14:45:25 +0200 Subject: [PATCH] Minor changes. --- CHANGELOG.md | 4 ++-- README.md | 1 - src/_h5ai/client/js/inc/view/ensure.js | 9 +++++++-- src/_h5ai/client/js/scripts.js | 12 +++++++----- src/_h5ai/conf/options.json | 8 ++++---- src/_h5ai/index.html.jade | 2 +- src/_h5ai/server/php/inc/class-item.php | 3 ++- src/_h5ai/server/php/inc/page.php.jade | 2 +- 8 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d22dfae6..a7dfa79e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,8 @@ ## develop branch -* replaces PHP backtick operator with `exec` -* adds initial theme support * adds sidebar +* adds initial theme support * adds icons from [Evolvere Icon Theme](http://franksouza183.deviantart.com/art/Evolvere-Icon-theme-440718295) * adds PHP variant to calc folder sizes * adds scroll position reset on location change (issue [#279](https://github.com/lrsjng/h5ai/issues/279)) @@ -21,6 +20,7 @@ * improves preview GUI * disable thumbs in `cache` folder * fixes QR code URI origin (issue [#287](https://github.com/lrsjng/h5ai/issues/287)) +* replaces PHP backtick operator with `exec` * removes server side file manipulation extensions `dropbox`, `delete` and `rename` * updates H5BP to 4.3.0 * updates jQuery to 2.1.1 diff --git a/README.md b/README.md index a9390007..60f8ce54 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ It profits from these great projects: [Gnome Symbolic Icon Theme](https://git.gnome.org/browse/gnome-icon-theme-symbolic/) (CC BY-SA 3.0), [HTML5 ★ Boilerplate](http://html5boilerplate.com) (MIT), [jQuery](http://jquery.com) (MIT), -[jQuery.filedrop](http://www.github.com/weixiyen/jquery-filedrop) (MIT), [jQuery.fracs](http://larsjung.de/fracs/) (MIT), [jQuery.mousewheel](https://github.com/brandonaaron/jquery-mousewheel) (MIT), [jQuery.qrcode](http://larsjung.de/qrcode/) (MIT), diff --git a/src/_h5ai/client/js/inc/view/ensure.js b/src/_h5ai/client/js/inc/view/ensure.js index 986ddbf1..466a0e8e 100644 --- a/src/_h5ai/client/js/inc/view/ensure.js +++ b/src/_h5ai/client/js/inc/view/ensure.js @@ -13,10 +13,15 @@ modulejs.define('view/ensure', ['$', 'core/event'], function ($, event) { ensure = function () { if ( - $(selr).filter(isVisible).length !== 1 || + $(selr).text() !== sequence || $(sela).filter(isVisible).length !== 1 || - $(selr).text() !== sequence + $(selr).filter(isVisible).length !== 1 || + $(selb).filter(isVisible).length !== 1 ) { + if ($(selb).filter(isVisible).length !== 1) { + $(selb).remove(); + $('
').attr(styleKey, styleVal).appendTo('body'); + } $(selr).remove(); $('') .addClass('right') diff --git a/src/_h5ai/client/js/scripts.js b/src/_h5ai/client/js/scripts.js index 2faa0a6c..c6ed3177 100644 --- a/src/_h5ai/client/js/scripts.js +++ b/src/_h5ai/client/js/scripts.js @@ -32,17 +32,19 @@ if (window.attachEvent && !window.addEventListener) { throw 'no-browser'; } // @include "inc/**/*.js" var $ = jQuery, - mode = $('script[src$="scripts.js"]').data('mode'), - url = '.', - module = 'main'; + module = $('script[data-module]').data('module'), + url; if ($('html').hasClass('no-browser')) { return; } - if (mode === 'info') { + if (module === 'main') { + url = '.'; + } else if (module === 'info') { url = 'server/php/index.php'; - module = 'info'; + } else { + return; } $.ajax({ diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index 806516e8..00b5fcc1 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -13,11 +13,11 @@ Options are added to the top and bottom bar heights. */ "spacing": { + "top": 50, "bottom": 50, "left": "auto", - "maxWidth": 1024, "right": "auto", - "top": 50 + "maxWidth": 1024 }, /* @@ -40,7 +40,7 @@ Options The user selected view mode is also stored local in modern browsers so that it will be persistent. - smartBrowsing: use History API if available (no need to reload the whole page) - - theme: name of one of the folders in "_{{pkg.name}}/client/themes", defaults to "fallback" + - theme: name of one of the folders in "_{{pkg.name}}/client/themes", defaults to builtin fallback - unmanaged: don't manage folders containing one of those files - unmanagedInNewWindow: open unmanaged links in new window/tab */ @@ -54,7 +54,7 @@ Options "setParentFolderLabels": true, "sizes": [24, 32, 48, 64, 96], "smartBrowsing": true, - "theme": "fallback", + "theme": "", "unmanaged": ["index.html", "index.htm", "index.php"], "unmanagedInNewWindow": false }, diff --git a/src/_h5ai/index.html.jade b/src/_h5ai/index.html.jade index b8ea3863..335bf385 100644 --- a/src/_h5ai/index.html.jade +++ b/src/_h5ai/index.html.jade @@ -14,7 +14,7 @@ html.no-js.browser( lang="en" ) link( rel="shortcut icon", href="client/images/favicon/favicon-16-32.ico" ) link( rel="apple-touch-icon-precomposed", type="image/png", href="client/images/favicon/favicon-152.png" ) link( rel="stylesheet", href="client/css/styles.css" ) - script( src="client/js/scripts.js", data-mode="info" ) + script( src="client/js/scripts.js", data-module="info" ) body#h5ai-info diff --git a/src/_h5ai/server/php/inc/class-item.php b/src/_h5ai/server/php/inc/class-item.php index 1d5674d9..33643b57 100644 --- a/src/_h5ai/server/php/inc/class-item.php +++ b/src/_h5ai/server/php/inc/class-item.php @@ -24,7 +24,7 @@ class Item { return Item::$size_cache[$path]; } - $size = 0; + $size = null; if (is_file($path)) { @@ -38,6 +38,7 @@ class Item { $cmdv = array("du", "-sk", $path); $size = intval(preg_replace("#\s.*$#", "", exec_cmdv($cmdv)), 10) * 1024; } else { + $size = 0; foreach ($app->read_dir($path) as $name) { $size += Item::filesize($app, $path . "/" . $name); } diff --git a/src/_h5ai/server/php/inc/page.php.jade b/src/_h5ai/server/php/inc/page.php.jade index 77330679..eed68eac 100644 --- a/src/_h5ai/server/php/inc/page.php.jade +++ b/src/_h5ai/server/php/inc/page.php.jade @@ -18,7 +18,7 @@ html.no-js.browser( lang="en" ) link( rel="shortcut icon", href!="#{app_href}client/images/favicon/favicon-16-32.ico" ) link( rel="apple-touch-icon-precomposed", type="image/png", href!="#{app_href}client/images/favicon/favicon-152.png" ) link( rel="stylesheet", href!="#{app_href}client/css/styles.css" ) - script( src!="#{app_href}client/js/scripts.js" ) + script( src!="#{app_href}client/js/scripts.js", data-module="main" ) body