X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fckeditor%2Fjs%2Fplugins%2Fdrupalimagecaption%2Fplugin.js;h=7cd215a70589c674a9afa4badca054a250350e97;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=c9c9427327023947c4cff89f6310622b28a46372;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js b/web/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js index c9c942732..7cd215a70 100644 --- a/web/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js +++ b/web/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js @@ -6,6 +6,22 @@ **/ (function (CKEDITOR) { + function findElementByName(element, name) { + if (element.name === name) { + return element; + } + + var found = null; + element.forEach(function (el) { + if (el.name === name) { + found = el; + + return false; + } + }, CKEDITOR.NODE_ELEMENT); + return found; + } + CKEDITOR.plugins.add('drupalimagecaption', { requires: 'drupalimage', @@ -72,9 +88,11 @@ widgetDefinition.upcast = function (element, data) { if (element.name !== 'img' || !element.attributes['data-entity-type'] || !element.attributes['data-entity-uuid']) { return; - } else if (element.attributes['data-cke-realelement']) { - return; - } + } + + if (element.attributes['data-cke-realelement']) { + return; + } element = originalUpcast.call(this, element, data); var attrs = element.attributes; @@ -192,20 +210,4 @@ } } }); - - function findElementByName(element, name) { - if (element.name === name) { - return element; - } - - var found = null; - element.forEach(function (el) { - if (el.name === name) { - found = el; - - return false; - } - }, CKEDITOR.NODE_ELEMENT); - return found; - } })(CKEDITOR); \ No newline at end of file