roojs-all.js
authorEdward <edward@roojs.com>
Mon, 13 Jan 2014 09:17:32 +0000 (17:17 +0800)
committerEdward <edward@roojs.com>
Mon, 13 Jan 2014 09:17:32 +0000 (17:17 +0800)
roojs-debug.js

roojs-all.js
roojs-debug.js

index 8e58d62..b3f7174 100644 (file)
@@ -892,7 +892,7 @@ this.cleanUpChildren(A);}});Roo.form.HtmlEditor.white=['area','br','img','input'
 //Roo/form/HtmlEditor/ToolbarStandard.js
 Roo.form.HtmlEditor.ToolbarStandard=function(A){Roo.apply(this,A);this.disable=this.disable||{};Roo.applyIf(this.disable,{fontSize:true,colors:true,specialElements:true});}
 Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,{tb:false,rendered:false,editor:false,disable:false,fontFamilies:['Arial','Courier New','Tahoma','Times New Roman','Verdana'],specialChars:["&#169;","&#174;","&#8482;","&#163;","&#8230;","&#247;","&#8364;","&#176;"],specialElements:[{text:"Insert Table",xtype:'MenuItem',xns:Roo.Menu,ihtml:'<table><tr><td>Cell</td></tr></table>'},{text:"Insert Image",xtype:'MenuItem',xns:Roo.Menu,ihtml:'<img src="about:blank"/>'}],inputElements:["form","input:text","input:hidden","input:checkbox","input:radio","input:password","input:submit","input:button","select","textarea","label"],formats:[["p"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["pre"],["code"],["abbr"],["acronym"],["address"],["cite"],["samp"],["var"],['div'],['span']],cleanStyles:["font-size"],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function btn(id,G,H){var I=B+'-'+id;return {id:I,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:G!==false,scope:A,handler:H||A.relayBtnCmd,clickEvent:'mousedown',tooltip:C.buttonTips[id]||undefined,tabIndex:-1};}var tb=new Roo.Toolbar(A.wrap.dom.firstChild);this.tb=tb;tb.el.on('click',function(e){e.preventDefault();});if(!this.disable.font){};if(!this.disable.formats){this.formatCombo=new Roo.form.ComboBox({store:new Roo.data.SimpleStore({id:'tag',fields:['tag'],data:this.formats}),blockFocus:true,name:'',displayField:'tag',typeAhead:false,mode:'local',editable:false,triggerAction:'all',emptyText:'Add tag',selectOnFocus:true,width:135,listeners:{'select':function(c,r,i){A.insertTag(r.get('tag'));A.focus();}}});tb.addField(this.formatCombo);}if(!this.disable.format){tb.add(btn('bold'),btn('italic'),btn('underline'));};if(!this.disable.fontSize){tb.add('-',btn('increasefontsize',false,A.adjustFont),btn('decreasefontsize',false,A.adjustFont));};if(!this.disable.colors){tb.add('-',{id:A.frameId+'-forecolor',cls:'x-btn-icon x-edit-forecolor',clickEvent:'mousedown',tooltip:this.buttonTips['forecolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({allowReselect:true,focus:Roo.emptyFn,value:'000000',plain:true,selectHandler:function(cp,G){A.execCmd('forecolor',Roo.isSafari||Roo.isIE?'#'+G:G);A.deferFocus();},scope:A,clickEvent:'mousedown'})},{id:A.frameId+'backcolor',cls:'x-btn-icon x-edit-backcolor',clickEvent:'mousedown',tooltip:this.buttonTips['backcolor']||undefined,tabIndex:-1,menu:new Roo.menu.ColorMenu({focus:Roo.emptyFn,value:'FFFFFF',plain:true,allowReselect:true,selectHandler:function(cp,G){if(Roo.isGecko){A.execCmd('useCSS',false);A.execCmd('hilitecolor',G);A.execCmd('useCSS',true);A.deferFocus();}else {A.execCmd(Roo.isOpera?'hilitecolor':'backcolor',Roo.isSafari||Roo.isIE?'#'+G:G);A.deferFocus();}},scope:A,clickEvent:'mousedown'})});};if(!this.disable.alignments){tb.add('-',btn('justifyleft'),btn('justifycenter'),btn('justifyright'));};if(!this.disable.links){tb.add('-',btn('createlink',false,A.createLink));};if(!this.disable.lists){tb.add('-',btn('insertorderedlist'),btn('insertunorderedlist'));}if(!this.disable.sourceEdit){tb.add('-',btn('sourceedit',true,function(G){this.toggleSourceEdit(G.pressed);}));}var D={};if(!this.disable.special){D={text:"&#169;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i<this.specialChars.length;i++){D.menu.items.push({html:this.specialChars[i],handler:function(a,b){A.insertAtCursor(String.fromCharCode(a.html.replace('&#','').replace(';','')));},tabIndex:-1});}
-tb.add(D);}var E={};if(!this.disable.cleanStyles){E={cls:'x-btn-icon x-btn-clear',menu:{items:[]}};for(var i=0;i<this.cleanStyles.length;i++){E.menu.items.push({html:this.cleanStyles[i],handler:function(a,b){var c=Roo.get(A.doc.body);c.select('[style]').each(function(s){s.dom.style.removeProperty(a.html);});},tabIndex:-1});}
+tb.add(D);}var E={};if(!this.disable.cleanStyles){E={cls:'x-btn-icon x-btn-clear',menu:{items:[]}};for(var i=0;i<this.cleanStyles.length;i++){E.menu.items.push({actiontype:this.cleanStyles[i],html:'Remove '+this.cleanStyles[i],handler:function(a,b){Roo.log(a);Roo.log(b);var c=Roo.get(A.doc.body);c.select('[style]').each(function(s){s.dom.style.removeProperty(a.actiontype);});},tabIndex:-1});}
 tb.add(E);}if(!this.disable.specialElements){var F={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i<this.specialElements.length;i++){F.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);}},this.specialElements[i]));}
 tb.add(F);}if(this.btns){for(var i=0;i<this.btns.length;i++){var b=Roo.factory(this.btns[i],Roo.form);b.cls='x-edit-none';b.scope=A;tb.add(b);}}
 this.tb.items.each(function(G){if(G.id!=A.frameId+'-sourceedit'){G.disable();}});this.rendered=true;A.on('editorevent',this.updateToolbar,this);},updateToolbar:function(){if(!this.editor.activated){this.editor.onFirstFocus();return;}var A=this.tb.items.map,B=this.editor.doc,C=this.editor.frameId;if(!this.disable.font&&!Roo.isSafari){}if(!this.disable.format){A[C+'-bold'].toggle(B.queryCommandState('bold'));A[C+'-italic'].toggle(B.queryCommandState('italic'));A[C+'-underline'].toggle(B.queryCommandState('underline'));}if(!this.disable.alignments){A[C+'-justifyleft'].toggle(B.queryCommandState('justifyleft'));A[C+'-justifycenter'].toggle(B.queryCommandState('justifycenter'));A[C+'-justifyright'].toggle(B.queryCommandState('justifyright'));}if(!Roo.isSafari&&!this.disable.lists){A[C+'-insertorderedlist'].toggle(B.queryCommandState('insertorderedlist'));A[C+'-insertunorderedlist'].toggle(B.queryCommandState('insertunorderedlist'));}var D=this.editor.getAllAncestors();if(this.formatCombo){var E=this.formatCombo.store;this.formatCombo.setValue("");for(var i=0;i<D.length;i++){if(D[i]&&E.query('tag',D[i].tagName.toLowerCase(),false).length){this.formatCombo.setValue(D[i].tagName.toLowerCase());break;}}}
index 4b8400f..25b48d4 100644 (file)
@@ -41933,12 +41933,14 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
             };
             for (var i =0; i < this.cleanStyles.length; i++) {
                 cmenu.menu.items.push({
-                    
-                    html: this.cleanStyles[i],
+                    actiontype : this.cleanStyles[i],
+                    html: 'Remove ' + this.cleanStyles[i],
                     handler: function(a,b) {
+                        Roo.log(a);
+                        Roo.log(b);
                         var c = Roo.get(editor.doc.body);
                         c.select('[style]').each(function(s) {
-                            s.dom.style.removeProperty(a.html);
+                            s.dom.style.removeProperty(a.actiontype);
                         });
                         
                     },