Skip to content
Snippets Groups Projects
Commit 297d27bc authored by Gerrit Uitslag's avatar Gerrit Uitslag
Browse files

If external link inserted with link wizard, empty input

Fixes #1483
parent 9a9a364c
No related branches found
No related tags found
No related merge requests found
...@@ -259,7 +259,14 @@ var dw_linkwiz = { ...@@ -259,7 +259,14 @@ var dw_linkwiz = {
dw_linkwiz.hide(); dw_linkwiz.hide();
// reset the entry to the parent namespace // reset the entry to the parent namespace
dw_linkwiz.$entry.val(dw_linkwiz.$entry.val().replace(/[^:]*$/, '')); var externallinkpattern = new RegExp('^((f|ht)tps?:)?//', 'i'),
entry_value;
if(externallinkpattern.test(dw_linkwiz.$entry.val())) {
entry_value = ''; //reset whole external links
}else {
entry_value = dw_linkwiz.$entry.val().replace(/[^:]*$/, '')
}
dw_linkwiz.$entry.val(entry_value);
}, },
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment