Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / token / js / token.js
index f9d6862c072db281a9059caa0007d03f6bd5600c..3a41d6259a18efde7c4d706769b993e8192ed9b8 100644 (file)
           else if (typeof(CKEDITOR) != 'undefined' && CKEDITOR.currentInstance) {
             CKEDITOR.currentInstance.insertHtml(content);
           }
+          // Direct CodeMirror support.
+          else if (typeof(CodeMirror) != 'undefined' && drupalSettings.tokenFocusedField && $(drupalSettings.tokenFocusedField).parents('.CodeMirror').length) {
+            var editor = $(drupalSettings.tokenFocusedField).parents('.CodeMirror')[0].CodeMirror;
+            editor.replaceSelection(content);
+            editor.focus();
+          }
           // WYSIWYG support, should work in all editors if available.
           else if (Drupal.wysiwyg && Drupal.wysiwyg.activeId) {
             Drupal.wysiwyg.instances[Drupal.wysiwyg.activeId].insert(content)