• R/O
  • HTTP
  • SSH
  • HTTPS

clientJs: コミット

クライアント側 js 開発用


コミットメタ情報

リビジョン5568fa9f90ed70083505118d7c8fab58c34d9749 (tree)
日時2012-11-15 21:04:00
作者itozyun <itozyun@gmai...>
コミッターitozyun

ログメッセージ

version 0.5.20, fixed around AbstractApplication.

変更サマリ

差分

--- a/0.5.x/javascripts/peta.apps.js
+++ b/0.5.x/javascripts/peta.apps.js
@@ -1,6 +1,6 @@
11 /*
22 * pettanR peta.apps.js
3- * version 0.5.19
3+ * version 0.5.20
44 *
55 * author:
66 * itozyun
@@ -487,7 +487,8 @@ var Cabinet = gOS.registerApplication( function(){
487487 nodeClose = null,
488488 nodePath = null,
489489 nodeBody = null,
490- headerH = 0;
490+ headerH = 0,
491+ eventRoot = null;
491492
492493 this.bgColor = '#FFFFFF';
493494 this.MIN_WIDTH = 500;
@@ -504,17 +505,15 @@ var Cabinet = gOS.registerApplication( function(){
504505 ].join( '' );
505506
506507 self.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
507- self.useInteractiveLayer( 'mousemove', 'mousedown', 'mouseup', 'mouseout' );
508508
509- tree = FileAPI.createTree( FILE_DATA_SERVICE_ROOT );
509+ tree = FileAPI.createTree( FILE_DATA_SERVICE_ROOT );
510+ eventRoot = self.getPointingDeviceEventTreeRoot();
510511
511512 delete self.onInit;
512513 };
513514 this.onOpen = function( _w, _h ){
514515 headerH = Util.getElementSize( document.getElementById( 'cabinet-header' ) ).height;
515516
516- var eventRoot = self.getPointingDeviceEventTreeRoot();
517- eventRoot.addEventListener( 'mousemove', new Function() );
518517 nodeClose = eventRoot.createNode( document.getElementById( 'cabinet-close-button' ), false, false, 'close-button-hover', 'pointer' );
519518 nodeClose.addEventListener( 'click', Cabinet.shutdown );
520519 nodePath = eventRoot.createNode( document.getElementById( 'cabinet-path' ), false, false );
@@ -542,7 +541,8 @@ var Gallery = gOS.registerApplication( function(){
542541 tree = null,
543542 nodePath = null,
544543 nodeBody = null,
545- headerH = 0;
544+ headerH = 0,
545+ eventRoot = null;
546546
547547 this.bgColor = '#FFFFFF';
548548 this.MIN_WIDTH = 500;
@@ -559,7 +559,6 @@ var Gallery = gOS.registerApplication( function(){
559559 ].join( '' );
560560
561561 self.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
562- self.useInteractiveLayer( 'mousemove', 'mousedown', 'mouseup', 'mouseout' );
563562
564563 tree = FileAPI.createTree( FILE_DATA_PICTURE_ROOT );
565564 var _root = tree.getRootFile(),
@@ -569,14 +568,14 @@ var Gallery = gOS.registerApplication( function(){
569568 _pic.getSeqentialFiles();
570569 _myPic.destroy();
571570 _pic.destroy();
571+
572+ eventRoot = self.getPointingDeviceEventTreeRoot();
572573 };
573574 this.onOpen = function( w, h ){
574575 headerH = Util.getElementSize( document.getElementById( 'gallery-header' ) ).height;
575576
576577 self.addEventListener( document.getElementById( 'gallery-close-button' ), 'click', Gallery.shutdown );
577578
578- var eventRoot = self.getPointingDeviceEventTreeRoot();
579- eventRoot.addEventListener( 'mousemove', new Function() );
580579 nodePath = eventRoot.createNode( document.getElementById( 'gallery-path' ), false, false );
581580 nodeBody = eventRoot.createNode( document.getElementById( 'gallery-container' ), false, true, null, '', true );
582581
@@ -585,8 +584,8 @@ var Gallery = gOS.registerApplication( function(){
585584 self.onPaneResize( w, h );
586585 };
587586 this.onClose = function(){
588- finder.destroy();
589- tree.destroy();
587+ // finder.destroy();
588+ // tree.destroy();
590589 finder = tree = null;
591590 };
592591 this.onPaneResize = function( w, h ){
@@ -1282,7 +1281,6 @@ var Editor = gOS.registerApplication( function(){
12821281 elm.style.borderStyle = this.border === true ? 'solid' : 'none';
12831282
12841283 this.node = nodeBox.createNode( elm, false, true, 'menubar-option-hover', 'pointer' );
1285- // this.node.addEventListener( 'click', this.callback, this.thisObject );
12861284 this.node.disabled( !this.visible );
12871285 },
12881286 hide : function(){
@@ -1414,17 +1412,6 @@ var Editor = gOS.registerApplication( function(){
14141412 option = this.optionDataList[ i ];
14151413 if( target === nodeBox ) return true;
14161414 option.fire();
1417- },
1418- onMousemove : function( e ){
1419- // if( currentMenu === -1 ) return;
1420- var x = e.clientX,
1421- y = e.clientY,
1422- boxX = nodeBox.x();
1423- console.log( 'x:' + x + ' y:' + y + ' Box.x:' + nodeBox.x() + ' Box.y:' + nodeBox.y() + ' Box.w:' + nodeBox.width() + ' Box.h:' + nodeBox.height() )
1424- console.log( 'x:' + x + ' y:' + y + ' Bar.x:' + nodeBar.x() + ' Bar.y:' + nodeBar.y() + ' Bar.w:' + nodeBar.width() + ' Bar.h:' + nodeBar.height() + ' hit:' + e.hit )
1425- //if( barH < y && ( x < boxX || nodeBox.width() + boxX < x || barH + nodeBox.y() + nodeBox.height() < y ) ){
1426- // this.menu.hide();
1427- //};
14281415 }
14291416 };
14301417 MenuPrivateDataClass.list = [];
@@ -1472,7 +1459,7 @@ var Editor = gOS.registerApplication( function(){
14721459 list[ i ].show( children[ i ] );
14731460 };
14741461 nodeBox.mesure();
1475- // eventRoot.addEventListener( 'mousemove', data.onMousemove, data );
1462+
14761463 nodeBar.addEventListener( 'mouseout', this.hide, this );
14771464 nodeBox.addEventListener( 'click', data.onOptionClick, data );
14781465 data.visible = true;
@@ -1487,7 +1474,7 @@ var Editor = gOS.registerApplication( function(){
14871474 };
14881475 elmBar.parentNode.removeChild( elmBox );
14891476 nodeBox.disabled( true );
1490- // eventRoot.removeEventListener( 'mousemove', data.onMousemove );
1477+
14911478 nodeBar.removeEventListener( 'mouseout', this.hide );
14921479 nodeBox.removeEventListener( 'click', data.onOptionClick );
14931480 data.visible = false;
@@ -1559,6 +1546,7 @@ var Editor = gOS.registerApplication( function(){
15591546 close : function(){
15601547 var data;
15611548 while( data = MenuPrivateDataClass.list.shift() ) data.close();
1549+ nodeBox.remove();
15621550 MenuPrivateDataClass.list = elmBar = layerBox = elmBox = null;
15631551 MENU_BAR_CONTROL.kill = kill;
15641552 MENU_BAR_CONTROL.kill();
@@ -2843,7 +2831,7 @@ var Editor = gOS.registerApplication( function(){
28432831 delete CONSOLE_CONTROLER.init;
28442832 },
28452833 open: function(){
2846- layerWrapper = app.createInteractContainer( elmConsoleWrapper );
2834+ // layerWrapper = app.createInteractContainer( elmConsoleWrapper );
28472835
28482836 LAYER_BACK_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'layer back', 'ctrl + B', layerBack, false, true, false );
28492837 LAYER_FORWARD_BUTTON = MENU_BAR_CONTROL.EDIT.createOption( 'layer forward', 'ctrl + F', layerForward, false, false, false );
@@ -2898,7 +2886,7 @@ var Editor = gOS.registerApplication( function(){
28982886 styleConsoleWrapper.left = CONSOLE_CONTROLER.x + 'px';
28992887 styleConsoleWrapper.top = CONSOLE_CONTROLER.y + 'px';
29002888
2901- layerWrapper.mesure();
2889+ // layerWrapper.mesure();
29022890 },
29032891 hide: function(){
29042892 if( visible === true ) styleConsoleWrapper.display = 'none';
@@ -2925,7 +2913,7 @@ var Editor = gOS.registerApplication( function(){
29252913 return false;
29262914 }
29272915 // buttonClickable === false && buttonBackOrForward( false ); */
2928- layerWrapper.mesure();
2916+ // layerWrapper.mesure();
29292917 return false;
29302918 }
29312919 }
@@ -4198,7 +4186,6 @@ var Editor = gOS.registerApplication( function(){
41984186 ].join( '' );
41994187
42004188 app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
4201- app.useInteractiveLayer( 'mousemove', 'mousedown', 'mouseup', 'mouseout' );
42024189 eventRoot = app.getPointingDeviceEventTreeRoot();
42034190
42044191 delete app.onInit;
@@ -4292,17 +4279,6 @@ var Editor = gOS.registerApplication( function(){
42924279
42934280 phase = 1;
42944281
4295- /*
4296- * MOUSE_LISTENER_ARRAY は、表示順に格納.手前の要素が最初
4297- * MENU_BAR_CONTROL,
4298- * WINDOW_CONTROL,
4299- * PANEL_ELEMENT_CONTROL,
4300- * PANEL_CONTROL
4301- * .busy() === true なら、そのままmousemove()にイベントを流す.
4302- * mousemove()に流してみて、false が帰れば、次のリスナーにも流す.
4303- */
4304- app.registerInteractiveListener( /* MENU_BAR_CONTROL, WINDOWS_CONTROL, PANEL_RESIZER_TOP, PANEL_RESIZER_BOTTOM, PANEL_ELEMENT_CONTROL, PANEL_CONTROL */ );
4305-
43064282 delete app.onOpen;
43074283 };
43084284 this.onClose = function(){
--- a/0.5.x/javascripts/pongame.js
+++ b/0.5.x/javascripts/pongame.js
@@ -192,7 +192,7 @@
192192 self.onPaneResize( _w, _h );
193193
194194 self.addEventListener( paddle1, 'click', Start );
195- self.addEventListener( close, 'click', self.close );
195+ self.addEventListener( close, 'click', self.close, self );
196196 };
197197 this.onPaneResize = function( _w, _h ){
198198 var h = Util.getElementSize( self.rootElement ).height;
--- a/0.5.x/javascripts/system.js
+++ b/0.5.x/javascripts/system.js
@@ -1,6 +1,6 @@
11 /*
22 * pettanR system.js
3- * version 0.5.19
3+ * version 0.5.20
44 *
55 * gadgetOS
66 * author:
@@ -211,19 +211,19 @@ var SystemTimer = ( function(){
211211 };
212212 };
213213
214- var TimerTicketClass = function( _apiuser, _callback, _time, _once ){
214+ var TimerTicketClass = function( _apiuser, _callback, _time, _once, opt_thisObject ){
215215 this.apiuser = _apiuser;
216216 this.callback = _callback;
217217 this.time = _time;
218218 this.count = _time;
219219 this.once = _once;
220- _apiuser = _callback = null;
220+ this.thisObj = opt_thisObject;
221221 };
222222 TimerTicketClass.prototype = new TicketBase();
223223 TimerTicketClass.prototype.call = function( c ){
224224 this.count -= c;
225225 if( this.count <= 0 ){
226- this.callback();
226+ this.callback.call( this.thisObj || this.apiuser );
227227 if( this.once === true ){
228228 this.destroy();
229229 TICKET_LIST.splice( Util.getIndex( TICKET_LIST, this ), 1 );
@@ -242,10 +242,10 @@ var SystemTimer = ( function(){
242242 };
243243
244244 return {
245- add: function( _apiuser, _handler, _time, _once ){
245+ add: function( _apiuser, _handler, _time, _once, opt_thisObject ){
246246 if( Type.isNumber( _time ) === false || _time < INTERVAL_TIME ) _time = INTERVAL_TIME;
247247
248- var _ticket = new TimerTicketClass( _apiuser, _handler, Math.ceil( _time / INTERVAL_TIME ), _once );
248+ var _ticket = new TimerTicketClass( _apiuser, _handler, Math.ceil( _time / INTERVAL_TIME ), _once, opt_thisObject );
249249 TICKET_LIST.push( _ticket );
250250
251251 update();
@@ -1049,35 +1049,8 @@ var File = ( function(){
10491049
10501050 var APPLICATION_LIST = [];
10511051
1052-var AbstractBasicPane = function(){
1053- var instance = null;
1054- this.MIN_WIDTH = 240;
1055- this.MIN_HEIGHT = 240;
1056- this.init = function(){
1057- instance = this;
1058- instance.onInit();
1059- };
1060- this.onInit = function(){};
1061- this.resize = function( _w, _h ){
1062- if( instance.MIN_WIDTH > _w || instance.MIN_HEIGHT > _h ){
1063- if( Type.isHTMLElement( instance.rootElement ) === true ){
1064- // 小さすぎる!、と表示
1065- };
1066- return;
1067- };
1068- instance.onPaneResize( _w, _h );
1069- };
1070- this.onPaneResize = function( _w, _h ){};
1071- this.close = function(){
1072- instance.onClose();
1073- instance = this;
1074- };
1075-};
1076-
1077-var ApplicationPrivateDataClass = function(){
1078-
1079-};
1080-ApplicationPrivateDataClass.prototype = {
1052+var ApplicationPrivateData = function(){};
1053+ApplicationPrivateData.prototype = {
10811054 appClass : null,
10821055 application : null,
10831056 displayName : null,
@@ -1086,495 +1059,214 @@ ApplicationPrivateDataClass.prototype = {
10861059 bgColor : '#C1CACF',
10871060 uiList : null,
10881061 finderList : null,
1089- layer : null,
1062+ styleCursor : null,
10901063 eventRoot : null,
10911064 fetchResource : 0,
10921065 bootParams : null,
10931066 phase : 0,
1094- cursor : ''
1095-};
1096-
1097-var AbstractApplication = function( displayName, appClass, isOverlay ){
1098- var self = null, // init で設定
1099- uiList = [],
1100- finderList = [],
1101- layer = null,
1102- root = null,
1103- fetchResource = 0,
1104- bootParams = null,
1105- phase = 0,
1106- cursor = '';
1107- this.rootElement = document.createElement( 'div' );
1108- this.bgColor = '#C1CACF';
1109- this.getUID = function(){
1110- return Util.getIndex( API_USER_LIST, appClass );
1111- };
1112- this.init = function(){
1113- phase = 1;
1114- self = this;
1115- appClass === Page.appClass && Page.show();
1116- self.onInit();
1117- layer !== null && layer.start();
1118- phase = 2;
1119- };
1120- this.open = function( _w, _h /*, _option */ ){
1121- phase = 3;
1122- bootParams = Util.copyArray( arguments );
1123-
1124- if( this.rootElement.innerHTML && this.rootElement.innerHTML.length > 0 ){
1125- SystemTimer.add( self, detect, 16 );
1126- } else {
1127- onOpen();
1067+ cursor : '',
1068+ w : 0,
1069+ h : 0,
1070+ init : function( displayName, appClass, isOverlay ){
1071+ // this.application = app;
1072+ this.displayName = displayName;
1073+ this.appClass = appClass;
1074+ this.isOverlay = isOverlay;
1075+ // app.rootElement = ;
1076+ this.rootElement = document.createElement( 'div' );
1077+ this.styleCursor = this.rootElement.style;
1078+ ApplicationPrivateData.list.push( this );
1079+ },
1080+ detect : function(){
1081+ if( this.rootElement.firstChild && this.fetchResource === 0 ){
1082+ SystemTimer.remove( this.application, this.detect );
1083+ this.onOpen();
11281084 };
1085+ },
1086+ onOpen : function(){
1087+ this.rootElement.style.display = '';
11291088
1130- function detect(){
1131- if( self.rootElement.firstChild && fetchResource === 0 ){
1132- SystemTimer.remove( self, detect );
1133- onOpen();
1134- };
1135- };
1089+ // this.layer !== null && this.layer.onResize( this.w, this.h );
11361090
1137- function onOpen(){
1138- self.rootElement.style.display = '';
1139-
1140- layer !== null && layer.onResize( _w, _h );
1141-
1142- if( self.MIN_WIDTH > _w || self.MIN_HEIGHT > _h ){
1143- if( Type.isHTMLElement( self.rootElement ) === true ){
1144- // 小さすぎる!、と表示
1145- };
1146- };
1147- if( bootParams.length > 2 ){
1148- self.onOpen.apply( self, bootParams );
1149- } else {
1150- self.onOpen( _w, _h );
1091+ if( this.application.MIN_WIDTH > this.w || this.application.MIN_HEIGHT > this.h ){
1092+ if( Type.isHTMLElement( this.rootElement ) === true ){
1093+ // 小さすぎる!、と表示
11511094 };
1152- phase = 4;
11531095 };
1096+ if( this.bootParams.length > 2 ){
1097+ this.application.onOpen.apply( this.application, this.bootParams );
1098+ } else {
1099+ this.application.onOpen( this.w, this.h );
1100+ };
1101+ this.phase = 4;
1102+ },
1103+ fetchResourceComplete : function(){
1104+ --this.fetchResource;
1105+ }
1106+};
1107+ApplicationPrivateData.list = [];
1108+ApplicationPrivateData.get = function( app ){
1109+ var list = ApplicationPrivateData.list,
1110+ i = list.length;
1111+ for( ; i; ){
1112+ if( app instanceof list[ --i ].appClass ) return list[ i ];
11541113 };
1155- this.resize = function( _w, _h ){
1156- if( phase !== 4 ) return;
1157- if( self.MIN_WIDTH > _w || self.MIN_HEIGHT > _h ){
1158- if( Type.isHTMLElement( self.rootElement ) === true ){
1114+ return null;
1115+};
1116+
1117+var AbstractApplication = {
1118+ getUID : function(){
1119+ var data = ApplicationPrivateData.get( this );
1120+ return Util.getIndex( API_USER_LIST, data.appClass );
1121+ },
1122+ init : function(){
1123+ var data = ApplicationPrivateData.get( this );
1124+ this.rootElement = data.rootElement;
1125+ data.application = this;
1126+ data.phase = 1;
1127+ data.appClass === Page.appClass && Page.show();
1128+ this.onInit();
1129+ // data.layer && data.layer.start();
1130+ data.phase = 2;
1131+ },
1132+ open : function( w, h /*, _option */ ){
1133+ var data = ApplicationPrivateData.get( this );
1134+ data.phase = 3;
1135+ data.bootParams = Util.copyArray( arguments );
1136+ data.w = w;
1137+ data.h = h;
1138+ if( data.rootElement.innerHTML && data.rootElement.innerHTML.length > 0 ){
1139+ SystemTimer.add( this, data.detect, 16, false, data );
1140+ } else {
1141+ data.onOpen();
1142+ };
1143+ },
1144+ resize : function( w, h ){
1145+ var data = ApplicationPrivateData.get( this );
1146+ if( data.phase !== 4 ) return;
1147+ if( this.MIN_WIDTH > w || this.MIN_HEIGHT > h ){
1148+ if( Type.isHTMLElement( this.rootElement ) === true ){
11591149 // 小さすぎる!、と表示
11601150 };
11611151 return;
11621152 };
1163- self.onPaneResize( _w, _h );
1164- layer !== null && layer.onResize( _w, _h );
1165- };
1166- this.close = function(){
1167- phase = 5;
1168- if( self.onClose() === false ){
1153+ this.onPaneResize( w, h );
1154+ // data.layer !== null && data.layer.onResize( w, h );
1155+ },
1156+ close : function(){
1157+ var data = ApplicationPrivateData.get( this );
1158+ data.phase = 5;
1159+ if( this.onClose() === false ){
11691160 return false;
11701161 };
1171- while( uiList.length > 0 ){
1172- uiList.shift().destroy();
1162+ if( data.uiList ){
1163+ while( data.uiList.length > 0 ) data.uiList.shift().destroy();
11731164 };
1174- while( finderList.length > 0 ){
1175- finderList.shift().destroy();
1165+ if( data.finderList ){
1166+ while( data.finderList.length > 0 ) data.finderList.shift().destroy();
11761167 };
11771168
1178- root && PointingDeviceEventTree.destroyTree( root );
1179- MouseEvent.remove( self );
1180- KeyEvent.remove( self );
1181- SystemTimer.remove( self );
1182- AsyncCall.remove( self );
1183- StyleSheet.unload( self );
1184-
1185- layer !== null && layer.destroy();
1186- layer = null;
1169+ data.eventRoot && PointingDeviceEventTree.destroyTree( data.eventRoot );
1170+ MouseEvent.remove( this );
1171+ KeyEvent.remove( this );
1172+ SystemTimer.remove( this );
1173+ AsyncCall.remove( this );
1174+ StyleSheet.unload( this );
11871175
1176+ // data.layer && data.layer.destroy();
11881177
1189- var elm = self.rootElement;
1178+ var elm = this.rootElement;
11901179 Util.removeAllChildren( elm );
11911180 elm.parentNode.removeChild( elm );
1192- self.rootElement = null;
1193-
1194- Application.shutdown( self, isOverlay );
11951181
1196- appClass === Page.appClass && Page.hide();
1182+ Application.shutdown( this, data.isOverlay );
11971183
1198- self = appClass = uiList = null;
1199-
1200- phase = 6;
1201- };
1202- this.createUIGroup = function(){
1203- var _ui = UI.createUIGroup( self );
1204- uiList.push( _ui );
1205- return _ui;
1206- };
1207- this.createFinder = function( _elmTarget, _tree, _onSelect, _viewerOption, _editorOption ){
1208- var _finder = Finder.create( self, _elmTarget, _tree, _onSelect, _viewerOption, _editorOption );
1209- finderList.push( _finder );
1210- return _finder;
1211- };
1212- this.createBasicPane = function( _class, _options ){
1213- if( Type.isFunction( _class ) === false ) return null;
1214- _class.prototype = new AbstractBasicPane();
1215- return new _class( _options );
1216- };
1217- this.createDHTML = function( _elm ){
1218- return DHTML.create( self, _elm );
1219- };
1220- this.addEventListener = function( _element, _eventType, _handler, _opt_thisObject ){
1221- if( layer !== null && layer.contain( _element ) === true ){
1222- layer.addEvent( _element, _eventType, _handler, _opt_thisObject );
1223- } else {
1224- MouseEvent.add( self, _element, _eventType, _handler, _opt_thisObject );
1225- };
1226- };
1227- this.removeEventListener = function( _element, _eventType, _handler ){
1228- if( layer !== null && layer.contain( _element ) === true ){
1229- layer.removeEvent( _element, _eventType, _handler );
1230- } else {
1231- MouseEvent.remove( self, _element, _eventType, _handler );
1232- };
1233- };
1234- this.useInteractiveLayer = function( /* handleEvents */ ){
1235- if( phase === 1 && layer === null ){
1236- layer = InteractiveLayer.create( self, Util.copyArray( arguments ) );
1237- root = PointingDeviceEventTree.create( self, layer );
1238- };
1239- };
1240- this.getPointingDeviceEventTreeRoot = function(){
1241- return root;
1242- };
1243- this.createInteractContainer = function( elm ){
1244- if( layer !== null ) return layer.createContainer( elm );
1245- };
1246- this.registerInteractiveListener = function( /* */ ){
1247- layer !== null && layer.register( Util.copyArray( arguments ) );
1248- };
1249- this.isCurrentInteractiveEventListener = function( listener ){
1250- layer !== null && layer.isCurrentListener( listener );
1251- };
1252- this.updateCoursor = function( _cursor ){
1253- if( cursor !== _cursor ){
1254- if( layer ){
1255- layer.elm.style.cursor = cursor = _cursor;
1256- } else {
1257- self.rootElement.style.cursor = cursor = _cursor;
1258- };
1259- };
1260- };
1261- this.fetchCSS = function( _url, opt_onload, opt_onerror ){
1262- if( phase === 1 ){
1263- ++fetchResource;
1264- StyleSheet.load( self, _url, fetchResourceComplete, fetchResourceComplete );
1265- };
1266- };
1267-
1268- function fetchResourceComplete(){
1269- --fetchResource;
1270- };
1271-};
1272-
1273-AbstractApplication.prototype = new AbstractBasicPane();
1274-AbstractApplication.prototype.onInit = function(){
1275- // overrride
1276-};
1277-AbstractApplication.prototype.onOpen = function( _w, _h /*, _option */ ){
1278- // overrride
1279-};
1280-AbstractApplication.prototype.onClose = function(){
1281- // overrride
1282- return true;
1283-}; // false の場合、close の拒否
1284-AbstractApplication.prototype.addKeyEventListener = function( _eventType, _handler, _keyCode, _shift, _ctrl ){
1285- KeyEvent.add( this, _eventType, _handler, _keyCode, _shift, _ctrl );
1286-};
1287-AbstractApplication.prototype.removeKeyEventListener = function( _eventType, _handler, _keyCode, _shift, _ctrl ){
1288- KeyEvent.remove( this, _eventType, _handler, _keyCode, _shift, _ctrl );
1289-};
1290-AbstractApplication.prototype.shiftEnabled = function(){
1291- return KeyEvent.shiftEnabled;
1292-};
1293-AbstractApplication.prototype.ctrlEnabled = function(){
1294- return KeyEvent.ctrlEnabled;
1295-};
1296-AbstractApplication.prototype.addTimer = function( handler, time, once ){
1297- SystemTimer.add( this, handler, time, !!once );
1298-};
1299-AbstractApplication.prototype.removeTimer = function( handler ){
1300- SystemTimer.remove( this, handler );
1301-};
1302-AbstractApplication.prototype.addAsyncCall = function( _callback, _argments, _thisObject ){
1303- AsyncCall.add( this, _callback, _argments, _thisObject );
1304-};
1305-AbstractApplication.prototype.removeAsyncCall = function( _callback ){
1306- AsyncCall.remove( this, _callback );
1307-};
1308-AbstractApplication.prototype.fetchHTMLElement = function( id ){
1309- var elm = document.getElementById( id );
1310- if( elm ){
1311- elm.removeAttribute( 'id' );
1312- elm.parentNode.removeChild( elm );
1313- return elm;
1314- };
1315-};
1316-
1184+ data.appClass === Page.appClass && Page.hide();
13171185
1318-var InteractiveLayer = ( function(){
1319- var LAYER_LIST = [],
1320- currentLayer = null,
1321- currentList = null,
1322- currentListener = null;
1323-
1324- function eventRellay( e ){
1325- var _mouseX = e.clientX,
1326- _mouseY = e.clientY,
1327- _type = e.type === 'mouseout' ? 'mouseup' : e.type,
1328- _listener = currentListener,
1329- i, l;
1330- if( _listener !== null && _listener.busy() === true && _listener[ _type ] && _listener[ _type ]( _mouseX, _mouseY, e, _type ) === true ){
1331- // currentListener[ _type ]( _mouseX, _mouseY, e, _type );
1332- // console.log( '** current true : ' + _type + ' ' + Util.getIndex( currentList, _listener ) + ( _listener.id || _listener.elm.id ) );
1333- } else {
1334- currentListener = null;
1335- for( i = 0, l = currentList.length; i<l; ++i ){
1336- _listener = currentList[ i ];
1337- if( _listener[ _type ] && _listener[ _type ]( _mouseX, _mouseY, e, _type ) === true ){
1338- currentListener = _listener;
1339- // console.log( 'true : currentList.length = ' + l + ' ' + i )
1340- break;
1341- };
1342- };
1343-
1344- };
1345- // 文字選択の禁止
1346- //!document.selection && window.getSelection().removeAllRanges();
1347- return false;
1348- };
1349-
1350- var LayerClass = function( apiuser ){
1351- this.apiuser = apiuser;
1352- };
1353- LayerClass.prototype = {
1354- init: function( events ){
1355- this.elm = document.createElement( 'div' );
1356- body.appendChild( this.elm );
1357- // this.elm.style.cssText = 'position:absolute;top:0;left:0;height:100%;';
1358- this.elm.className = 'mouse-operation-catcher';
1359- this.elm.unselectable = 'on';
1360-
1361- this.listeners = [];
1362-
1363- if( Type.isString( events ) === true ){
1364- events = events.split( ',' );
1365- } else
1366- if( Type.isArray( events ) === false ){
1367- return;
1368- };
1369- for( var i = events.length; i; ){
1370- MouseEvent.add( this.apiuser, this.elm, events[ --i ], eventRellay );
1371- };
1372- },
1373- register: function( listener ){
1374- if( Type.isArray( listener ) === false ){
1375- this.listeners.push( listener );
1376- } else {
1377- this.listeners.push.apply( this.listeners, listener );
1378- };
1379- },
1380- isCurrentListener : function( listener ){
1381- return currentListener === listener;
1382- },
1383- onResize : function( _w, _h ){
1384- this.elm.style.height = _h + 'px';
1385- },
1386- contain : function( elm ){
1387- return !!this.getContainer( elm );
1388- },
1389- getContainer : function( elm ){
1390- var linstener;
1391- for( var i = this.listeners.length; i; ){
1392- linstener = this.listeners[ --i ];
1393- if( linstener instanceof InteractiveContainer ){
1394- if( linstener.contain( elm ) === true ) return linstener;
1395- };
1396- };
1397- return null;
1398- },
1399- createContainer : function( elm ){
1400- if( this.contain( elm ) === true ) return null;
1401- var ret = new InteractiveContainer( this.apiuser, elm );
1402- this.listeners.unshift( ret );
1403- return ret;
1404- },
1405- addEvent : function( element, eventType, handler, _opt_thisObject ){
1406- //console.log( eventType )
1407- currentListener = null;
1408-
1409- var container = this.getContainer( element );
1410- container !== null && container.addEvent( element, eventType, handler, _opt_thisObject );
1411-
1412- MouseEvent.add( this.apiuser, this.elm, eventType, eventRellay );
1413- },
1414- removeEvent : function( element, eventType, handler ){
1415- currentListener = null;
1416-
1417- var container = this.getContainer( element );
1418- container !== null && container.removeEvent( element, eventType, handler );
1419- },
1420- start : function(){
1421- currentLayer = this;
1422- currentList = currentLayer.listeners;
1423- currentLayer.elm.style.display = '';
1424- },
1425- destroy: function(){
1426- MouseEvent.remove( this.apiuser, this.elm );
1427- body.removeChild( this.elm );
1428-
1429- this.listeners.splice( 0, this.listeners.length );
1430-
1431- LAYER_LIST.splice( Util.getIndex( LAYER_LIST, this ), 1 );
1432- }
1433- };
1434-
1435- return {
1436- create : function( apiuser, events ){
1437- var ret = new LayerClass( apiuser );
1438- ret.init( events );
1439- LAYER_LIST.push( ret );
1440- return ret;
1441- },
1442- onCurrentApplicationChange : function( _application ){
1443- for( var i = 0, l = LAYER_LIST.length; i < l; ++i ){
1444- if( LAYER_LIST[ i ].apiuser === _application ){
1445- currentLayer = LAYER_LIST[ i ];
1446- currentList = currentLayer.listeners;
1447- currentLayer.elm.style.display = '';
1448- return;
1449- };
1450- };
1451- if( currentLayer ) currentLayer.elm.style.display = 'none';
1452- currentLayer = null;
1453- currentList = null;
1454- currentListener = null;
1455- },
1456- onSystemShutdown : function(){
1457-
1458- }
1459- };
1460-})();
1461-
1462-var InteractiveContainer = function( apiuser, elm ){
1463- this.apiuser = apiuser;
1464- this.elm = elm;
1465- this.events = {};
1466- this.mesure();
1467-};
1468-InteractiveContainer.prototype = {
1469- current : null,
1470- addEvent : function( element, eventType, handler, opt_thisObject ){
1471- var list = this.events[ eventType ], i;
1472- if( !list ){
1473- list = this.events[ eventType ] = [];
1474- this[ eventType ] = this._eventRellay;
1475- };
1476- for( i = list.length; i; ){
1477- if( list[ --i ].match( element, eventType, handler ) === true ){
1478- return;
1479- };
1480- };
1481- var ticket = new InterractiveEventTicket( element, eventType, handler, this.elm, opt_thisObject );
1482- ticket.init( Position.cumulativeOffset( this.elm ) );
1483- list.push( ticket );
1484- // AsyncCall.add( this.apiuser, ticket.init, Position.cumulativeOffset( this.elm ), ticket );
1186+ data.phase = 6;
1187+
1188+ var list = ApplicationPrivateData.list;
1189+ list.splice( Util.getIndex( list, data ), 1 );
14851190 },
1486- removeEvent : function( element, eventType, handler ){
1487- var list, i;
1488- for( var type in this.events ){
1489- list = this.events[ type ];
1490- if( eventType && eventType !== type ) continue;
1491- if( Type.isArray( list ) === false ) continue;
1492- for( i = list.length; i; ){
1493- if( list[ --i ].match( element, eventType, handler ) === true ){
1494- list.splice( i, 1 );
1495- if( list.length === 0 ){
1496- delete this[ type ];
1497- delete this.events[ type ];
1498- };
1499- };
1500- };
1501- };
1191+ createUIGroup : function(){
1192+ var data = ApplicationPrivateData.get( this ),
1193+ ui = UI.createUIGroup( this );
1194+ if( data.uiList === null ) data.uiList = [];
1195+ data.uiList.push( ui );
1196+ return ui;
15021197 },
1503- mesured : false,
1504- mesure : function(){
1505- var positon = Position.cumulativeOffset( this.elm );
1506- this.x = positon[ 0 ];
1507- this.y = positon[ 1 ];
1508- this.mesured = true;
1198+ createFinder : function( _elmTarget, _tree, _onSelect, _viewerOption, _editorOption ){
1199+ var data = ApplicationPrivateData.get( this ),
1200+ finder = Finder.create( this, _elmTarget, _tree, _onSelect, _viewerOption, _editorOption );
1201+ if( data.finderList === null ) data.finderList = [];
1202+ data.finderList.push( finder );
1203+ return finder;
15091204 },
1510- asyncMesure : function(){
1511- this.mesured === false && this.mesure();
1205+ createDHTML : function( _elm ){
1206+ return DHTML.create( this, _elm );
15121207 },
1513- setPositon : function( x, y ){
1514- this.x = x;
1515- this.y = y;
1516- this.elm.style.left = x + 'px';
1517- this.elm.style.top = y + 'px';
1208+ addEventListener : function( element, eventType, handler, opt_thisObject ){
1209+ MouseEvent.add( this, element, eventType, handler, opt_thisObject );
15181210 },
1519- contain : function( child ){
1520- return this.elm === child || Util.contain( this.elm, child );
1211+ removeEventListener : function( element, eventType, handler ){
1212+ MouseEvent.remove( this, element, eventType, handler );
15211213 },
1522- busy : function(){
1523- return this.current !== null;
1214+ getPointingDeviceEventTreeRoot : function(){
1215+ var data = ApplicationPrivateData.get( this );
1216+ if( data.phase === 1 ){
1217+ data.eventRoot = PointingDeviceEventTree.create( this );
1218+ data.styleCursor = PointingDeviceEventTree._getNodePrivateData( data.eventRoot ).elmMouseCatch.style;
1219+ };
1220+ return data.eventRoot;
15241221 },
1525- _eventRellay : function( mouseX, mouseY, e, eventType ){
1526- var list = this.events[ eventType ];
1527- if( Type.isArray( list ) === false ) return false;
1528- // console.log( eventType + ' mX:' + mouseX + ' mY:' + mouseY + ' x:' + this.x + ' y:' + this.y + ' ' + this.elm.id );
1529- var x = mouseX - this.x,
1530- y = mouseY - this.y,
1531- c = this.current,
1532- t, i;
1533- if( c !== null && c.type === eventType ){
1534- if( c.x <= x && x <= c.x + c.target.offsetWidth && c.y <= y && y <= c.y + c.target.offsetHeight ){
1535- c.handler.call( c.thisObj || c.target, e, x, y );
1536- return true;
1537- };
1222+ updateCoursor : function( _cursor ){
1223+ var data = ApplicationPrivateData.get( this );
1224+ if( data.cursor !== _cursor ){
1225+ data.styleCursor.cursor = data.cursor = _cursor;
15381226 };
1539- for( i = list.length; i; ){
1540- t = list[ --i ];
1541- if( t.x <= x && x <= t.x + t.target.offsetWidth && t.y <= y && y <= t.y + t.target.offsetHeight ){
1542- t.handler.call( t.thisObj || t.target, e, x, y );
1543- this.current = t;
1544- return true;
1545- };
1227+ },
1228+ fetchCSS : function( url, opt_onload, opt_onerror ){
1229+ var data = ApplicationPrivateData.get( this );
1230+ if( data.phase === 1 ){
1231+ ++data.fetchResource;
1232+ StyleSheet.load( this, url, data.fetchResourceComplete, data.fetchResourceComplete, data );
15461233 };
1547- // console.log( 'false ' + this.elm.id );
1548- this.current = null;
1549- return false;
1550- }
1551-};
1552-
1553-var InterractiveEventTicket = function( elm, type, handler, parent, opt_thisObject ){
1554- this.target = elm;
1555- this.type = type;
1556- this.handler = handler;
1557- this.parent = parent;
1558- this.thisObj = opt_thisObject;
1559-};
1560-InterractiveEventTicket.prototype = {
1561- x : -99999,
1562- y : -99999,
1563- w : 0,
1564- h : 0,
1565- init : function( _positon ){
1566- var positon = Position.cumulativeOffset( this.target );
1567- this.x = positon[ 0 ] - _positon[ 0 ];
1568- this.y = positon[ 1 ] - _positon[ 1 ];
1569- this.w = this.target.offsetWidth;
1570- this.h = this.target.offsetHeight;
1571- // console.log( '- x: ' + this.x + ' y: ' + this.y + ' w: ' + this.w + ' h: ' + this.h + ' ' + ( this.target.id || '-' ) + ' ,' + this.type );
15721234 },
1573- match : function( element, eventType, handler ){
1574- if( handler && this.handler !== handler ) return false;
1575- if( eventType && this.type !== eventType ) return false;
1576- if( element && this.target !== element ) return false;
1577- return true;
1235+ onInit : function(){},
1236+ onOpen : function(){},
1237+ onClose : function(){ return true; },
1238+ onPaneResize : function( w, h ){},
1239+ addKeyEventListener : function( _eventType, _handler, _keyCode, _shift, _ctrl ){
1240+ KeyEvent.add( this, _eventType, _handler, _keyCode, _shift, _ctrl );
1241+ },
1242+ removeKeyEventListener : function( _eventType, _handler, _keyCode, _shift, _ctrl ){
1243+ KeyEvent.remove( this, _eventType, _handler, _keyCode, _shift, _ctrl );
1244+ },
1245+ shiftEnabled : function(){
1246+ return KeyEvent.shiftEnabled;
1247+ },
1248+ ctrlEnabled : function(){
1249+ return KeyEvent.ctrlEnabled;
1250+ },
1251+ addTimer : function( handler, time, once ){
1252+ SystemTimer.add( this, handler, time, !!once );
1253+ },
1254+ removeTimer : function( handler ){
1255+ SystemTimer.remove( this, handler );
1256+ },
1257+ addAsyncCall : function( _callback, _argments, _thisObject ){
1258+ AsyncCall.add( this, _callback, _argments, _thisObject );
1259+ },
1260+ removeAsyncCall : function( _callback ){
1261+ AsyncCall.remove( this, _callback );
1262+ },
1263+ fetchHTMLElement : function( id ){
1264+ var elm = document.getElementById( id );
1265+ if( elm ){
1266+ elm.removeAttribute( 'id' );
1267+ elm.parentNode.removeChild( elm );
1268+ return elm;
1269+ };
15781270 }
15791271 };
15801272
@@ -2376,15 +2068,23 @@ var PointingDeviceEventTree = ( function(){
23762068 })();
23772069
23782070 return {
2379- create : function( apiuser, layer ){
2071+ create : function( apiuser ){
23802072 var root = new NodeClass( apiuser, null, null, apiuser.rootElement ),
2381- data = NodePrivateData.get( root );
2382- data.elmMouseCatch = layer.elm;
2073+ data = NodePrivateData.get( root ),
2074+ elm = document.createElement( 'div' );
2075+ body.appendChild( elm );
2076+ // elm.style.cssText = 'position:absolute;top:0;left:0;height:100%;';
2077+ elm.className = 'mouse-operation-catcher';
2078+ elm.unselectable = 'on';
2079+ data.elmMouseCatch = elm;
2080+
23832081 data.eventCounter = {};
23842082 ROOT_LIST.push( data );
23852083 currentRootData = data;
23862084 targetNodeData = null;
23872085 forceNodeData = null;
2086+
2087+ MouseEvent.add( apiuser, elm, 'mousemove', eventRellay );
23882088 return root;
23892089 },
23902090 onCurrentApplicationChange : function( _application ){
@@ -2399,6 +2099,9 @@ var PointingDeviceEventTree = ( function(){
23992099 };
24002100 },
24012101 destroyTree : function( root ){
2102+ var data = NodePrivateData.get( root );
2103+ MouseEvent.remove( data.apiuser, data.elmMouseCatch, 'mousemove', eventRellay );
2104+ body.removeChild( data.elmMouseCatch );
24022105 NodePrivateData.get( root )._destroy();
24032106 ROOT_LIST.splice( Util.getIndex( ROOT_LIST, root ), 1 );
24042107 },
@@ -2460,17 +2163,14 @@ var Application = ( function(){
24602163 _tail === true && Home.add( _ref );
24612164 return _ref;
24622165 },
2463- isBasicPaneInstance: function( _basicPane ){
2464- return _basicPane instanceof AbstractBasicPane;
2465- },
2466- isApplicationInstance: function( _application ){
2467- return _application instanceof AbstractApplication;
2166+ isApplicationInstance: function( app ){
2167+ return ApplicationPrivateData.get( app ) !== null;
24682168 },
24692169 isApplicationReference: function( _reference ){
24702170 return _reference instanceof ApplicationReference;
24712171 },
2472- isCurrentAppplication: function( _application ){
2473- return true
2172+ isCurrentAppplication: function( app ){
2173+ return app === currentApplication;
24742174 },
24752175 boot: function( displayName, uid, appClass, isOverlay, arg ){
24762176 if( currentApplication ){
@@ -2478,7 +2178,9 @@ var Application = ( function(){
24782178 if( isOverlay === false && currentApplication.close() === false ) return null;
24792179 };
24802180
2481- appClass.prototype = new AbstractApplication( displayName, appClass, isOverlay );
2181+ appClass.prototype = AbstractApplication;
2182+ var data = new ApplicationPrivateData();
2183+ data.init( displayName, appClass, isOverlay );
24822184 var application = new appClass(); // new は boot で
24832185
24842186 coveredApplication = isOverlay === true ? currentApplication : null;
@@ -2488,8 +2190,8 @@ var Application = ( function(){
24882190 if( isOverlay === false ){
24892191 body.style.backgroundColor = application.bgColor;
24902192
2491- body.appendChild( application.rootElement );
2492- application.rootElement.style.display = 'none';
2193+ body.appendChild( data.rootElement );
2194+ data.rootElement.style.display = 'none';
24932195 application.init();
24942196
24952197 application.addAsyncCall( asyncOpen, arg );
@@ -3422,22 +3124,21 @@ var ResizeEvent = ( function(){
34223124 };
34233125 };
34243126 },
3425- remove: function( _apiuser, _element, _eventType, _handler ){
3426- if( isApiUser( _apiuser ) === true ){
3427- var _uid = _apiuser.getUID(),
3428- _events = EVENT_LIST_MAP[ _uid ],
3429- _removed,
3430- i = 0;
3431- if( Type.isArray( _events ) === false ) return;
3432- for( ;i < _events.length; ){
3433- if( _events[ i ].destroy( _element, _eventType, _handler ) === true ){
3434- _events.splice( i, 1 );
3127+ remove: function( apiuser, element, eventType, handler ){
3128+ if( isApiUser( apiuser ) === true ){
3129+ var uid = apiuser.getUID(),
3130+ list = EVENT_LIST_MAP[ uid ],
3131+ i = 0;
3132+ if( Type.isArray( list ) === false ) return;
3133+ for( ;i < list.length; ){
3134+ if( list[ i ].destroy( element, eventType, handler ) === true ){
3135+ list.splice( i, 1 );
34353136 } else {
34363137 ++i;
34373138 };
34383139 };
3439- if( _events.length === 0 ){
3440- _events = EVENT_LIST_MAP[ _uid ] = null;
3140+ if( list.length === 0 ){
3141+ EVENT_LIST_MAP[ uid ] = null;
34413142 };
34423143 };
34433144 },
@@ -3675,12 +3376,13 @@ var StyleSheet = ( function(){
36753376
36763377 var cssRules, sheet;
36773378
3678- var FetchCssTicketClass = function( _apiuser, _url, _elm, _onload, _onerror ){
3379+ var FetchCssTicketClass = function( _apiuser, _url, _elm, _onload, _onerror, opt_thisObject ){
36793380 this.apiusers = [ _apiuser ];
36803381 this.url = _url;
36813382 this.elm = _elm;
36823383 this.onload = [ _onload ];
36833384 this.onerror = [ _onerror ];
3385+ this.thisObj = [ opt_thisObject ];
36843386 this.time = 0;
36853387 };
36863388 FetchCssTicketClass.prototype = {
@@ -3697,6 +3399,7 @@ var StyleSheet = ( function(){
36973399 this.apiusers.splice( i, 1 );
36983400 this.onload.splice( i, 1 );
36993401 this.onerror.splice( i, 1 );
3402+ this.thisObj.splice( i, 1 );
37003403
37013404 if( this.apiusers.length !== 0 ) return false;
37023405
@@ -3709,6 +3412,7 @@ var StyleSheet = ( function(){
37093412 delete this.elm;
37103413 delete this.onload;
37113414 delete this.onerror;
3415+ delete this.thisObj;
37123416 delete this.time;
37133417
37143418 return true;
@@ -3716,14 +3420,14 @@ var StyleSheet = ( function(){
37163420 loaded: function(){
37173421 for( var i = this.onload.length, f; i; ){
37183422 f = this.onload[ --i ];
3719- Type.isFunction( f ) === true && AsyncCall.add( this.apiusers[ i ], f, this.url );
3423+ Type.isFunction( f ) === true && AsyncCall.add( this.apiusers[ i ], f, this.url, this.thisObj[ i ] || this.apiusers[ i ] );
37203424 this.onload[ i ] = this.onerror[ i ] = null;
37213425 };
37223426 },
37233427 error: function(){
37243428 for( var i = this.onerror.length, f; i; ){
37253429 f = this.onerror[ --i ];
3726- Type.isFunction( f ) === true && AsyncCall.add( this.apiusers[ i ], f, this.url );
3430+ Type.isFunction( f ) === true && AsyncCall.add( this.apiusers[ i ], f, this.url, this.thisObj[ i ] || this.apiusers[ i ] );
37273431 this.onload[ i ] = this.onerror[ i ] = null;
37283432 };
37293433 },
@@ -3775,7 +3479,7 @@ var StyleSheet = ( function(){
37753479 };
37763480
37773481 return {
3778- load: function( _apiuser, _url, opt_onload, opt_onerror ){
3482+ load: function( _apiuser, _url, opt_onload, opt_onerror, opt_thisObject ){
37793483 _url = Util.getAbsolutePath( _url );
37803484 var t;
37813485 for( var i=TICKET_LIST.length; i; ){
@@ -3785,6 +3489,7 @@ var StyleSheet = ( function(){
37853489 t.apiusers.push( _apiuser );
37863490 t.onload.push( opt_onload );
37873491 t.onerror.push( opt_onerror );
3492+ t.thisObj.push( opt_thisObject );
37883493 };
37893494 SystemTimer.add( SUPER_USER_KEY, checkTimer, 333 );
37903495 return;
@@ -3806,7 +3511,7 @@ var StyleSheet = ( function(){
38063511 };
38073512 };
38083513
3809- TICKET_LIST.push( new FetchCssTicketClass( _apiuser, _url, elm, opt_onload, opt_onerror ) );
3514+ TICKET_LIST.push( new FetchCssTicketClass( _apiuser, _url, elm, opt_onload, opt_onerror, opt_thisObject ) );
38103515
38113516 SystemTimer.add( SUPER_USER_KEY, checkTimer, 333 );
38123517 },
@@ -3978,15 +3683,12 @@ var Overlay = ( function(){
39783683 Overlay.hide();
39793684 return false;
39803685 };
3981- function asyncInit( /* arguments */ ){
3982-
3983- //body.appendChild( application.rootElement );
3686+ function asyncInit( /* arguments */ ){
3687+ application.init();
39843688 elmContainer.insertBefore( application.rootElement, elmCloseButton );
39853689 application.rootElement.style.display = 'none';
3986- application.init();
39873690 };
39883691 function asyncOpen( /* arguments */ ){
3989-
39903692 var _arg = Util.copyArray( arguments );
39913693 _arg.unshift( windowW, windowH );
39923694 application.open.apply( application, _arg );
@@ -4027,11 +3729,13 @@ var Overlay = ( function(){
40273729
40283730 elmContainer.style.display = 'none'; // hide for fadeIn
40293731
4030- _application.addAsyncCall( asyncInit );
4031- _application.addAsyncCall( asyncOpen, _bootParams );
4032-
40333732 visible = true;
40343733 application = _application;
3734+
3735+ //asyncInit();
3736+
3737+ _application.addAsyncCall( asyncInit );
3738+ _application.addAsyncCall( asyncOpen, _bootParams );
40353739 },
40363740 hide: function(){
40373741 if( visible === false ) return;
@@ -5002,16 +4706,22 @@ var Finder = ( function(){
50024706 },
50034707 destroy : function(){
50044708 this.tree.removeTreeEventListener( Const.TREE.EVENT.UPDATE, this.draw );
5005-
5006- this.nodeRoot.remove();
5007- this.nodePath && this.nodePath.remove();
5008-
4709+
50094710 if( this.pathList ){
50104711 while( this.pathList.length > 0 ) this.pathList.shift().destroy();
50114712 };
50124713 while( this.iconList.length > 0 ) this.iconList.shift().destroy();
50134714
5014- this.elmRoot.removeChild( this.elmRoot );
4715+ this.nodeRoot.remove();
4716+ // this.nodePath && this.nodePath.remove();
4717+
4718+ // this.elmRoot.removeChild( this.elmRoot );
4719+
4720+ FINDER_LIST.splice( Util.getIndex( FINDER_LIST, this.finder ), 1 );
4721+ var data = ApplicationPrivateData.get( this.apiuser ),
4722+ list = data.finderList,
4723+ i = Util.getIndex( list, this.finder );
4724+ i !== -1 && list.splice( i, 1 );
50154725 }
50164726 };
50174727 FinderPrivateData.LIST = [];
@@ -5032,35 +4742,34 @@ var Finder = ( function(){
50324742 var FinderClass = function( application, elmRoot, tree, onSelect, viewerOption, editorOption ){
50334743 ( new FinderPrivateData() ).init( this, application, elmRoot, tree, onSelect, viewerOption, editorOption );
50344744 };
5035- FinderClass.prototype = new AbstractBasicPane();
5036- FinderClass.prototype.MIN_WIDTH = 240;
5037- FinderClass.prototype.MIN_HEIGHT = 240;
5038- FinderClass.prototype.onInit = function(){
4745+ FinderClass.prototype = {
4746+ MIN_WIDTH : 200,
4747+ MIN_HEIGHT : 200,
4748+ init : function(){
50394749 var data = FinderPrivateData.get( this );
5040- // var position = Util.getAbsolutePosition( elmPath );
5041- // data.headX = position.x;
5042- // data.headY = position.y;
5043- // data.bodyY = Util.getAbsolutePosition( data.elmBody ).y;
5044- console.log( 'Finder onInit..........' );
5045- data.apiuser.addEventListener( data.elmRoot, 'mousemove', data.mousemove, data );
5046- data.apiuser.addEventListener( data.elmRoot, 'click', data.click, data );
5047- data.apiuser.addEventListener( data.elmRoot, 'mousewheel', data.mousewheel, data );
5048- };
5049- FinderClass.prototype.onPaneResize = function( _w, _h ){
5050- var data = FinderPrivateData.get( this ),
5051- i = data.iconList.length;
5052- //data.draw( _w, _h );
5053-
5054- //data.elmRoot.style.height = ( _h - data.headH ) + 'px';
5055-
5056- for( ; i; ) data.iconList[ --i ].resize( _w );
5057- };
5058- FinderClass.prototype.createPath = function( node ){
5059- return FinderPrivateData.get( this ).createPath( node );
5060- };
5061- FinderClass.prototype.destroy = function(){
5062- FinderPrivateData.get( this ).destroy();
5063- FINDER_LIST.splice( Util.getIndex( FINDER_LIST, this ), 1 );
4750+ // var position = Util.getAbsolutePosition( elmPath );
4751+ // data.headX = position.x;
4752+ // data.headY = position.y;
4753+ // data.bodyY = Util.getAbsolutePosition( data.elmBody ).y;
4754+ data.apiuser.addEventListener( data.elmRoot, 'mousemove', data.mousemove, data );
4755+ data.apiuser.addEventListener( data.elmRoot, 'click', data.click, data );
4756+ data.apiuser.addEventListener( data.elmRoot, 'mousewheel', data.mousewheel, data );
4757+ },
4758+ resize : function( w, h ){
4759+ var data = FinderPrivateData.get( this ),
4760+ i = data.iconList.length;
4761+ //data.draw( _w, _h );
4762+
4763+ //data.elmRoot.style.height = ( _h - data.headH ) + 'px';
4764+
4765+ for( ; i; ) data.iconList[ --i ].resize( w );
4766+ },
4767+ createPath : function( node ){
4768+ return FinderPrivateData.get( this ).createPath( node );
4769+ },
4770+ destroy : function(){
4771+ FinderPrivateData.get( this ).destroy();
4772+ }
50644773 };
50654774
50664775 return {
旧リポジトリブラウザで表示