/*
* pettanR peta.apps.js
- * version 0.5.20
+ * version 0.5.22
*
* author:
* itozyun
var self = this,
finder = null,
tree = null,
+ nodeClose = null,
nodePath = null,
nodeBody = null,
headerH = 0,
this.onOpen = function( w, h ){
headerH = Util.getElementSize( document.getElementById( 'gallery-header' ) ).height;
- self.addEventListener( document.getElementById( 'gallery-close-button' ), 'click', Gallery.shutdown );
-
+ nodeClose = eventRoot.createNode( document.getElementById( 'gallery-close-button' ), false, false, 'close-button-hover', 'pointer' );
+ nodeClose.addEventListener( 'click', Gallery.shutdown );
nodePath = eventRoot.createNode( document.getElementById( 'gallery-path' ), false, false );
nodeBody = eventRoot.createNode( document.getElementById( 'gallery-container' ), false, true, null, '', true );
/*
* pettanR system.js
- * version 0.5.21
+ * version 0.5.22
*
* gadgetOS
* author:
cursor : '',
w : 0,
h : 0,
- init : function( displayName, appClass, isOverlay ){
- // this.application = app;
- this.displayName = displayName;
+ init : function( appClass, displayName, isOverlay ){
this.appClass = appClass;
+ this.displayName = displayName;
this.isOverlay = isOverlay;
- // app.rootElement = ;
this.rootElement = document.createElement( 'div' );
this.styleCursor = this.rootElement.style;
ApplicationPrivateData.list.push( this );
return null;
};
-var AbstractApplication = {
+var AbstractApplication = function( appClass, displayName, isOverlay ){
+ ( new ApplicationPrivateData() ).init( appClass, displayName, isOverlay );
+};
+AbstractApplication.prototype = {
getUID : function(){
var data = ApplicationPrivateData.get( this );
return Util.getIndex( API_USER_LIST, data.appClass );
data.phase = 1;
data.appClass === Page.appClass && Page.show();
this.onInit();
- // data.layer && data.layer.start();
data.phase = 2;
},
open : function( w, h /*, _option */ ){
return;
};
this.onPaneResize( w, h );
- // data.layer !== null && data.layer.onResize( w, h );
},
close : function(){
var data = ApplicationPrivateData.get( this );
SystemTimer.remove( this );
AsyncCall.remove( this );
StyleSheet.unload( this );
-
- // data.layer && data.layer.destroy();
var elm = this.rootElement;
Util.removeAllChildren( elm );
return Util.getIndex( API_USER_LIST, appClass );
};
this.boot = function( /* _option */ ){
- application = Application.boot( displayName, self.getUID(), appClass, isOverlay, Util.copyArray( arguments ) );
+ application = Application.boot( appClass, displayName, self.getUID(), isOverlay, Util.copyArray( arguments ) );
};
this.shutdown = function(){
if( !application ) return false;
isCurrentAppplication: function( app ){
return app === currentApplication;
},
- boot: function( displayName, uid, appClass, isOverlay, arg ){
+ boot: function( appClass, displayName, uid, isOverlay, arg ){
if( currentApplication ){
if( currentApplication.getUID() === uid ) return null;
if( isOverlay === false && currentApplication.close() === false ) return null;
};
- appClass.prototype = AbstractApplication;
- var data = new ApplicationPrivateData();
- data.init( displayName, appClass, isOverlay );
- var application = new appClass(); // new は boot で
+ appClass.prototype = new AbstractApplication( appClass, displayName, isOverlay );
+
+ var application = new appClass(),
+ data = ApplicationPrivateData.get( application );
coveredApplication = isOverlay === true ? currentApplication : null;
application.addAsyncCall( asyncOpen, arg );
} else {
Overlay.show( application, arg );
- }
+ };
return application;
},
}).fadeOut( onFadeOutComplete );
visible = false;
- KeyEvent.remove( application, Const.KEY.EVENT.KEY_DOWN, Overlay.hide ); // 27.esc
- MouseEvent.remove( application, elmCloseButton );
-
application = null;
},
onWindowResize: function( _windowW, _windowH ){