diff --git a/README.md b/README.md index d34a26dd..f9b9b2ca 100644 --- a/README.md +++ b/README.md @@ -63,9 +63,9 @@ It profits from these great projects: * general changes h5ai directory layout and configuration * splits configuration file (`config.json`) into files `options.json`, `types.json` and `langs.json` * localization now in separate files -* adds auto-refresh (PHP) -* adds drag'n'drop upload (PHP) -* adds file deletion (PHP) +* adds auto-refresh +* adds drag'n'drop upload (PHP, experimental) +* adds file deletion (PHP, experimental) * cleans and improves PHP code * PHP no longer respects htaccess restrictions (so be careful) * PHP ignore patterns might include paths now diff --git a/src/_h5ai/client/js/inc/core/settings.js b/src/_h5ai/client/js/inc/core/settings.js index 2f22923a..6afde834 100644 --- a/src/_h5ai/client/js/inc/core/settings.js +++ b/src/_h5ai/client/js/inc/core/settings.js @@ -1,11 +1,15 @@ -modulejs.define('core/settings', ['config', '_'], function (config, _) { +modulejs.define('core/settings', ['config', '_', '$'], function (config, _, $) { var settings = _.extend({ h5aiAbsHref: '/_h5ai/' - }, config.options); + }, config.options), - settings.h5aiAbsHref = settings.h5aiAbsHref.replace(/\/*$/, '/'); + filename = 'client/js/scripts.js', + src = $('script[src$="' + filename + '"]').attr('src'), + appHref = src.substr(0, src.length - filename.length); + + settings.h5aiAbsHref = src.substr(0, src.length - filename.length).replace(/\/*$/, '/'); settings.rootAbsHref = /^(.*\/)[^\/]+\/?$/.exec(settings.h5aiAbsHref)[1]; return settings; diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index 07cba1f5..4fccbd0d 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -6,12 +6,6 @@ Options */ { - /* - The absolute link to {{pkg.name}}. - Must point to the "_{{pkg.name}}" directory. - */ - "h5aiAbsHref": "/_{{pkg.name}}/", - /* Spacing of the main content. Left and right will be added to a minimum of 30px. Top and bottom @@ -82,14 +76,14 @@ Options "footer": "_{{pkg.name}}.footer.html" }, - /* [php] + /* [php, EXPERIMENTAL] Allow file deletion. */ "delete": { "enabled": true }, - /* [php] + /* [php, EXPERIMENTAL] File upload via drag'n'drop. Folders are not supported. The working file size seems to be very browser dependent. @@ -258,8 +252,9 @@ Options "size": 150 }, - /* [php] + /* [php, EXPERIMENTAL] Allow to rename files. + No GUI yet. */ "rename": { "enabled": false