From 7d0a691bc340100969b29f2196c1aefdcb1445e3 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 21 Oct 2012 18:37:19 +0200 Subject: [PATCH] Add option related to non-h5ai links. --- src/_h5ai/client/js/inc/core/location.js | 5 +++-- src/_h5ai/conf/options.json | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/_h5ai/client/js/inc/core/location.js b/src/_h5ai/client/js/inc/core/location.js index e5a63a69..5529447e 100644 --- a/src/_h5ai/client/js/inc/core/location.js +++ b/src/_h5ai/client/js/inc/core/location.js @@ -2,7 +2,8 @@ modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event', 'core/notify'], function (_, modernizr, allsettings, event, notify) { var settings = _.extend({ - smartBrowsing: false + smartBrowsing: true, + extInNewWindow: true }, allsettings.view), doc = document, @@ -106,7 +107,7 @@ modulejs.define('core/location', ['_', 'modernizr', 'core/settings', 'core/event }); } - if (item.status !== '=h5ai=') { + if (settings.extInNewWindow && item.status !== '=h5ai=') { $el.attr('target', '_blank'); } }; diff --git a/src/_h5ai/conf/options.json b/src/_h5ai/conf/options.json index f4b7049c..759607ce 100644 --- a/src/_h5ai/conf/options.json +++ b/src/_h5ai/conf/options.json @@ -30,8 +30,10 @@ Options so that it will be persistent. - setParentFolderLabels: set parent folder labels to real folder names - binaryPrefix: set to true uses 1024B=1KiB when formatting file sizes (see http://en.wikipedia.org/wiki/Binary_prefix) - - indexFiles [php only]: consider folder with those files as non {{pkg.name}} folders - - ignore [php only]: don't list items matching these regular expressions + - indexFiles: consider folder with those files as non {{pkg.name}} folders + - ignore: don't list items matching these regular expressions + - smartBrowsing: use browser history if available (no need to reload the whole page) + - extInNewWindow: open non-h5ai links in new window/tab */ "view": { "modes": ["details", "icons", "grid", "list"], @@ -39,7 +41,8 @@ Options "binaryPrefix": false, "indexFiles": ["index.html", "index.htm", "index.php"], "ignore": ["^\\.", "^_{{pkg.name}}"], - "smartBrowsing": true + "smartBrowsing": true, + "extInNewWindow": true },