I have a rule
// Editor status: 0 // Executes when in html source mode. if ( htmlFilter ) { htmlFilter.addRules({ // Loop through all elements elements: { // Perform this when it found image tag. img : function( element) { // Replace inline image with INLINE placeholder (comment). // Only run this when toggling "Source" button if (element.attributes.class == 'wysiwyg-inline-image') { // Return the image alt value. return new CKEDITOR.htmlParser.comment(element.attributes.alt); } // Return this when saving the node using "Save" button. else { return element; } } } }); }
Anyone knows what is the API that I can use to wrap this code below so that it will execute only when I switch to html source using "Source" button?
// Replace inline image with INLINE placeholder (comment). // Only run this when toggling "Source" button if (element.attributes.class == 'wysiwyg-inline-image') { // Return the image alt value. return new CKEDITOR.htmlParser.comment(element.attributes.alt); }
Thanks