From: edward Date: Mon, 26 Mar 2018 04:10:46 +0000 (+0800) Subject: commit X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=0065f80eaafcf13147480179f549fa6165c7ea0d commit --- diff --git a/Roo/HtmlEditorCore.js b/Roo/HtmlEditorCore.js index a5b781da10..d021ebc26b 100644 --- a/Roo/HtmlEditorCore.js +++ b/Roo/HtmlEditorCore.js @@ -133,7 +133,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { black: false, white: false, - + bodyCls : '', /** * Protected method that will not generally be called directly. It diff --git a/roojs-all.js b/roojs-all.js index 9be423b85d..eb8cc77b38 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1756,11 +1756,11 @@ Roo.form.Radio=function(){Roo.form.Radio.superclass.constructor.apply(this,argum },onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue;}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel} );}if(this.checked){this.el.dom.checked='checked';}}}); // Roo/HtmlEditorCore.js -Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,getDocMarkup:function(){var st=''; -if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(A){st+=A.dom.outerHTML||new XMLSerializer().serializeToString(A.dom);});Roo.get(document.head).select('link').each(function(A){st+=A.dom.outerHTML||new XMLSerializer().serializeToString(A.dom); +Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st=''; +if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom); });}else if(!this.stylesheets.length){st='';}else{st='';}st+=''; -return ''+st+' ';},onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none';this.el.dom.setAttribute('tabIndex',-1); -this.el.addClass('x-hidden hide');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')}this.frameId=Roo.id();var B=this.owner.wrap.createChild({tag:'iframe',cls:'form-control',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"} +var A='roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return ''+st+' ';},onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none'; +this.el.dom.setAttribute('tabIndex',-1);this.el.addClass('x-hidden hide');if(Roo.isIE){this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')}this.frameId=Roo.id();var B=this.owner.wrap.createChild({tag:'iframe',cls:'form-control',id:this.frameId,name:this.frameId,frameBorder:'no','src':Roo.SSL_SECURE_URL?Roo.SSL_SECURE_URL:"javascript:false"} ,this.el);this.iframe=B.dom;this.assignDocWin();this.doc.designMode='on';this.doc.open();this.doc.write(this.getDocMarkup());this.doc.close();var C={run:function(){this.assignDocWin();if(this.doc.body||this.doc.readyState=='complete'){try{this.doc.designMode="on"; }catch(e){return;}Roo.TaskMgr.stop(C);this.initEditor.defer(10,this);}},interval:10,duration:10000,scope:this};Roo.TaskMgr.start(C);},onResize:function(w,h){Roo.log('resize: '+w+','+h);if(!this.iframe){return;}if(typeof w=='number'){this.iframe.style.width=w+'px'; }if(typeof h=='number'){this.iframe.style.height=h+'px';if(this.doc){(this.doc.body||this.doc.documentElement).style.height=(h-(this.iframePad*2))+'px';}}},toggleSourceEdit:function(A){this.sourceEditMode=A===true;if(this.sourceEditMode){Roo.get(this.iframe).addClass(['x-hidden','hide']); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 85309aff02..722a14874d 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -21290,7 +21290,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { black: false, white: false, - + bodyCls : '', /** * Protected method that will not generally be called directly. It @@ -22991,6 +22991,8 @@ Roo.extend(Roo.bootstrap.HtmlEditor, Roo.bootstrap.TextArea, { tbContainer : false, + bodyCls : '', + toolbarContainer :function() { return this.wrap.select('.x-html-editor-tb',true).first(); }, diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 668ecf5b1c..86eebaf94b 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -882,7 +882,7 @@ this.errorMsg='';return true;},CharacterSetChecks:function(A){this.type=A;this.f break;}}}var E=0;for(var D=0;D';}else{st='';}st+=''; var A='roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return ''+st+' ';},onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none'; @@ -950,7 +950,7 @@ Roo.HtmlEditorCore.ablack=['on'];Roo.HtmlEditorCore.aclean=['action','background // Roo/bootstrap/HtmlEditor.js Roo.bootstrap.HtmlEditor=function(A){Roo.bootstrap.HtmlEditor.superclass.constructor.call(this,A);if(!this.toolbars){this.toolbars=[];}this.editorcore=new Roo.HtmlEditorCore(Roo.apply({owner:this},A));this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editmodechange:true,editorevent:true,firstfocus:true,autosave:true,savedpreview:true} -);};Roo.extend(Roo.bootstrap.HtmlEditor,Roo.bootstrap.TextArea,{toolbars:false,btns:[],resizable:false,height:300,width:false,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',tbContainer:false,toolbarContainer:function(){return this.wrap.select('.x-html-editor-tb',true).first(); +);};Roo.extend(Roo.bootstrap.HtmlEditor,Roo.bootstrap.TextArea,{toolbars:false,btns:[],resizable:false,height:300,width:false,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',tbContainer:false,bodyCls:'',toolbarContainer:function(){return this.wrap.select('.x-html-editor-tb',true).first(); },createToolbar:function(){Roo.log('renewing');Roo.log("create toolbars");this.toolbars=[new Roo.bootstrap.htmleditor.ToolbarStandard({editor:this})];this.toolbars[0].render(this.toolbarContainer());return;},onRender:function(ct,A){var _t=this;Roo.bootstrap.HtmlEditor.superclass.onRender.call(this,ct,A); this.wrap=this.inputEl().wrap({cls:'x-html-editor-wrap',cn:{cls:'x-html-editor-tb'}});this.editorcore.onRender(ct,A);if(this.resizable){this.resizeEl=new Roo.Resizable(this.wrap,{pinned:true,wrap:true,dynamic:true,minHeight:this.height,height:this.height,handles:this.resizable,width:this.width,listeners:{resize:function(r,w,h){_t.onResize(w,h); }}});}this.createToolbar(this);if(!this.width&&this.resizable){this.setSize(this.wrap.getSize());}if(this.resizeEl){this.resizeEl.resizeTo.defer(100,this.resizeEl,[this.width,this.height]);}},onResize:function(w,h){Roo.log('resize: '+w+','+h);Roo.bootstrap.HtmlEditor.superclass.onResize.apply(this,arguments); diff --git a/roojs-debug.js b/roojs-debug.js index e80e40ac02..b78fa167d9 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -42816,7 +42816,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { black: false, white: false, - + bodyCls : '', /** * Protected method that will not generally be called directly. It diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index b7d97c0c35..02021156e2 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -20486,7 +20486,7 @@ Roo.extend(Roo.HtmlEditorCore, Roo.Component, { black: false, white: false, - + bodyCls : '', /** * Protected method that will not generally be called directly. It diff --git a/roojs-ui.js b/roojs-ui.js index 1db5c07b20..a3e2f1ff34 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -893,7 +893,7 @@ Roo.form.Radio=function(){Roo.form.Radio.superclass.constructor.apply(this,argum },onRender:function(ct,A){Roo.form.Checkbox.superclass.onRender.call(this,ct,A);if(this.inputValue!==undefined){this.el.dom.value=this.inputValue;}this.wrap=this.el.wrap({cls:"x-form-check-wrap"});if(this.boxLabel){this.wrap.createChild({tag:'label',htmlFor:this.el.id,cls:'x-form-cb-label',html:this.boxLabel} );}if(this.checked){this.el.dom.checked='checked';}}}); // Roo/HtmlEditorCore.js -Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,getDocMarkup:function(){var st=''; +Roo.HtmlEditorCore=function(A){Roo.HtmlEditorCore.superclass.constructor.call(this,A);this.addEvents({initialize:true,activate:true,beforesync:true,beforepush:true,sync:true,push:true,editorevent:true});this.applyBlacklists();};Roo.extend(Roo.HtmlEditorCore,Roo.Component,{owner:false,resizable:false,height:300,width:500,stylesheets:false,frameId:false,validationEvent:false,deferHeight:true,initialized:false,activated:false,sourceEditMode:false,onFocus:Roo.emptyFn,iframePad:3,hideMode:'offsets',clearUp:true,black:false,white:false,bodyCls:'',getDocMarkup:function(){var st=''; if(this.stylesheets===false){Roo.get(document.head).select('style').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom);});Roo.get(document.head).select('link').each(function(B){st+=B.dom.outerHTML||new XMLSerializer().serializeToString(B.dom); });}else if(!this.stylesheets.length){st='';}else{st='';}st+=''; var A='roo-htmleditor-body';if(this.bodyCls.length){A+=' '+this.bodyCls;}return ''+st+' ';},onRender:function(ct,A){var _t=this;this.el=this.owner.inputEl?this.owner.inputEl():this.owner.el;this.el.dom.style.border='0 none';