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. 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..fcbc4279179 100755 --- a/plugins/link/plugin.js +++ b/plugins/link/plugin.js @@ -754,5 +754,19 @@ * @member CKEDITOR.config */ linkShowTargetTab: true + + /** + * 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. + * + * @since 4.4.1 + * @cfg {Boolean} [linkJavaScriptLinksAllowed=false] + * @member CKEDITOR.config + */ } ); } )(); \ No newline at end of file