• R/O
  • HTTP
  • SSH
  • HTTPS

clientJs: コミット

クライアント側 js 開発用


コミットメタ情報

リビジョン67cb7059b2dab2d5d1c72214e7cfa026b0ec6b75 (tree)
日時2012-12-08 23:48:36
作者itozyun <itozyun@gmai...>
コミッターitozyun

ログメッセージ

version 0.5.29, fixed PointingDeviceEventTree.ScrollManager, peta.apps.

変更サマリ

差分

--- 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.28
3+ * version 0.5.29
44 *
55 * author:
66 * itozyun
@@ -28,7 +28,7 @@
2828 _data.state = Const.FILE.STATE.OK;
2929
3030 if( Type.isArray( _json ) === true ){
31- for( var i=0, l = _json.length; i<l; ++i ){
31+ for( var i = 0, l = _json.length; i < l; ++i ){
3232 buildFileData( _json[ i ], _data );
3333 };
3434 } else
@@ -2235,12 +2235,14 @@ var Editor = gOS.registerApplication( function(){
22352235 var onHelpLoad = function( _xml ){
22362236 var jqXML = $( _xml ),
22372237 helpTitle = jqXML.find( 'pages' ).eq( 0 ).attr( 'title' ),
2238+ elmRoot = document.createElement( 'div' ),
22382239 elmNavi = document.createElement( 'div' ),
22392240 elmItemOrigin = document.createElement( 'a' ),
22402241 elmPages = document.createElement( 'div' ),
22412242 elmPageOrigin = document.createElement( 'div' ),
22422243 elmTitleOrigin = document.createElement( 'h2' ),
22432244 elmPage;
2245+ elmRoot.className = 'multi-page-container clearfix';
22442246 elmNavi.className = 'sidenavi';
22452247 elmItemOrigin.className = 'sidenavi-item';
22462248 elmItemOrigin.href = '#';
@@ -2276,8 +2278,9 @@ var Editor = gOS.registerApplication( function(){
22762278 MENU_BAR_CONTROL.HELP.createOption( title, null, onSelectionClick, true );
22772279 ++numPage;
22782280 });
2279-
2280- jqAjaxContents.removeClass( 'loading' ).append( elmNavi, elmPages );
2281+ elmRoot.appendChild( elmNavi );
2282+ elmRoot.appendChild( elmPages );
2283+ jqAjaxContents.removeClass( 'loading' ).append( elmRoot );
22812284
22822285 jqNaviItems = jqAjaxContents.find( 'a.' + elmItemOrigin.className ).click( onNaviClick );
22832286 jqPages = jqAjaxContents.find( '.page-content' );
@@ -2966,7 +2969,7 @@ var Editor = gOS.registerApplication( function(){
29662969 baseW = _w;
29672970 baseH = _h = _memoryY -_y;
29682971 flip( false, true);
2969- flipH = currentElement.flipH();
2972+ flipH = currentElement.flipH;
29702973 } else {
29712974 // flipVH
29722975 _memoryX = _x;
@@ -3492,7 +3495,6 @@ var Editor = gOS.registerApplication( function(){
34923495 this.resize( this.x + shiftX, this.y + shiftY );
34933496 },
34943497 mouseover : function( e ){
3495- console.log( 'w:' + this.node.width() + ' h:' + this.node.height() + ' x:' + this.node.x() + ' y:' + this.node.y() )
34963498 PanelElementOperatorManager.show( this );
34973499 }
34983500 };
@@ -3716,6 +3718,8 @@ var Editor = gOS.registerApplication( function(){
37163718 this.$.stop().remove();
37173719 this.balloon.destroy();
37183720 this.node.remove();
3721+
3722+ this.destroy = null;
37193723 }
37203724 }
37213725 );
@@ -4080,7 +4084,7 @@ var Editor = gOS.registerApplication( function(){
40804084 '</div>',
40814085 '<div class="window-body"></div>',
40824086 '<div class="window-footer">',
4083- '<div class="window-resize-button">/</div>',
4087+ '<div class="window-resize-button"></div>',
40844088 '</div>',
40854089 '</div>',
40864090
@@ -4367,10 +4371,10 @@ var ComicConsole = gOS.registerApplication( function(){
43674371 _optionList = _select.getElementsByTagName( 'option' )
43684372 if( _name === 'comic[visible]' ){
43694373 _select.selectedIndex = comboboxVisible.selectIndex();
4370- } else
4374+ }/* else
43714375 if( _name === 'comic[editable]' ){
4372- // _select.selectedIndex = comboboxEditable.selectIndex();
4373- };
4376+ _select.selectedIndex = comboboxEditable.selectIndex();
4377+ } */;
43744378 };
43754379 app.submit();
43764380 };
@@ -4471,10 +4475,10 @@ var ComicConsole = gOS.registerApplication( function(){
44714475 option = optionList[ j ];
44724476 if( select.name === 'comic[visible]' ){
44734477 comboboxVisible.createOption( option.innerHTML, option.value, option.selected );
4474- } else
4478+ }/* else
44754479 if( select.name === 'comic[editable]' ){
4476- // comboboxEditable.createOption( option.innerHTML, option.value, option.selected );
4477- };
4480+ comboboxEditable.createOption( option.innerHTML, option.value, option.selected );
4481+ }*/;
44784482 };
44794483 };
44804484 inputTitle.focus();
@@ -4482,7 +4486,6 @@ var ComicConsole = gOS.registerApplication( function(){
44824486 //node.mesure();
44834487 app.onPaneResize( windowW, windowH );
44844488
4485-
44864489 delete app.onFoemReady;
44874490 };
44884491 this.submitError = function(){
@@ -4495,6 +4498,7 @@ var ComicConsole = gOS.registerApplication( function(){
44954498
44964499 var UploadConsole = gOS.registerApplication( function(){
44974500 var windowW, windowH,
4501+ eventRoot, node,
44984502 buttonSubmit, buttonCancel,
44994503 elmFile,
45004504 app = this;
@@ -4531,6 +4535,8 @@ var UploadConsole = gOS.registerApplication( function(){
45314535
45324536 app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
45334537
4538+ eventRoot = app.getPointingDeviceEventTreeRoot();
4539+
45344540 delete app.onInit;
45354541 };
45364542 this.elmProgressID = 'upload-console-progress';
@@ -4540,8 +4546,6 @@ var UploadConsole = gOS.registerApplication( function(){
45404546 this.hideUploader = false;
45414547 FormApplicationHelper( this );
45424548 this.onFormReady = function(){
4543- app.onPaneResize( windowW, windowH );
4544-
45454549 var _inputList = app.elmForm.getElementsByTagName( 'input' ),
45464550 _input;
45474551 for( var i = _inputList.length; i; ){
@@ -4553,6 +4557,9 @@ var UploadConsole = gOS.registerApplication( function(){
45534557 _input.style.display = 'none';
45544558 };
45554559 };
4560+ node.mesure();
4561+ app.onPaneResize( windowW, windowH );
4562+ node.mesureChildren();
45564563 delete app.onFoemReady;
45574564 };
45584565 this.submitError = function(){
@@ -4562,20 +4569,23 @@ var UploadConsole = gOS.registerApplication( function(){
45624569 app.addTimer( clickCancel , 5000, true );
45634570 };
45644571 this.onOpen = function( w, h ){
4565- var ui = app.createUIGroup();
4566- buttonSubmit = ui.createButton( document.getElementById( 'upload-console-post-button'), clickOK );
4567- buttonCancel = ui.createButton( document.getElementById( 'upload-console-cancel-button'), clickCancel );
4572+ node = eventRoot.createNode( app.rootElement, true, true );
4573+ var ui = app.createUIGroup( node );
4574+
4575+ buttonSubmit = ui.createButton( document.getElementById( 'upload-console-post-button' ), clickOK );
4576+ buttonCancel = ui.createButton( document.getElementById( 'upload-console-cancel-button' ), clickCancel );
45684577
45694578 app.onPaneResize( w, h );
45704579 app.fetchScript();
45714580 };
4572- this.onPaneResize = function( _windowW, _windowH){
4573- windowW = _windowW;
4574- windowH = _windowH;
4575- app.rootElement.style.cssText = [
4576- 'left:', Math.floor( ( _windowW - app.rootElement.offsetWidth ) /2 ), 'px;',
4577- 'top:', Math.floor( ( _windowH - app.rootElement.offsetHeight ) /2 ), 'px;'
4578- ].join( '' );
4581+ this.onPaneResize = function( w, h ){
4582+ windowW = w;
4583+ windowH = h;
4584+ //app.rootElement.style.cssText = [
4585+ // 'left:', Math.floor( ( _w - app.rootElement.offsetWidth ) /2 ), 'px;',
4586+ // 'top:', Math.floor( ( _h- app.rootElement.offsetHeight ) /2 ), 'px;'
4587+ //].join( '' );
4588+ node.update( w / 2 - node.width() / 2, h / 2 - node.height() / 2 );
45794589 };
45804590 this.onClose = function(){
45814591 app.destroyHelper();
@@ -4585,11 +4595,15 @@ var UploadConsole = gOS.registerApplication( function(){
45854595
45864596 var ArtistConsole = gOS.registerApplication( function(){
45874597 var windowW, windowH,
4598+ eventRoot, node,
4599+ elmName, elmLicense,
4600+ inputName, inputLicense,
45884601 buttonSubmit, buttonCancel,
45894602 app = this;
45904603
45914604 function clickOK(){
45924605 if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
4606+ inputUpdate();
45934607 app.submit();
45944608 return false;
45954609 };
@@ -4598,6 +4612,10 @@ var ArtistConsole = gOS.registerApplication( function(){
45984612 ArtistConsole.shutdown();
45994613 return false;
46004614 };
4615+ function inputUpdate( v ){
4616+ elmName.value = inputName.value();
4617+ elmLicense.value = inputLicense.value();
4618+ };
46014619
46024620 /* grobal method */
46034621 this.MIN_WIDTH = 320;
@@ -4608,16 +4626,25 @@ var ArtistConsole = gOS.registerApplication( function(){
46084626 app.rootElement.innerHTML = [
46094627 '<div id="artist-console-header" class="console-header">Register Artist</div>',
46104628 '<div id="artist-console" class="console-inner">',
4611- '<div id="register"></div>',
4629+ '<div id="artist-console-name" class="field">',
4630+ '<span class="field-label">Name:</span>',
4631+ '<span id="artist-console-name-value" class="comic-console-value editable-value">artist name here.</span>',
4632+ '</div>',
4633+ '<div id="artist-console-license" class="field">',
4634+ '<span class="field-label">License:</span>',
4635+ '<span id="artist-console-license-value" class="comic-console-value editable-value">license here.</span>',
4636+ '</div>',
46124637 '<div class="console-button-container">',
46134638 '<div id="artist-console-post-button" class="button console-submit-button">register</div>',
46144639 '<div id="artist-console-cancel-button" class="button console-cancel-button">cancel</div>',
46154640 '</div>',
46164641 '<div id="artist-console-progress" class="console-progress">&nbsp;</div>',
4642+ '<div id="register" style="display:none;"></div>',
46174643 '</div>'
46184644 ].join( '' );
46194645
46204646 app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
4647+ eventRoot = app.getPointingDeviceEventTreeRoot();
46214648
46224649 delete app.onInit;
46234650 };
@@ -4628,8 +4655,6 @@ var ArtistConsole = gOS.registerApplication( function(){
46284655 this.hideUploader = false;
46294656 FormApplicationHelper( this );
46304657 this.onFormReady = function(){
4631- app.onPaneResize( windowW, windowH );
4632-
46334658 var _inputList = app.elmForm.getElementsByTagName( 'input' ),
46344659 _input;
46354660 for( var i = _inputList.length; i; ){
@@ -4637,7 +4662,18 @@ var ArtistConsole = gOS.registerApplication( function(){
46374662 if( _input.type === 'submit' ){
46384663 _input.style.display = 'none';
46394664 };
4665+ if( _input.name === 'artist[name]' ){
4666+ elmName = _input;
4667+ };
4668+ if( _input.name === 'artist[default_license_id]' ){
4669+ elmLicense = _input;
4670+ };
46404671 };
4672+
4673+ node.mesure();
4674+ app.onPaneResize( windowW, windowH );
4675+ node.mesureChildren();
4676+
46414677 delete app.onFoemReady;
46424678 };
46434679 this.submitError = function(){
@@ -4647,20 +4683,25 @@ var ArtistConsole = gOS.registerApplication( function(){
46474683 app.addTimer( clickCancel , 5000, true );
46484684 };
46494685 this.onOpen = function( w, h ){
4650- var ui = app.createUIGroup();
4651- buttonSubmit = ui.createButton( document.getElementById( 'artist-console-post-button'), clickOK );
4652- buttonCancel = ui.createButton( document.getElementById( 'artist-console-cancel-button'), clickCancel );
4686+ node = eventRoot.createNode( app.rootElement, true, true );
4687+ var ui = app.createUIGroup( node );
4688+
4689+ inputName = ui.createInputText( document.getElementById( 'artist-console-name' ), inputUpdate );
4690+ inputLicense = ui.createInputText( document.getElementById( 'artist-console-license' ), inputUpdate );
4691+ buttonSubmit = ui.createButton( document.getElementById( 'artist-console-post-button' ), clickOK );
4692+ buttonCancel = ui.createButton( document.getElementById( 'artist-console-cancel-button' ), clickCancel );
46534693
46544694 app.onPaneResize( w, h );
46554695 app.fetchScript();
46564696 };
4657- this.onPaneResize = function( _windowW, _windowH ){
4658- windowW = _windowW;
4659- windowH = _windowH;
4660- app.rootElement.style.cssText = [
4661- 'left:', Math.floor( ( _windowW - app.rootElement.offsetWidth ) /2 ), 'px;',
4662- 'top:', Math.floor( ( _windowH - app.rootElement.offsetHeight ) /2 ), 'px;'
4663- ].join( '' );
4697+ this.onPaneResize = function( w, h ){
4698+ windowW = w;
4699+ windowH = h;
4700+ //app.rootElement.style.cssText = [
4701+ // 'left:', Math.floor( ( _w - app.rootElement.offsetWidth ) /2 ), 'px;',
4702+ // 'top:', Math.floor( ( _h- app.rootElement.offsetHeight ) /2 ), 'px;'
4703+ //].join( '' );
4704+ node.update( w / 2 - node.width() / 2, h / 2 - node.height() / 2 );
46644705 };
46654706 this.onClose = function(){
46664707 app.destroyHelper();
@@ -4668,6 +4709,139 @@ var ArtistConsole = gOS.registerApplication( function(){
46684709 };
46694710 }, true, true, 'Artist Console', 'artistConsole', null, '#FFC40D' );
46704711
4712+var PanelConsole = gOS.registerApplication( function(){
4713+ var windowW, windowH,
4714+ eventRoot, node, inputData,
4715+ comboboxPublish, buttonPost, buttonClose,
4716+ elmInput,
4717+ app = this,
4718+ model = null;
4719+
4720+ /*
4721+ * upload ボタンが押されたらまず iframe をつくる.
4722+ */
4723+ function clickOK(){
4724+ if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
4725+ inputData.value();
4726+ app.submit();
4727+ return false;
4728+ }
4729+
4730+ function clickCancel(){
4731+ if( app.isUploading === true ) return false;
4732+ PanelConsole.shutdown();
4733+ return false;
4734+ };
4735+ function publishUpdate(){
4736+ if( model ){
4737+ model.publish( comboboxPublish.selectIndex() === 1 );
4738+ elmInput.value = model.getJsonPostString().replace( /\n/g, '' );
4739+ inputData.value( elmInput.value );
4740+ } else {
4741+ elmInput.value = inputData.value();
4742+ };
4743+ };
4744+
4745+ /* grobal method */
4746+ this.MIN_WIDTH = 320;
4747+ this.MIN_HEIGHT = 320;
4748+ this.onInit = function(){
4749+ app.rootElement.id = 'panel-console-wrapper';
4750+ app.rootElement.className = 'console-wrapper';
4751+ app.rootElement.innerHTML = [
4752+ '<div id="panel-console-header" class="console-header">Create New Panel (dev)</div>',
4753+ '<div id="panel-console" class="console-inner">',
4754+ '<div id="panel-console-data" class="field">',
4755+ '<span class="field-label">POST DATA:</span>',
4756+ '<span id="panel-console-data-value" class="comic-console-value editable-value">panel json here.</span>',
4757+ '</div>',
4758+ '<div id="panel-console-publish" class="field">',
4759+ '<span class="field-label">Publish:</span>',
4760+ '<span id="panel-console-publish-value" class="combobox"></span>',
4761+ '</div>',
4762+ '<div class="console-button-container">',
4763+ '<div id="panel-console-post-button" class="button console-submit-button">post</div>',
4764+ '<div id="panel-console-cancel-button" class="button console-cancel-button">cancel</div>',
4765+ '</div>',
4766+ '<div id="panel-console-progress" class="console-progress">&nbsp;</div>',
4767+ '<div id="newpanel" style="display:none;"></div>',
4768+ '</div>'
4769+ ].join( '' );
4770+
4771+ app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
4772+ eventRoot = app.getPointingDeviceEventTreeRoot();
4773+
4774+ delete app.onInit;
4775+ };
4776+ this.elmProgressID = 'panel-console-progress';
4777+ this.elmUploaderID = 'newpanel';
4778+ this.elmIframeName = 'targetFrameNewPanel'
4779+ this.scriptSrc = pettanr.CONST.CREATE_PANEL_JS;
4780+ this.hideUploader = false;
4781+ FormApplicationHelper( this );
4782+ this.onFormReady = function(){
4783+ var _inputList = app.elmForm.getElementsByTagName( 'input' ),
4784+ _input;
4785+ for( var i = _inputList.length; i; ){
4786+ _input = _inputList[ --i ];
4787+ if( _input.type === 'submit' ){
4788+ _input.style.display = 'none';
4789+ };
4790+ if( _input.name === 'json' ){
4791+ elmInput = _input;
4792+ publishUpdate();
4793+ };
4794+ };
4795+
4796+ node.mesure();
4797+ app.onPaneResize( windowW, windowH );
4798+ node.mesureChildren();
4799+
4800+ delete app.onFoemReady;
4801+ };
4802+ this.submitError = function(){
4803+ app.addTimer( clickCancel , 5000, true );
4804+ };
4805+ this.submitSuccess = function(){
4806+ app.addTimer( clickCancel , 5000, true );
4807+ };
4808+ this.onOpen = function( w, h, _model ){
4809+ node = eventRoot.createNode( app.rootElement, true, true );
4810+ var ui = app.createUIGroup( node ),
4811+ elm = document.getElementById( 'panel-console-publish' );
4812+
4813+ inputData = ui.createInputText( document.getElementById( 'panel-console-data' ), publishUpdate );
4814+
4815+ if( _model ){
4816+ comboboxPublish = ui.createCombobox( elm, publishUpdate );
4817+ comboboxPublish.createOption( 'only me', '0', _model.publish() === false );
4818+ comboboxPublish.createOption( 'publish', '1', _model.publish() === true );
4819+ model = _model;
4820+ } else {
4821+ elm.parentNode.removeChild( elm );
4822+ };
4823+
4824+ buttonPost = ui.createButton( document.getElementById( 'panel-console-post-button' ), clickOK );
4825+ buttonClose = ui.createButton( document.getElementById( 'panel-console-cancel-button' ), clickCancel );
4826+
4827+ app.onPaneResize( w, h );
4828+ app.fetchScript();
4829+ };
4830+ this.onPaneResize = function( w, h ){
4831+ windowW = w;
4832+ windowH = h;
4833+ //app.rootElement.style.cssText = [
4834+ // 'left:', Math.floor( ( _w - app.rootElement.offsetWidth ) /2 ), 'px;',
4835+ // 'top:', Math.floor( ( _h- app.rootElement.offsetHeight ) /2 ), 'px;'
4836+ //].join( '' );
4837+ node.update( w / 2 - node.width() / 2, h / 2 - node.height() / 2 );
4838+ };
4839+ this.onClose = function(){
4840+ app.destroyHelper();
4841+ model && model.destroy();
4842+ app = model = comboboxPublish = buttonPost = buttonClose = elmInput = null;
4843+ };
4844+}, true, true, 'Panel Console', 'panelConsole', null, '#603CBA' );
46714845
46724846 var Model = ( function(){
46734847
@@ -5030,123 +5204,4 @@ var OutputConsole = gOS.registerApplication( function(){
50305204 };
50315205 }, true, false, 'Output Console', 'outputConsole', null, '#2D89F0' );
50325206
5033-
5034-var PanelConsole = gOS.registerApplication( function(){
5035- var windowW, windowH,
5036- comboboxPublish, buttonPost, buttonClose,
5037- elmInput,
5038- app = this,
5039- model = null;
5040-
5041- /*
5042- * upload ボタンが押されたらまず iframe をつくる.
5043- */
5044- function clickOK(){
5045- if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
5046- app.submit();
5047- return false;
5048- }
5049-
5050- function clickCancel(){
5051- if( app.isUploading === true ) return false;
5052- PanelConsole.shutdown();
5053- return false;
5054- };
5055- function publishUpdate(){
5056- if( model ){
5057- model.publish( comboboxPublish.selectIndex() === 1 );
5058- elmInput.value = model.getJsonPostString().replace( /\n/g, '' );
5059- };
5060- };
5061-
5062- /* grobal method */
5063- this.MIN_WIDTH = 320;
5064- this.MIN_HEIGHT = 320;
5065- this.onInit = function(){
5066- app.rootElement.id = 'panel-console-wrapper';
5067- app.rootElement.className = 'console-wrapper';
5068- app.rootElement.innerHTML = [
5069- '<div id="panel-console-header" class="console-header">Create New Panel (dev)</div>',
5070- '<div id="panel-console" class="console-inner">',
5071- '<div id="newpanel"></div>',
5072- '<div id="panel-console-publish" class="field">',
5073- '<span class="field-label">Publish:</span>',
5074- '<span id="panel-console-publish-value" class="combobox"></span>',
5075- '</div>',
5076- '<div class="console-button-container">',
5077- '<div id="panel-console-post-button" class="button console-submit-button">post</div>',
5078- '<div id="panel-console-cancel-button" class="button console-cancel-button">cancel</div>',
5079- '</div>',
5080- '<div id="panel-console-progress" class="console-progress">&nbsp;</div>',
5081- '</div>'
5082- ].join( '' );
5083-
5084- app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS );
5085-
5086- delete app.onInit;
5087- };
5088- this.elmProgressID = 'panel-console-progress';
5089- this.elmUploaderID = 'newpanel';
5090- this.elmIframeName = 'targetFrameNewPanel'
5091- this.scriptSrc = pettanr.CONST.CREATE_PANEL_JS;
5092- this.hideUploader = false;
5093- FormApplicationHelper( this );
5094- this.onFormReady = function(){
5095- app.onPaneResize( windowW, windowH );
5096-
5097- var _inputList = app.elmForm.getElementsByTagName( 'input' ),
5098- _input;
5099- for( var i = _inputList.length; i; ){
5100- _input = _inputList[ --i ];
5101- if( _input.type === 'submit' ){
5102- _input.style.display = 'none';
5103- };
5104- if( _input.name === 'json' ){
5105- elmInput = _input;
5106- publishUpdate();
5107- };
5108- };
5109-
5110- delete app.onFoemReady;
5111- };
5112- this.submitError = function(){
5113- app.addTimer( clickCancel , 5000, true );
5114- };
5115- this.submitSuccess = function(){
5116- app.addTimer( clickCancel , 5000, true );
5117- };
5118- this.onOpen = function( w, h, _model ){
5119- var ui = app.createUIGroup(),
5120- elm = document.getElementById( 'panel-console-publish' );
5121- if( _model ){
5122- comboboxPublish = ui.createCombobox( elm, publishUpdate );
5123- comboboxPublish.createOption( 'only me', '0', _model.publish() === false );
5124- comboboxPublish.createOption( 'publish', '1', _model.publish() === true );
5125- model = _model;
5126- } else {
5127- elm.parentNode.removeChild( elm );
5128- };
5129-
5130- buttonPost = ui.createButton( document.getElementById( 'panel-console-post-button' ), clickOK );
5131- buttonClose = ui.createButton( document.getElementById( 'panel-console-cancel-button' ), clickCancel );
5132-
5133- app.onPaneResize( w, h );
5134- app.fetchScript();
5135- };
5136- this.onPaneResize = function( _windowW, _windowH ){
5137- windowW = _windowW;
5138- windowH = _windowH;
5139- app.rootElement.style.cssText = [
5140- 'left:', Math.floor( ( _windowW - app.rootElement.offsetWidth ) /2 ), 'px;',
5141- 'top:', Math.floor( ( _windowH - app.rootElement.offsetHeight ) /2 ), 'px;'
5142- ].join( '' );
5143- };
5144- this.onClose = function(){
5145- app.destroyHelper();
5146- model && model.destroy();
5147- app = model = comboboxPublish = buttonPost = buttonClose = elmInput = null;
5148- };
5149-}, true, true, 'Panel Console', 'panelConsole', null, '#603CBA' );
5150-
5151-
51525207 })( pettanr, gOS, window, document );
--- 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.28
3+ * version 0.5.29
44 *
55 * gadgetOS
66 * author:
@@ -111,9 +111,7 @@
111111 }
112112 };
113113
114-var EX = ( function(){
115- var F = new Function();
116-
114+var Class = ( function(){
117115 function clone( src ){
118116 var ret;
119117 if( Type.isArray(src) === true ){
@@ -133,26 +131,35 @@ var EX = ( function(){
133131 return ret;
134132 };
135133
134+ function extend(){
135+
136+ };
137+
138+ var f = true;
139+ var c = Util.copyArray;
140+
141+ function I(){
142+ var klass = this;
143+ f = false;
144+ var instance = klass.pool.shift() || new klass();
145+ f = true;
146+ instance.init.apply( instance, c( arguments ) );
147+ klass.live.push( instance );
148+ return instance;
149+ };
150+
136151 return {
137- extend: function( base, extend ){
138- F.prototype = base;
139- var ret = new F;
140- for( var p in extend ){
141- ret[ p ] = extend[ p ];
152+ create : function( def, final, pool, abstract ){
153+ var klass = function(){
154+ var a = arguments;
155+ if( f ) return I.apply( a.collee, c( a ) );
142156 };
143- return ret;
144- },
145- clone: function( obj ){
146- return clone( obj );
147- },
148- kill: function(){
149- var self = this, v;
150- for( var p in s ){
151- if( self.hasOwnProperty && !self.hasOwnProperty( p ) ) continue;
152- v = self[ p ];
153- v && v instanceof TicketBase && self.kill();
154- delete self[ p ];
155- }
157+ klass.prototype = def;
158+ if( pool === true ){
159+ klass.pool = [];
160+ klass.live = [];
161+ };
162+ return klass;
156163 }
157164 }
158165 })();
@@ -1499,7 +1506,7 @@ var PointingDeviceEventTree = ( function(){
14991506 this.hoverClass = hover;
15001507 this.scroll = clip && scroll;
15011508 this.mesure();
1502- this.scroll === true && this.addEventListener( 'mouseover', this.onScrollReady, this );
1509+ this.scroll === true && ScrollBarManager.register( this );
15031510 } else {
15041511 this.update( rangeOrElm.x, rangeOrElm.y, rangeOrElm.w, rangeOrElm.h );
15051512 };
@@ -1520,7 +1527,6 @@ var PointingDeviceEventTree = ( function(){
15201527 this.y = y;
15211528 this.w = w;
15221529 this.h = h;
1523- console.log( ' ---- mesure' + this.elm.id + ' x:' + this.x + ' y:' + this.y + ' w:' + w + ' h:' + h )
15241530 parent = this.parentData;
15251531 parent && this._updateAbsoluteXY( parent.absoluteX, parent.absoluteY, parent.scrollingX, parent.scrollingY );
15261532 this._updateRectangle();
@@ -1658,6 +1664,7 @@ var PointingDeviceEventTree = ( function(){
16581664 // this.w = r - x;
16591665 // this.h = b - y;
16601666 this.parentData && this.parentData.clip === false && this.parentData._updateRectangle();
1667+ return true;
16611668 };
16621669 },
16631670 setPosition : function( x, y ){
@@ -1800,24 +1807,6 @@ var PointingDeviceEventTree = ( function(){
18001807 };
18011808 forceNodeData = null;
18021809 },
1803- onScrollReady : function( e ){
1804- ScrollBarManager.show( this );
1805- },
1806- onMouseWheelScroll : function( e ){
1807- this._scrollY += e.wheelDelta;
1808- ScrollBarManager.update( this );
1809- //return true;
1810- },
1811- onMouseDragScroll : function( e ){
1812- //e.dragOffsetY;
1813- this._scrollY = this.scrollStartY + e.dragOffsetY;
1814- ScrollBarManager.update( this );
1815- this.scrollStartY = this._scrollY;
1816- return true;
1817- },
1818- onScrollComplete : function( e ){
1819- ScrollBarManager.hide( this );
1820- },
18211810 scrollTo : function( x, y ){
18221811 this._scrollX = x;
18231812 this._scrollY = y;
@@ -1930,7 +1919,7 @@ var PointingDeviceEventTree = ( function(){
19301919 this.node = node;
19311920 this.type = eventType;
19321921 this.handler = handler;
1933- this.thisObj = opt_thisObject;
1922+ this.thisObj = opt_thisObject || node;
19341923 };
19351924 EventTicketClass.prototype = {
19361925 match : function( eventType, handler ){
@@ -1949,22 +1938,22 @@ var PointingDeviceEventTree = ( function(){
19491938 fire : ( function(){
19501939 if( Function.prototype.call ){
19511940 return function( e ){
1952- return this.handler.call( this.thisObj || this.node, e );
1941+ return this.handler.call( this.thisObj, e );
19531942 };
19541943 };
19551944 return function( e ){
1956- var thisObj = this.thisObj || this.node,
1957- ret;
1958- thisObj._currentHandler = this.handler;
1959- ret = thisObj._currentHandler( e );
1960- delete thisObj._currentHandler;
1945+ var ret;
1946+ this.thisObj._currentHandler = this.handler;
1947+ ret = this.thisObj._currentHandler( e );
1948+ delete this.thisObj._currentHandler;
19611949 return ret;
19621950 };
19631951 })()
19641952 };
19651953
19661954 var ScrollBarManager = ( function(){
1967- var elmBar = document.createElement( 'div' ),
1955+ var elmScroller = document.createElement( 'div' ),
1956+ elmBar = document.createElement( 'div' ),
19681957 smoothList = [],
19691958 currentNodeData = null;
19701959
@@ -1980,8 +1969,8 @@ var PointingDeviceEventTree = ( function(){
19801969 } else {
19811970 y = data._scrollY < y ? data._scrollY : y;
19821971 };
1983- data.scrollingY = y;
1984- data.elmScroller.style.top = y + 'px';
1972+ data.scrollingY = y;
1973+ data.elm.scrollTop = -y;
19851974 };
19861975 if( data.scrollingY === data._scrollY ){
19871976 list.splice( i, 1 );
@@ -1992,74 +1981,103 @@ var PointingDeviceEventTree = ( function(){
19921981 list.length === 0 && SystemTimer.remove( SUPER_USER_KEY, tick );
19931982 };
19941983
1984+ function onScrollStart( e ){
1985+ var data = this;
1986+ if( data === currentNodeData ) return;
1987+ currentNodeData && onScrollComplete();
1988+
1989+ data.elm.parentNode.appendChild( elmScroller );
1990+ elmScroller.appendChild( data.elm );
1991+
1992+ elmScroller.style.cssText = 'position:absolute;left:0;top:0;';
1993+ elmScroller.appendChild( elmBar );
1994+
1995+ data.scrollStartX = data.scrollingX;
1996+ data.scrollStartY = data.scrollingY;
1997+ data.elm.scrollTop = -data.scrollingY;
1998+ data.addEventListener( 'mousewheel', onMouseWheelScroll, data );
1999+ data.addEventListener( 'mousedrag', onMouseDragScroll, data );
2000+ data.addEventListener( 'mouseout', onScrollComplete, data );
2001+ currentNodeData = data;
2002+ ScrollBarManager.update( data );
2003+ };
2004+ function onScrollComplete( e ){
2005+ if( currentNodeData === null ) return;
2006+
2007+ var data = currentNodeData;
2008+ var parent = elmScroller.parentNode;
2009+ parent.appendChild( currentNodeData.elm );
2010+ parent.removeChild( elmScroller );
2011+ currentNodeData.elm.scrollTop = -data.scrollingY;
2012+
2013+ data.removeEventListener( 'mousewheel', onMouseWheelScroll, data );
2014+ data.removeEventListener( 'mousedrag', onMouseDragScroll, data );
2015+ data.removeEventListener( 'mouseout', onScrollComplete, data );
2016+ currentNodeData = null;
2017+ };
2018+ function onMouseWheelScroll( e ){
2019+ var data = this;
2020+ this._scrollY += e.wheelDelta;
2021+ ScrollBarManager.update( this );
2022+ return true;
2023+ };
2024+ function onMouseDragScroll( e ){
2025+ var data = this;
2026+ //e.dragOffsetY;
2027+ this._scrollY = this.scrollStartY + e.dragOffsetY;
2028+ ScrollBarManager.update( this );
2029+ this.scrollStartY = this._scrollY;
2030+ return true;
2031+ };
2032+
19952033 return {
1996- show : function( data ){
1997- console.log( '############ show ' + ( currentNodeData === null ) )
1998- if( data === currentNodeData ) return;
1999- currentNodeData && ScrollBarManager.hide( currentNodeData );
2000- if( !data.elmScroller ){
2001- data.elmScroll = data.elm.firstChild;
2002- data.elmScroller = document.createElement( 'div' );
2003- data.elm.appendChild( data.elmScroller );
2004- data.elmScroller.style.cssText = 'position:absolute;top:0;left:0;width:100%;';
2005- data.elmScroller.appendChild( data.elmScroll );
2006- };
2007- data.scrollStartX = data.scrollingX;
2008- data.scrollStartY = data.scrollingY;
2009- //data._scrollX = data.elmScroll.offsetLeft;
2010- //data._scrollY = data.elmScroll.offsetTop;
2011- data.addEventListener( 'mousewheel', data.onMouseWheelScroll, data );
2012- data.addEventListener( 'mousedrag', data.onMouseDragScroll, data );
2013- data.addEventListener( 'mouseout', data.onScrollComplete, data );
2014- currentNodeData = data;
2015- data.elm.appendChild( elmBar );
2016- ScrollBarManager.update( data );
2034+ register : function( data ){
2035+ data.addEventListener( 'mouseover', onScrollStart, data );
20172036 },
20182037 update : function( data ){
2019- //if( data !== currentNodeData ) return;
2020- if( data.elmScroll === null ) return;
2021- var contentH = data._scrollH = data.elmScroll.offsetHeight,
2022- scrollY = data._scrollY,
2038+ if( data !== currentNodeData ) return;
2039+
2040+ var contentH = data._scrollH = data.elm.scrollHeight,
20232041 clipH = data.h,
2024- barH = Math.floor( clipH * ( clipH / contentH ) ),
20252042 offsetH = contentH - clipH,
2026- barY;
2027- if( 0 < scrollY ) scrollY = data._scrollY = 0;
2028- if( scrollY < -offsetH ) scrollY = data._scrollY = -offsetH;
2029- barY = Math.floor( ( clipH - barH ) * -scrollY / ( contentH - clipH ) );
2030- if( contentH <= clipH ) data._scrollY = barY = barH = scrollY = 0;
2031- data.smoothY = ( data._scrollY - data.scrollingY ) / 10;
2032- elmBar.style.cssText = [
2033- 'position:absolute;',
2034- 'width:10px;',
2035- 'background-color:#333;',
2036- 'right:2px;',
2037- 'height:', barH, 'px;',
2038- 'top:', barY, 'px;'
2039- ].join( '' );
2040- if( data.scrollingY !== data._scrollY && Util.getIndex( smoothList, data ) === -1 ){
2043+ scrollY = data._scrollY = 0 < data._scrollY ? 0 : ( data._scrollY < -offsetH ? -offsetH : data._scrollY ),
2044+ barH, barY;
2045+ elmScroller.style.width = data.w + 'px';
2046+ elmScroller.style.height = clipH + 'px';
2047+ if( offsetH < 1 ){
2048+ data._scrollY = scrollY = 0;
2049+ elmBar.style.display = 'none';
2050+ } else {
2051+ barH = Math.floor( clipH * ( clipH / contentH ) );
2052+ barY = Math.floor( ( clipH - barH ) * - scrollY / offsetH );
2053+ elmBar.style.cssText = [
2054+ 'position:absolute;',
2055+ 'width:10px;',
2056+ 'background-color:#333;',
2057+ 'right:2px;',
2058+ 'font-size:0;line-height:0;',
2059+ 'height:', barH, 'px;',
2060+ 'top:', data.y + barY, 'px;'
2061+ ].join( '' );
2062+ };
2063+ data.smoothY = ( scrollY - data.scrollingY ) / 10;
2064+ if( data.scrollingY !== scrollY && Util.getIndex( smoothList, data ) === -1 ){
20412065 smoothList.length === 0 && SystemTimer.add( SUPER_USER_KEY, tick, 16 );
20422066 smoothList.push( data );
20432067 };
2044- },
2045- hide : function( data ){
2046- console.log( '############ hide ' + ( currentNodeData === null ) )
2047- if( data !== currentNodeData ) return;
2048- data.removeEventListener( 'mousewheel', data.onMouseWheelScroll, data );
2049- data.removeEventListener( 'mousedrag', data.onMouseDragScroll, data );
2050- data.removeEventListener( 'mouseout', data.onScrollComplete, data );
2051- data.elm.removeChild( elmBar );
2052- currentNodeData = null;
20532068 }
20542069 };
20552070 })();
20562071
20572072 return {
20582073 create : function( apiuser ){
2059- var root = new NodeClass( apiuser, null, null, apiuser.rootElement ),
2060- data = NodePrivateData.get( root ),
2061- elm = document.createElement( 'div' );
2074+ var elm = document.createElement( 'div' ),
2075+ root, data;
20622076 body.appendChild( elm );
2077+
2078+ root = new NodeClass( apiuser, null, null, elm );
2079+ data = NodePrivateData.get( root );
2080+
20632081 // elm.style.cssText = 'position:absolute;top:0;left:0;height:100%;';
20642082 elm.className = 'mouse-operation-catcher';
20652083 elm.unselectable = 'on';
@@ -2125,11 +2143,16 @@ var Application = ( function(){
21252143 this.displayName = displayName;
21262144 this.thumbnailUrl = thumbnailUrl;
21272145 this.tailColor = tailColor;
2146+
2147+ function asyncBoot(){
2148+ application = Application.boot( appClass, displayName, self.getUID(), isOverlay, Util.copyArray( arguments ) );
2149+ };
2150+
21282151 this.getUID = function(){
21292152 return Util.getIndex( API_USER_LIST, appClass );
21302153 };
21312154 this.boot = function( /* _option */ ){
2132- application = Application.boot( appClass, displayName, self.getUID(), isOverlay, Util.copyArray( arguments ) );
2155+ AsyncCall.add( this, asyncBoot, Util.copyArray( arguments ) );
21332156 };
21342157 this.shutdown = function(){
21352158 if( !application ) return false;
@@ -2494,6 +2517,7 @@ var Application = ( function(){
24942517 if( document.attachEvent ){
24952518 wrappedHandlerClass = function( ticket ){
24962519 this.handler = function(){
2520+ if( ticket === null ) alert( window.event.type )
24972521 if( ticket.fire( new wrappedEventClass( window.event, ticket.element ) ) !== false ) return;
24982522 // e.preventDefault();
24992523 // e.stopPropagation();
@@ -3189,7 +3213,8 @@ var KeyEvent = ( function(){
31893213 key = e.keyCode, // || e.which,
31903214 shift = Type.isBoolean( e.shiftKey ) === true ? e.shiftKey : ( e.modifiers & Event.SHIFT_MASK ),
31913215 ctrl = Type.isBoolean( e.ctrlKey ) === true ? e.ctrlKey : ( e.modifiers & Event.CONTROL_MASK ),
3192- lock = type === 'keyup' ? LOCK_UP : LOCK_DOWN;
3216+ lock = type === 'keyup' ? LOCK_UP : LOCK_DOWN,
3217+ i, t;
31933218
31943219 // block chattering
31953220 if( Util.getIndex( lock, key ) !== -1 ) return;
@@ -3202,10 +3227,13 @@ var KeyEvent = ( function(){
32023227 if( key === 17 || ctrl === true ){
32033228 KeyEvent.ctrlEnabled = type !== 'keyup';
32043229 };
3205- for( var i=currentList.length, t; t = currentList[ --i ]; ){
3230+ for( i = currentList.length; i; ){
3231+ t = currentList[ --i ];
32063232 if( Type.isFunction( t[ type ] ) === true && t.keyCode === key && ( t.shift === undefined || t.shift === shift ) && ( t.ctrl === undefined || t.ctrl === ctrl )){
3207- AsyncCall.add( t.apiuser, t[ type ], e );
3208- cancel = true;
3233+ if( t[ type ].call( t.apiuser, e ) === false ){
3234+ cancel = true;
3235+ break;
3236+ };
32093237 };
32103238 };
32113239 if( cancel === true || key === 18 || key === 9 || key === 27 || e.altKey === true ){ // 13.enter 18.esc 9.tab 27.esc || ( key === 13 && overlayEnabled === false)
@@ -3849,41 +3877,57 @@ var UI = ( function(){
38493877 ret.id = 'ui-textinput';
38503878 return ret;
38513879 })();
3880+ var currentData;
3881+
3882+ function updateWrapperPosition(){
3883+ var p = Position.cumulativeOffset( currentData.elmValue ),
3884+ w = currentData.elmValue.offsetWidth - 2,
3885+ _w;
3886+ elmInput.style.cssText = [
3887+ 'left:', p[ 0 ], 'px;',
3888+ 'top:', p[ 1 ], 'px;',//,
3889+ 'width:', w, 'px;'//,
3890+ //'height:', data.elmValue.offsetHeight, 'px;',
3891+ //'position:absolute;'
3892+ ].join( '' );
3893+
3894+ //_w = elmInput.offsetWidth;
3895+ //if( w !== _w ) elmInput.style.width = ( w - ( _w - w ) ) + 'px;';
3896+ };
38523897
38533898 return {
38543899 show: function( data ){
38553900 // this.groupData.node.addEventListener( 'mouseout' );
3856- var p = Position.cumulativeOffset( data.elmValue ),
3857- w = data.elmValue.offsetWidth - 2,
3858- _w;
3859- elmInput.style.cssText = [
3860- 'left:', p[ 0 ], 'px;',
3861- 'top:', p[ 1 ], 'px;',//,
3862- 'width:', w, 'px;'//,
3863- //'height:', data.elmValue.offsetHeight, 'px;',
3864- //'position:absolute;'
3865- ].join( '' );
3866- elmInput.value = data.value;
3901+ currentData = data;
3902+
38673903 body.appendChild( elmInput );
3868- _w = elmInput.offsetWidth;
3869- if( w !== _w ) elmInput.style.width = ( w - ( _w - w ) ) + 'px;';
3904+ elmInput.value = data.value;
3905+ updateWrapperPosition();
38703906
38713907 elmInput.focus();
38723908 elmInput.select();
3909+
3910+ SystemTimer.add( SUPER_USER_KEY, updateWrapperPosition, 500 );
38733911 },
38743912 hide : function( data ){
3913+ if( currentData !== data ) return;
3914+ currentData = null;
38753915 body.removeChild( elmInput );
38763916 var ret = elmInput.value;
38773917 elmInput.value = '';
3918+ SystemTimer.remove( SUPER_USER_KEY, updateWrapperPosition );
38783919 return ret;
38793920 },
38803921 update : function( data ){
38813922 elmInput.value = data.value;
3923+ },
3924+ onWindowResize: function( _w, _h ){
3925+ AsyncCall.add( currentData.apiuser, updateWrapperPosition );
38823926 }
38833927 };
38843928 })();
38853929
3886- var InputTextClass = function( groupData, elmWrapper, elmValue, onUpdate, validater ){
3930+ var TextInputClass = function( groupData, elmWrapper, elmValue, onUpdate, validater ){
38873931 var data = new UIItemPrivateData();
38883932 data.init( groupData, this, elmWrapper, elmValue.innerHTML, onUpdate, validater, false, true, true );
38893933 Util.addClass( elmValue, 'editable-text' );
@@ -3893,7 +3937,7 @@ var UI = ( function(){
38933937 data.node.addEventListener( 'click', this.focus, this );
38943938 //MouseEvent.add( groupData.apiuser, elmWrapper, 'click', instance.focus );
38953939 };
3896- InputTextClass.prototype = {
3940+ TextInputClass.prototype = {
38973941 value : function( value ){
38983942 var data = UIItemPrivateData.get( this );
38993943 if( Type.isString( value ) === true || Type.isNumber( value ) === true ){
@@ -3914,8 +3958,8 @@ var UI = ( function(){
39143958 var data = UIItemPrivateData.get( this ),
39153959 newValue;
39163960 if( data.focus === false ) return;
3917- newValue = TextInputManager.hide( data );
3918- newValue = keep !== 27 ? ( data.validater ? '' + data.validater( newValue ) : newValue ) : value; // 27:ESC
3961+ newValue = TextInputManager.hide( data );
3962+ newValue = keep !== 27 ? ( data.validater ? '' + data.validater( newValue ) : newValue ) : data.value; // 27:ESC
39193963
39203964 data.elmValue.innerHTML = newValue;
39213965
@@ -3925,15 +3969,23 @@ var UI = ( function(){
39253969 data.focus = false;
39263970 finish( data );
39273971 },
3928- enabled : function(){
3972+ enabled : function( v ){
39293973 var data = UIItemPrivateData.get( this );
3974+ if( Type.isBoolean( v ) === true && data.enabled !== v ){
3975+ Util.toggleClass( data.elm, 'ui-textinput-disabled', !v );
3976+ if( data.focus === true && v === false ) this.blur();
3977+ data.enabled = v;
3978+ data.node.disabled( !( data.visible && v ) );
3979+ };
39303980 return data.enabled;
39313981 },
3932- visible : function( _visible ){
3982+ visible : function( v ){
39333983 var data = UIItemPrivateData.get( this );
3934- if( Type.isBoolean( _visible ) === true ){
3935- data.elm.style.display = _visible ? '' : 'none';
3936- data.visible = _visible;
3984+ if( Type.isBoolean( v ) === true && data.visible !== v ){
3985+ data.elm.style.display = v ? '' : 'none';
3986+ if( data.focus === true && v === false ) this.blur();
3987+ data.visible = v;
3988+ data.node.disabled( !( data.enabled && v ) );
39373989 };
39383990 return data.visible;
39393991 },
@@ -3943,11 +3995,121 @@ var UI = ( function(){
39433995 data.destroy();
39443996 }
39453997 };
3998+
3999+/* --------------------------------
4000+ * TextInputManager
4001+ */
4002+ var FileInputManager = ( function(){
4003+ var currentData,
4004+ elmForm,
4005+ elmInput;
4006+
4007+ function updateWrapperPosition(){
4008+ var p = Position.cumulativeOffset( currentData.elmValue ),
4009+ w = currentData.elmValue.offsetWidth - 2,
4010+ _w;
4011+ elmInput.style.cssText = [
4012+ 'left:', p[ 0 ], 'px;',
4013+ 'top:', p[ 1 ], 'px;',//,
4014+ 'width:', w, 'px;'//,
4015+ //'height:', data.elmValue.offsetHeight, 'px;',
4016+ //'position:absolute;'
4017+ ].join( '' );
4018+
4019+ _w = elmInput.offsetWidth;
4020+ if( w !== _w ) elmInput.style.width = ( w - ( _w - w ) ) + 'px;';
4021+ };
4022+
4023+ function change( e ){
4024+ var data = currentData,
4025+ file = data.elmFileInputReal.value;
4026+ if( data.value !== file ){
4027+ data.onUpdate && AsyncCall.add( data.groupData.apiuser, data.onUpdate, [ file, data.value ], this );
4028+ data.elmValue.innerHTML = data.value = value;
4029+ currentData.blur();
4030+ };
4031+ };
4032+
4033+ return {
4034+ show : function( data ){
4035+ currentData = data;
4036+ updateWrapperPosition();
4037+
4038+ elmInput = data.elmFileInputReal;
4039+ elmInput.focus();
4040+ data.node.addEventListener( 'change', change, data );
4041+
4042+ SystemTimer.add( SUPER_USER_KEY, updateWrapperPosition, 500 );
4043+ },
4044+ hide : function( data ){
4045+ if( currentData !== data ) return;
4046+ data.node.removeEventListener( 'change', change );
4047+ currentData = null;
4048+ SystemTimer.remove( SUPER_USER_KEY, updateWrapperPosition );
4049+ },
4050+ onWindowResize: function( _w, _h ){
4051+ AsyncCall.add( currentData.apiuser, updateWrapperPosition );
4052+ }
4053+ };
4054+ })();
4055+
4056+ var FileInputClass = function( groupData, elmWrapper, onUpdate, elmFileInputReal, elmValue ){
4057+ var data = new UIItemPrivateData();
4058+ data.init( groupData, this, elmWrapper, null, onUpdate, null, false, true, true );
4059+ data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-fileinput-hover', 'pointer' );
4060+ data.elmValue = elmValue;
4061+ data.elmFileInputReal = elmFileInputReal;
4062+ data.node.addEventListener( 'mouseover', this.focus, this );
4063+ };
4064+ FileInputClass.prototype = {
4065+ value : function(){
4066+ return data.value;
4067+ },
4068+ focus : function(){
4069+ var data = UIItemPrivateData.get( this );
4070+ data.focus = true;
4071+ Util.addClass( data.elm, 'fileinput-has-focus' );
4072+ start( data );
4073+ FileInputManager.show( data );
4074+ },
4075+ blur : function( keyCode ){
4076+ var data = UIItemPrivateData.get( this );
4077+ Util.removeClass( data.elm, 'fileinput-has-focus' );
4078+ data.focus = false;
4079+ FileInputManager.hide( data );
4080+ finish( data );
4081+ },
4082+ enabled : function( v ){
4083+ var data = UIItemPrivateData.get( this );
4084+ if( Type.isBoolean( v ) === true && data.enabled !== v ){
4085+ if( data.focus === true && v === false ) this.blur();
4086+ Util.toggleClass( data.elm, 'fileinput-disabled', !v );
4087+ data.enabled = v;
4088+ data.node.disabled( !( data.visible && v ) );
4089+ };
4090+ return data.enabled;
4091+ },
4092+ visible : function( v ){
4093+ var data = UIItemPrivateData.get( this );
4094+ if( Type.isBoolean( v ) === true && data.visible !== v ){
4095+ if( data.focus === true && v === false ) this.blur();
4096+ data.elm.style.display = v ? '' : 'none';
4097+ data.visible = v;
4098+ data.node.disabled( !( data.enabled && v ) );
4099+ };
4100+ return data.visible;
4101+ },
4102+ destroy : function(){
4103+ var data = UIItemPrivateData.get( this );
4104+ data.focus === true && FileInputManager.hide( data );
4105+ data.destroy();
4106+ }
4107+ };
39464108
39474109 var ButtonClass = function( groupData, elmWrapper, onUpdate ){
39484110 var data = new UIItemPrivateData();
39494111 data.init( groupData, this, elmWrapper, null, onUpdate, null, false, true, true );
3950- data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-inpittext-hover', 'pointer' );
4112+ data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-button-hover', 'pointer' );
39514113 data.node.addEventListener( 'click', onUpdate );
39524114 //MouseEvent.add( groupData.apiuser, elmWrapper, 'click', onUpdate );
39534115 };
@@ -3965,19 +4127,21 @@ var UI = ( function(){
39654127 data.focus = false;
39664128 finish( data );
39674129 },
3968- enabled : function( _enabled ){
4130+ enabled : function( v ){
39694131 var data = UIItemPrivateData.get( this );
3970- if( Type.isBoolean( _enabled ) === true && data.enabled !== _enabled ){
3971- _enabled === true ? Util.removeClass( data.elm, 'button-disabled' ) : Util.addClass( data.elm, 'button-disabled' );
3972- data.enabled = _enabled;
4132+ if( Type.isBoolean( v ) === true && data.enabled !== v ){
4133+ Util.toggleClass( data.elm, 'button-disabled', !v );
4134+ data.enabled = v;
4135+ data.node.disabled( !( data.visible && v ) );
39734136 };
39744137 return data.enabled;
39754138 },
3976- visible : function( _visible ){
4139+ visible : function( v ){
39774140 var data = UIItemPrivateData.get( this );
3978- if( Type.isBoolean( _visible ) === true ){
3979- data.elm.style.display = _visible ? '' : 'none';
3980- data.visible = _visible;
4141+ if( Type.isBoolean( v ) === true && data.visible !== v ){
4142+ data.elm.style.display = v ? '' : 'none';
4143+ data.visible = v;
4144+ data.node.disabled( !( data.enabled && v ) );
39814145 };
39824146 return data.visible;
39834147 },
@@ -4001,14 +4165,12 @@ var UI = ( function(){
40014165 data.selectIndex = 0;
40024166 data.optionList = [];
40034167
4004- data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-inpittext-hover', 'pointer' );
4168+ data.node = groupData.node.createNode( elmWrapper, false, true, 'ui-combobox-hover', 'pointer' );
40054169 data.node.addEventListener( 'click', this.focus, this );
4006- // MouseEvent.add( groupData.apiuser, data.elm, 'click', this.focus );
40074170 };
40084171 ComboBoxClass.prototype = {
40094172 focus : function( e ){
40104173 var data = UIItemPrivateData.get( this );
4011- // MouseEvent.remove( data.groupData.apiuser, data.elm, 'click', this.focus );
40124174 data.node.removeEventListener( 'click', this.focus );
40134175 data.focus = true;
40144176 data.elmA.className = 'combobox-has-focus';
@@ -4023,17 +4185,24 @@ var UI = ( function(){
40234185 data.elmA.className = '';
40244186 finish( data );
40254187 data.node.addEventListener( 'click', this.focus, this );
4026- // MouseEvent.add( data.groupData.apiuser, data.elm, 'click', this.focus );
40274188 },
4028- enabled : function(){
4189+ enabled : function( v ){
40294190 var data = UIItemPrivateData.get( this );
4191+ if( Type.isBoolean( v ) === true && data.enabled !== v ){
4192+ Util.toggleClass( data.elm, 'ui-combobox-disabled', !v );
4193+ if( data.focus === true && v === false ) this.blur();
4194+ data.enabled = v;
4195+ data.node.disabled( !( data.visible && v ) );
4196+ };
40304197 return data.enabled;
40314198 },
4032- visible : function( _visible ){
4199+ visible : function( v ){
40334200 var data = UIItemPrivateData.get( this );
4034- if( Type.isBoolean( _visible ) === true ){
4035- data.elm.style.display = _visible ? '' : 'none';
4036- data.visible = _visible;
4201+ if( Type.isBoolean( v ) === true && data.visible !== v ){
4202+ data.elm.style.display = v ? '' : 'none';
4203+ if( data.focus === true && v === false ) this.blur();
4204+ data.visible = v;
4205+ data.node.disabled( !( data.enabled && v ) );
40374206 };
40384207 return data.visible;
40394208 },
@@ -4333,7 +4502,7 @@ var UI = ( function(){
43334502 elmValue = Util.getElementsByClassName( elmWrapper, 'editable-value' )[ 0 ],
43344503 ret;
43354504 if( elmValue ){
4336- ret = new InputTextClass( data, elmWrapper, elmValue, onUpdate, validater );
4505+ ret = new TextInputClass( data, elmWrapper, elmValue, onUpdate, validater );
43374506 data.itemList.push( ret );
43384507 return ret;
43394508 };
@@ -4345,10 +4514,15 @@ var UI = ( function(){
43454514 data.itemList.push( ret );
43464515 return ret;
43474516 },
4348- createFileInput : function( elm, onUpdate, validater, elmFileInput ){
4349- var data = UIGroupPrivateData.get( this ),
4350- ret = new FileInputClass( data, elm, onUpdate, validater, elmFileInput );
4351- data.itemList.push( ret );
4517+ createFileInput : function( elm, onUpdate, validater, elmFileInputReal ){
4518+ var data = UIGroupPrivateData.get( this ),
4519+ elmValue = Util.getElementsByClassName( elmWrapper, 'fileinput-value' )[ 0 ],
4520+ ret;
4521+ if( elmValue ){
4522+ ret = new FileInputClass( data, elm, onUpdate, validater, elmFileInputReal, elmValue );
4523+ data.itemList.push( ret );
4524+ return ret;
4525+ };
43524526 return ret;
43534527 },
43544528 createCombobox : function( elm, onUpdate, optionList ){
@@ -4369,17 +4543,24 @@ var UI = ( function(){
43694543 visible : function( v ){
43704544 var data = UIGroupPrivateData.get( this );
43714545 if( Type.isBoolean( v ) === true && data.visible !== v ){
4372- data.node.disabled( !v );
4373- data.visible = v;
4374- if( v === false && currentUi === this ){
4375- currentItem.blur();
4376- // finish( UIItemPrivateData.get( currentItem ) );
4546+ for( var i = data.itemList.length; i; ){
4547+ data.itemList[ --i ].visible( v );
43774548 };
4549+ data.visible = v;
4550+ data.node.disabled( !( data.enabled && v ) );
43784551 };
43794552 return data.visible;
43804553 },
43814554 enabled : function( v ){
4382-
4555+ var data = UIGroupPrivateData.get( this );
4556+ if( Type.isBoolean( v ) === true && data.enabled !== v ){
4557+ for( var i = data.itemList.length; i; ){
4558+ data.itemList[ --i ].enabled( v );
4559+ };
4560+ data.enabled = v;
4561+ data.node.disabled( !( data.visible && v ) );
4562+ };
4563+ return data.enabled;
43834564 },
43844565 destroy : function(){
43854566 var data = UIGroupPrivateData.get( this ),
@@ -4440,8 +4621,8 @@ var UI = ( function(){
44404621 keyCode === 13 && currentItem instanceof ComboBoxClass && OptionControl.onEnter();
44414622 keyCode === 13 && tabShift( index, 1 );
44424623 currentItem && currentItem.blur( keyCode );
4624+ return false;
44434625 };
4444- return false;
44454626 };
44464627
44474628 function tabShift( index, way ){
@@ -4477,6 +4658,8 @@ var UI = ( function(){
44774658 windowW = w;
44784659 windowH = h;
44794660 currentItem instanceof ComboBoxClass && OptionControl.onWindowResize( w, h );
4661+ currentItem instanceof TextInputClass && TextInputManager.onWindowResize( w, h );
4662+ currentItem instanceof FileInputClass && FileInputManager.onWindowResize( w, h );
44804663 },
44814664 onCurrentApplicationChange: function( _apiuser ){
44824665 currentList = UI_LIST[ _apiuser.getUID() ];
旧リポジトリブラウザで表示