Skip to content
Snippets Groups Projects
Commit a5114909 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Merge pull request #1557 from splitbrain/linkwizexternallinks

If external link inserted with link wizard, empty input
parents 2298b37b 99f0dd4b
No related branches found
No related tags found
No related merge requests found
......@@ -259,7 +259,18 @@ var dw_linkwiz = {
dw_linkwiz.hide();
// 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())) {
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);
},
/**
......
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