(function ($) { // @todo Array syntax required; 'break' is a predefined token in JavaScript. Drupal.wysiwyg.plugins['break'] = { /** * Return whether the passed node belongs to this plugin. */ isNode: function(node) { return ($(node).is('img.wysiwyg-break')); }, /** * Execute the button. */ invoke: function(data, settings, instanceId) { if (data.format == 'html') { // Prevent duplicating a teaser break. if ($(data.node).is('img.wysiwyg-break')) { return; } var content = this._getPlaceholder(settings); } else { // Prevent duplicating a teaser break. // @todo data.content is the selection only; needs access to complete content. if (data.content.match(//)) { return; } var content = ''; } if (typeof content != 'undefined') { Drupal.wysiwyg.instances[instanceId].insert(content); } }, /** * Replace all tags with images. */ attach: function(content, settings, instanceId) { content = content.replace(//g, this._getPlaceholder(settings)); return content; }, /** * Replace images with tags in content upon detaching editor. */ detach: function(content, settings, instanceId) { var $content = $('