Added Entity and Entity Reference Revisions which got dropped somewhere along the...
[yaffs-website] / web / core / modules / ckeditor / js / ckeditor.js
index 17477e559e17293420a85da73390fc9babd911e8..cc12d7389e71b6ddfd9aba24500a1fa1199c000c 100644 (file)
@@ -15,7 +15,9 @@
       };
 
       var label = $('label[for=' + element.getAttribute('id') + ']').html();
-      format.editorSettings.title = Drupal.t('Rich Text Editor, !label field', { '!label': label });
+      format.editorSettings.title = Drupal.t('Rich Text Editor, !label field', {
+        '!label': label
+      });
 
       return !!CKEDITOR.replace(element, format.editorSettings);
     },
       var externalPlugins = format.editorSettings.drupalExternalPlugins;
 
       if (externalPlugins) {
-        for (var pluginName in externalPlugins) {
-          if (externalPlugins.hasOwnProperty(pluginName)) {
-            CKEDITOR.plugins.addExternal(pluginName, externalPlugins[pluginName], '');
-          }
-        }
+        Object.keys(externalPlugins || {}).forEach(function (pluginName) {
+          CKEDITOR.plugins.addExternal(pluginName, externalPlugins[pluginName], '');
+        });
         delete format.editorSettings.drupalExternalPlugins;
       }
     }
   });
 
   function redirectTextareaFragmentToCKEditorInstance() {
-    var hash = location.hash.substr(1);
+    var hash = window.location.hash.substr(1);
     var element = document.getElementById(hash);
     if (element) {
       var editor = CKEDITOR.dom.element.get(element).getEditor();
       if (editor) {
         var id = editor.container.getAttribute('id');
-        location.replace('#' + id);
+        window.location.replace('#' + id);
       }
     }
   }