[BUGFIX] RTE: Disable autolink functionality in source-mode 71/57371/2
authorJosef Glatz <josefglatz@gmail.com>
Mon, 25 Jun 2018 20:21:10 +0000 (22:21 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 26 Jun 2018 08:51:37 +0000 (10:51 +0200)
Limit the functionality only to the wysiwyg-mode. This also
prevents javascript errors in source-mode.

Resolves: #85332
Releases: master, 8.7
Change-Id: I0adc30400fb27745713f0a86b7916a8865609428
Reviewed-on: https://review.typo3.org/57371
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Wittkiel Gruppe <ts@wittkiel-gruppe.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/rte_ckeditor/Resources/Public/JavaScript/Plugins/autolinking.js

index 43a97a5..f0cfda1 100644 (file)
@@ -121,8 +121,10 @@ CKEDITOR.plugins.add('autolinking', {
       };
 
       editor.on('key', function(evt) {
-        if (evt.data.keyCode === spaceChar || evt.data.keyCode === tabChar || evt.data.keyCode === enterChar) {
-          editor.autolinking(evt);
+        if (this.mode !== 'source') {
+          if (evt.data.keyCode === spaceChar || evt.data.keyCode === tabChar || evt.data.keyCode === enterChar) {
+            editor.autolinking(evt);
+          }
         }
       });
     });