リビジョン | 67cb7059b2dab2d5d1c72214e7cfa026b0ec6b75 (tree) |
---|---|
日時 | 2012-12-08 23:48:36 |
作者 | itozyun <itozyun@gmai...> |
コミッター | itozyun |
version 0.5.29, fixed PointingDeviceEventTree.ScrollManager, peta.apps.
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | * pettanR peta.apps.js |
3 | - * version 0.5.28 | |
3 | + * version 0.5.29 | |
4 | 4 | * |
5 | 5 | * author: |
6 | 6 | * itozyun |
@@ -28,7 +28,7 @@ | ||
28 | 28 | _data.state = Const.FILE.STATE.OK; |
29 | 29 | |
30 | 30 | 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 ){ | |
32 | 32 | buildFileData( _json[ i ], _data ); |
33 | 33 | }; |
34 | 34 | } else |
@@ -2235,12 +2235,14 @@ var Editor = gOS.registerApplication( function(){ | ||
2235 | 2235 | var onHelpLoad = function( _xml ){ |
2236 | 2236 | var jqXML = $( _xml ), |
2237 | 2237 | helpTitle = jqXML.find( 'pages' ).eq( 0 ).attr( 'title' ), |
2238 | + elmRoot = document.createElement( 'div' ), | |
2238 | 2239 | elmNavi = document.createElement( 'div' ), |
2239 | 2240 | elmItemOrigin = document.createElement( 'a' ), |
2240 | 2241 | elmPages = document.createElement( 'div' ), |
2241 | 2242 | elmPageOrigin = document.createElement( 'div' ), |
2242 | 2243 | elmTitleOrigin = document.createElement( 'h2' ), |
2243 | 2244 | elmPage; |
2245 | + elmRoot.className = 'multi-page-container clearfix'; | |
2244 | 2246 | elmNavi.className = 'sidenavi'; |
2245 | 2247 | elmItemOrigin.className = 'sidenavi-item'; |
2246 | 2248 | elmItemOrigin.href = '#'; |
@@ -2276,8 +2278,9 @@ var Editor = gOS.registerApplication( function(){ | ||
2276 | 2278 | MENU_BAR_CONTROL.HELP.createOption( title, null, onSelectionClick, true ); |
2277 | 2279 | ++numPage; |
2278 | 2280 | }); |
2279 | - | |
2280 | - jqAjaxContents.removeClass( 'loading' ).append( elmNavi, elmPages ); | |
2281 | + elmRoot.appendChild( elmNavi ); | |
2282 | + elmRoot.appendChild( elmPages ); | |
2283 | + jqAjaxContents.removeClass( 'loading' ).append( elmRoot ); | |
2281 | 2284 | |
2282 | 2285 | jqNaviItems = jqAjaxContents.find( 'a.' + elmItemOrigin.className ).click( onNaviClick ); |
2283 | 2286 | jqPages = jqAjaxContents.find( '.page-content' ); |
@@ -2966,7 +2969,7 @@ var Editor = gOS.registerApplication( function(){ | ||
2966 | 2969 | baseW = _w; |
2967 | 2970 | baseH = _h = _memoryY -_y; |
2968 | 2971 | flip( false, true); |
2969 | - flipH = currentElement.flipH(); | |
2972 | + flipH = currentElement.flipH; | |
2970 | 2973 | } else { |
2971 | 2974 | // flipVH |
2972 | 2975 | _memoryX = _x; |
@@ -3492,7 +3495,6 @@ var Editor = gOS.registerApplication( function(){ | ||
3492 | 3495 | this.resize( this.x + shiftX, this.y + shiftY ); |
3493 | 3496 | }, |
3494 | 3497 | mouseover : function( e ){ |
3495 | - console.log( 'w:' + this.node.width() + ' h:' + this.node.height() + ' x:' + this.node.x() + ' y:' + this.node.y() ) | |
3496 | 3498 | PanelElementOperatorManager.show( this ); |
3497 | 3499 | } |
3498 | 3500 | }; |
@@ -3716,6 +3718,8 @@ var Editor = gOS.registerApplication( function(){ | ||
3716 | 3718 | this.$.stop().remove(); |
3717 | 3719 | this.balloon.destroy(); |
3718 | 3720 | this.node.remove(); |
3721 | + | |
3722 | + this.destroy = null; | |
3719 | 3723 | } |
3720 | 3724 | } |
3721 | 3725 | ); |
@@ -4080,7 +4084,7 @@ var Editor = gOS.registerApplication( function(){ | ||
4080 | 4084 | '</div>', |
4081 | 4085 | '<div class="window-body"></div>', |
4082 | 4086 | '<div class="window-footer">', |
4083 | - '<div class="window-resize-button">/</div>', | |
4087 | + '<div class="window-resize-button"></div>', | |
4084 | 4088 | '</div>', |
4085 | 4089 | '</div>', |
4086 | 4090 |
@@ -4367,10 +4371,10 @@ var ComicConsole = gOS.registerApplication( function(){ | ||
4367 | 4371 | _optionList = _select.getElementsByTagName( 'option' ) |
4368 | 4372 | if( _name === 'comic[visible]' ){ |
4369 | 4373 | _select.selectedIndex = comboboxVisible.selectIndex(); |
4370 | - } else | |
4374 | + }/* else | |
4371 | 4375 | if( _name === 'comic[editable]' ){ |
4372 | - // _select.selectedIndex = comboboxEditable.selectIndex(); | |
4373 | - }; | |
4376 | + _select.selectedIndex = comboboxEditable.selectIndex(); | |
4377 | + } */; | |
4374 | 4378 | }; |
4375 | 4379 | app.submit(); |
4376 | 4380 | }; |
@@ -4471,10 +4475,10 @@ var ComicConsole = gOS.registerApplication( function(){ | ||
4471 | 4475 | option = optionList[ j ]; |
4472 | 4476 | if( select.name === 'comic[visible]' ){ |
4473 | 4477 | comboboxVisible.createOption( option.innerHTML, option.value, option.selected ); |
4474 | - } else | |
4478 | + }/* else | |
4475 | 4479 | 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 | + }*/; | |
4478 | 4482 | }; |
4479 | 4483 | }; |
4480 | 4484 | inputTitle.focus(); |
@@ -4482,7 +4486,6 @@ var ComicConsole = gOS.registerApplication( function(){ | ||
4482 | 4486 | //node.mesure(); |
4483 | 4487 | app.onPaneResize( windowW, windowH ); |
4484 | 4488 | |
4485 | - | |
4486 | 4489 | delete app.onFoemReady; |
4487 | 4490 | }; |
4488 | 4491 | this.submitError = function(){ |
@@ -4495,6 +4498,7 @@ var ComicConsole = gOS.registerApplication( function(){ | ||
4495 | 4498 | |
4496 | 4499 | var UploadConsole = gOS.registerApplication( function(){ |
4497 | 4500 | var windowW, windowH, |
4501 | + eventRoot, node, | |
4498 | 4502 | buttonSubmit, buttonCancel, |
4499 | 4503 | elmFile, |
4500 | 4504 | app = this; |
@@ -4531,6 +4535,8 @@ var UploadConsole = gOS.registerApplication( function(){ | ||
4531 | 4535 | |
4532 | 4536 | app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS ); |
4533 | 4537 | |
4538 | + eventRoot = app.getPointingDeviceEventTreeRoot(); | |
4539 | + | |
4534 | 4540 | delete app.onInit; |
4535 | 4541 | }; |
4536 | 4542 | this.elmProgressID = 'upload-console-progress'; |
@@ -4540,8 +4546,6 @@ var UploadConsole = gOS.registerApplication( function(){ | ||
4540 | 4546 | this.hideUploader = false; |
4541 | 4547 | FormApplicationHelper( this ); |
4542 | 4548 | this.onFormReady = function(){ |
4543 | - app.onPaneResize( windowW, windowH ); | |
4544 | - | |
4545 | 4549 | var _inputList = app.elmForm.getElementsByTagName( 'input' ), |
4546 | 4550 | _input; |
4547 | 4551 | for( var i = _inputList.length; i; ){ |
@@ -4553,6 +4557,9 @@ var UploadConsole = gOS.registerApplication( function(){ | ||
4553 | 4557 | _input.style.display = 'none'; |
4554 | 4558 | }; |
4555 | 4559 | }; |
4560 | + node.mesure(); | |
4561 | + app.onPaneResize( windowW, windowH ); | |
4562 | + node.mesureChildren(); | |
4556 | 4563 | delete app.onFoemReady; |
4557 | 4564 | }; |
4558 | 4565 | this.submitError = function(){ |
@@ -4562,20 +4569,23 @@ var UploadConsole = gOS.registerApplication( function(){ | ||
4562 | 4569 | app.addTimer( clickCancel , 5000, true ); |
4563 | 4570 | }; |
4564 | 4571 | 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 ); | |
4568 | 4577 | |
4569 | 4578 | app.onPaneResize( w, h ); |
4570 | 4579 | app.fetchScript(); |
4571 | 4580 | }; |
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 ); | |
4579 | 4589 | }; |
4580 | 4590 | this.onClose = function(){ |
4581 | 4591 | app.destroyHelper(); |
@@ -4585,11 +4595,15 @@ var UploadConsole = gOS.registerApplication( function(){ | ||
4585 | 4595 | |
4586 | 4596 | var ArtistConsole = gOS.registerApplication( function(){ |
4587 | 4597 | var windowW, windowH, |
4598 | + eventRoot, node, | |
4599 | + elmName, elmLicense, | |
4600 | + inputName, inputLicense, | |
4588 | 4601 | buttonSubmit, buttonCancel, |
4589 | 4602 | app = this; |
4590 | 4603 | |
4591 | 4604 | function clickOK(){ |
4592 | 4605 | if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false; |
4606 | + inputUpdate(); | |
4593 | 4607 | app.submit(); |
4594 | 4608 | return false; |
4595 | 4609 | }; |
@@ -4598,6 +4612,10 @@ var ArtistConsole = gOS.registerApplication( function(){ | ||
4598 | 4612 | ArtistConsole.shutdown(); |
4599 | 4613 | return false; |
4600 | 4614 | }; |
4615 | + function inputUpdate( v ){ | |
4616 | + elmName.value = inputName.value(); | |
4617 | + elmLicense.value = inputLicense.value(); | |
4618 | + }; | |
4601 | 4619 | |
4602 | 4620 | /* grobal method */ |
4603 | 4621 | this.MIN_WIDTH = 320; |
@@ -4608,16 +4626,25 @@ var ArtistConsole = gOS.registerApplication( function(){ | ||
4608 | 4626 | app.rootElement.innerHTML = [ |
4609 | 4627 | '<div id="artist-console-header" class="console-header">Register Artist</div>', |
4610 | 4628 | '<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>', | |
4612 | 4637 | '<div class="console-button-container">', |
4613 | 4638 | '<div id="artist-console-post-button" class="button console-submit-button">register</div>', |
4614 | 4639 | '<div id="artist-console-cancel-button" class="button console-cancel-button">cancel</div>', |
4615 | 4640 | '</div>', |
4616 | 4641 | '<div id="artist-console-progress" class="console-progress"> </div>', |
4642 | + '<div id="register" style="display:none;"></div>', | |
4617 | 4643 | '</div>' |
4618 | 4644 | ].join( '' ); |
4619 | 4645 | |
4620 | 4646 | app.fetchCSS( pettanr.CONST.URL_PETA_APPS_CSS ); |
4647 | + eventRoot = app.getPointingDeviceEventTreeRoot(); | |
4621 | 4648 | |
4622 | 4649 | delete app.onInit; |
4623 | 4650 | }; |
@@ -4628,8 +4655,6 @@ var ArtistConsole = gOS.registerApplication( function(){ | ||
4628 | 4655 | this.hideUploader = false; |
4629 | 4656 | FormApplicationHelper( this ); |
4630 | 4657 | this.onFormReady = function(){ |
4631 | - app.onPaneResize( windowW, windowH ); | |
4632 | - | |
4633 | 4658 | var _inputList = app.elmForm.getElementsByTagName( 'input' ), |
4634 | 4659 | _input; |
4635 | 4660 | for( var i = _inputList.length; i; ){ |
@@ -4637,7 +4662,18 @@ var ArtistConsole = gOS.registerApplication( function(){ | ||
4637 | 4662 | if( _input.type === 'submit' ){ |
4638 | 4663 | _input.style.display = 'none'; |
4639 | 4664 | }; |
4665 | + if( _input.name === 'artist[name]' ){ | |
4666 | + elmName = _input; | |
4667 | + }; | |
4668 | + if( _input.name === 'artist[default_license_id]' ){ | |
4669 | + elmLicense = _input; | |
4670 | + }; | |
4640 | 4671 | }; |
4672 | + | |
4673 | + node.mesure(); | |
4674 | + app.onPaneResize( windowW, windowH ); | |
4675 | + node.mesureChildren(); | |
4676 | + | |
4641 | 4677 | delete app.onFoemReady; |
4642 | 4678 | }; |
4643 | 4679 | this.submitError = function(){ |
@@ -4647,20 +4683,25 @@ var ArtistConsole = gOS.registerApplication( function(){ | ||
4647 | 4683 | app.addTimer( clickCancel , 5000, true ); |
4648 | 4684 | }; |
4649 | 4685 | 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 ); | |
4653 | 4693 | |
4654 | 4694 | app.onPaneResize( w, h ); |
4655 | 4695 | app.fetchScript(); |
4656 | 4696 | }; |
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 ); | |
4664 | 4705 | }; |
4665 | 4706 | this.onClose = function(){ |
4666 | 4707 | app.destroyHelper(); |
@@ -4668,6 +4709,139 @@ var ArtistConsole = gOS.registerApplication( function(){ | ||
4668 | 4709 | }; |
4669 | 4710 | }, true, true, 'Artist Console', 'artistConsole', null, '#FFC40D' ); |
4670 | 4711 | |
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"> </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' ); | |
4671 | 4845 | |
4672 | 4846 | var Model = ( function(){ |
4673 | 4847 |
@@ -5030,123 +5204,4 @@ var OutputConsole = gOS.registerApplication( function(){ | ||
5030 | 5204 | }; |
5031 | 5205 | }, true, false, 'Output Console', 'outputConsole', null, '#2D89F0' ); |
5032 | 5206 | |
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"> </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 | - | |
5152 | 5207 | })( pettanr, gOS, window, document ); |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* |
2 | 2 | * pettanR system.js |
3 | - * version 0.5.28 | |
3 | + * version 0.5.29 | |
4 | 4 | * |
5 | 5 | * gadgetOS |
6 | 6 | * author: |
@@ -111,9 +111,7 @@ | ||
111 | 111 | } |
112 | 112 | }; |
113 | 113 | |
114 | -var EX = ( function(){ | |
115 | - var F = new Function(); | |
116 | - | |
114 | +var Class = ( function(){ | |
117 | 115 | function clone( src ){ |
118 | 116 | var ret; |
119 | 117 | if( Type.isArray(src) === true ){ |
@@ -133,26 +131,35 @@ var EX = ( function(){ | ||
133 | 131 | return ret; |
134 | 132 | }; |
135 | 133 | |
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 | + | |
136 | 151 | 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 ) ); | |
142 | 156 | }; |
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; | |
156 | 163 | } |
157 | 164 | } |
158 | 165 | })(); |
@@ -1499,7 +1506,7 @@ var PointingDeviceEventTree = ( function(){ | ||
1499 | 1506 | this.hoverClass = hover; |
1500 | 1507 | this.scroll = clip && scroll; |
1501 | 1508 | this.mesure(); |
1502 | - this.scroll === true && this.addEventListener( 'mouseover', this.onScrollReady, this ); | |
1509 | + this.scroll === true && ScrollBarManager.register( this ); | |
1503 | 1510 | } else { |
1504 | 1511 | this.update( rangeOrElm.x, rangeOrElm.y, rangeOrElm.w, rangeOrElm.h ); |
1505 | 1512 | }; |
@@ -1520,7 +1527,6 @@ var PointingDeviceEventTree = ( function(){ | ||
1520 | 1527 | this.y = y; |
1521 | 1528 | this.w = w; |
1522 | 1529 | this.h = h; |
1523 | - console.log( ' ---- mesure' + this.elm.id + ' x:' + this.x + ' y:' + this.y + ' w:' + w + ' h:' + h ) | |
1524 | 1530 | parent = this.parentData; |
1525 | 1531 | parent && this._updateAbsoluteXY( parent.absoluteX, parent.absoluteY, parent.scrollingX, parent.scrollingY ); |
1526 | 1532 | this._updateRectangle(); |
@@ -1658,6 +1664,7 @@ var PointingDeviceEventTree = ( function(){ | ||
1658 | 1664 | // this.w = r - x; |
1659 | 1665 | // this.h = b - y; |
1660 | 1666 | this.parentData && this.parentData.clip === false && this.parentData._updateRectangle(); |
1667 | + return true; | |
1661 | 1668 | }; |
1662 | 1669 | }, |
1663 | 1670 | setPosition : function( x, y ){ |
@@ -1800,24 +1807,6 @@ var PointingDeviceEventTree = ( function(){ | ||
1800 | 1807 | }; |
1801 | 1808 | forceNodeData = null; |
1802 | 1809 | }, |
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 | - }, | |
1821 | 1810 | scrollTo : function( x, y ){ |
1822 | 1811 | this._scrollX = x; |
1823 | 1812 | this._scrollY = y; |
@@ -1930,7 +1919,7 @@ var PointingDeviceEventTree = ( function(){ | ||
1930 | 1919 | this.node = node; |
1931 | 1920 | this.type = eventType; |
1932 | 1921 | this.handler = handler; |
1933 | - this.thisObj = opt_thisObject; | |
1922 | + this.thisObj = opt_thisObject || node; | |
1934 | 1923 | }; |
1935 | 1924 | EventTicketClass.prototype = { |
1936 | 1925 | match : function( eventType, handler ){ |
@@ -1949,22 +1938,22 @@ var PointingDeviceEventTree = ( function(){ | ||
1949 | 1938 | fire : ( function(){ |
1950 | 1939 | if( Function.prototype.call ){ |
1951 | 1940 | return function( e ){ |
1952 | - return this.handler.call( this.thisObj || this.node, e ); | |
1941 | + return this.handler.call( this.thisObj, e ); | |
1953 | 1942 | }; |
1954 | 1943 | }; |
1955 | 1944 | 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; | |
1961 | 1949 | return ret; |
1962 | 1950 | }; |
1963 | 1951 | })() |
1964 | 1952 | }; |
1965 | 1953 | |
1966 | 1954 | var ScrollBarManager = ( function(){ |
1967 | - var elmBar = document.createElement( 'div' ), | |
1955 | + var elmScroller = document.createElement( 'div' ), | |
1956 | + elmBar = document.createElement( 'div' ), | |
1968 | 1957 | smoothList = [], |
1969 | 1958 | currentNodeData = null; |
1970 | 1959 |
@@ -1980,8 +1969,8 @@ var PointingDeviceEventTree = ( function(){ | ||
1980 | 1969 | } else { |
1981 | 1970 | y = data._scrollY < y ? data._scrollY : y; |
1982 | 1971 | }; |
1983 | - data.scrollingY = y; | |
1984 | - data.elmScroller.style.top = y + 'px'; | |
1972 | + data.scrollingY = y; | |
1973 | + data.elm.scrollTop = -y; | |
1985 | 1974 | }; |
1986 | 1975 | if( data.scrollingY === data._scrollY ){ |
1987 | 1976 | list.splice( i, 1 ); |
@@ -1992,74 +1981,103 @@ var PointingDeviceEventTree = ( function(){ | ||
1992 | 1981 | list.length === 0 && SystemTimer.remove( SUPER_USER_KEY, tick ); |
1993 | 1982 | }; |
1994 | 1983 | |
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 | + | |
1995 | 2033 | 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 ); | |
2017 | 2036 | }, |
2018 | 2037 | 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, | |
2023 | 2041 | clipH = data.h, |
2024 | - barH = Math.floor( clipH * ( clipH / contentH ) ), | |
2025 | 2042 | 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 ){ | |
2041 | 2065 | smoothList.length === 0 && SystemTimer.add( SUPER_USER_KEY, tick, 16 ); |
2042 | 2066 | smoothList.push( data ); |
2043 | 2067 | }; |
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; | |
2053 | 2068 | } |
2054 | 2069 | }; |
2055 | 2070 | })(); |
2056 | 2071 | |
2057 | 2072 | return { |
2058 | 2073 | 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; | |
2062 | 2076 | body.appendChild( elm ); |
2077 | + | |
2078 | + root = new NodeClass( apiuser, null, null, elm ); | |
2079 | + data = NodePrivateData.get( root ); | |
2080 | + | |
2063 | 2081 | // elm.style.cssText = 'position:absolute;top:0;left:0;height:100%;'; |
2064 | 2082 | elm.className = 'mouse-operation-catcher'; |
2065 | 2083 | elm.unselectable = 'on'; |
@@ -2125,11 +2143,16 @@ var Application = ( function(){ | ||
2125 | 2143 | this.displayName = displayName; |
2126 | 2144 | this.thumbnailUrl = thumbnailUrl; |
2127 | 2145 | this.tailColor = tailColor; |
2146 | + | |
2147 | + function asyncBoot(){ | |
2148 | + application = Application.boot( appClass, displayName, self.getUID(), isOverlay, Util.copyArray( arguments ) ); | |
2149 | + }; | |
2150 | + | |
2128 | 2151 | this.getUID = function(){ |
2129 | 2152 | return Util.getIndex( API_USER_LIST, appClass ); |
2130 | 2153 | }; |
2131 | 2154 | this.boot = function( /* _option */ ){ |
2132 | - application = Application.boot( appClass, displayName, self.getUID(), isOverlay, Util.copyArray( arguments ) ); | |
2155 | + AsyncCall.add( this, asyncBoot, Util.copyArray( arguments ) ); | |
2133 | 2156 | }; |
2134 | 2157 | this.shutdown = function(){ |
2135 | 2158 | if( !application ) return false; |
@@ -2494,6 +2517,7 @@ var Application = ( function(){ | ||
2494 | 2517 | if( document.attachEvent ){ |
2495 | 2518 | wrappedHandlerClass = function( ticket ){ |
2496 | 2519 | this.handler = function(){ |
2520 | + if( ticket === null ) alert( window.event.type ) | |
2497 | 2521 | if( ticket.fire( new wrappedEventClass( window.event, ticket.element ) ) !== false ) return; |
2498 | 2522 | // e.preventDefault(); |
2499 | 2523 | // e.stopPropagation(); |
@@ -3189,7 +3213,8 @@ var KeyEvent = ( function(){ | ||
3189 | 3213 | key = e.keyCode, // || e.which, |
3190 | 3214 | shift = Type.isBoolean( e.shiftKey ) === true ? e.shiftKey : ( e.modifiers & Event.SHIFT_MASK ), |
3191 | 3215 | 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; | |
3193 | 3218 | |
3194 | 3219 | // block chattering |
3195 | 3220 | if( Util.getIndex( lock, key ) !== -1 ) return; |
@@ -3202,10 +3227,13 @@ var KeyEvent = ( function(){ | ||
3202 | 3227 | if( key === 17 || ctrl === true ){ |
3203 | 3228 | KeyEvent.ctrlEnabled = type !== 'keyup'; |
3204 | 3229 | }; |
3205 | - for( var i=currentList.length, t; t = currentList[ --i ]; ){ | |
3230 | + for( i = currentList.length; i; ){ | |
3231 | + t = currentList[ --i ]; | |
3206 | 3232 | 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 | + }; | |
3209 | 3237 | }; |
3210 | 3238 | }; |
3211 | 3239 | 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(){ | ||
3849 | 3877 | ret.id = 'ui-textinput'; |
3850 | 3878 | return ret; |
3851 | 3879 | })(); |
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 | + }; | |
3852 | 3897 | |
3853 | 3898 | return { |
3854 | 3899 | show: function( data ){ |
3855 | 3900 | // 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 | + | |
3867 | 3903 | 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(); | |
3870 | 3906 | |
3871 | 3907 | elmInput.focus(); |
3872 | 3908 | elmInput.select(); |
3909 | + | |
3910 | + SystemTimer.add( SUPER_USER_KEY, updateWrapperPosition, 500 ); | |
3873 | 3911 | }, |
3874 | 3912 | hide : function( data ){ |
3913 | + if( currentData !== data ) return; | |
3914 | + currentData = null; | |
3875 | 3915 | body.removeChild( elmInput ); |
3876 | 3916 | var ret = elmInput.value; |
3877 | 3917 | elmInput.value = ''; |
3918 | + SystemTimer.remove( SUPER_USER_KEY, updateWrapperPosition ); | |
3878 | 3919 | return ret; |
3879 | 3920 | }, |
3880 | 3921 | update : function( data ){ |
3881 | 3922 | elmInput.value = data.value; |
3923 | + }, | |
3924 | + onWindowResize: function( _w, _h ){ | |
3925 | + AsyncCall.add( currentData.apiuser, updateWrapperPosition ); | |
3882 | 3926 | } |
3883 | 3927 | }; |
3884 | 3928 | })(); |
3885 | 3929 | |
3886 | - var InputTextClass = function( groupData, elmWrapper, elmValue, onUpdate, validater ){ | |
3930 | + var TextInputClass = function( groupData, elmWrapper, elmValue, onUpdate, validater ){ | |
3887 | 3931 | var data = new UIItemPrivateData(); |
3888 | 3932 | data.init( groupData, this, elmWrapper, elmValue.innerHTML, onUpdate, validater, false, true, true ); |
3889 | 3933 | Util.addClass( elmValue, 'editable-text' ); |
@@ -3893,7 +3937,7 @@ var UI = ( function(){ | ||
3893 | 3937 | data.node.addEventListener( 'click', this.focus, this ); |
3894 | 3938 | //MouseEvent.add( groupData.apiuser, elmWrapper, 'click', instance.focus ); |
3895 | 3939 | }; |
3896 | - InputTextClass.prototype = { | |
3940 | + TextInputClass.prototype = { | |
3897 | 3941 | value : function( value ){ |
3898 | 3942 | var data = UIItemPrivateData.get( this ); |
3899 | 3943 | if( Type.isString( value ) === true || Type.isNumber( value ) === true ){ |
@@ -3914,8 +3958,8 @@ var UI = ( function(){ | ||
3914 | 3958 | var data = UIItemPrivateData.get( this ), |
3915 | 3959 | newValue; |
3916 | 3960 | 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 | |
3919 | 3963 | |
3920 | 3964 | data.elmValue.innerHTML = newValue; |
3921 | 3965 |
@@ -3925,15 +3969,23 @@ var UI = ( function(){ | ||
3925 | 3969 | data.focus = false; |
3926 | 3970 | finish( data ); |
3927 | 3971 | }, |
3928 | - enabled : function(){ | |
3972 | + enabled : function( v ){ | |
3929 | 3973 | 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 | + }; | |
3930 | 3980 | return data.enabled; |
3931 | 3981 | }, |
3932 | - visible : function( _visible ){ | |
3982 | + visible : function( v ){ | |
3933 | 3983 | 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 ) ); | |
3937 | 3989 | }; |
3938 | 3990 | return data.visible; |
3939 | 3991 | }, |
@@ -3943,11 +3995,121 @@ var UI = ( function(){ | ||
3943 | 3995 | data.destroy(); |
3944 | 3996 | } |
3945 | 3997 | }; |
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 | + }; | |
3946 | 4108 | |
3947 | 4109 | var ButtonClass = function( groupData, elmWrapper, onUpdate ){ |
3948 | 4110 | var data = new UIItemPrivateData(); |
3949 | 4111 | 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' ); | |
3951 | 4113 | data.node.addEventListener( 'click', onUpdate ); |
3952 | 4114 | //MouseEvent.add( groupData.apiuser, elmWrapper, 'click', onUpdate ); |
3953 | 4115 | }; |
@@ -3965,19 +4127,21 @@ var UI = ( function(){ | ||
3965 | 4127 | data.focus = false; |
3966 | 4128 | finish( data ); |
3967 | 4129 | }, |
3968 | - enabled : function( _enabled ){ | |
4130 | + enabled : function( v ){ | |
3969 | 4131 | 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 ) ); | |
3973 | 4136 | }; |
3974 | 4137 | return data.enabled; |
3975 | 4138 | }, |
3976 | - visible : function( _visible ){ | |
4139 | + visible : function( v ){ | |
3977 | 4140 | 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 ) ); | |
3981 | 4145 | }; |
3982 | 4146 | return data.visible; |
3983 | 4147 | }, |
@@ -4001,14 +4165,12 @@ var UI = ( function(){ | ||
4001 | 4165 | data.selectIndex = 0; |
4002 | 4166 | data.optionList = []; |
4003 | 4167 | |
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' ); | |
4005 | 4169 | data.node.addEventListener( 'click', this.focus, this ); |
4006 | - // MouseEvent.add( groupData.apiuser, data.elm, 'click', this.focus ); | |
4007 | 4170 | }; |
4008 | 4171 | ComboBoxClass.prototype = { |
4009 | 4172 | focus : function( e ){ |
4010 | 4173 | var data = UIItemPrivateData.get( this ); |
4011 | - // MouseEvent.remove( data.groupData.apiuser, data.elm, 'click', this.focus ); | |
4012 | 4174 | data.node.removeEventListener( 'click', this.focus ); |
4013 | 4175 | data.focus = true; |
4014 | 4176 | data.elmA.className = 'combobox-has-focus'; |
@@ -4023,17 +4185,24 @@ var UI = ( function(){ | ||
4023 | 4185 | data.elmA.className = ''; |
4024 | 4186 | finish( data ); |
4025 | 4187 | data.node.addEventListener( 'click', this.focus, this ); |
4026 | - // MouseEvent.add( data.groupData.apiuser, data.elm, 'click', this.focus ); | |
4027 | 4188 | }, |
4028 | - enabled : function(){ | |
4189 | + enabled : function( v ){ | |
4029 | 4190 | 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 | + }; | |
4030 | 4197 | return data.enabled; |
4031 | 4198 | }, |
4032 | - visible : function( _visible ){ | |
4199 | + visible : function( v ){ | |
4033 | 4200 | 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 ) ); | |
4037 | 4206 | }; |
4038 | 4207 | return data.visible; |
4039 | 4208 | }, |
@@ -4333,7 +4502,7 @@ var UI = ( function(){ | ||
4333 | 4502 | elmValue = Util.getElementsByClassName( elmWrapper, 'editable-value' )[ 0 ], |
4334 | 4503 | ret; |
4335 | 4504 | if( elmValue ){ |
4336 | - ret = new InputTextClass( data, elmWrapper, elmValue, onUpdate, validater ); | |
4505 | + ret = new TextInputClass( data, elmWrapper, elmValue, onUpdate, validater ); | |
4337 | 4506 | data.itemList.push( ret ); |
4338 | 4507 | return ret; |
4339 | 4508 | }; |
@@ -4345,10 +4514,15 @@ var UI = ( function(){ | ||
4345 | 4514 | data.itemList.push( ret ); |
4346 | 4515 | return ret; |
4347 | 4516 | }, |
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 | + }; | |
4352 | 4526 | return ret; |
4353 | 4527 | }, |
4354 | 4528 | createCombobox : function( elm, onUpdate, optionList ){ |
@@ -4369,17 +4543,24 @@ var UI = ( function(){ | ||
4369 | 4543 | visible : function( v ){ |
4370 | 4544 | var data = UIGroupPrivateData.get( this ); |
4371 | 4545 | 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 ); | |
4377 | 4548 | }; |
4549 | + data.visible = v; | |
4550 | + data.node.disabled( !( data.enabled && v ) ); | |
4378 | 4551 | }; |
4379 | 4552 | return data.visible; |
4380 | 4553 | }, |
4381 | 4554 | 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; | |
4383 | 4564 | }, |
4384 | 4565 | destroy : function(){ |
4385 | 4566 | var data = UIGroupPrivateData.get( this ), |
@@ -4440,8 +4621,8 @@ var UI = ( function(){ | ||
4440 | 4621 | keyCode === 13 && currentItem instanceof ComboBoxClass && OptionControl.onEnter(); |
4441 | 4622 | keyCode === 13 && tabShift( index, 1 ); |
4442 | 4623 | currentItem && currentItem.blur( keyCode ); |
4624 | + return false; | |
4443 | 4625 | }; |
4444 | - return false; | |
4445 | 4626 | }; |
4446 | 4627 | |
4447 | 4628 | function tabShift( index, way ){ |
@@ -4477,6 +4658,8 @@ var UI = ( function(){ | ||
4477 | 4658 | windowW = w; |
4478 | 4659 | windowH = h; |
4479 | 4660 | currentItem instanceof ComboBoxClass && OptionControl.onWindowResize( w, h ); |
4661 | + currentItem instanceof TextInputClass && TextInputManager.onWindowResize( w, h ); | |
4662 | + currentItem instanceof FileInputClass && FileInputManager.onWindowResize( w, h ); | |
4480 | 4663 | }, |
4481 | 4664 | onCurrentApplicationChange: function( _apiuser ){ |
4482 | 4665 | currentList = UI_LIST[ _apiuser.getUID() ]; |