roojs-core.js
authorAlan Knowles <alan@roojs.com>
Tue, 20 Aug 2013 04:19:01 +0000 (12:19 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 20 Aug 2013 04:19:01 +0000 (12:19 +0800)
roojs-core-debug.js
roojs-ui.js
roojs-ui-debug.js

roojs-ui-debug.js
roojs-ui.js

index 02bb933..4f56145 100644 (file)
@@ -26650,7 +26650,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
             e.preventDefault(); // what does this do?
         });
 
-        if(!this.disable.font && !Roo.isSafari){
+        if(!this.disable.font) { // && !Roo.isSafari){
             /* why no safari for fonts */
             editor.fontSelect = tb.el.createChild({
                 tag:'select',
index b4ac463..bf7db05 100644 (file)
@@ -583,7 +583,7 @@ F.push(p);return true;});if(F.length){A.setAttribute(n,F.join(';'));}else {A.rem
 this.cleanUpChildren(A);}});Roo.form.HtmlEditor.white=['area','br','img','input','hr','wbr','address','blockquote','center','dd','dir','div','dl','dt','h1','h2','h3','h4','h5','h6','hr','isindex','listing','marquee','menu','multicol','ol','p','plaintext','pre','table','ul','xmp','caption','col','colgroup','tbody','td','tfoot','th','thead','tr','dir','menu','ol','ul','dl','embed','object'];Roo.form.HtmlEditor.black=['applet','base','basefont','bgsound','blink','body','frame','frameset','head','html','ilayer','iframe','layer','link','meta','object','script','style','title','xml'];Roo.form.HtmlEditor.clean=['script','style','title','xml'];Roo.form.HtmlEditor.remove=['font'];Roo.form.HtmlEditor.ablack=['on'];Roo.form.HtmlEditor.aclean=['action','background','codebase','dynsrc','href','lowsrc'];Roo.form.HtmlEditor.pwhite=['http','https','mailto'];Roo.form.HtmlEditor.cwhite=['text-align'];Roo.form.HtmlEditor.cblack=[];Roo.form.HtmlEditor.swapCodes=[[8211,"--"],[8212,"--"],[8216,"'"],[8217,"'"],[8220,'"'],[8221,'"'],[8226,"*"],[8230,"..."]];
 //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"]],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function btn(id,F,G){var H=B+'-'+id;return {id:H,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:F!==false,scope:A,handler:G||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&&!Roo.isSafari){A.fontSelect=tb.el.createChild({tag:'select',tabIndex:-1,cls:'x-font-select',html:A.createFontOptions()});A.fontSelect.on('change',function(){var F=A.fontSelect.dom.value;A.relayCmd('fontname',F);A.deferFocus();},A);tb.add(A.fontSelect.dom,'-');};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,F){A.execCmd('forecolor',Roo.isSafari||Roo.isIE?'#'+F:F);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,F){if(Roo.isGecko){A.execCmd('useCSS',false);A.execCmd('hilitecolor',F);A.execCmd('useCSS',true);A.deferFocus();}else {A.execCmd(Roo.isOpera?'hilitecolor':'backcolor',Roo.isSafari||Roo.isIE?'#'+F:F);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(F){this.toggleSourceEdit(F.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});}
+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"]],defaultFont:'tahoma',fontSelect:false,formatCombo:false,init:function(A){this.editor=A;var B=A.frameId;var C=this;function btn(id,F,G){var H=B+'-'+id;return {id:H,cmd:id,cls:'x-btn-icon x-edit-'+id,enableToggle:F!==false,scope:A,handler:G||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){A.fontSelect=tb.el.createChild({tag:'select',tabIndex:-1,cls:'x-font-select',html:A.createFontOptions()});A.fontSelect.on('change',function(){var F=A.fontSelect.dom.value;A.relayCmd('fontname',F);A.deferFocus();},A);tb.add(A.fontSelect.dom,'-');};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,F){A.execCmd('forecolor',Roo.isSafari||Roo.isIE?'#'+F:F);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,F){if(Roo.isGecko){A.execCmd('useCSS',false);A.execCmd('hilitecolor',F);A.execCmd('useCSS',true);A.deferFocus();}else {A.execCmd(Roo.isOpera?'hilitecolor':'backcolor',Roo.isSafari||Roo.isIE?'#'+F:F);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(F){this.toggleSourceEdit(F.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);}if(!this.disable.specialElements){var E={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i<this.specialElements.length;i++){E.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);}},this.specialElements[i]));}
 tb.add(E);}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(F){if(F.id!=A.frameId+'-sourceedit'){F.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;}}}