From 99f0dd4b53cedaddb6d35f828b687bc99097056e Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 2 May 2016 22:46:01 +0200 Subject: after insert external link, reset to parent namespace --- lib/scripts/linkwiz.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/scripts/linkwiz.js') diff --git a/lib/scripts/linkwiz.js b/lib/scripts/linkwiz.js index 8767cc50a..fddbe485a 100644 --- a/lib/scripts/linkwiz.js +++ b/lib/scripts/linkwiz.js @@ -261,9 +261,13 @@ var dw_linkwiz = { // reset the entry to the parent namespace var externallinkpattern = new RegExp('^((f|ht)tps?:)?//', 'i'), entry_value; - if(externallinkpattern.test(dw_linkwiz.$entry.val())) { - entry_value = ''; //reset whole external links - }else { + if (externallinkpattern.test(dw_linkwiz.$entry.val())) { + if (JSINFO.namespace) { + entry_value = JSINFO.namespace + ':'; + } else { + entry_value = ''; //reset whole external links + } + } else { entry_value = dw_linkwiz.$entry.val().replace(/[^:]*$/, '') } dw_linkwiz.$entry.val(entry_value); -- cgit v1.2.3