From 0465531c490e6cdb304ec649f9375890e33eef2b Mon Sep 17 00:00:00 2001 From: mb21 Date: Sat, 9 Apr 2016 12:34:09 +0200 Subject: [PATCH 1/2] set data-cke-saved-href attribute --- dialogs/simplelink.js | 1 + 1 file changed, 1 insertion(+) diff --git a/dialogs/simplelink.js b/dialogs/simplelink.js index 796ca3f..aabf995 100644 --- a/dialogs/simplelink.js +++ b/dialogs/simplelink.js @@ -31,6 +31,7 @@ href = "http://" + href; } element.setAttribute("href", href); + element.setAttribute("data-cke-saved-href", href); if(!element.getText()) { element.setText(this.getValue()); } From 6e463dfe98e07e3b6c9552dcd1c43feafc1e485f Mon Sep 17 00:00:00 2001 From: Mauro Bieg Date: Tue, 5 Jun 2018 13:52:03 +0200 Subject: [PATCH 2/2] allow mailto urls --- dialogs/simplelink.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dialogs/simplelink.js b/dialogs/simplelink.js index aabf995..adaf227 100644 --- a/dialogs/simplelink.js +++ b/dialogs/simplelink.js @@ -1,4 +1,5 @@ CKEDITOR.dialog.add("simplelinkDialog", function(editor) { + var isExternalURL = /^((http|https):\/\/|mailto:)/; return { allowedContent: "a[href,target]", title: "Insert Link", @@ -15,7 +16,6 @@ validate: CKEDITOR.dialog.validate.notEmpty( "url cannot be empty." ), setup: function( element ) { var href = element.getAttribute("href"); - var isExternalURL = /^(http|https):\/\//; if(href) { if(!isExternalURL.test(href)) { href = "http://" + href; @@ -25,7 +25,6 @@ }, commit: function(element) { var href = this.getValue(); - var isExternalURL = /^(http|https):\/\//; if(href) { if(!isExternalURL.test(href)) { href = "http://" + href;