roojs-ui.js wip_alan_T6048_clean_up_hanging_span_content
authorAlan Knowles <alan@roojs.com>
Thu, 26 Sep 2019 02:22:03 +0000 (10:22 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 26 Sep 2019 02:22:03 +0000 (10:22 +0800)
roojs-ui-debug.js
roojs-all.js
roojs-debug.js

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

index cda078c..bd2adb5 100644 (file)
@@ -1872,24 +1872,25 @@ B.execCmd('hilitecolor',H);B.execCmd('useCSS',true);A.deferFocus();}else{B.execC
 },tabIndex:-1});}tb.add(E);}var F={};if(!this.disable.cleanStyles){F={cls:'x-btn-icon x-btn-clear',menu:{items:[]}};for(var i=0;i<this.cleanStyles.length;i++){F.menu.items.push({actiontype:this.cleanStyles[i],html:'Remove '+this.cleanStyles[i],handler:function(a,b){var c=Roo.get(B.doc.body);
 c.select('[style]').each(function(s){s.dom.style.removeProperty(a.actiontype);});B.syncValue();},tabIndex:-1});}F.menu.items.push({actiontype:'tablewidths',html:'Remove Table Widths',handler:function(a,b){B.cleanTableWidths();B.syncValue();},tabIndex:-1});
 F.menu.items.push({actiontype:'word',html:'Remove MS Word Formating',handler:function(a,b){B.cleanWord();B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All Styles',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[style]').each(function(s){s.dom.removeAttribute('style');
-});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All CSS Classes',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[class]').each(function(s){s.dom.removeAttribute('class');});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'tidy',html:'Tidy HTML Source',handler:function(a,b){B.doc.body.innerHTML=B.domToHTML();
-B.syncValue();},tabIndex:-1});tb.add(F);}if(!this.disable.specialElements){var G={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i<this.specialElements.length;i++){G.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);
-}},this.specialElements[i]));}tb.add(G);}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';if(typeof(this.btns[i].cls)!='undefined'&&this.btns[i].cls.indexOf('x-init-enable')!==-1){b.cls+=' x-init-enable';
-}b.scope=B;tb.add(b);}}this.tb.items.each(function(H){if(H.id!=B.frameId+'-sourceedit'&&(typeof(H.cls)!='undefined'&&H.cls.indexOf('x-init-enable')===-1)){H.disable();}});this.rendered=true;A.on('editorevent',this.updateToolbar,this);},relayBtnCmd:function(A){this.editorcore.relayCmd(A.cmd);
-},createLink:function(){Roo.log("create link?");var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!='http:/'+'/'){this.editorcore.relayCmd('createlink',A);}},updateToolbar:function(){if(!this.editorcore.activated){this.editor.onFirstFocus();return;
-}var A=this.tb.items.map,B=this.editorcore.doc,C=this.editorcore.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'));
-A[C+'-strikethrough'].toggle(B.queryCommandState('strikethrough'));}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.editorcore.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;}}}Roo.menu.MenuMgr.hideAll();},createFontOptions:function(){var A=[],fs=this.fontFamilies,ff,lc;
-for(var i=0,B=fs.length;i<B;i++){ff=fs[i];lc=ff.toLowerCase();A.push('<option value="',lc,'" style="font-family:',ff,';"',(this.defaultFont==lc?' selected="true">':'>'),ff,'</option>');}return A.join('');},toggleSourceEdit:function(A){Roo.log("toolbar toogle");
-if(A===undefined){A=!this.sourceEditMode;}this.sourceEditMode=A===true;var B=this.tb.items.get(this.editorcore.frameId+'-sourceedit');if(B.pressed!==this.sourceEditMode){B.toggle(this.sourceEditMode);return;}if(A){Roo.log("disabling buttons");this.tb.items.each(function(C){if(C.cmd!='sourceedit'&&(typeof(C.cls)!='undefined'&&C.cls.indexOf('x-init-enable')===-1)){C.disable();
-}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.tb.items.each(function(C){C.enable();});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'}
-,italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},strikethrough:{title:'Strikethrough',text:'Strikethrough the selected text.',cls:'x-html-editor-tip'}
-,increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'}
-,forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'}
-,justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'}
-,createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();
-if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});}});
+});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All CSS Classes',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[class]').each(function(s){s.dom.removeAttribute('class');});B.cleanWord();B.syncValue();},tabIndex:-1}
+);F.menu.items.push({actiontype:'tidy',html:'Tidy HTML Source',handler:function(a,b){B.doc.body.innerHTML=B.domToHTML();B.syncValue();},tabIndex:-1});tb.add(F);}if(!this.disable.specialElements){var G={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;
+i<this.specialElements.length;i++){G.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);}},this.specialElements[i]));}tb.add(G);}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';
+if(typeof(this.btns[i].cls)!='undefined'&&this.btns[i].cls.indexOf('x-init-enable')!==-1){b.cls+=' x-init-enable';}b.scope=B;tb.add(b);}}this.tb.items.each(function(H){if(H.id!=B.frameId+'-sourceedit'&&(typeof(H.cls)!='undefined'&&H.cls.indexOf('x-init-enable')===-1)){H.disable();
+}});this.rendered=true;A.on('editorevent',this.updateToolbar,this);},relayBtnCmd:function(A){this.editorcore.relayCmd(A.cmd);},createLink:function(){Roo.log("create link?");var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!='http:/'+'/'){this.editorcore.relayCmd('createlink',A);
+}},updateToolbar:function(){if(!this.editorcore.activated){this.editor.onFirstFocus();return;}var A=this.tb.items.map,B=this.editorcore.doc,C=this.editorcore.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'));A[C+'-strikethrough'].toggle(B.queryCommandState('strikethrough'));}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.editorcore.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;}}}Roo.menu.MenuMgr.hideAll();},createFontOptions:function(){var A=[],fs=this.fontFamilies,ff,lc;for(var i=0,B=fs.length;i<B;i++){ff=fs[i];lc=ff.toLowerCase();A.push('<option value="',lc,'" style="font-family:',ff,';"',(this.defaultFont==lc?' selected="true">':'>'),ff,'</option>');
+}return A.join('');},toggleSourceEdit:function(A){Roo.log("toolbar toogle");if(A===undefined){A=!this.sourceEditMode;}this.sourceEditMode=A===true;var B=this.tb.items.get(this.editorcore.frameId+'-sourceedit');if(B.pressed!==this.sourceEditMode){B.toggle(this.sourceEditMode);
+return;}if(A){Roo.log("disabling buttons");this.tb.items.each(function(C){if(C.cmd!='sourceedit'&&(typeof(C.cls)!='undefined'&&C.cls.indexOf('x-init-enable')===-1)){C.disable();}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.tb.items.each(function(C){C.enable();
+});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'}
+,underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},strikethrough:{title:'Strikethrough',text:'Strikethrough the selected text.',cls:'x-html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'}
+,decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'}
+,justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'}
+,insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'}
+,sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();
+});}});
 // Roo/form/HtmlEditor/ToolbarContext.js
 Roo.form.HtmlEditor.ToolbarContext=function(A){Roo.apply(this,A);this.styles=this.styles||{};};Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80}
 ,border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},target:{title:"Target",width:120},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}
