/*\r
* pettanR work.js\r
- * version 0.4.24\r
+ * version 0.4.25\r
* \r
* author:\r
* itozyun\r
jqStage, jqBar;\r
ELM_BAR.style.top = ( -barH) +'px';\r
\r
- var MenubarSelectionClass = function( container, title, shortcut, visible, separateAfter){\r
+ var MenubarSelectionClass = function( container, title, shortcut, visible, separateAfter ){\r
var ELM_WRAPPER = ELM_SELECTION_ORIGN.cloneNode( true),\r
ELM_TITLE = ELM_WRAPPER.getElementsByTagName( 'span')[ 0],\r
elmShortcut = ELM_WRAPPER.getElementsByTagName( 'kbd')[ 0];\r
elmWrap = document.getElementById( 'comic-console-wrapper' ),\r
elmHeader = document.getElementById( 'comic-console-header' ),\r
elmProgress = document.getElementById( 'comic-console-progress' ),\r
- inputTitle, inputW, inputH, inputVisible, inputEditable,\r
+ inputTitle, inputW, inputH,\r
+ comboboxVisible, comboboxEditable,\r
+ buttonSubmit, buttonCancel,\r
elmUploader = null,\r
elmScript = null,\r
elmIframe = null,\r
_name = _select.name;\r
_optionList = _select.getElementsByTagName( 'option' )\r
if( _name === 'comic[visible]'){\r
- _select.selectedIndex = 1;\r
+ _select.selectedIndex = comboboxVisible.selectIndex;\r
} else\r
if( _name === 'comic[editable]'){\r
- _select.selectedIndex = 0;\r
+ _select.selectedIndex = comboboxEditable.selectIndex;\r
}\r
}\r
try {\r
}\r
function detectForm(){\r
elmForm = elmUploader.getElementsByTagName( 'form' )[ 0 ];\r
- if( elmForm){\r
+ if( elmForm ){\r
+ var selectList = elmForm.getElementsByTagName( 'select' ),\r
+ select,\r
+ j, m,\r
+ optionList, option;\r
+ for( var i=0, l=selectList.length; i<l; ++i ){\r
+ select = selectList[ i ];\r
+ optionList = select.getElementsByTagName( 'option' );\r
+ for( j=0, m=optionList.length; j<m; ++j ){\r
+ option = optionList[ j ];\r
+ if( select.name === 'comic[visible]' ){\r
+ comboboxVisible.createOption( option.innerHTML, option.value, option.selected );\r
+ } else\r
+ if( select.name === 'comic[editable]' ){\r
+ comboboxEditable.createOption( option.innerHTML, option.value, option.selected );\r
+ }\r
+ }\r
+ }\r
+ \r
window.clearInterval( timer);\r
timer = null;\r
pettanr.util.createIframe( 'targetFrameCreateComic', onCreateIframe );\r
this.MIN_HEIGHT = 320;\r
this.init = function(){\r
jqWrap = $( '#comic-console-wrapper').hide();\r
- $( '#comic-console-post-button').click( clickOK );\r
- $( '#comic-console-cancel-button').click( clickCancel );\r
\r
- var CREATER = pettanr.form.createInputText;//pettanr.key.createEditableText;\r
- inputTitle = CREATER( document.getElementById( 'comic-console-title'), null, ID);\r
- inputW = CREATER( document.getElementById( 'comic-console-width'), null, ID);\r
- inputH = CREATER( document.getElementById( 'comic-console-height'), null, ID);\r
- inputVisible = CREATER( document.getElementById( 'comic-console-visible'), null, ID);\r
- inputEditable = CREATER( document.getElementById( 'comic-console-editable'), null, ID);\r
+ inputTitle = pettanr.form.createInputText( document.getElementById( 'comic-console-title'), null, ID);\r
+ inputW = pettanr.form.createInputText( document.getElementById( 'comic-console-width'), null, ID);\r
+ inputH = pettanr.form.createInputText( document.getElementById( 'comic-console-height'), null, ID);\r
+ comboboxVisible = pettanr.form.createCombobox( document.getElementById( 'comic-console-visible'), null, ID);\r
+ comboboxEditable = pettanr.form.createCombobox( document.getElementById( 'comic-console-editable'), null, ID);\r
+ buttonSubmit = pettanr.form.createButton( document.getElementById( 'comic-console-post-button'), clickOK, ID);\r
+ buttonCancel = pettanr.form.createButton( document.getElementById( 'comic-console-cancel-button'), clickCancel, ID);\r
\r
delete instance.init;\r
}\r
\r
jqWrap.show();\r
\r
- inputTitle.start();\r
+ inputTitle.focus();\r
\r
elmUploader = document.createElement( 'div' );\r
elmUploader.id = 'newcomic';\r
var elmScript = document.createElement( 'script');\r
elmScript.type = 'text\/javascript';\r
elmScript.src = pettanr.CONST.CREATE_COMIC_JS;\r
- elmWrap.appendChild( elmScript);\r
+ elmWrap.appendChild( elmScript );\r
\r
elmProgress.innerHTML = 'loading form.';\r
\r
isUploading = false,\r
instance = this;\r
/*\r
- * upload ボタンが押されたらまず iframe をつくる.
+ * upload ボタンが押されたらまず iframe をつくる.\r
*/\r
function clickOK(){\r
if( !elmForm || !elmIframe || isUploading === true ) return false;\r
return false;\r
}\r
/*\r
- * form の target に iframe を指定したのち submit();
+ * form の target に iframe を指定したのち submit();\r
*/\r
function submit(){\r
try {\r
elmProgress.innerHTML = 'uploading..';\r
}\r
/*\r
- * ie の 場合、readyState をチェック.
+ * ie の 場合、readyState をチェック.\r
*/\r
function detectIframe(){\r
if ( elmIframe.readyState === 'complete') {\r
instance.onPaneResize( windowW, windowH );\r
}\r
/*\r
- *
+ * \r
*/\r
function clickCancel(){\r
if( isUploading === true) return false;\r
this.onOpen = function( w, h){\r
instance.init && instance.init();\r
/*\r
- * ie 6, 7 で fadeIn 中の要素に appendChild すると クラッシュするので、document.body に追加.
+ * ie 6, 7 で fadeIn 中の要素に appendChild すると クラッシュするので、document.body に追加.\r
*/ \r
elmScript = document.createElement( 'script');\r
elmScript.type = 'text\/javascript';\r