From d80b16ac6adf870750b72fc9c222a7d6237071d0 Mon Sep 17 00:00:00 2001 From: edward Date: Wed, 5 Oct 2016 14:40:08 +0800 Subject: [PATCH] roojs-ui.js roojs-ui-debug.js roojs-all.js roojs-debug.js --- roojs-all.js | 6 +++--- roojs-debug.js | 14 +++++++++++--- roojs-ui-debug.js | 1 + roojs-ui.js | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/roojs-all.js b/roojs-all.js index 0234f57e3f..976fa6825f 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -1,6 +1,6 @@ // Roo.js -window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var A=0;var ua=navigator.userAgent.toLowerCase();var B=document.compatMode=="CSS1Compat",C=ua.indexOf("opera")>-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("firefox")>-1,F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=/trident.*rv\:11\./.test(ua),I=!D&&ua.indexOf("gecko")>-1,J=F&&!B,K=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),L=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),M=(ua.indexOf("linux")!=-1),N=window.location.href.toLowerCase().indexOf("https")===0,O=/iphone|ipad/.test(ua),P=(function(){try{document.createEvent("TouchEvent"); -return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Roo.apply(Roo,{isStrict:B,isSecure:N,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){} +window["undefined"]=window["undefined"];var Roo={};Roo.apply=function(o,c,A){if(A){Roo.apply(o,A);}if(o&&c&&typeof c=='object'){for(var p in c){o[p]=c[p];}}return o;};(function(){var A=0;var ua=navigator.userAgent.toLowerCase();var B=document.compatMode=="CSS1Compat",C=ua.indexOf("opera")>-1,D=(/webkit|khtml/).test(ua),E=ua.indexOf("firefox")>-1,F=ua.indexOf("msie")>-1,G=ua.indexOf("msie 7")>-1,H=/trident.*rv\:11\./.test(ua),I=!D&&ua.indexOf("gecko")>-1,J=F&&!B,K=(ua.indexOf("windows")!=-1||ua.indexOf("win32")!=-1),L=(ua.indexOf("macintosh")!=-1||ua.indexOf("mac os x")!=-1),M=(ua.indexOf("linux")!=-1),N=window.location.href.toLowerCase().indexOf("https")===0,O=/iphone|ipad/.test(ua),P=(function(){try{if(ua.indexOf('chrome')!=-1&&ua.indexOf('android')==-1){window.addEventListener('touchstart',function __set_has_touch__(){Roo.isTouch=true; +winow.removeEventListener('touchstart',__set_has_touch__);});return false;}document.createEvent("TouchEvent");return true;}catch(e){return false;}})();if(F&&!G){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}Roo.apply(Roo,{isStrict:B,isSecure:N,isReady:false,debug:false,enableGarbageCollector:true,enableListenerCollection:false,SSL_SECURE_URL:"javascript:false",BLANK_IMAGE_URL:"http:/"+"/localhost/s.gif",emptyFn:function(){} ,applyIf:function(o,c){if(o&&c){for(var p in c){if(typeof o[p]=="undefined"){o[p]=c[p];}}}return o;},addBehaviors:function(o){if(!Roo.isReady){Roo.onReady(function(){Roo.addBehaviors(o);});return;}var Q={};for(var b in o){var R=b.split('@');if(R[1]){var s=R[0]; if(!Q[s]){Q[s]=Roo.select(s);}Q[s].on(R[1],o[b]);}}Q=null;},id:function(el,Q){Q=Q||"roo-gen";el=Roo.getDom(el);var id=Q+(++A);return el?(el.id?el.id:(el.id=id)):id;},extend:function(){var io=function(o){for(var m in o){this[m]=o[m];}};return function(sb,sp,Q){if(typeof sp=='object'){Q=sp; sp=sb;sb=function(){sp.apply(this,arguments);};}var F=function(){},R,S=sp.prototype;F.prototype=S;R=sb.prototype=new F();R.constructor=sb;sb.superclass=S;if(S.constructor==Object.prototype.constructor){S.constructor=sp;}sb.override=function(o){Roo.override(sb,o); @@ -1832,7 +1832,7 @@ var tb=new Roo.Toolbar(D);tb.add(nm+": ");var E=[];for(var i in this.styles C.syncValue();}}}));}var F=Roo.form.HtmlEditor.ToolbarContext;var G=F.options;for(var i in A){var H=A[i];tb.add(H.title+": ");var I=H.opts?H.opts:false;if(H.optname){I=G[H.optname];}if(I){tb.addField(new Roo.form.ComboBox({store:typeof(F.stores[i])!='undefined'?Roo.factory(F.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:I} ),name:'-roo-edit-'+i,attrname:i,stylename:H.style?H.style:false,displayField:H.displayField?H.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(F.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:H.width?H.width:130,listeners:{'select':function(c,r,i){if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val'); return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:H.width,value:'',listeners:{'change':function(f,nv,ov){tb.selectedNode.setAttribute(f.attrname,nv); -}}}));}var J=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){J.editor.fireEvent('stylesheetsclick',J.editor);}}});}tb.addFill();tb.addButton({text:'Remove Tag',listeners:{click:function(){var sn=tb.selectedNode; +C.syncValue();}}}));}var J=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){J.editor.fireEvent('stylesheetsclick',J.editor);}}});}tb.addFill();tb.addButton({text:'Remove Tag',listeners:{click:function(){var sn=tb.selectedNode; var pn=sn.parentNode;var K=sn.childNodes[0];var en=sn.childNodes[sn.childNodes.length-1];while(sn.childNodes.length){var L=sn.childNodes[0];sn.removeChild(L);pn.insertBefore(L,sn);}pn.removeChild(sn);var M=C.createRange();M.setStart(K,0);M.setEnd(en,0);var N=C.getSelection(); N.removeAllRanges();N.addRange(M);J.updateToolbar(null,null,null);J.footDisp.dom.innerHTML='';}}});tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();tb.name=nm;return tb;},buildFooter:function(){var A=this.editor.wrap.createChild(); this.footer=new Roo.Toolbar(A);var B=new Roo.Toolbar.Fill();var _t=this;this.footer.add({text:'<',xtype:'Button',handler:function(){_t.footDisp.scrollTo('left',0,true)}});this.footer.add(B);this.footer.add({text:'>',xtype:'Button',handler:function(){_t.footDisp.select('span').last().scrollIntoView(_t.footDisp,true); diff --git a/roojs-debug.js b/roojs-debug.js index 0e62cb39e4..e2e528a003 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -65,7 +65,14 @@ Roo.apply = function(o, c, defaults){ isSecure = window.location.href.toLowerCase().indexOf("https") === 0, isIOS = /iphone|ipad/.test(ua), isTouch = (function() { - try { + try { + if (ua.indexOf('chrome') != -1 && ua.indexOf('android') == -1) { + window.addEventListener('touchstart', function __set_has_touch__ () { + Roo.isTouch = true; + winow.removeEventListener('touchstart', __set_has_touch__); + }); + return false; // no touch on chrome!? + } document.createEvent("TouchEvent"); return true; } catch (e) { @@ -16123,7 +16130,7 @@ Roo.apply(Roo.XComponent, { * @property is_alt * Is an alternative Root - normally used by bootstrap or other systems, * where the top element in the tree can wrap 'body' - * @type {boolean} true (default false) + * @type {boolean} (default false) */ is_alt : false, @@ -16131,7 +16138,7 @@ Roo.apply(Roo.XComponent, { * @property build_from_html * Build elements from html - used by bootstrap HTML stuff * - this is cleared after build is completed - * @type {boolean} true (default false) + * @type {boolean} (default false) */ build_from_html : false, @@ -44887,6 +44894,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype, { listeners: { 'change' : function(f, nv, ov) { tb.selectedNode.setAttribute(f.attrname, nv); + editorcore.syncValue(); } } })); diff --git a/roojs-ui-debug.js b/roojs-ui-debug.js index 0560f56cf6..437883714c 100644 --- a/roojs-ui-debug.js +++ b/roojs-ui-debug.js @@ -28406,6 +28406,7 @@ Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype, { listeners: { 'change' : function(f, nv, ov) { tb.selectedNode.setAttribute(f.attrname, nv); + editorcore.syncValue(); } } })); diff --git a/roojs-ui.js b/roojs-ui.js index 0d18b256ff..1b3e9355f2 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1162,7 +1162,7 @@ var tb=new Roo.Toolbar(D);tb.add(nm+": ");var E=[];for(var i in this.styles C.syncValue();}}}));}var F=Roo.form.HtmlEditor.ToolbarContext;var G=F.options;for(var i in A){var H=A[i];tb.add(H.title+": ");var I=H.opts?H.opts:false;if(H.optname){I=G[H.optname];}if(I){tb.addField(new Roo.form.ComboBox({store:typeof(F.stores[i])!='undefined'?Roo.factory(F.stores[i],Roo.data):new Roo.data.SimpleStore({id:'val',fields:['val','display'],data:I} ),name:'-roo-edit-'+i,attrname:i,stylename:H.style?H.style:false,displayField:H.displayField?H.displayField:'val',valueField:'val',typeAhead:false,mode:typeof(F.stores[i])!='undefined'?'remote':'local',editable:false,triggerAction:'all',emptyText:'Select',selectOnFocus:true,width:H.width?H.width:130,listeners:{'select':function(c,r,i){if(c.stylename){tb.selectedNode.style[c.stylename]=r.get('val'); return;}tb.selectedNode.setAttribute(c.attrname,r.get('val'));}}}));continue;tb.addField(new Roo.form.TextField({name:i,width:100,value:''}));continue;}tb.addField(new Roo.form.TextField({name:'-roo-edit-'+i,attrname:i,width:H.width,value:'',listeners:{'change':function(f,nv,ov){tb.selectedNode.setAttribute(f.attrname,nv); -}}}));}var J=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){J.editor.fireEvent('stylesheetsclick',J.editor);}}});}tb.addFill();tb.addButton({text:'Remove Tag',listeners:{click:function(){var sn=tb.selectedNode; +C.syncValue();}}}));}var J=this;if(nm=='BODY'){tb.addSeparator();tb.addButton({text:'Stylesheets',listeners:{click:function(){J.editor.fireEvent('stylesheetsclick',J.editor);}}});}tb.addFill();tb.addButton({text:'Remove Tag',listeners:{click:function(){var sn=tb.selectedNode; var pn=sn.parentNode;var K=sn.childNodes[0];var en=sn.childNodes[sn.childNodes.length-1];while(sn.childNodes.length){var L=sn.childNodes[0];sn.removeChild(L);pn.insertBefore(L,sn);}pn.removeChild(sn);var M=C.createRange();M.setStart(K,0);M.setEnd(en,0);var N=C.getSelection(); N.removeAllRanges();N.addRange(M);J.updateToolbar(null,null,null);J.footDisp.dom.innerHTML='';}}});tb.el.on('click',function(e){e.preventDefault();});tb.el.setVisibilityMode(Roo.Element.DISPLAY);tb.el.hide();tb.name=nm;return tb;},buildFooter:function(){var A=this.editor.wrap.createChild(); this.footer=new Roo.Toolbar(A);var B=new Roo.Toolbar.Fill();var _t=this;this.footer.add({text:'<',xtype:'Button',handler:function(){_t.footDisp.scrollTo('left',0,true)}});this.footer.add(B);this.footer.add({text:'>',xtype:'Button',handler:function(){_t.footDisp.select('span').last().scrollIntoView(_t.footDisp,true); -- 2.39.2