From 98a9f8c249d6dc91b737286669e47e69472975eb Mon Sep 17 00:00:00 2001 From: leon Date: Fri, 17 Jun 2022 12:21:17 +0800 Subject: [PATCH] Roo/util/Observable.js roojs-bootstrap.js roojs-bootstrap-debug.js roojs-core.js roojs-core-debug.js --- Roo/util/Observable.js | 1 + roojs-bootstrap-debug.js | 2 ++ roojs-bootstrap.js | 4 ++-- roojs-core-debug.js | 2 ++ roojs-core.js | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Roo/util/Observable.js b/Roo/util/Observable.js index 11e39c5c87..5a4c6a7f08 100644 --- a/Roo/util/Observable.js +++ b/Roo/util/Observable.js @@ -29,6 +29,7 @@ Roo.util.Observable = function(cfg){ console.log("UTIL OBSERVABLE CONSTRUCTOR"); + consolg.log("config"); cfg = cfg|| {}; this.addEvents(cfg.events || {}); diff --git a/roojs-bootstrap-debug.js b/roojs-bootstrap-debug.js index 1fb6e64f97..604929d568 100644 --- a/roojs-bootstrap-debug.js +++ b/roojs-bootstrap-debug.js @@ -248,6 +248,7 @@ Roo.bootstrap = Roo.bootstrap || {}; Roo.bootstrap.Component = function(config){ console.log("BOOSTRAP COMPONENT CONSTRUCTOR"); + console.log(config); Roo.bootstrap.Component.superclass.constructor.call(this, config); this.addEvents({ @@ -33334,6 +33335,7 @@ Roo.extend(Roo.bootstrap.Alert, Roo.bootstrap.Component, { Roo.bootstrap.UploadCropbox = function(config){ console.log("BOOTSTRAP UPLOAD CROPBOX CONSTRUCTOR"); + console.log(config); Roo.bootstrap.UploadCropbox.superclass.constructor.call(this, config); this.addEvents({ diff --git a/roojs-bootstrap.js b/roojs-bootstrap.js index 71b78e2300..714f28ca54 100644 --- a/roojs-bootstrap.js +++ b/roojs-bootstrap.js @@ -22,7 +22,7 @@ if(s.width!=B||s.height!=C){s.width=B;s.height=C;if(!Roo.isIE){var cn=d.childNod }}},hide:function(){if(this.el){this.el.dom.style.display="none";Roo.Shadow.Pool.push(this.el);delete this.el;}},setZIndex:function(z){this.zIndex=z;if(this.el){this.el.setStyle("z-index",z);}}};Roo.Shadow.Pool=function(){var p=[];var A=Roo.isIE?'
':'
'; return {pull:function(){var sh=p.shift();if(!sh){sh=Roo.get(Roo.DomHelper.insertHtml("beforeBegin",document.body.firstChild,A));sh.autoBoxAdjust=false;}return sh;},push:function(sh){p.push(sh);}};}(); // Roo/bootstrap/Component.js -Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){console.log("BOOSTRAP COMPONENT CONSTRUCTOR");Roo.bootstrap.Component.superclass.constructor.call(this,A);this.addEvents({"childrenrendered":true});};Roo.extend(Roo.bootstrap.Component,Roo.BoxComponent,{allowDomMove:false,cls:false,style:false,autoCreate:false,tooltip:null,initEvents:function(){} +Roo.bootstrap=Roo.bootstrap||{};Roo.bootstrap.Component=function(A){console.log("BOOSTRAP COMPONENT CONSTRUCTOR");console.log(A);Roo.bootstrap.Component.superclass.constructor.call(this,A);this.addEvents({"childrenrendered":true});};Roo.extend(Roo.bootstrap.Component,Roo.BoxComponent,{allowDomMove:false,cls:false,style:false,autoCreate:false,tooltip:null,initEvents:function(){} ,xattr:false,parentId:false,can_build_overlaid:true,container_method:false,dataId:false,name:false,parent:function(){return Roo.ComponentMgr.get(this.parentId)},onRender:function(ct,A){Roo.bootstrap.Component.superclass.onRender.call(this,ct,A);if(this.el){if(this.el.attr('xtype')){this.el.attr('xtypex',this.el.attr('xtype')); this.el.dom.removeAttribute('xtype');this.initEvents();}return;}var B=Roo.apply({},this.getAutoCreate());B.id=this.id||Roo.id();if(this.xattr&&typeof(this.xattr)=='object'){for(var i in this.xattr){B[i]=this.xattr[i];}}if(this.dataId){B.dataId=this.dataId; }if(this.cls){B.cls=(typeof(B.cls)=='undefined'?this.cls:B.cls)+' '+this.cls;}if(this.style){B.style=(typeof(B.style)=='undefined'?this.style:B.style)+'; '+this.style;}if(this.name){B.name=this.name;}this.el=ct.createChild(B,A);if(this.tooltip){this.tooltipEl().attr('tooltip',this.tooltip); @@ -1441,7 +1441,7 @@ Roo.bootstrap.Alert=function(A){Roo.bootstrap.Alert.superclass.constructor.call( if(this.seconds>0){this.hide.defer(this.seconds,this);}},setTitle:function(A){this.titleEl.dom.innerHTML=A;},setHtml:function(A){this.htmlEl.dom.innerHTML=A;},setWeight:function(A){if(this.weight){this.el.removeClass('alert-'+this.weight);}this.weight=A;this.el.addClass('alert-'+this.weight); },setIcon:function(A){if(this.faicon){this.alertEl.removeClass(['fa','fa-'+this.faicon]);}this.faicon=A;this.alertEl.addClass(['fa','fa-'+this.faicon]);},hide:function(){this.el.hide();},show:function(){this.el.show();}}); // Roo/bootstrap/UploadCropbox.js -Roo.bootstrap.UploadCropbox=function(A){console.log("BOOTSTRAP UPLOAD CROPBOX CONSTRUCTOR");Roo.bootstrap.UploadCropbox.superclass.constructor.call(this,A);this.addEvents({"beforeselectfile":true,"initial":true,"crop":true,"prepare":true,"exception":true,"beforeloadcanvas":true,"trash":true,"download":true,"footerbuttonclick":true,"resize":true,"rotate":true,"inspect":true,"upload":true,"arrange":true} +Roo.bootstrap.UploadCropbox=function(A){console.log("BOOTSTRAP UPLOAD CROPBOX CONSTRUCTOR");console.log(A);Roo.bootstrap.UploadCropbox.superclass.constructor.call(this,A);this.addEvents({"beforeselectfile":true,"initial":true,"crop":true,"prepare":true,"exception":true,"beforeloadcanvas":true,"trash":true,"download":true,"footerbuttonclick":true,"resize":true,"rotate":true,"inspect":true,"upload":true,"arrange":true} );this.buttons=this.buttons||Roo.bootstrap.UploadCropbox.footer.STANDARD;};Roo.extend(Roo.bootstrap.UploadCropbox,Roo.bootstrap.Component,{emptyText:'Click to upload image',rotateNotify:'Image is too small to rotate',errorTimeout:3000,scale:0,baseScale:1,rotate:0,dragable:false,pinching:false,mouseX:0,mouseY:0,cropData:false,minWidth:300,minHeight:300,file:false,exif:{} ,baseRotate:1,cropType:'image/jpeg',buttons:false,canvasLoaded:false,isDocument:false,method:'POST',paramName:'imageUpload',loadMask:true,loadingText:'Loading...',maskEl:false,getAutoCreate:function(){var A={tag:'div',cls:'roo-upload-cropbox',cn:[{tag:'input',cls:'roo-upload-cropbox-selector',type:'file'} ,{tag:'div',cls:'roo-upload-cropbox-body',style:'cursor:pointer',cn:[{tag:'div',cls:'roo-upload-cropbox-preview'},{tag:'div',cls:'roo-upload-cropbox-thumb'},{tag:'div',cls:'roo-upload-cropbox-empty-notify',html:this.emptyText},{tag:'div',cls:'roo-upload-cropbox-error-notify alert alert-danger',html:this.rotateNotify} diff --git a/roojs-core-debug.js b/roojs-core-debug.js index 6851d2d406..f4d85286bc 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -7125,6 +7125,7 @@ Roo.query = Roo.DomQuery.select; Roo.util.Observable = function(cfg){ console.log("UTIL OBSERVABLE CONSTRUCTOR"); + consolg.log("config"); cfg = cfg|| {}; this.addEvents(cfg.events || {}); @@ -16867,6 +16868,7 @@ Roo.ComponentMgr = function(){ */ Roo.Component = function(config){ console.log("COMPONENT CONSTRUCTOR"); + console.log(config); config = config || {}; if(config.tagName || config.dom || typeof config == "string"){ // element object config = {el: config, id: config.id || config}; diff --git a/roojs-core.js b/roojs-core.js index 2fa6bec9e7..988cfa436a 100644 --- a/roojs-core.js +++ b/roojs-core.js @@ -305,7 +305,7 @@ break;}}if(N){r[++ri]=ci;}}return r;},"contains":function(c,v){var r=[],ri=-1;fo },"next":function(c,ss){var is=Roo.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=next(ci);if(n&&is(n,ss)){r[++ri]=ci;}}return r;},"prev":function(c,ss){var is=Roo.DomQuery.is;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var n=prev(ci);if(n&&is(n,ss)){r[++ri]=ci; }}return r;}}};}();Roo.query=Roo.DomQuery.select; // Roo/util/Observable.js -Roo.util.Observable=function(A){console.log("UTIL OBSERVABLE CONSTRUCTOR");A=A||{};this.addEvents(A.events||{});if(A.events){delete A.events;}Roo.apply(this,A);if(this.listeners){this.on(this.listeners);delete this.listeners;}};Roo.util.Observable.prototype={fireEvent:function(){var ce=this.events[arguments[0].toLowerCase()]; +Roo.util.Observable=function(A){console.log("UTIL OBSERVABLE CONSTRUCTOR");consolg.log("config");A=A||{};this.addEvents(A.events||{});if(A.events){delete A.events;}Roo.apply(this,A);if(this.listeners){this.on(this.listeners);delete this.listeners;}};Roo.util.Observable.prototype={fireEvent:function(){var ce=this.events[arguments[0].toLowerCase()]; if(typeof ce=="object"){return ce.fire.apply(ce,Array.prototype.slice.call(arguments,1));}else{return true;}},filterOptRe:/^(?:scope|delay|buffer|single)$/,addListener:function(A,fn,B,o){if(typeof A=="object"){o=A;for(var e in o){if(this.filterOptRe.test(e)){continue; }if(typeof o[e]=="function"){this.addListener(e,o[e],o.scope,o);}else{this.addListener(e,o[e].fn,o[e].scope,o[e]);}}return;}o=(!o||typeof o=="boolean")?{}:o;A=A.toLowerCase();var ce=this.events[A]||true;if(typeof ce=="boolean"){ce=new Roo.util.Event(this,A); this.events[A]=ce;}ce.addListener(fn,B,o);},removeListener:function(A,fn,B){var ce=this.events[A.toLowerCase()];if(typeof ce=="object"){ce.removeListener(fn,B);}},purgeListeners:function(){for(var A in this.events){if(typeof this.events[A]=="object"){this.events[A].clearListeners(); @@ -685,7 +685,7 @@ Roo.state.CookieProvider=function(A){Roo.state.CookieProvider.superclass.constru Roo.ComponentMgr=function(){var A=new Roo.util.MixedCollection();return {register:function(c){A.add(c);},unregister:function(c){A.remove(c);},get:function(id){return A.get(id);},onAvailable:function(id,fn,B){A.on("add",function(C,o){if(o.id==id){fn.call(B||o,o); A.un("add",fn,B);}});}};}(); // Roo/Component.js -Roo.Component=function(A){console.log("COMPONENT CONSTRUCTOR");A=A||{};if(A.tagName||A.dom||typeof A=="string"){A={el:A,id:A.id||A};}this.initialConfig=A;Roo.apply(this,A);this.addEvents({disable:true,enable:true,beforeshow:true,show:true,beforehide:true,hide:true,beforerender:true,render:true,beforedestroy:true,destroy:true} +Roo.Component=function(A){console.log("COMPONENT CONSTRUCTOR");console.log(A);A=A||{};if(A.tagName||A.dom||typeof A=="string"){A={el:A,id:A.id||A};}this.initialConfig=A;Roo.apply(this,A);this.addEvents({disable:true,enable:true,beforeshow:true,show:true,beforehide:true,hide:true,beforerender:true,render:true,beforedestroy:true,destroy:true} );if(!this.id){this.id="roo-comp-"+(++Roo.Component.AUTO_ID);}Roo.ComponentMgr.register(this);Roo.Component.superclass.constructor.call(this);this.initComponent();if(this.renderTo){this.render(this.renderTo);delete this.renderTo;}};Roo.Component.AUTO_ID=1000; Roo.extend(Roo.Component,Roo.util.Observable,{hidden:false,disabled:false,rendered:false,disabledClass:"x-item-disabled",allowDomMove:true,hideMode:'display',ctype:"Roo.Component",actionMode:"el",getActionEl:function(){return this[this.actionMode];},initComponent:Roo.emptyFn,render:function(A,B){if(this.rendered){return this; }if(this.fireEvent("beforerender",this)===false){return false;}if(!A&&this.el){this.el=Roo.get(this.el);A=this.el.dom.parentNode;this.allowDomMove=false;}this.container=Roo.get(A);this.rendered=true;if(B!==undefined){if(typeof B=='number'){B=this.container.dom.childNodes[B]; -- 2.39.2