From 470cb2b42cbe3ba4dda0a3927124fb1c2284ddd9 Mon Sep 17 00:00:00 2001 From: adelura Date: Mon, 28 Apr 2014 16:15:09 +0200 Subject: [PATCH 1/4] Added optional, configurable possibility to set javascript code in href attr in anchor tags. --- plugins/link/dialogs/link.js | 2 +- plugins/link/plugin.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/link/dialogs/link.js b/plugins/link/dialogs/link.js index 61a58e634f8..105948bedc0 100755 --- a/plugins/link/dialogs/link.js +++ b/plugins/link/dialogs/link.js @@ -201,7 +201,7 @@ if ( dialog.getContentElement( 'info', 'linkType' ) && dialog.getValueOf( 'info', 'linkType' ) != 'url' ) return true; - if ( ( /javascript\:/ ).test( this.getValue() ) ) { + if ( !editor.config.linkJavaScriptLinksAllowed && ( /javascript\:/ ).test( this.getValue() ) ) { alert( commonLang.invalidValue ); return false; } diff --git a/plugins/link/plugin.js b/plugins/link/plugin.js index 2d1595d0de7..18aa0282ebe 100755 --- a/plugins/link/plugin.js +++ b/plugins/link/plugin.js @@ -754,5 +754,14 @@ * @member CKEDITOR.config */ linkShowTargetTab: true + + /** + * Whether JavaScript code is allowed as a `href` attribute in anchor tag. + * + * hello world + * + * @cfg {Boolean} [linkJavaScriptLinksAllowed=false] + * @member CKEDITOR.config + */ } ); } )(); \ No newline at end of file From e55b60fbb2bb7778c3449ffd2ef18c060e923cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Wed, 7 May 2014 08:52:11 +0200 Subject: [PATCH 2/4] Clarified documentation. --- plugins/link/plugin.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/link/plugin.js b/plugins/link/plugin.js index 18aa0282ebe..e2a7c4d47ee 100755 --- a/plugins/link/plugin.js +++ b/plugins/link/plugin.js @@ -757,9 +757,13 @@ /** * Whether JavaScript code is allowed as a `href` attribute in anchor tag. + * With this option enabled it is possible to create links like: * * hello world * + * By default JavaScript links are not allowed and will not pass + * the dialog validation. + * * @cfg {Boolean} [linkJavaScriptLinksAllowed=false] * @member CKEDITOR.config */ From 7ba867a1bb9ca29c62b09e08b9b5cd7eefbeb64d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Thu, 8 May 2014 11:49:50 +0200 Subject: [PATCH 3/4] Added @since tag. --- plugins/link/plugin.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/link/plugin.js b/plugins/link/plugin.js index e2a7c4d47ee..fcbc4279179 100755 --- a/plugins/link/plugin.js +++ b/plugins/link/plugin.js @@ -764,6 +764,7 @@ * By default JavaScript links are not allowed and will not pass * the dialog validation. * + * @since 4.4.1 * @cfg {Boolean} [linkJavaScriptLinksAllowed=false] * @member CKEDITOR.config */ From 9b11b6cd6a6fa23902c98ce95bf386923f676eed Mon Sep 17 00:00:00 2001 From: adelura Date: Thu, 8 May 2014 13:33:55 +0200 Subject: [PATCH 4/4] Changelog entry. --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index f8f23bf080a..ad168c7279e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ CKEditor 4 Changelog ## CKEditor 4.4.1 Fixed Issues: +* [#9661](http://dev.ckeditor.com/ticket/9661): Added optional, configurable possibility to set JavaScript code in `href` attribute in anchor tags. * [#11809](http://dev.ckeditor.com/ticket/11809): Set indentation to four spaces in [Code Snippet](http://ckeditor.com/addon/codesnippet) sample. * [#11223](http://dev.ckeditor.com/ticket/11223): Fixed: issue when [Protected Source](http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-protectedSource) was not working in the title element. * [#11859](http://dev.ckeditor.com/ticket/11859): Fixed: Removed [Source Dialog](http://ckeditor.com/addon/sourcedialog) plugin from required in [Code Snippet](http://ckeditor.com/addon/codesnippet) sample.