/*
* pettanR peta.apps.js
- * version 0.5.32
+ * version 0.5.33
*
* author:
* itozyun
}, false, true, 'Panel Editor', 'paneleditor', null, '#2D89F0' );
var FormApplicationHelper = function( app ){
- app.isUploading = false;
- app.elmProgress = null;
- app.elmUploader = null;
- app.elmScript = null;
- app.elmIframe = null;
- app.elmForm = null;
+ app.isUploading = false;
+ app.elmProgress = null;
+ app.elmUploader = null;
+ app.elmScript = null;
+ app.elmIframeWrap = null;
+ app.elmIframe = null;
+ app.elmForm = null;
app.fetchScript = function(){
app.elmProgress = document.getElementById( app.elmProgressID );
};
};
+ app.elmIframeWrap = document.getElementById( app.iframeWrapID );
app.elmScript = document.createElement( 'script' );
document.body.appendChild( app.elmScript );
app.elmScript.type = 'text\/javascript';
app.detectForm = function(){
app.elmForm = app.elmUploader.getElementsByTagName( 'form' )[ 0 ];
if( !app.elmForm ) return;
-
app.removeTimer( app.detectForm );
+
Util.createIframe( 'targetFrame', app.onCreateIframe );
app.elmProgress.innerHTML = 'create iframe';
-
delete app.detectForm;
};
app.onCreateIframe = function( _iframe ){
- app.elmUploader.appendChild( _iframe );
+ app.elmIframeWrap.appendChild( _iframe );
+ _iframe.className = 'form-iframe';
app.elmIframe = _iframe;
app.elmForm.target = _iframe.name;
app.elmProgress.innerHTML = '';
app.elmIframe = null;
app.elmProgress.innerHTML = 'success!';
app.isUploading = false;
- app.submitSuccess && app.submitSuccess();
+ // app.submitSuccess && app.submitSuccess();
delete app.onIframeUpdate;
};
app.destroyHelper = function(){
+ app.elmUploader.parentNode.removeChild( app.elmUploader );
app = null;
};
};
_select.selectedIndex = comboboxEditable.selectIndex();
} */;
};
+ buttonSubmit.enabled( false );
app.submit();
};
function clickCancel(){
'<div id="comic-console-cancel-button" class="button console-cancel-button">cancel</div>',
'</div>',
'<div id="comic-console-progress" class="console-progress"> </div>',
+ '<div id="comic-console-iframe-container"></div>',
'</div>'
].join( '' );
};
this.elmProgressID = 'comic-console-progress';
this.elmUploaderID = 'newcomic';
+ this.iframeWrapID = 'comic-console-iframe-container';
this.elmIframeName = 'targetFrameCreateComic'
this.scriptSrc = pettanr.CONST.CREATE_COMIC_JS;
this.hideUploader = true;
this.onPaneResize = function( w, h ){
windowW = w;
windowH = h;
- //app.rootElement.style.cssText = [
- // 'left:', Math.floor( ( _w - app.rootElement.offsetWidth ) /2 ), 'px;',
- // 'top:', Math.floor( ( _h- app.rootElement.offsetHeight ) /2 ), 'px;'
- //].join( '' );
node.update( w / 2 - node.width() / 2, h / 2 - node.height() / 2 );
};
this.onClose = function(){
};
inputTitle.focus();
- //node.mesure();
+ node.mesure();
app.onPaneResize( windowW, windowH );
delete app.onFormReady;
if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
if( elmFile.value.length === 0 ) return false;
app.submit();
+ buttonSubmit.enabled( false );
return false;
};
function clickCancel(){
'<div id="upload-console-cancel-button" class="button console-cancel-button">cancel</div>',
'</div>',
'<div id="upload-console-progress" class="console-progress"> </div>',
+ '<div id="upload-console-iframe-container"></div>',
'</div>'
].join( '' );
};
this.elmProgressID = 'upload-console-progress';
this.elmUploaderID = 'uploader';
+ this.iframeWrapID = 'upload-console-iframe-container';
this.elmIframeName = 'targetFrameUpload';
this.scriptSrc = pettanr.CONST.UPLOAD_PICTURE_JS;
this.hideUploader = false;
_input.style.display = 'none';
};
};
- app.onPaneResize( windowW, windowH );
+
app.createUIForm( nodeForm, elmForm );
node.mesure();
node.mesureChildren();
+ app.onPaneResize( windowW, windowH );
delete app.onFormReady;
};
this.submitError = function(){
if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
inputUpdate();
app.submit();
+ buttonSubmit.enabled( false );
return false;
};
function clickCancel(){
'</div>',
'<div id="artist-console-progress" class="console-progress"> </div>',
'<div id="register" style="display:none;"></div>',
+ '<div id="artist-console-iframe-container"></div>',
'</div>'
].join( '' );
};
this.elmProgressID = 'artist-console-progress';
this.elmUploaderID = 'register';
+ this.iframeWrapID = 'artist-console-iframe-container';
this.elmIframeName = 'targetFrameArtistRegister'
this.scriptSrc = pettanr.CONST.REGISTER_ARTIST_JS;
this.hideUploader = false;
var PanelConsole = gOS.registerApplication( function(){
var windowW, windowH,
eventRoot, node, inputData,
- comboboxPublish, buttonPost, buttonClose,
+ comboboxPublish, buttonSubmit, buttonClose,
elmInput,
app = this,
model = null;
if( !app.elmForm || !app.elmIframe || app.isUploading === true ) return false;
inputData.value();
app.submit();
+ buttonSubmit.enabled( false );
return false;
}
'</div>',
'<div id="panel-console-progress" class="console-progress"> </div>',
'<div id="newpanel" style="display:none;"></div>',
+ '<div id="panel-console-iframe-container"></div>',
'</div>'
].join( '' );
};
this.elmProgressID = 'panel-console-progress';
this.elmUploaderID = 'newpanel';
- this.elmIframeName = 'targetFrameNewPanel'
+ this.iframeWrapID = 'panel-console-iframe-container';
+ this.elmIframeName = 'targetFrameNewPanel';
this.scriptSrc = pettanr.CONST.CREATE_PANEL_JS;
this.hideUploader = false;
FormApplicationHelper( this );
- this.onFormReady = function(){
- var _inputList = app.elmForm.getElementsByTagName( 'input' ),
- _input;
- for( var i = _inputList.length; i; ){
- _input = _inputList[ --i ];
- if( _input.type === 'submit' ){
- _input.style.display = 'none';
- };
- if( _input.name === 'json' ){
- elmInput = _input;
- publishUpdate();
- };
- };
-
- node.mesure();
- app.onPaneResize( windowW, windowH );
- node.mesureChildren();
-
- delete app.onFormReady;
- };
- this.submitError = function(){
- app.addTimer( clickCancel , 5000, true );
- };
- this.submitSuccess = function(){
- app.addTimer( clickCancel , 5000, true );
- };
+
this.onOpen = function( w, h, _model ){
node = eventRoot.createNode( app.rootElement, true, true );
var ui = app.createUIGroup( node ),
elm.parentNode.removeChild( elm );
};
- buttonPost = ui.createButton( document.getElementById( 'panel-console-post-button' ), clickOK );
+ buttonSubmit = ui.createButton( document.getElementById( 'panel-console-post-button' ), clickOK );
buttonClose = ui.createButton( document.getElementById( 'panel-console-cancel-button' ), clickCancel );
app.onPaneResize( w, h );
this.onPaneResize = function( w, h ){
windowW = w;
windowH = h;
- //app.rootElement.style.cssText = [
- // 'left:', Math.floor( ( _w - app.rootElement.offsetWidth ) /2 ), 'px;',
- // 'top:', Math.floor( ( _h- app.rootElement.offsetHeight ) /2 ), 'px;'
- //].join( '' );
node.update( w / 2 - node.width() / 2, h / 2 - node.height() / 2 );
};
this.onClose = function(){
app.destroyHelper();
model && model.destroy();
- app = model = comboboxPublish = buttonPost = buttonClose = elmInput = null;
+ app = model = comboboxPublish = buttonSubmit = buttonClose = elmInput = null;
+ };
+ this.onFormReady = function(){
+ var _inputList = app.elmForm.getElementsByTagName( 'input' ),
+ _input;
+ for( var i = _inputList.length; i; ){
+ _input = _inputList[ --i ];
+ if( _input.type === 'submit' ){
+ _input.style.display = 'none';
+ };
+ if( _input.name === 'json' ){
+ elmInput = _input;
+ publishUpdate();
+ };
+ };
+
+ node.mesure();
+ node.mesureChildren();
+ app.onPaneResize( windowW, windowH );
+
+ delete app.onFormReady;
+ };
+ this.submitError = function(){
+ app.addTimer( clickCancel , 5000, true );
+ };
+ this.submitSuccess = function(){
+ app.addTimer( clickCancel , 5000, true );
};
}, true, true, 'Panel Console', 'panelConsole', null, '#603CBA' );
var elmOutputArea,
eventRoot, node,
comboboxFormat, inputOption,
- buttonPost, buttonClose,
+ buttonSubmit, buttonClose,
windowW, windowH,
timing = 0,
comicID, panelID, panelTimming, panelW, panelH, borderSize, panelElementArray,
function formatUpdate(){
var i = comboboxFormat.selectIndex(),
text = 'sorry...';
- // buttonPost.enabled( false );
+ // buttonSubmit.enabled( false );
if( i === 0 ){
text = model.getJsonPostString();
- // buttonPost.enabled( true );
+ // buttonSubmit.enabled( true );
} else
if( i === 1 ){
text = model.getJsonGetString();
comboboxFormat.createOption( FORMAT_LIST.shift(), null, i === 0 );
};
inputOption = ui.createInputText( document.getElementById( 'output-console-option' ), null );
- // buttonPost = ui.createButton( document.getElementById( 'output-console-post-button' ), clickPost );
+ // buttonSubmit = ui.createButton( document.getElementById( 'output-console-post-button' ), clickPost );
buttonClose = ui.createButton( document.getElementById( 'output-console-close-button' ), clickClose );
app.onPaneResize( _w, _h );
this.onClose = function(){
elmOutputArea.value = '';
model.destroy();
- elmOutputArea = comboboxFormat = inputOption = buttonPost = buttonClose = panelElementArray = instance = model = null;
+ elmOutputArea = comboboxFormat = inputOption = buttonSubmit = buttonClose = panelElementArray = instance = model = null;
};
}, true, false, 'Output Console', 'outputConsole', null, '#2D89F0' );