]> git.proxmox.com Git - extjs.git/blame - extjs/build/packages/legacy/modern/legacy.js
add extjs 6.0.1 sources
[extjs.git] / extjs / build / packages / legacy / modern / legacy.js
CommitLineData
6527f429 1Ext.define("Ext.data.proxy.Sql",{alias:"proxy.sql",extend:"Ext.data.proxy.Client",alternateClassName:"Ext.data.proxy.SQL",isSQLProxy:true,config:{reader:null,writer:null,table:null,database:"Sencha"},_createOptions:{silent:true,dirty:false},updateModel:function(c){var g=this,b,a,e,d,f;if(c){g.uniqueIdStrategy=c.identifier.isUnique;if(!g.getTable()){b=c.entityName;g.setTable(b.slice(b.lastIndexOf(".")+1))}g.columns=d=g.getPersistedModelColumns(c);g.quotedColumns=f=[];for(e=0,a=d.length;e<a;++e){f.push('"'+d[e]+'"')}}g.callParent([c])},setException:function(a,b){a.setException(b)},create:function(c){var e=this,b=c.getRecords(),a,d;c.setStarted();e.executeTransaction(function(f){e.insertRecords(b,f,function(h,g){a=h;d=g})},function(f){c.setException(f)},function(){if(d){c.setException(statementError)}else{c.process(a)}})},read:function(d){var g=this,e=g.getModel(),b=d.getRecords(),f=b?b[0]:null,i,h,a,c;if(f&&!f.phantom){a=f.getId()}else{a=d.getId()}if(a!==undefined){c={idOnly:true,id:a}}else{c={page:d.getPage(),start:d.getStart(),limit:d.getLimit(),sorters:d.getSorters(),filters:d.getFilters()}}d.setStarted();g.executeTransaction(function(j){g.selectRecords(j,c,function(l,k){i=l;h=k})},function(j){d.setException(j)},function(){if(h){d.setException(statementError)}else{d.process(i)}})},update:function(c){var e=this,b=c.getRecords(),a,d;c.setStarted();e.executeTransaction(function(f){e.updateRecords(f,b,function(h,g){a=h;d=g})},function(f){c.setException(f)},function(){if(d){c.setException(statementError)}else{c.process(a)}})},erase:function(c){var e=this,b=c.getRecords(),a,d;c.setStarted();e.executeTransaction(function(f){e.destroyRecords(f,b,function(h,g){a=h;d=g})},function(f){c.setException(f)},function(){if(d){c.setException(d)}else{c.process(a)}})},createTable:function(b){var a=this;if(!b){a.executeTransaction(function(c){a.createTable(c)});return}a.executeStatement(b,'CREATE TABLE IF NOT EXISTS "'+a.getTable()+'" ('+a.getSchemaString()+")",function(){a.tableExists=true})},insertRecords:function(k,l,d){var q=this,a=q.columns,h=k.length,s=0,p=q.uniqueIdStrategy,o=q._createOptions,n=k.length,j,c,e,m,r,b,f,g;g=function(i){++s;if(s===h){d.call(q,new Ext.data.ResultSet({success:!f}),f)}};e=Ext.String.repeat("?",a.length,",");m='INSERT INTO "'+q.getTable()+'" ('+q.quotedColumns.join(",")+") VALUES ("+e+")";for(j=0;j<n;++j){c=k[j];r=q.getRecordData(c);b=q.getColumnValues(a,r);(function(i){q.executeStatement(l,m,b,function(u,t){if(!p){i.setId(t.insertId,o)}g()},function(u,t){if(!f){f=[]}f.push(t);g()})})(c)}},selectRecords:function(s,v,e,c){var w=this,l=w.getModel(),j=l.idProperty,t='SELECT * FROM "'+w.getTable()+'"',a=" WHERE ",o=" ORDER BY ",d=[],b,k,f,r,u,n,m,q,g,h,p;if(v.idOnly){t+=a+'"'+j+'" = ?';d.push(v)}else{k=v.filters;u=k&&k.length;if(u){for(r=0;r<u;r++){m=k[r];g=m.getProperty();p=w.toSqlValue(m.getValue(),l.getField(g));h=m.getOperator();if(g!==null){h=h||"=";f="?";if(h==="like"||(h==="="&&m.getAnyMatch())){h="LIKE";p="%"+p+"%"}if(h==="in"||h==="notin"){if(h==="notin"){h="not in"}f="("+Ext.String.repeat("?",p.length,",")+")";d=d.concat(p)}else{d.push(p)}t+=a+'"'+g+'" '+h+" "+f;a=" AND "}}}b=v.sorters;u=b&&b.length;if(u){for(r=0;r<u;r++){q=b[r];g=q.getProperty();if(g!==null){t+=o+'"'+g+'" '+q.getDirection();o=", "}}}if(v.page!==undefined){t+=" LIMIT "+parseInt(v.start,10)+", "+parseInt(v.limit,10)}}w.executeStatement(s,t,d,function(z,I){var K=I.rows,G=K.length,A=[],E=l.fields,y=E.length,J,D,C,F,B,H,x;for(C=0,F=G;C<F;++C){J=K.item(C);D={};for(B=0;B<y;++B){H=E[B];x=H.name;D[x]=w.fromSqlValue(J[x],H)}A.push(new l(D))}e.call(w,new Ext.data.ResultSet({records:A,success:true,total:G,count:G}))},function(x,i){e.call(w,new Ext.data.ResultSet({success:false,total:0,count:0}),i)})},updateRecords:function(n,m,d){var r=this,a=r.columns,j=r.quotedColumns,k=m.length,t=0,g=[],q=r._createOptions,p,l,c,e,o,s,b,f,h;h=function(i){++t;if(t===k){d.call(r,new Ext.data.ResultSet({success:!f}),f)}};for(l=0,p=j.length;l<p;l++){g.push(j[l]+" = ?")}o='UPDATE "'+r.getTable()+'" SET '+g.join(", ")+' WHERE "'+r.getModel().idProperty+'" = ?';for(l=0,p=m.length;l<p;++l){c=m[l];s=r.getRecordData(c);b=r.getColumnValues(a,s);b.push(c.getId());(function(i){r.executeStatement(n,o,b,function(v,u){h()},function(v,u){if(!f){f=[]}f.push(u);h()})})(c)}},destroyRecords:function(b,c,l){var j=this,m=j.getTable(),n=j.getModel().idProperty,a=[],k=[],d=[],h=c.length,g='"'+n+'" = ?',e,p,f,o;for(e=0;e<h;e++){a.push(g);k.push(c[e].getId())}o='DELETE FROM "'+j.getTable()+'" WHERE '+a.join(" OR ");j.executeStatement(b,o,k,function(q,i){l.call(j,new Ext.data.ResultSet({success:true}))},function(q,i){l.call(j,new Ext.data.ResultSet({success:false}),i)})},getRecordData:function(e){var j=this,g=e.fields,m=e.idProperty,f=j.uniqueIdStrategy,d={},h=g.length,b=e.data,c,a,l,k;for(c=0;c<h;++c){k=g[c];if(k.persist!==false){a=k.name;if(a===m&&!f){continue}d[a]=j.toSqlValue(b[a],k)}}return d},getColumnValues:function(d,g){var a=d.length,b=[],c,e,f;for(c=0;c<a;c++){e=d[c];f=g[e];if(f!==undefined){b.push(f)}}return b},getSchemaString:function(){var j=this,b=[],d=j.getModel(),l=d.idProperty,f=d.fields,e=j.uniqueIdStrategy,g=f.length,c,k,h,a;for(c=0;c<g;c++){k=f[c];h=k.getType();a=k.name;if(a===l){if(e){h=j.convertToSqlType(h);b.unshift('"'+l+'" '+h)}else{b.unshift('"'+l+'" INTEGER PRIMARY KEY AUTOINCREMENT')}}else{h=j.convertToSqlType(h);b.push('"'+a+'" '+h)}}return b.join(", ")},convertToSqlType:function(a){switch(a.toLowerCase()){case"string":case"auto":return"TEXT";case"int":case"date":return"INTEGER";case"float":return"REAL";case"bool":return"NUMERIC"}},dropTable:function(){var a=this;a.executeTransaction(function(b){a.executeStatement(b,'DROP TABLE "'+a.getTable()+'"',function(){a.tableExists=false})},null,null,false)},getDatabaseObject:function(){return window.openDatabase(this.getDatabase(),"1.0","Sencha Database",5*1024*1024)},privates:{executeStatement:function(f,e,a,d,b){var c=this;f.executeSql(e,a,d?function(){d.apply(c,arguments)}:null,b?function(){b.apply(c,arguments)}:null)},executeTransaction:function(c,a,e,d){var b=this;d=d!==false;b.getDatabaseObject().transaction(c?function(f){if(d&&!b.tableExists){b.createTable(f)}c.apply(b,arguments)}:null,a?function(){a.apply(b,arguments)}:null,e?function(){e.apply(b,arguments)}:null)},fromSqlValue:function(a,b){if(b.isDateField){a=a?new Date(a):null}else{if(b.isBooleanField){a=a===1}}return a},getPersistedModelColumns:function(d){var f=d.fields,e=this.uniqueIdStrategy,j=d.idProperty,b=[],g=f.length,c,h,a;for(c=0;c<g;++c){h=f[c];a=h.name;if(a===j&&!e){continue}if(h.persist!==false){b.push(h.name)}}return b},toSqlValue:function(a,b){if(b.isDateField){a=a?a.getTime():null}else{if(b.isBooleanField){a=a?1:0}}return a}}});Ext.define("Ext.device.accelerometer.Abstract",{config:{frequency:10000},getCurrentAcceleration:function(a){return a},watchAcceleration:function(b){var a=Ext.device.accelerometer.Abstract.prototype.config;b=Ext.applyIf(b,{frequency:a.frequency});return b},clearWatch:Ext.emptyFn});Ext.define("Ext.device.accelerometer.Cordova",{alternateClassName:"Ext.device.accelerometer.PhoneGap",extend:"Ext.device.accelerometer.Abstract",activeWatchID:null,getCurrentAcceleration:function(a){a=this.callParent(arguments);navigator.accelerometer.getCurrentAcceleration(a.success,a.failure);return a},watchAcceleration:function(a){a=this.callParent(arguments);if(this.activeWatchID){this.clearWatch()}this.activeWatchID=navigator.accelerometer.watchAcceleration(a.callback,a.failure,a);return a},clearWatch:function(){if(this.activeWatchID){navigator.accelerometer.clearWatch(this.activeWatchID);this.activeWatchID=null}}});Ext.define("Ext.device.accelerometer.Simulator",{extend:"Ext.device.accelerometer.Abstract"});Ext.define("Ext.device.Accelerometer",{singleton:true,requires:["Ext.device.accelerometer.Cordova","Ext.device.accelerometer.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView&&a.Cordova){return Ext.create("Ext.device.accelerometer.Cordova")}return Ext.create("Ext.device.accelerometer.Simulator")}});Ext.define("Ext.device.communicator.Default",{SERVER_URL:"http://localhost:3000",callbackDataMap:{},callbackIdMap:{},idSeed:0,globalScopeId:"0",generateId:function(){return String(++this.idSeed)},getId:function(a){var b=a.$callbackId;if(!b){a.$callbackId=b=this.generateId()}return b},getCallbackId:function(h,d){var c=this.callbackIdMap,b=this.callbackDataMap,g,a,f,e;if(!d){a=this.globalScopeId}else{if(d.isIdentifiable){a=d.getId()}else{a=this.getId(d)}}f=this.getId(h);if(!c[a]){c[a]={}}if(!c[a][f]){g=this.generateId();e={callback:h,scope:d};c[a][f]=g;b[g]=e}return c[a][f]},getCallbackData:function(a){return this.callbackDataMap[a]},invoke:function(c,a){var b=this.getCallbackData(c);b.callback.apply(b.scope,a)},send:function(c){var e,d,b,f;if(!c){c={}}else{if(c.callbacks){e=c.callbacks;d=c.scope;delete c.callbacks;delete c.scope;for(b in e){if(e.hasOwnProperty(b)){f=e[b];if(typeof f=="function"){c[b]=this.getCallbackId(f,d)}}}}}c.__source=document.location.href;var a=this.doSend(c);return(a&&a.length>0)?JSON.parse(a):null},doSend:function(a){var c=new XMLHttpRequest();c.open("GET",this.SERVER_URL+"?"+Ext.Object.toQueryString(a)+"&_dc="+new Date().getTime(),false);try{c.send(null);return c.responseText}catch(b){if(a.failure){this.invoke(a.failure)}else{if(a.callback){this.invoke(a.callback)}}}}});Ext.define("Ext.device.communicator.Android",{extend:"Ext.device.communicator.Default",doSend:function(a){return window.Sencha.action(JSON.stringify(a))}});Ext.define("Ext.device.Communicator",{requires:["Ext.device.communicator.Default","Ext.device.communicator.Android"],singleton:true,constructor:function(){if(Ext.os.is.Android){return new Ext.device.communicator.Android()}return new Ext.device.communicator.Default()}});Ext.define("Ext.device.analytics.Abstract",{config:{accountID:null},updateAccountID:function(a){if(a){window.plugins.googleAnalyticsPlugin.startTrackerWithAccountID(a)}},registerAccount:function(a){this.setAccountID(a)},trackEvent:Ext.emptyFn,trackPageview:Ext.emptyFn});Ext.define("Ext.device.analytics.Cordova",{extend:"Ext.device.analytics.Abstract",trackEvent:function(a){if(!this.getAccountID()){return}window.plugins.googleAnalyticsPlugin.trackEvent(a.category,a.action,a.label,a.value,a.nonInteraction)},trackPageview:function(a){if(!this.getAccountID()){return}window.plugins.googleAnalyticsPlugin.trackPageview(a)}});Ext.define("Ext.device.Analytics",{alternateClassName:"Ext.ux.device.Analytics",singleton:true,requires:["Ext.device.Communicator","Ext.device.analytics.*"],constructor:function(){var a=Ext.browser.is;if(a.WebView&&a.Cordova){return Ext.create("Ext.device.analytics.Cordova")}else{return Ext.create("Ext.device.analytics.Abstract")}}});Ext.define("Ext.device.browser.Abstract",{open:Ext.emptyFn,close:Ext.emptyFn});Ext.define("Ext.device.browser.Cordova",{extend:"Ext.device.browser.Abstract",open:function(a){if(!this._window){this._window=Ext.create("Ext.device.browser.Window")}this._window.open(a);return this._window},close:function(){if(!this._window){return}this._window.close()}});Ext.define("Ext.device.browser.Simulator",{open:function(a){window.open(a.url,"_blank")},close:Ext.emptyFn});Ext.define("Ext.device.Browser",{singleton:true,requires:["Ext.device.Communicator","Ext.device.browser.Cordova","Ext.device.browser.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView&&a.Cordova){return Ext.create("Ext.device.browser.Cordova")}return Ext.create("Ext.device.browser.Simulator")}});Ext.define("Ext.device.camera.Abstract",{source:{library:0,camera:1,album:2},destination:{data:0,file:1,"native":2},encoding:{jpeg:0,jpg:0,png:1},media:{picture:0,video:1,all:2},direction:{back:0,front:1},capture:Ext.emptyFn,getPicture:Ext.emptyFn,cleanup:Ext.emptyFn});Ext.define("Ext.device.camera.Cordova",{alternateClassName:"Ext.device.camera.PhoneGap",extend:"Ext.device.camera.Abstract",getPicture:function(d,b,a){try{navigator.camera.getPicture(d,b,a)}catch(c){alert(c)}},cleanup:function(c,a){try{navigator.camera.cleanup(c,a)}catch(b){alert(b)}},capture:function(h){var f=h.success,d=h.failure,j=h.scope,b=this.source,e=this.destination,g=this.encoding,a=h.source,i=h.destination,c=h.encoding,k={};if(j){f=Ext.Function.bind(f,j);d=Ext.Function.bind(d,j)}if(a!==undefined){k.sourceType=b.hasOwnProperty(a)?b[a]:a}if(i!==undefined){k.destinationType=e.hasOwnProperty(i)?e[i]:i}if(c!==undefined){k.encodingType=g.hasOwnProperty(c)?g[c]:c}if("quality" in h){k.quality=h.quality}if("width" in h){k.targetWidth=h.width}if("height" in h){k.targetHeight=h.height}this.getPicture(f,d,k)}});Ext.define("Ext.device.camera.Simulator",{extend:"Ext.device.camera.Abstract",config:{samples:[{success:"http://www.sencha.com/img/sencha-large.png"}]},constructor:function(a){this.initConfig(a)},updateSamples:function(a){this.sampleIndex=0},capture:function(d){var c=this.sampleIndex,b=this.getSamples(),g=b.length,f=b[c],e=d.scope,h=d.success,a=d.failure;if("success" in f){if(h){h.call(e,f.success)}}else{if(a){a.call(e,f.failure)}}if(++c>g-1){c=0}this.sampleIndex=c}});Ext.define("Ext.device.Camera",{singleton:true,requires:["Ext.device.Communicator","Ext.device.camera.Cordova","Ext.device.camera.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.camera.Cordova")}}return Ext.create("Ext.device.camera.Simulator")}});Ext.define("Ext.device.capture.Cordova",{captureAudio:function(b){var a={limit:b.limit,duration:b.maximumDuration};navigator.device.capture.captureAudio(b.success,b.failure,a)},captureVideo:function(b){var a={limit:b.limit,duration:b.maximumDuration};navigator.device.capture.captureVideo(b.success,b.failure,a)}});Ext.define("Ext.device.capture.Abstract",{alternateClassName:"Ext.device.capture.Simulator",captureAudio:Ext.emptyFn,captureVideo:Ext.emptyFn});Ext.define("Ext.device.Capture",{singleton:true,requires:["Ext.device.Communicator","Ext.device.capture.Cordova","Ext.device.capture.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView&&a.Cordova){return Ext.create("Ext.device.capture.Cordova")}return Ext.create("Ext.device.capture.Simulator")}});Ext.define("Ext.device.compass.Abstract",{config:{frequency:100},getHeadingAvailable:function(a){return a},getCurrentHeading:function(a){return a},watchHeading:function(b){var a=Ext.device.compass.Abstract.prototype.config;b=Ext.applyIf(b,{frequency:a.frequency});return b},clearWatch:Ext.emptyFn});Ext.define("Ext.device.compass.Cordova",{alternateClassName:"Ext.device.compass.PhoneGap",extend:"Ext.device.compass.Abstract",activeWatchID:null,getHeadingAvailable:function(a){var b=function(c){if(c.hasOwnProperty("code")){a.callback.call(a.scope||this,false)}else{a.callback.call(a.scope||this,true)}};this.getCurrentHeading({success:b,failure:b})},getCurrentHeading:function(a){a=this.callParent(arguments);navigator.compass.getCurrentHeading(a.success,a.failure);return a},watchHeading:function(a){a=this.callParent(arguments);if(this.activeWatchID){this.clearWatch()}this.activeWatchID=navigator.compass.watchHeading(a.callback,a.failure,a);return a},clearWatch:function(){if(this.activeWatchID){navigator.compass.clearWatch(this.activeWatchID);this.activeWatchID=null}}});Ext.define("Ext.device.compass.Simulator",{extend:"Ext.device.compass.Abstract"});Ext.define("Ext.device.Compass",{singleton:true,requires:["Ext.device.compass.Cordova","Ext.device.compass.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView&&a.Cordova){return Ext.create("Ext.device.compass.Cordova")}return Ext.create("Ext.device.compass.Simulator")}});Ext.define("Ext.device.connection.Abstract",{extend:"Ext.Evented",mixins:["Ext.mixin.Observable"],config:{online:false,type:null},UNKNOWN:"Unknown connection",ETHERNET:"Ethernet connection",WIFI:"WiFi connection",CELL_2G:"Cell 2G connection",CELL_3G:"Cell 3G connection",CELL_4G:"Cell 4G connection",NONE:"No network connection",isOnline:function(){return this.getOnline()}});Ext.define("Ext.device.connection.Cordova",{alternateClassName:"Ext.device.connection.PhoneGap",extend:"Ext.device.connection.Abstract",constructor:function(){var a=this;document.addEventListener("online",function(){a.fireEvent("online",a)});document.addEventListener("offline",function(){a.fireEvent("offline",a)})},syncOnline:function(){var a=navigator.connection.type;this._type=a;this._online=a!=Connection.NONE},getOnline:function(){this.syncOnline();return this._online},getType:function(){this.syncOnline();return this._type}});Ext.define("Ext.device.connection.Simulator",{extend:"Ext.device.connection.Abstract",getOnline:function(){this._online=navigator.onLine;this._type=Ext.device.Connection.UNKNOWN;return this._online}});Ext.define("Ext.device.Connection",{singleton:true,requires:["Ext.device.Communicator","Ext.device.connection.Cordova","Ext.device.connection.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.connection.Cordova")}}return Ext.create("Ext.device.connection.Simulator")}});Ext.define("Ext.device.contacts.Abstract",{mixins:["Ext.mixin.Observable"],config:{includeImages:false},getContacts:function(a){if(!this._store){this._store=[{first:"Peter",last:"Venkman",emails:{work:"peter.venkman@gb.com"}},{first:"Egon",last:"Spengler",emails:{work:"egon.spengler@gb.com"}}]}a.success.call(a.scope||this,this._store)},getThumbnail:function(a){a.callback.call(a.scope||this,"")},getLocalizedLabel:function(a){a.callback.call(a.scope||this,a.label.toUpperCase(),a.label)}});Ext.define("Ext.device.contacts.Cordova",{alternateClassName:"Ext.device.contacts.PhoneGap",extend:"Ext.device.contacts.Abstract",getContacts:function(a){if(!a){Ext.Logger.warn("Ext.device.Contacts#getContacts: You must specify a `config` object.");return false}if(!a.success){Ext.Logger.warn("Ext.device.Contacts#getContacts: You must specify a `success` method.");return false}if(!a.fields){a.fields=["*"]}if(!Ext.isArray(a.fields)){a.fields=[a.fields]}if(Ext.isEmpty(a.multiple)){a.multiple=true}navigator.contacts.find(a.fields,a.success,a.failure,a)}});Ext.define("Ext.device.Contacts",{singleton:true,requires:["Ext.device.Communicator","Ext.device.contacts.Cordova"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.contacts.Cordova")}}return Ext.create("Ext.device.contacts.Abstract")}});Ext.define("Ext.device.device.Abstract",{mixins:["Ext.mixin.Observable"],name:"not available",uuid:"anonymous",platform:Ext.os.name,scheme:false,openURL:function(a){window.location=a}});Ext.define("Ext.device.device.Cordova",{alternateClassName:"Ext.device.device.PhoneGap",extend:"Ext.device.device.Abstract",availableListeners:["pause","resume","backbutton","batterycritical","batterylow","batterystatus","menubutton","searchbutton","startcallbutton","endcallbutton","volumeupbutton","volumedownbutton"],constructor:function(){if(Ext.isReady){this.onReady()}else{Ext.onReady(this.onReady,this,{single:true})}},onReady:function(){var b=this,a=window.device;b.name=a.name||a.model;b.cordova=a.cordova;b.platform=a.platform||Ext.os.name;b.uuid=a.uuid;b.version=a.version;b.model=a.model},privates:{doAddListener:function(a){var b=this;if(!b.addedListeners){b.addedListeners=[]}if(b.availableListeners.indexOf(a)!=-1&&b.addedListeners.indexOf(a)==-1){b.addedListeners.push(a);document.addEventListener(a,function(){b.fireEvent(a,b)})}Ext.device.Device.mixins.observable.doAddListener.apply(Ext.device.Device.mixins.observable,arguments)}}});Ext.define("Ext.device.device.Simulator",{extend:"Ext.device.device.Abstract"});Ext.define("Ext.device.Device",{singleton:true,requires:["Ext.device.Communicator","Ext.device.device.Cordova","Ext.device.device.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.device.Cordova")}}return Ext.create("Ext.device.device.Simulator")}});Ext.define("Ext.device.filesystem.Abstract",{config:{fileSystemType:1,fileSystemSize:0,readerType:"text",stringEncoding:"UTF8"},requestFileSystem:function(b){var a=Ext.device.filesystem.Abstract.prototype.config;b=Ext.applyIf(b,{type:a.fileSystemType,size:a.fileSystemSize,success:Ext.emptyFn,failure:Ext.emptyFn});return b}});Ext.define("Ext.device.filesystem.HTML5",{extend:"Ext.device.filesystem.Abstract",requestFileSystem:function(b){if(!b.success){Ext.Logger.error("Ext.device.filesystem#requestFileSystem: You must specify a `success` callback.");return null}var c=this;var a=function(d){var e=Ext.create("Ext.device.filesystem.FileSystem",d);b.success.call(b.scope||c,e)};window.requestFileSystem(b.type,b.size,a,b.failure||Ext.emptyFn)}},function(){Ext.define("Ext.device.filesystem.FileSystem",{fs:null,root:null,constructor:function(a){this.fs=a;this.root=Ext.create("Ext.device.filesystem.DirectoryEntry","/",this)},getRoot:function(){return this.root}},function(){Ext.define("Ext.device.filesystem.Entry",{directory:false,path:0,fileSystem:null,entry:null,constructor:function(a,c,b){this.directory=a;this.path=c;this.fileSystem=b},isFile:function(){return !this.directory},isDirectory:function(){return this.directory},getName:function(){var b=this.path.split("/");for(var a=b.length-1;a>=0;--a){if(b[a].length>0){return b[a]}}return"/"},getFullPath:function(){return this.path},getFileSystem:function(){return this.fileSystem},getEntry:function(){return null},moveTo:function(a){if(a.parent==null){Ext.Logger.error("Ext.device.filesystem.Entry#moveTo: You must specify a new `parent` of the entry.");return null}var b=this;this.getEntry({options:a.options||{},success:function(c){a.parent.getEntry({options:a.options||{},success:function(d){if(a.copy){c.copyTo(d,a.newName,function(e){a.success.call(a.scope||b,e.isDirectory?Ext.create("Ext.device.filesystem.DirectoryEntry",e.fullPath,b.fileSystem):Ext.create("Ext.device.filesystem.FileEntry",e.fullPath,b.fileSystem))},a.failure)}else{c.moveTo(d,a.newName,function(e){a.success.call(a.scope||b,e.isDirectory?Ext.create("Ext.device.filesystem.DirectoryEntry",e.fullPath,b.fileSystem):Ext.create("Ext.device.filesystem.FileEntry",e.fullPath,b.fileSystem))},a.failure)}},failure:a.failure})},failure:a.failure})},copyTo:function(a){this.moveTo(Ext.apply(a,{copy:true}))},remove:function(a){this.getEntry({success:function(b){if(a.recursively&&this.directory){b.removeRecursively(a.success,a.failure)}else{b.remove(a.success,a.failure)}},failure:a.failure})},getParent:function(a){if(!a.success){Ext.Logger.error("Ext.device.filesystem.Entry#getParent: You must specify a `success` callback.");return null}var b=this;this.getEntry({options:a.options||{},success:function(c){c.getParent(function(d){a.success.call(a.scope||b,d.isDirectory?Ext.create("Ext.device.filesystem.DirectoryEntry",d.fullPath,b.fileSystem):Ext.create("Ext.device.filesystem.FileEntry",d.fullPath,b.fileSystem))},a.failure)},failure:a.failure})}});Ext.define("Ext.device.filesystem.DirectoryEntry",{extend:"Ext.device.filesystem.Entry",cachedDirectory:null,constructor:function(b,a){this.callParent([true,b,a])},getEntry:function(b){var d=this;var e=b.success;if((b.options&&b.options.create)&&this.path){var c=this.path.split("/");if(c[0]=="."||c[0]==""){c=c.slice(1)}var a=function(f){if(c.length){f.getDirectory(c.shift(),b.options,a,b.failure)}else{e(f)}};a(this.fileSystem.fs.root)}else{this.fileSystem.fs.root.getDirectory(this.path,b.options,function(f){b.success.call(b.scope||d,f)},b.failure)}},readEntries:function(a){if(!a.success){Ext.Logger.error("Ext.device.filesystem.DirectoryEntry#readEntries: You must specify a `success` callback.");return null}var b=this;this.getEntry({success:function(d){var c=d.createReader();c.readEntries(function(h){var f=[],g=0,e=h.length;for(;g<e;g++){entryInfo=h[g];f[g]=entryInfo.isDirectory?Ext.create("Ext.device.filesystem.DirectoryEntry",entryInfo.fullPath,b.fileSystem):Ext.create("Ext.device.filesystem.FileEntry",entryInfo.fullPath,b.fileSystem)}a.success.call(a.scope||this,f)},function(e){if(a.failure){a.failure.call(a.scope||this,e)}})},failure:a.failure})},getFile:function(b){if(b.path==null){Ext.Logger.error("Ext.device.filesystem.DirectoryEntry#getFile: You must specify a `path` of the file.");return null}var c=this;var a=this.path+b.path;var d=Ext.create("Ext.device.filesystem.FileEntry",a,this.fileSystem);d.getEntry({success:function(){b.success.call(b.scope||c,d)},options:b.options||{},failure:b.failure})},getDirectory:function(c){if(c.path==null){Ext.Logger.error("Ext.device.filesystem.DirectoryEntry#getFile: You must specify a `path` of the file.");return null}var d=this;var b=this.path+c.path;var a=Ext.create("Ext.device.filesystem.DirectoryEntry",b,this.fileSystem);a.getEntry({success:function(){c.success.call(c.scope||d,a)},options:c.options||{},failure:c.failure})},removeRecursively:function(a){this.remove(Ext.apply(a,{recursively:true}))}});Ext.define("Ext.device.filesystem.FileEntry",{extend:"Ext.device.filesystem.Entry",length:0,offset:0,constructor:function(b,a){this.callParent([false,b,a]);this.offset=0;this.length=0},getEntry:function(b){var c=this;var d=Ext.applyIf({},b);if(this.fileSystem){var a=function(e){if((b.options&&b.options.create)&&Ext.isString(this.path)){var f=this.path.split("/");if(f[0]=="."||f[0]==""){f=f.slice(1)}if(f.length>1&&!b.recursive===true){f.pop();var g=Ext.create("Ext.device.filesystem.DirectoryEntry",f.join("/"),c.fileSystem);g.getEntry({options:b.options,success:function(){d.recursive=true;c.getEntry(d)},failure:b.failure})}else{if(b.failure){b.failure.call(b.scope||c,e)}}}else{if(b.failure){b.failure.call(b.scope||c,e)}}};this.fileSystem.fs.root.getFile(this.path,b.options||null,function(e){e.file(function(f){c.length=f.size;d.success.call(b.scope||c,e)},function(f){a.call(b.scope||c,f)})},function(e){a.call(b.scope||c,e)})}else{b.failure({code:-1,message:"FileSystem not Initialized"})}},getOffset:function(){return this.offset},seek:function(a){if(a.offset==null){Ext.Logger.error("Ext.device.filesystem.FileEntry#seek: You must specify an `offset` in the file.");return null}this.offset=a.offset||0;if(a.success){a.success.call(a.scope||this)}},read:function(a){var b=this;this.getEntry({success:function(c){c.file(function(e){if(Ext.isNumber(a.length)){if(Ext.isFunction(e.slice)){e=e.slice(b.offset,a.length)}else{if(a.failure){a.failure.call(a.scope||b,{code:-2,message:"File missing slice functionality"})}return}}var d=new FileReader();d.onloadend=function(f){a.success.call(a.scope||b,f.target.result)};d.onerror=function(f){a.failure.call(a.scope||b,f)};if(a.reader){d=Ext.applyIf(d,a.reader)}a.encoding=a.encoding||"UTF8";switch(a.type){default:case"text":d.readAsText(e,a.encoding);break;case"dataURL":d.readAsDataURL(e);break;case"binaryString":d.readAsBinaryString(e);break;case"arrayBuffer":d.readAsArrayBuffer(e);break}},function(d){a.failure.call(a.scope||b,d)})},failure:function(c){a.failure.call(a.scope||b,c)}})},write:function(a){if(a.data==null){Ext.Logger.error("Ext.device.filesystem.FileEntry#write: You must specify `data` to write into the file.");return null}var b=this;this.getEntry({options:a.options||{},success:function(c){c.createWriter(function(d){d.onwriteend=function(e){b.length=e.target.length;a.success.call(a.scope||b,e.result)};d.onerror=function(e){a.failure.call(a.scope||b,e)};if(a.writer){d=Ext.applyIf(d,a.writer)}if(b.offset){d.seek(b.offset)}else{if(a.append){d.seek(b.length)}}b.writeData(d,a.data)},function(d){a.failure.call(a.scope||b,d)})},failure:function(c){a.failure.call(a.scope||b,c)}})},writeData:function(b,a){b.write(new Blob([a]))},truncate:function(a){if(a.size==null){Ext.Logger.error("Ext.device.filesystem.FileEntry#write: You must specify a `size` of the file.");return null}var b=this;this.getEntry({success:function(c){c.createWriter(function(d){d.truncate(a.size);a.success.call(a.scope||b,b)},function(d){a.failure.call(a.scope||b,d)})},failure:function(c){a.failure.call(a.scope||b,c)}})}})})});Ext.define("Ext.device.filesystem.Cordova",{alternateClassName:"Ext.device.filesystem.PhoneGap",extend:"Ext.device.filesystem.HTML5",constructor:function(){Ext.override(Ext.device.filesystem.Entry,{writeMetadata:function(a){var b=this;this.getEntry({options:a.options,success:function(c){c.setMetadata(function(){a.success.call(a.scope||b)},function(d){a.failure.call(a.scope||b,d)},a.metadata)},failure:function(c){a.failure.call(a.scope||b,c)}})},readMetadata:function(a){var b=this;this.getEntry({options:a.options,success:function(c){c.getMetadata(function(d){a.success.call(a.scope||b,d)},function(d){a.failure.call(a.scope||b,d)})},failure:function(c){a.failure.call(a.scope||b,c)}})}});Ext.override(Ext.device.filesystem.FileEntry,{writeData:function(b,a){b.write(a.toString())},upload:function(c){var b=new FileUploadOptions();b.fileKey=c.fileKey||"file";b.fileName=this.path.substr(this.path.lastIndexOf("/")+1);b.mimeType=c.mimeType||"image/jpeg";b.params=c.params||{};b.headers=c.headers||{};b.chunkMode=c.chunkMode||true;var a=new FileTransfer();a.upload(this.path,encodeURI(c.url),c.success,c.failure,b,c.trustAllHosts||false);return a},download:function(b){var a=new FileTransfer();a.download(encodeURI(b.source),this.path,b.success,b.failure,b.trustAllHosts||false,b.options||{});return a}})}});Ext.define("Ext.device.filesystem.Chrome",{extend:"Ext.device.filesystem.HTML5",requestFileSystem:function(b){var c=this;b=Ext.device.filesystem.Abstract.prototype.requestFileSystem(b);var a=function(d){var e=Ext.create("Ext.device.filesystem.FileSystem",d);b.success.call(b.scope||c,e)};if(b.type==window.PERSISTENT){if(navigator.webkitPersistentStorage){navigator.webkitPersistentStorage.requestQuota(b.size,function(d){window.webkitRequestFileSystem(b.type,d,a,b.failure)})}else{window.webkitStorageInfo.requestQuota(window.PERSISTENT,b.size,function(d){window.webkitRequestFileSystem(b.type,d,a,b.failure)})}}else{window.webkitRequestFileSystem(b.type,b.size,a,b.failure)}}});Ext.define("Ext.device.filesystem.Simulator",{extend:"Ext.device.filesystem.HTML5"});Ext.define("Ext.device.FileSystem",{singleton:true,requires:["Ext.device.Communicator","Ext.device.filesystem.Cordova","Ext.device.filesystem.Chrome","Ext.device.filesystem.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.filesystem.Cordova")}}else{if(a.Chrome){return Ext.create("Ext.device.filesystem.Chrome")}}return Ext.create("Ext.device.filesystem.Simulator")}});Ext.define("Ext.device.geolocation.Abstract",{config:{maximumAge:0,frequency:10000,allowHighAccuracy:false,timeout:Infinity},getCurrentPosition:function(b){var a=Ext.device.geolocation.Abstract.prototype.config;b=Ext.applyIf(b,{maximumAge:a.maximumAge,frequency:a.frequency,allowHighAccuracy:a.allowHighAccuracy,timeout:a.timeout});return b},watchPosition:function(b){var a=Ext.device.geolocation.Abstract.prototype.config;b=Ext.applyIf(b,{maximumAge:a.maximumAge,frequency:a.frequency,allowHighAccuracy:a.allowHighAccuracy,timeout:a.timeout});return b},clearWatch:function(){}});Ext.define("Ext.device.geolocation.Cordova",{alternateClassName:"Ext.device.geolocation.PhoneGap",extend:"Ext.device.geolocation.Abstract",activeWatchID:null,getCurrentPosition:function(a){a=this.callParent(arguments);navigator.geolocation.getCurrentPosition(a.success,a.failure,a);return a},watchPosition:function(a){a=this.callParent(arguments);if(this.activeWatchID){this.clearWatch()}this.activeWatchID=navigator.geolocation.watchPosition(a.callback,a.failure,a);return a},clearWatch:function(){if(this.activeWatchID){navigator.geolocation.clearWatch(this.activeWatchID);this.activeWatchID=null}}});Ext.define("Ext.device.geolocation.Simulator",{extend:"Ext.device.geolocation.Abstract",requires:["Ext.util.Geolocation"],getCurrentPosition:function(a){a=this.callParent([a]);Ext.apply(a,{autoUpdate:false,listeners:{scope:this,locationupdate:function(b){if(a.success){a.success.call(a.scope||this,b.position)}},locationerror:function(){if(a.failure){a.failure.call(a.scope||this)}}}});this.geolocation=Ext.create("Ext.util.Geolocation",a);this.geolocation.updateLocation();return a},watchPosition:function(a){a=this.callParent([a]);Ext.apply(a,{listeners:{scope:this,locationupdate:function(b){if(a.callback){a.callback.call(a.scope||this,b.position)}},locationerror:function(){if(a.failure){a.failure.call(a.scope||this)}}}});this.geolocation=Ext.create("Ext.util.Geolocation",a);return a},clearWatch:function(){if(this.geolocation){this.geolocation.destroy()}this.geolocation=null}});Ext.define("Ext.device.Geolocation",{singleton:true,requires:["Ext.device.Communicator","Ext.device.geolocation.Cordova","Ext.device.geolocation.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.geolocation.Cordova")}}return Ext.create("Ext.device.geolocation.Simulator")}});Ext.define("Ext.device.globalization.Abstract",{mixins:["Ext.mixin.Observable"],config:{formatLength:"full",selector:"date and time",dateType:"wide",items:"months",numberType:"decimal",currencyCode:"USD"},getPreferredLanguage:function(a){return a},getLocaleName:function(a){return a},dateToString:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{date:new Date(),formatLength:a.formatLength,selector:a.selector});return b},stringToDate:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{dateString:Ext.util.Format.date(new Date(),"m/d/Y"),formatLength:a.formatLength,selector:a.selector});return b},getDatePattern:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{formatLength:a.formatLength,selector:a.selector});return b},getDateNames:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{type:a.dateType,items:a.items});return b},isDayLightSavingsTime:function(a){a=Ext.applyIf(a,{date:new Date()});return a},getFirstDayOfWeek:function(a){return a},numberToString:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{number:a.number,type:a.numberType});return b},stringToNumber:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{type:a.numberType});return b},getNumberPattern:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{type:a.numberType});if(!b.success){Ext.Logger.warn("You need to specify a `success` function for #getNumberPattern")}return b},getCurrencyPattern:function(b){var a=Ext.device.globalization.Abstract.prototype.config;b=Ext.applyIf(b,{currencyCode:a.currencyCode});if(!b.success){Ext.Logger.warn("You need to specify a `success` function for #getCurrency")}return b}});Ext.define("Ext.device.globalization.Cordova",{alternateClassName:"Ext.device.globalization.PhoneGap",extend:"Ext.device.globalization.Abstract",getPreferredLanguage:function(a){a=this.callParent(arguments);navigator.globalization.getPreferredLanguage(a.success,a.error)},getLocaleName:function(a){a=this.callParent(arguments);navigator.globalization.getLocaleName(a.success,a.error)},dateToString:function(a){a=this.callParent(arguments);navigator.globalization.dateToString(a.date,a.success,a.error,a)},stringToDate:function(a){a=this.callParent(arguments);navigator.globalization.stringToDate(a.dateString,a.success,a.error,a)},getDatePattern:function(a){a=this.callParent(arguments);navigator.globalization.getDatePattern(a.success,a.error,a)},getDateNames:function(a){a=this.callParent(arguments);navigator.globalization.getDateNames(a.success,a.error,a)},isDayLightSavingsTime:function(a){a=this.callParent(arguments);navigator.globalization.isDayLightSavingsTime(a.date,a.success,a.error,a)},getFirstDayOfWeek:function(a){a=this.callParent(arguments);navigator.globalization.getFirstDayOfWeek(a.success,a.error)},numberToString:function(a){a=this.callParent(arguments);navigator.globalization.numberToString(a.number,a.success,a.error,a)},stringToNumber:function(a){a=this.callParent(arguments);navigator.globalization.stringToNumber(a.string,a.success,a.error,a)},getNumberPattern:function(a){a=this.callParent(arguments);navigator.globalization.getNumberPattern(a.success,a.error,a)},getCurrencyPattern:function(a){a=this.callParent(arguments);navigator.globalization.getCurrencyPattern(a.currencyCode,a.success,a.error)}});Ext.define("Ext.device.globalization.Simulator",{extend:"Ext.device.globalization.Abstract"});Ext.define("Ext.device.Globalization",{singleton:true,requires:["Ext.device.globalization.Cordova","Ext.device.globalization.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.globalization.Cordova")}}return Ext.create("Ext.device.globalization.Simulator")}});Ext.define("Ext.device.media.Abstract",{mixins:["Ext.mixin.Observable"],config:{src:null},play:Ext.emptyFn,pause:Ext.emptyFn,stop:Ext.emptyFn,release:Ext.emptyFn,seekTo:Ext.emptyFn,getCurrentPosition:Ext.emptyFn,getDuration:Ext.emptyFn,startRecord:Ext.emptyFn,stopRecord:Ext.emptyFn});Ext.define("Ext.device.media.Cordova",{alternateClassName:"Ext.device.media.PhoneGap",extend:"Ext.device.media.Abstract",config:{src:null,media:null},updateSrc:function(b,a){this.setMedia(new Media(b))},play:function(){var a=this.getMedia();if(a){a.play()}},pause:function(){var a=this.getMedia();if(a){a.pause()}},stop:function(){var a=this.getMedia();if(a){a.stop()}},release:function(){var a=this.getMedia();if(a){a.release()}},seekTo:function(a){var b=this.getMedia();if(b){b.seekTo(a)}},getDuration:function(){var a=this.getMedia();if(a){a.getDuration()}},startRecord:function(){var a=this.getMedia();if(!a){this.setSrc(null)}a.startRecord()},stopRecord:function(){var a=this.getMedia();if(a){a.stopRecord()}}});Ext.define("Ext.device.Media",{singleton:true,requires:["Ext.device.Communicator","Ext.device.media.Cordova"],constructor:function(){var a=Ext.browser.is;if(a.WebView&&a.Cordova){return Ext.create("Ext.device.media.Cordova")}return Ext.create("Ext.device.media.Abstract")}});Ext.define("Ext.device.notification.Abstract",{show:function(a){if(!a.message){throw ("[Ext.device.Notification#show] You passed no message")}if(!a.buttons){a.buttons=["OK","Cancel"]}if(!Ext.isArray(a.buttons)){a.buttons=[a.buttons]}if(!a.scope){a.scope=this}return a},alert:function(a){if(!a.message){throw ("[Ext.device.Notification#alert] You passed no message")}if(!a.scope){a.scope=this}return a},confirm:function(a){if(!a.message){throw ("[Ext.device.Notification#confirm] You passed no message")}if(!a.buttons){a.buttons=["OK","Cancel"]}if(!Ext.isArray(a.buttons)){a.buttons=[a.buttons]}if(!a.scope){a.scope=this}return a},prompt:function(a){if(!a.message){throw ("[Ext.device.Notification#prompt] You passed no message")}if(!a.buttons){a.buttons=["OK","Cancel"]}if(!Ext.isArray(a.buttons)){a.buttons=[a.buttons]}if(!a.scope){a.scope=this}return a},vibrate:Ext.emptyFn,beep:Ext.emptyFn});Ext.define("Ext.device.notification.Cordova",{alternateClassName:"Ext.device.notification.PhoneGap",extend:"Ext.device.notification.Abstract",requires:["Ext.device.Communicator"],show:function(a){a=this.callParent(arguments);this.confirm(a)},confirm:function(b){b=this.callParent(arguments);var e=b.buttons,d=b.buttons.length;if(d&&typeof e[0]!="string"){var a=[],c;for(c=0;c<d;c++){a.push(e[c].text)}e=a}var f=function(g){if(b.callback){b.callback.apply(b.scope,(e)?[e[g-1].toLowerCase()]:[])}};navigator.notification.confirm(b.message,f,b.title,e)},alert:function(a){navigator.notification.alert(a.message,a.callback,a.title,a.buttonName)},prompt:function(b){b=this.callParent(arguments);var e=b.buttons,d=b.buttons.length;if(d&&typeof e[0]!="string"){var a=[],c;for(c=0;c<d;c++){a.push(e[c].text)}e=a}var f=function(g){if(b.callback){b.callback.call(b.scope,(e)?e[g.buttonIndex-1].toLowerCase():null,g.input1)}};navigator.notification.prompt(b.message,f,b.title,e)},vibrate:function(a){navigator.notification.vibrate(a)},beep:function(a){navigator.notification.vibrate(a)}});Ext.define("Ext.device.notification.Simulator",{extend:"Ext.device.notification.Abstract",requires:["Ext.MessageBox","Ext.util.Audio"],msg:null,show:function(){var a=this.callParent(arguments),e=[],d=a.buttons.length,c,b,f;for(b=0;b<d;b++){c=a.buttons[b];if(Ext.isString(c)){c={text:a.buttons[b],itemId:a.buttons[b].toLowerCase()}}e.push(c)}this.msg=Ext.create("Ext.MessageBox");f=function(g){if(a.callback){a.callback.apply(a.scope,[g])}};this.msg.show({title:a.title,message:a.message,scope:this.msg,buttons:e,fn:f})},alert:function(){var a=this.callParent(arguments);if(a.buttonName){a.buttons=[a.buttonName]}this.show(a)},confirm:function(){var a=this.callParent(arguments);this.show(a)},prompt:function(){var a=this.callParent(arguments),e=[],d=a.buttons.length,c,b,f;for(b=0;b<d;b++){c=a.buttons[b];if(Ext.isString(c)){c={text:a.buttons[b],itemId:a.buttons[b].toLowerCase()}}e.push(c)}this.msg=Ext.create("Ext.MessageBox");f=function(g,h){if(a.callback){a.callback.apply(a.scope,[g,h])}};this.msg.prompt(a.title,a.message,f,this.msg,a.multiLine,a.value,a.prompt)},beep:function(b){if(!Ext.isNumber(b)){b=1}var a=0;var c=function(){if(a<b){Ext.defer(function(){Ext.util.Audio.beep(c)},50)}a++};c()},vibrate:function(){var c=["@-webkit-keyframes vibrate{"," from {"," -webkit-transform: rotate(-2deg);"," }"," to{"," -webkit-transform: rotate(2deg);"," }","}","body {"," -webkit-animation: vibrate 50ms linear 10 alternate;","}"];var b=document.getElementsByTagName("head")[0];var a=document.createElement("style");a.innerHTML=c.join("\n");b.appendChild(a);Ext.defer(function(){b.removeChild(a)},400)}});Ext.define("Ext.device.Notification",{singleton:true,requires:["Ext.device.Communicator","Ext.device.notification.Cordova","Ext.device.notification.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.notification.Cordova")}}return Ext.create("Ext.device.notification.Simulator")}});Ext.define("Ext.device.orientation.Abstract",{mixins:["Ext.mixin.Observable"],onDeviceOrientation:function(a){this.doFireEvent("orientationchange",[a])}});Ext.define("Ext.device.orientation.HTML5",{extend:"Ext.device.orientation.Abstract",constructor:function(){this.callParent(arguments);this.onDeviceOrientation=Ext.Function.bind(this.onDeviceOrientation,this);window.addEventListener("deviceorientation",this.onDeviceOrientation,true)}});Ext.define("Ext.device.Orientation",{singleton:true,requires:["Ext.device.Communicator","Ext.device.orientation.HTML5"],constructor:function(){return Ext.create("Ext.device.orientation.HTML5")}});Ext.define("Ext.device.push.Abstract",{ALERT:1,BADGE:2,SOUND:4,register:function(a){var b=this;if(!a.received){Ext.Logger.error("Failed to pass a received callback. This is required.")}if(a.type==null){Ext.Logger.error("Failed to pass a type. This is required.")}return{success:function(c){b.onSuccess(c,a.success,a.scope||b)},failure:function(c){b.onFailure(c,a.failure,a.scope||b)},received:function(c){b.onReceived(c,a.received,a.scope||b)},type:a.type}},onSuccess:function(a,c,b){if(c){c.call(b,a)}},onFailure:function(a,c,b){if(c){c.call(b,a)}},onReceived:function(a,c,b){if(c){c.call(b,a)}}});Ext.define("Ext.device.push.Cordova",{extend:"Ext.device.push.Abstract",statics:{callbacks:{}},setPushConfig:function(b){var a=Ext.id(null,"callback");Ext.device.push.Cordova.callbacks[a]=b.callbacks.received;return{badge:(b.callbacks.type===Ext.device.Push.BADGE)?"true":"false",sound:(b.callbacks.type===Ext.device.Push.SOUND)?"true":"false",alert:(b.callbacks.type===Ext.device.Push.ALERT)?"true":"false",ecb:"Ext.device.push.Cordova.callbacks."+a,senderID:b.senderID}},register:function(){var a=arguments[0];a.callbacks=this.callParent(arguments);var c=this.setPushConfig(a),b=window.plugins.pushNotification;b.register(a.callbacks.success,a.callbacks.failure,c)}});Ext.define("Ext.device.Push",{singleton:true,requires:["Ext.device.Communicator","Ext.device.push.Cordova"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.push.Cordova")}}return Ext.create("Ext.device.push.Abstract")}});Ext.define("Ext.device.splashscreen.Abstract",{show:Ext.emptyFn,hide:Ext.emptyFn});Ext.define("Ext.device.splashscreen.Cordova",{alternateClassName:"Ext.device.splashscreen.PhoneGap",extend:"Ext.device.splashscreen.Abstract",show:function(){navigator.splashscreen.show()},hide:function(){navigator.splashscreen.hide()}});Ext.define("Ext.device.splashscreen.Simulator",{extend:"Ext.device.splashscreen.Abstract"});Ext.define("Ext.device.Splashscreen",{singleton:true,requires:["Ext.device.splashscreen.Cordova","Ext.device.splashscreen.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.splashscreen.Cordova")}}return Ext.create("Ext.device.splashscreen.Simulator")}});Ext.define("Ext.device.storage.Abstract",{config:{databaseName:"Sencha",databaseVersion:"1.0",databaseDisplayName:"Sencha Database",databaseSize:5*1024*1024},openDatabase:function(b){var a=Ext.device.storage.Abstract.prototype.config;b=Ext.applyIf(b,{name:a.databaseName,version:a.databaseVersion,displayName:a.databaseDisplayName,size:a.databaseSize});return b},numKeys:Ext.emptyFn,getKey:Ext.emptyFn,getItem:Ext.emptyFn,setItem:Ext.emptyFn,removeItem:Ext.emptyFn,clear:Ext.emptyFn});Ext.define("Ext.device.storage.HTML5.SQLStatement",{extend:"Ext.Base",sql:null,"arguments":null,success:Ext.emptyFn,failure:Ext.emptyFn,constructor:function(a){this.sql=a.sql;this.arguments=a.arguments;this.success=a.success;this.failure=a.failure}});Ext.define("Ext.device.storage.HTML5.Database",{requires:["Ext.device.storage.HTML5.SQLStatement"],db:null,constructor:function(a){this.db=window.openDatabase(a.name,a.version,a.displayName,a.size)},getVersion:function(){if(this.db){return this.db.version}return null},transaction:function(d,c,a){if(!this.db){return}if(!Ext.isArray(d)){d=[d]}var b=function(e){Ext.each(d,function(f){if(Ext.isString(f)){e.executeSql(f)}else{if(Ext.isObject(f)){e.executeSql(f.sql,f.arguments,f.success,f.failure)}}})};this.db.transaction(b,a,c)}});Ext.define("Ext.device.storage.HTML5.HTML5",{extend:"Ext.device.storage.Abstract",requires:["Ext.device.storage.HTML5.Database"],dbCache:{},openDatabase:function(a){a=this.callParent(arguments);if(!this.dbCache[a.name]||a.noCache){this.dbCache[a.name]=Ext.create("Ext.device.storage.HTML5.Database",a)}return this.dbCache[a.name]},numKeys:function(){return window.localStorage.length},getKey:function(a){return window.localStorage.key(a)},getItem:function(a){return window.localStorage.getItem(a)},setItem:function(a,b){return window.localStorage.setItem(a,b)},removeItem:function(a){return window.localStorage.removeItem(a)},clear:function(){return window.localStorage.clear()}});Ext.define("Ext.device.storage.Cordova",{alternateClassName:"Ext.device.storage.PhoneGap",extend:"Ext.device.storage.HTML5.HTML5"});Ext.define("Ext.device.storage.Simulator",{extend:"Ext.device.storage.HTML5.HTML5"});Ext.define("Ext.device.Storage",{singleton:true,requires:["Ext.device.storage.Cordova","Ext.device.storage.Simulator"],constructor:function(){var a=Ext.browser.is;if(a.WebView){if(a.Cordova){return Ext.create("Ext.device.storage.Cordova")}}return Ext.create("Ext.device.storage.Simulator")}});Ext.define("Ext.device.twitter.Abstract",{compose:Ext.emptyFn,getPublicTimeline:Ext.emptyFn,getMentions:Ext.emptyFn,getTwitterUsername:Ext.emptyFn,getTwitterRequest:Ext.emptyFn});Ext.define("Ext.device.twitter.Cordova",{compose:function(a){window.plugins.twitter.composeTweet(a.success,a.failure,a.tweet,{urlAttach:a.url,imageAttach:a.image})},getPublicTimeline:function(a){window.plugins.twitter.getPublicTimeline(a.success,a.failure)},getMentions:function(a){window.plugins.twitter.getMentions(a.success,a.failure)},getTwitterUsername:function(a){window.plugins.twitter.getTwitterUsername(a.success,a.failure)},getTwitterRequest:function(a){window.plugins.twitter.getTWRequest(a.url,a.params,a.success,a.failure,a.options)}});Ext.define("Ext.device.Twitter",{alternateClassName:"Ext.ux.device.Twitter",singleton:true,requires:["Ext.device.Communicator","Ext.device.twitter.*"],constructor:function(){var a=Ext.browser.is;if(a.WebView&&a.Cordova){return Ext.create("Ext.device.twitter.Cordova")}else{return Ext.create("Ext.device.twitter.Abstract")}}});Ext.define("Ext.device.browser.Window",{extend:"Ext.Evented",open:function(a){var b=this;this._window=window.open(a.url,a.showToolbar?"_blank":"_self",a.options||null);this._window.addEventListener("loadstart",function(){b.fireEvent("loadstart",b)});this._window.addEventListener("loadstop",function(){b.fireEvent("loadstop",b)});this._window.addEventListener("loaderror",function(){b.fireEvent("loaderror",b)});this._window.addEventListener("exit",function(){b.fireEvent("close",b)})},close:function(){if(!this._window){return}this._window.close()}});