source: sandbox/2.3-MailArchiver/filemanager/tp/ckeditor/plugins/removeformat/plugin.js @ 6779

Revision 6779, 1.6 KB checked in by rafaelraymundo, 12 years ago (diff)

Ticket #2946 - Liberado Expresso(branch 2.3) integrado ao MailArchiver?.

Line 
1/*
2Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
3For licensing, see LICENSE.html or http://ckeditor.com/license
4*/
5
6CKEDITOR.plugins.add('removeformat',{requires:['selection'],init:function(a){a.addCommand('removeFormat',CKEDITOR.plugins.removeformat.commands.removeformat);a.ui.addButton('RemoveFormat',{label:a.lang.removeFormat,command:'removeFormat'});}});CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(a){var b=a._.removeFormatRegex||(a._.removeFormatRegex=new RegExp('^(?:'+a.config.removeFormatTags.replace(/,/g,'|')+')$','i')),c=a._.removeAttributes||(a._.removeAttributes=a.config.removeFormatAttributes.split(',')),d=a.getSelection().getRanges();for(var e=0,f;f=d[e];e++){if(f.collapsed)continue;f.enlarge(CKEDITOR.ENLARGE_ELEMENT);var g=f.createBookmark(),h=g.startNode,i=g.endNode,j=function(m){var n=new CKEDITOR.dom.elementPath(m),o=n.elements;for(var p=1,q;q=o[p];p++){if(q.equals(n.block)||q.equals(n.blockLimit))break;if(b.test(q.getName()))m.breakParent(q);}};j(h);j(i);var k=h.getNextSourceNode(true,CKEDITOR.NODE_ELEMENT);while(k){if(k.equals(i))break;var l=k.getNextSourceNode(false,CKEDITOR.NODE_ELEMENT);if(k.getName()!='img'||!k.getAttribute('_cke_protected_html'))if(b.test(k.getName()))k.remove(true);else k.removeAttributes(c);k=l;}f.moveToBookmark(g);}a.getSelection().selectRanges(d);}}}};CKEDITOR.config.removeFormatTags='b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var';CKEDITOR.config.removeFormatAttributes='class,style,lang,width,height,align,hspace,valign';
Note: See TracBrowser for help on using the repository browser.