index ababced..9f65734 100644 (file)
@@ -45693,6 +45693,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
                     c.select('[class]').each(function(s) {
                         s.dom.removeAttribute('class');
                     });
+                    editorcore.cleanWord();
                     editorcore.syncValue();
                 },
                 tabIndex:-1
index a4345a7..4bc1c3f 100644 (file)
@@ -23242,6 +23242,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
                     c.select('[class]').each(function(s) {
                         s.dom.removeAttribute('class');
                     });
+                    editorcore.cleanWord();
                     editorcore.syncValue();
                 },
                 tabIndex:-1
index 723b7cb..f5b570e 100644 (file)
@@ -1003,24 +1003,25 @@ B.execCmd('hilitecolor',H);B.execCmd('useCSS',true);A.deferFocus();}else{B.execC
 },tabIndex:-1});}tb.add(E);}var F={};if(!this.disable.cleanStyles){F={cls:'x-btn-icon x-btn-clear',menu:{items:[]}};for(var i=0;i<this.cleanStyles.length;i++){F.menu.items.push({actiontype:this.cleanStyles[i],html:'Remove '+this.cleanStyles[i],handler:function(a,b){var c=Roo.get(B.doc.body);
 c.select('[style]').each(function(s){s.dom.style.removeProperty(a.actiontype);});B.syncValue();},tabIndex:-1});}F.menu.items.push({actiontype:'tablewidths',html:'Remove Table Widths',handler:function(a,b){B.cleanTableWidths();B.syncValue();},tabIndex:-1});
 F.menu.items.push({actiontype:'word',html:'Remove MS Word Formating',handler:function(a,b){B.cleanWord();B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All Styles',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[style]').each(function(s){s.dom.removeAttribute('style');
-});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All CSS Classes',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[class]').each(function(s){s.dom.removeAttribute('class');});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'tidy',html:'Tidy HTML Source',handler:function(a,b){B.doc.body.innerHTML=B.domToHTML();
-B.syncValue();},tabIndex:-1});tb.add(F);}if(!this.disable.specialElements){var G={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;i<this.specialElements.length;i++){G.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);
-}},this.specialElements[i]));}tb.add(G);}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';if(typeof(this.btns[i].cls)!='undefined'&&this.btns[i].cls.indexOf('x-init-enable')!==-1){b.cls+=' x-init-enable';
-}b.scope=B;tb.add(b);}}this.tb.items.each(function(H){if(H.id!=B.frameId+'-sourceedit'&&(typeof(H.cls)!='undefined'&&H.cls.indexOf('x-init-enable')===-1)){H.disable();}});this.rendered=true;A.on('editorevent',this.updateToolbar,this);},relayBtnCmd:function(A){this.editorcore.relayCmd(A.cmd);
-},createLink:function(){Roo.log("create link?");var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!='http:/'+'/'){this.editorcore.relayCmd('createlink',A);}},updateToolbar:function(){if(!this.editorcore.activated){this.editor.onFirstFocus();return;
-}var A=this.tb.items.map,B=this.editorcore.doc,C=this.editorcore.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'));
-A[C+'-strikethrough'].toggle(B.queryCommandState('strikethrough'));}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.editorcore.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;}}}Roo.menu.MenuMgr.hideAll();},createFontOptions:function(){var A=[],fs=this.fontFamilies,ff,lc;
-for(var i=0,B=fs.length;i<B;i++){ff=fs[i];lc=ff.toLowerCase();A.push('<option value="',lc,'" style="font-family:',ff,';"',(this.defaultFont==lc?' selected="true">':'>'),ff,'</option>');}return A.join('');},toggleSourceEdit:function(A){Roo.log("toolbar toogle");
-if(A===undefined){A=!this.sourceEditMode;}this.sourceEditMode=A===true;var B=this.tb.items.get(this.editorcore.frameId+'-sourceedit');if(B.pressed!==this.sourceEditMode){B.toggle(this.sourceEditMode);return;}if(A){Roo.log("disabling buttons");this.tb.items.each(function(C){if(C.cmd!='sourceedit'&&(typeof(C.cls)!='undefined'&&C.cls.indexOf('x-init-enable')===-1)){C.disable();
-}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.tb.items.each(function(C){C.enable();});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'}
-,italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'},underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},strikethrough:{title:'Strikethrough',text:'Strikethrough the selected text.',cls:'x-html-editor-tip'}
-,increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'},decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'}
-,forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'},justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'}
-,justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'},insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'}
-,createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'},sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();
-if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();});}});
+});B.syncValue();},tabIndex:-1});F.menu.items.push({actiontype:'all',html:'Remove All CSS Classes',handler:function(a,b){var c=Roo.get(B.doc.body);c.select('[class]').each(function(s){s.dom.removeAttribute('class');});B.cleanWord();B.syncValue();},tabIndex:-1}
+);F.menu.items.push({actiontype:'tidy',html:'Tidy HTML Source',handler:function(a,b){B.doc.body.innerHTML=B.domToHTML();B.syncValue();},tabIndex:-1});tb.add(F);}if(!this.disable.specialElements){var G={text:"Other;",cls:'x-edit-none',menu:{items:[]}};for(var i=0;
+i<this.specialElements.length;i++){G.menu.items.push(Roo.apply({handler:function(a,b){A.insertAtCursor(this.ihtml);}},this.specialElements[i]));}tb.add(G);}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';
+if(typeof(this.btns[i].cls)!='undefined'&&this.btns[i].cls.indexOf('x-init-enable')!==-1){b.cls+=' x-init-enable';}b.scope=B;tb.add(b);}}this.tb.items.each(function(H){if(H.id!=B.frameId+'-sourceedit'&&(typeof(H.cls)!='undefined'&&H.cls.indexOf('x-init-enable')===-1)){H.disable();
+}});this.rendered=true;A.on('editorevent',this.updateToolbar,this);},relayBtnCmd:function(A){this.editorcore.relayCmd(A.cmd);},createLink:function(){Roo.log("create link?");var A=prompt(this.createLinkText,this.defaultLinkValue);if(A&&A!='http:/'+'/'){this.editorcore.relayCmd('createlink',A);
+}},updateToolbar:function(){if(!this.editorcore.activated){this.editor.onFirstFocus();return;}var A=this.tb.items.map,B=this.editorcore.doc,C=this.editorcore.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'));A[C+'-strikethrough'].toggle(B.queryCommandState('strikethrough'));}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.editorcore.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;}}}Roo.menu.MenuMgr.hideAll();},createFontOptions:function(){var A=[],fs=this.fontFamilies,ff,lc;for(var i=0,B=fs.length;i<B;i++){ff=fs[i];lc=ff.toLowerCase();A.push('<option value="',lc,'" style="font-family:',ff,';"',(this.defaultFont==lc?' selected="true">':'>'),ff,'</option>');
+}return A.join('');},toggleSourceEdit:function(A){Roo.log("toolbar toogle");if(A===undefined){A=!this.sourceEditMode;}this.sourceEditMode=A===true;var B=this.tb.items.get(this.editorcore.frameId+'-sourceedit');if(B.pressed!==this.sourceEditMode){B.toggle(this.sourceEditMode);
+return;}if(A){Roo.log("disabling buttons");this.tb.items.each(function(C){if(C.cmd!='sourceedit'&&(typeof(C.cls)!='undefined'&&C.cls.indexOf('x-init-enable')===-1)){C.disable();}});}else{Roo.log("enabling buttons");if(this.editorcore.initialized){this.tb.items.each(function(C){C.enable();
+});}}Roo.log("calling toggole on editor");this.editor.toggleSourceEdit(A);},buttonTips:{bold:{title:'Bold (Ctrl+B)',text:'Make the selected text bold.',cls:'x-html-editor-tip'},italic:{title:'Italic (Ctrl+I)',text:'Make the selected text italic.',cls:'x-html-editor-tip'}
+,underline:{title:'Underline (Ctrl+U)',text:'Underline the selected text.',cls:'x-html-editor-tip'},strikethrough:{title:'Strikethrough',text:'Strikethrough the selected text.',cls:'x-html-editor-tip'},increasefontsize:{title:'Grow Text',text:'Increase the font size.',cls:'x-html-editor-tip'}
+,decreasefontsize:{title:'Shrink Text',text:'Decrease the font size.',cls:'x-html-editor-tip'},backcolor:{title:'Text Highlight Color',text:'Change the background color of the selected text.',cls:'x-html-editor-tip'},forecolor:{title:'Font Color',text:'Change the color of the selected text.',cls:'x-html-editor-tip'}
+,justifyleft:{title:'Align Text Left',text:'Align text to the left.',cls:'x-html-editor-tip'},justifycenter:{title:'Center Text',text:'Center text in the editor.',cls:'x-html-editor-tip'},justifyright:{title:'Align Text Right',text:'Align text to the right.',cls:'x-html-editor-tip'}
+,insertunorderedlist:{title:'Bullet List',text:'Start a bulleted list.',cls:'x-html-editor-tip'},insertorderedlist:{title:'Numbered List',text:'Start a numbered list.',cls:'x-html-editor-tip'},createlink:{title:'Hyperlink',text:'Make the selected text a hyperlink.',cls:'x-html-editor-tip'}
+,sourceedit:{title:'Source Edit',text:'Switch to source editing mode.',cls:'x-html-editor-tip'}},onDestroy:function(){if(this.rendered){this.tb.items.each(function(A){if(A.menu){A.menu.removeAll();if(A.menu.el){A.menu.el.destroy();}}A.destroy();});}},onFirstFocus:function(){this.tb.items.each(function(A){A.enable();
+});}});
 // Roo/form/HtmlEditor/ToolbarContext.js
 Roo.form.HtmlEditor.ToolbarContext=function(A){Roo.apply(this,A);this.styles=this.styles||{};};Roo.form.HtmlEditor.ToolbarContext.types={'IMG':{width:{title:"Width",width:40},height:{title:"Height",width:40},align:{title:"Align",opts:[[""],["left"],["right"],["center"],["top"]],width:80}
 ,border:{title:"Border",width:40},alt:{title:"Alt",width:120},src:{title:"Src",width:220}},'A':{name:{title:"Name",width:50},target:{title:"Target",width:120},href:{title:"Href",width:220}},'TABLE':{rows:{title:"Rows",width:20},cols:{title:"Cols",width:20}