X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/ee06f37b0f6f6d94cd05a6ffae556660f7c4a2bc..c930e9176a5a85509c5b0230e2bff5c22a591432:/air/ext-air.js?ds=sidebyside diff --git a/air/ext-air.js b/air/ext-air.js deleted file mode 100644 index e3750e66..00000000 --- a/air/ext-air.js +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Ext JS Library 0.30 - * Copyright(c) 2006-2009, Ext JS, LLC. - * licensing@extjs.com - * - * http://extjs.com/license - */ - - -Ext.namespace('Ext.air','Ext.sql');Ext.Template.prototype.compile=function(){var fm=Ext.util.Format;var useF=this.disableFormats!==true;var prevOffset=0;var arr=[];var tpl=this;var fn=function(m,name,format,args,offset,s){if(prevOffset!=offset){var action={type:1,value:s.substr(prevOffset,offset-prevOffset)};arr.push(action);} -prevOffset=offset+m.length;if(format&&useF){if(args){var re=/^\s*['"](.*)["']\s*$/;args=args.split(/,(?=(?:[^"]*"[^"]*")*(?![^"]*"))/);for(var i=0,len=args.length;i+~]\s?|\s|$)/;var tagTokenRe=/^(#)?([\w-\*]+)/;var nthRe=/(\d*)n\+?(\d*)/,nthRe2=/\D/;function child(p,index){var i=0;var n=p.firstChild;while(n){if(n.nodeType==1){if(++i==index){return n;}} -n=n.nextSibling;} -return null;};function next(n){while((n=n.nextSibling)&&n.nodeType!=1);return n;};function prev(n){while((n=n.previousSibling)&&n.nodeType!=1);return n;};function children(d){var n=d.firstChild,ni=-1;while(n){var nx=n.nextSibling;if(n.nodeType==3&&!nonSpace.test(n.nodeValue)){d.removeChild(n);}else{n.nodeIndex=++ni;} -n=nx;} -return this;};function byClassName(c,a,v){if(!v){return c;} -var r=[],ri=-1,cn;for(var i=0,ci;ci=c[i];i++){if((' '+ci.className+' ').indexOf(v)!=-1){r[++ri]=ci;}} -return r;};function attrValue(n,attr){if(!n.tagName&&typeof n.length!="undefined"){n=n[0];} -if(!n){return null;} -if(attr=="for"){return n.htmlFor;} -if(attr=="class"||attr=="className"){return n.className;} -return n.getAttribute(attr)||n[attr];};function getNodes(ns,mode,tagName){var result=[],ri=-1,cs;if(!ns){return result;} -tagName=tagName||"*";if(typeof ns.getElementsByTagName!="undefined"){ns=[ns];} -if(!mode){for(var i=0,ni;ni=ns[i];i++){cs=ni.getElementsByTagName(tagName);for(var j=0,ci;ci=cs[j];j++){result[++ri]=ci;}}}else if(mode=="/"||mode==">"){var utag=tagName.toUpperCase();for(var i=0,ni,cn;ni=ns[i];i++){cn=ni.children||ni.childNodes;for(var j=0,cj;cj=cn[j];j++){if(cj.nodeName==utag||cj.nodeName==tagName||tagName=='*'){result[++ri]=cj;}}}}else if(mode=="+"){var utag=tagName.toUpperCase();for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&n.nodeType!=1);if(n&&(n.nodeName==utag||n.nodeName==tagName||tagName=='*')){result[++ri]=n;}}}else if(mode=="~"){for(var i=0,n;n=ns[i];i++){while((n=n.nextSibling)&&(n.nodeType!=1||(tagName=='*'||n.tagName.toLowerCase()!=tagName)));if(n){result[++ri]=n;}}} -return result;};function concat(a,b){if(b.slice){return a.concat(b);} -for(var i=0,l=b.length;i1){return nodup(results);} -return results;},selectNode:function(path,root){return Ext.DomQuery.select(path,root)[0];},selectValue:function(path,root,defaultValue){path=path.replace(trimRe,"");if(!valueCache[path]){valueCache[path]=Ext.DomQuery.compile(path,"select");} -var n=valueCache[path](root);n=n[0]?n[0]:n;var v=(n&&n.firstChild?n.firstChild.nodeValue:null);return((v===null||v===undefined||v==='')?defaultValue:v);},selectNumber:function(path,root,defaultValue){var v=Ext.DomQuery.selectValue(path,root,defaultValue||0);return parseFloat(v);},is:function(el,ss){if(typeof el=="string"){el=document.getElementById(el);} -var isArray=Ext.isArray(el);var result=Ext.DomQuery.filter(isArray?el:[el],ss);return isArray?(result.length==el.length):(result.length>0);},filter:function(els,ss,nonMatches){ss=ss.replace(trimRe,"");if(!simpleCache[ss]){simpleCache[ss]=Ext.DomQuery.compile(ss,"simple");} -var result=simpleCache[ss](els);return nonMatches?quickDiff(result,els):result;},matchers:[{re:/^\.([\w-]+)/,select:'n = byClassName(n, null, " {1} ");'},{re:/^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,select:'n = byPseudo(n, "{1}", "{2}");'},{re:/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,select:'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'},{re:/^#([\w-]+)/,select:'n = byId(n, null, "{1}");'},{re:/^@([\w-]+)/,select:'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'}],operators:{"=":function(a,v){return a==v;},"!=":function(a,v){return a!=v;},"^=":function(a,v){return a&&a.substr(0,v.length)==v;},"$=":function(a,v){return a&&a.substr(a.length-v.length)==v;},"*=":function(a,v){return a&&a.indexOf(v)!==-1;},"%=":function(a,v){return(a%v)==0;},"|=":function(a,v){return a&&(a==v||a.substr(0,v.length+1)==v+'-');},"~=":function(a,v){return a&&(' '+a+' ').indexOf(' '+v+' ')!=-1;}},pseudos:{"first-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.previousSibling)&&n.nodeType!=1);if(!n){r[++ri]=ci;}} -return r;},"last-child":function(c){var r=[],ri=-1,n;for(var i=0,ci;ci=n=c[i];i++){while((n=n.nextSibling)&&n.nodeType!=1);if(!n){r[++ri]=ci;}} -return r;},"nth-child":function(c,a){var r=[],ri=-1;var m=nthRe.exec(a=="even"&&"2n"||a=="odd"&&"2n+1"||!nthRe2.test(a)&&"n+"+a||a);var f=(m[1]||1)-0,l=m[2]-0;for(var i=0,n;n=c[i];i++){var pn=n.parentNode;if(batch!=pn._batch){var j=0;for(var cn=pn.firstChild;cn;cn=cn.nextSibling){if(cn.nodeType==1){cn.nodeIndex=++j;}} -pn._batch=batch;} -if(f==1){if(l==0||n.nodeIndex==l){r[++ri]=n;}}else if((n.nodeIndex+l)%f==0){r[++ri]=n;}} -return r;},"only-child":function(c){var r=[],ri=-1;;for(var i=0,ci;ci=c[i];i++){if(!prev(ci)&&!next(ci)){r[++ri]=ci;}} -return r;},"empty":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){var cns=ci.childNodes,j=0,cn,empty=true;while(cn=cns[j]){++j;if(cn.nodeType==1||cn.nodeType==3){empty=false;break;}} -if(empty){r[++ri]=ci;}} -return r;},"contains":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if((ci.textContent||ci.innerText||'').indexOf(v)!=-1){r[++ri]=ci;}} -return r;},"nodeValue":function(c,v){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.firstChild&&ci.firstChild.nodeValue==v){r[++ri]=ci;}} -return r;},"checked":function(c){var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(ci.checked==true){r[++ri]=ci;}} -return r;},"not":function(c,ss){return Ext.DomQuery.filter(c,ss,true);},"any":function(c,selectors){var ss=selectors.split('|');var r=[],ri=-1,s;for(var i=0,ci;ci=c[i];i++){for(var j=0;s=ss[j];j++){if(Ext.DomQuery.is(ci,s)){r[++ri]=ci;break;}}} -return r;},"odd":function(c){return this["nth-child"](c,"odd");},"even":function(c){return this["nth-child"](c,"even");},"nth":function(c,a){return c[a-1]||[];},"first":function(c){return c[0]||[];},"last":function(c){return c[c.length-1]||[];},"has":function(c,ss){var s=Ext.DomQuery.select;var r=[],ri=-1;for(var i=0,ci;ci=c[i];i++){if(s(ss,ci).length>0){r[++ri]=ci;}} -return r;},"next":function(c,ss){var is=Ext.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=Ext.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;}}};}();Ext.query=Ext.DomQuery.select;Date.precompileFormats=function(s){var formats=s.split('|');for(var i=0,len=formats.length;i ');Ext.uniqueId=function(){var t=String(new Date().getTime()).substr(4);var s='ABCDEFGHIJKLMNOPQRSTUVWXYZ';for(var i=0;i<4;i++){t+=s.charAt(Math.floor(Math.random()*26));} -return t;};Ext.data.JsonReader.override({getJsonAccessor:function(){var re=/[\[\.]/;return function(expr){try{if(re.test(expr)){var arr=expr.split('.');var ln=arr.length;return function(obj){var l=obj;for(var i=0;i100&&win.height>100){state.x=win.x;state.y=win.y;}});win.addEventListener('resize',function(){if(win.displayState!=air.NativeWindowDisplayState.MINIMIZED&&win.width>100&&win.height>100){state.width=win.width;state.height=win.height;}});Ext.air.NativeWindowManager.register(this);this.on('close',this.unregister,this);if(this.minimizeToTray){this.initMinimizeToTray(this.trayIcon,this.trayMenu);}};Ext.extend(Ext.air.NativeWindow,Ext.air.NativeObservable,{chrome:'standard',type:'normal',width:600,height:400,resizable:true,minimizable:true,maximizable:true,transparent:false,getNative:function(){return this.instance;},getCenterXY:function(){var b=air.Screen.mainScreen.visibleBounds;return{x:b.x+((b.width/2)-(this.width/2)),y:b.y+((b.height/2)-(this.height/2))};},show:function(){if(this.trayed){Ext.air.SystemTray.hideIcon();this.trayed=false;} -this.instance.visible=true;},activate:function(){this.show();this.instance.activate();},hide:function(){this.instance.visible=false;},close:function(){this.instance.close();},isMinimized:function(){return this.instance.displayState==air.NativeWindowDisplayState.MINIMIZED;},isMaximized:function(){return this.instance.displayState==air.NativeWindowDisplayState.MAXIMIZED;},moveTo:function(x,y){this.x=this.instance.x=x;this.y=this.instance.y=y;},fullscreen:function(nonInteractive){var SDS=runtime.flash.display.StageDisplayState;this.instance.stage.displayState=nonInteractive?SDS.FULL_SCREEN:SDS.FULL_SCREEN_INTERACTIVE;},bringToFront:function(){this.instance.orderToFront();},bringInFrontOf:function(win){this.instance.orderInFrontOf(win.instance?win.instance:win);},sendToBack:function(){this.instance.orderToBack();},sendBehind:function(win){this.instance.orderInBackOf(win.instance?win.instance:win);},resize:function(width,height){this.width=this.instance.width=width;this.height=this.instance.height=height;},unregister:function(){Ext.air.NativeWindowManager.unregister(this);},initMinimizeToTray:function(icon,menu){var tray=Ext.air.SystemTray;tray.setIcon(icon,this.trayTip);this.on('displayStateChanging',function(e){if(e.afterDisplayState=='minimized'){e.preventDefault();this.hide();tray.showIcon();this.trayed=true;}},this);tray.on('click',function(){this.activate();},this);if(menu){tray.setMenu(menu);}}});Ext.air.NativeWindow.getRootWindow=function(){return air.NativeApplication.nativeApplication.openedWindows[0];};Ext.air.NativeWindow.getRootHtmlWindow=function(){return Ext.air.NativeWindow.getRootWindow().stage.getChildAt(0).window;};Ext.air.NativeWindowGroup=function(){var list={};return{register:function(win){list[win.id]=win;},unregister:function(win){delete list[win.id];},get:function(id){return list[id];},closeAll:function(){for(var id in list){if(list.hasOwnProperty(id)){list[id].close();}}},each:function(fn,scope){for(var id in list){if(list.hasOwnProperty(id)){if(fn.call(scope||list[id],list[id])===false){return;}}}}};};Ext.air.NativeWindowManager=new Ext.air.NativeWindowGroup(); - -Ext.sql.Connection=function(config){Ext.apply(this,config);Ext.sql.Connection.superclass.constructor.call(this);this.addEvents({open:true,close:true});};Ext.extend(Ext.sql.Connection,Ext.util.Observable,{maxResults:10000,openState:false,open:function(file){},close:function(){},exec:function(sql){},execBy:function(sql,args){},query:function(sql){},queryBy:function(sql,args){},isOpen:function(){return this.openState;},getTable:function(name,keyName){return new Ext.sql.Table(this,name,keyName);},createTable:function(o){var tableName=o.name;var keyName=o.key;var fs=o.fields;if(!Ext.isArray(fs)){fs=fs.items;} -var buf=[];for(var i=0,len=fs.length;i99.7){this.onSoundFinished();}else{this.fireEvent('progress',this.activeChannel,this.activeSound);}}}}); - -Ext.air.Notify=Ext.extend(Ext.air.NativeWindow,{winType:'notify',type:'lightweight',width:400,height:50,chrome:'none',transparent:true,alwaysOnTop:true,extraHeight:22,hideDelay:3000,msgId:'msg',iconId:'icon',icon:Ext.BLANK_IMAGE_URL,boxCls:'x-box',extAllCSS:'../extjs/resources/css/ext-all.css',xtpl:new Ext.XTemplate('','','
','
','{msg}','
','
','
','',''),constructor:function(config){config=config||{};Ext.apply(this,config);config.html=this.xtpl.apply(this);Ext.air.Notify.superclass.constructor.call(this,config);this.getNative().alwaysInFront=true;this.onCompleteDelegate=this.onComplete.createDelegate(this);this.loader.addEventListener(air.Event.COMPLETE,this.onCompleteDelegate);},onComplete:function(event){this.loader.removeEventListener(air.Event.COMPLETE,this.onCompleteDelegate);this.show(event);},show:function(event){var h=event.target.window.document.getElementById(this.msgId).clientHeight+this.extraHeight;var main=air.Screen.mainScreen;var xy=[0,0];xy[0]=main.visibleBounds.bottomRight.x-this.width;xy[1]=main.visibleBounds.bottomRight.y-this.height;this.moveTo(xy[0],xy[1]);Ext.air.Notify.superclass.show.call(this);this.close.defer(this.hideDelay,this);}}); - -Ext.air.Clipboard=function(){var clipboard=air.Clipboard.generalClipboard;return{hasData:function(format){return clipboard.hasFormat(format);},setData:function(format,data){clipboard.setData(format,data);},setDataHandler:function(format,fn){clipboard.setDataHandler(format,fn);},getData:function(format,transferMode){clipboard.getData(format,transferMode);},clear:function(){clipboard.clear();},clearData:function(format){clipboard.clearData(format);}};}(); - -Ext.air.App=function(){return{launchOnStartup:function(launch){air.NativeApplication.nativeApplication.startAtLogin=!!launch;},getActiveWindow:function(){return air.NativeApplication.activeWindow;}};}(); - -Ext.air.dir=function(obj,indent){indent=indent||0;var indentString="";for(var i=0;i