\'>メール\n'); // write("投稿者メール\n"); write('HP\n'); write('認証'+safe+'認証'); write('題名\n'); } else { write('作成者メール\n'); write('題名\n'); } write('\n'); write('
\n'); write( document.frames[0].document.body.innerHTML.replace(/
/gi, '\n') ); write('
\n'); write('
\n'); write('
\n'); if( src == "" ) { //書き込み write('\n'); } else { write('\n'); } write('\n'); if( src == "" ) { //書き込み write('\n'); write('添付\n'); write('Pass' ); write('クッキー編集枠 \n'); write('   \n'); } else { write('Pass' ); write('\n'); } write('\n'); write('\n'); write('\n'); write('\n'); write('\n'); write('\n'); write('\n'); if( src == "" ) { //書き込み write('\n'); } else { //vml保存 write('\n'); } write('\n'); write('
\n'); write('\n'); } wp.document.close(); wp.focus(); } //----------------------------------------------------------------------------- function getCookie(key, tmp1, tmp2, xx1, xx2, xx3) { tmp1 = " " + document.cookie + ";"; xx1 = xx2 = 0; len = tmp1.length; while (xx1 < len) { xx2 = tmp1.indexOf(";", xx1); tmp2 = tmp1.substring(xx1 + 1, xx2); xx3 = tmp2.indexOf("="); if (tmp2.substring(0, xx3) == key) { return(unescape(tmp2.substring(xx3 + 1, xx2 - xx1 - 1))); } xx1 = xx2 + 1; } return(""); } function setCookie( key, val, tmp ) { tmp = key + "=" + escape(val) + "; "; tmp += "path=" + location.pathname + "; "; document.cookie = tmp; } //----------------------------------------------------------------------------- function exit_yesno() { //終了確認 if( confirm( "終了して掲示板に戻りますか?" ) ) { window.location.href='http://bomber.xps.jp/cgi-bin/fbs/'; } } //----------------------------------------------------------------------------- function allClear( Pal ) { //全消去 if( confirm( "全部消去してよろしいですか?" ) ) { var size_x = eval( document.getElementById( 'size_x' ).value )+2; var size_y = eval( document.getElementById( 'size_y' ).value )+2; document.getElementById( 'history' ).innerHTML = ''; document.frames[0].document.body.innerHTML = ''; layer.innerHTML = ''; layer_num = 0; layer_count = 0; layer_act = 0; layer_new(); layer_active( 0 ); document.frames[0].pNumber = 0; if( Pal ) { if( parent.document.forms[0].grade.checked ) { document.frames[0].document.body.innerHTML = '' + document.frames[0].document.body.innerHTML; } else { document.frames[0].document.body.innerHTML = '' + document.frames[0].document.body.innerHTML; } } } } //----------------------------------------------------------------------------- SelectPaletName = ''; //選択中のパレットネーム //----------------------------------------------------------------------------- function activePickupColor() { //picColクラスにonclickイベントを設定する var cellen = document.getElementsByTagName( 'td' ); for( var i = 0; i < cellen.length; i ++ ) { if( cellen[i].className == 'picCol' ) { cellen[i].onclick = pickupColor; //cellen[i].onmousedown = pickupColor; } } } //----------------------------------------------------------------------------- function paletSelect( Pal ) { //パレットの選択準備 if( SelectPaletName != '' ){ return; } document.getElementById( Pal + '_cel' ).style.backgroundColor = '#FFFFFF'; document.getElementById( Pal + '_cel' ).innerHTML = '

選択'; SelectPaletName = Pal; } //----------------------------------------------------------------------------- function pickupColor() { //パレット選択実行 if( SelectPaletName == '' ) { if( document.forms[0].pal_act[0].checked ) { SelectPaletName = document.forms[0].pal_act[0].value; } else { SelectPaletName = document.forms[0].pal_act[1].value; } } else { if( SelectPaletName == "color0" ) { palet_rep( 0, this.bgColor ); } else if( SelectPaletName == "color1" ) { palet_rep( 1, this.bgColor ); } } var picCol = (this.childNodes.length > 0)? '': this.bgColor; var dspCol = (this.childNodes.length > 0)? '

透明': ''; document.forms[0].elements[SelectPaletName].value = picCol; document.getElementById( SelectPaletName + '_cel' ).innerHTML = dspCol; document.getElementById( SelectPaletName + '_cel' ).style.backgroundColor = this.bgColor; document.getElementById( SelectPaletName + '_code' ).value = this.bgColor; grade_sample.color = document.getElementById( 'color1_code' ).value; grade_sample.color2 = document.getElementById( 'color2_code' ).value; grade_sample_1.color = document.getElementById( 'color1_1_code' ).value; grade_sample_1.color2 = document.getElementById( 'color2_1_code' ).value; if( SelectPaletName == "color3" || SelectPaletName == "color4" || SelectPaletName == "color3_1" || SelectPaletName == "color4_1" ) { grad_rep(); } SelectPaletName = ''; } //----------------------------------------------------------------------------- function paletUpdate( Num, Pal ) { //パレット更新 switch( Num ) { case 0: SelectPaletName = "color0"; palet_rep( 0, Pal ); break; case 1: SelectPaletName = "color1"; palet_rep( 1, Pal ); break; case 2: SelectPaletName = "color2"; break; case 3: SelectPaletName = "color0_1"; break; case 4: SelectPaletName = "color1_1"; break; case 5: SelectPaletName = "color2_1"; break; } document.forms[0].elements[SelectPaletName].value = Pal; document.getElementById(SelectPaletName + '_cel').innerHTML = ''; document.getElementById(SelectPaletName + '_cel').style.backgroundColor = Pal; if( Num < 3 ) { //プライマリカラー grade_sample.color = document.getElementById( 'color1_code' ).value; grade_sample.color2 = document.getElementById( 'color2_code' ).value; } else { //セカンドカラー grade_sample_1.color = document.getElementById( 'color1_1_code' ).value; grade_sample_1.color2 = document.getElementById( 'color2_1_code' ).value; } SelectPaletName = ''; } //----------------------------------------------------------------------------- function palet_cross() { //パレットの切替 var tmp; tmp = document.getElementById('grade').checked; document.getElementById('grade').checked = document.getElementById('grade_1').checked; document.getElementById('grade_1').checked = tmp; tmp = document.getElementById('grade_angle').value; document.getElementById('grade_angle').value = document.getElementById('grade_angle_1').value; document.getElementById('grade_angle_1').value = tmp; tmp = document.getElementById('grade_focus').value; document.getElementById('grade_focus').value = document.getElementById('grade_focus_1').value; document.getElementById('grade_focus_1').value = tmp; tmp = ""+grade_sample.color; grade_sample.color = grade_sample_1.color; grade_sample_1.color = tmp; tmp = ""+grade_sample.color2; grade_sample.color2 = grade_sample_1.color2; grade_sample_1.color2 = tmp; tmp = grade_sample.angle; grade_sample.angle = grade_sample_1.angle; grade_sample_1.angle = tmp; tmp = grade_sample.focus; grade_sample.focus = grade_sample_1.focus; grade_sample_1.focus = tmp; tmp = document.getElementById('color0_cel').style.backgroundColor; document.getElementById('color0_cel').style.backgroundColor = document.getElementById('color0_1_cel').style.backgroundColor; document.getElementById('color0_1_cel').style.backgroundColor = tmp; tmp = document.getElementById('color1_cel').style.backgroundColor; document.getElementById('color1_cel').style.backgroundColor = document.getElementById('color1_1_cel').style.backgroundColor; document.getElementById('color1_1_cel').style.backgroundColor = tmp; tmp = document.getElementById('color2_cel').style.backgroundColor; document.getElementById('color2_cel').style.backgroundColor = document.getElementById('color2_1_cel').style.backgroundColor; document.getElementById('color2_1_cel').style.backgroundColor = tmp; tmp = document.getElementById('color0_code').value; document.getElementById('color0_code').value = document.getElementById('color0_1_code').value; document.getElementById('color0_1_code').value = tmp; tmp = document.getElementById('color1_code').value; document.getElementById('color1_code').value = document.getElementById('color1_1_code').value; document.getElementById('color1_1_code').value = tmp; tmp = document.getElementById('color2_code').value; document.getElementById('color2_code').value = document.getElementById('color2_1_code').value; document.getElementById('color2_1_code').value = tmp; tmp = document.forms[0].elements['color0'].value; document.forms[0].elements['color0'].value = document.forms[0].elements['color0_1'].value; document.forms[0].elements['color0_1'].value = tmp; tmp = document.forms[0].elements['color1'].value; document.forms[0].elements['color1'].value = document.forms[0].elements['color1_1'].value; document.forms[0].elements['color1_1'].value = tmp; tmp = document.forms[0].elements['color2'].value; document.forms[0].elements['color2'].value = document.forms[0].elements['color2_1'].value; document.forms[0].elements['color2_1'].value = tmp; var tmpstr = '

透明'; tmp = (document.getElementById('color0_cel').childNodes.length > 0)? tmpstr: ''; document.getElementById('color0_cel').innerHTML = document.getElementById('color0_1_cel').innerHTML; document.getElementById('color0_1_cel').innerHTML = tmp; tmp = (document.getElementById('color1_cel').childNodes.length > 0)? tmpstr: ''; document.getElementById('color1_cel').innerHTML = document.getElementById('color1_1_cel').innerHTML; document.getElementById('color1_1_cel').innerHTML = tmp; tmp = (document.getElementById('color2_cel').childNodes.length > 0)? tmpstr: ''; document.getElementById('color2_cel').innerHTML = document.getElementById('color2_1_cel').innerHTML; document.getElementById('color2_1_cel').innerHTML = tmp; } //----------------------------------------------------------------------------- function sizeUpdate() { //キャンバスサイズ更新 document.getElementById( 'field' ).width = 5+Math.round( document.getElementById( 'size_x' ).value ); document.getElementById( 'field' ).height = 5+Math.round( document.getElementById( 'size_y' ).value ); } //----------------------------------------------------------------------------- function undo() { //戻す if( document.frames[0].pNumber > 0 ) { if( document.getElementById( 'H' + document.frames[0].pNumber ) ) { document.getElementById( 'H' + document.frames[0].pNumber ).removeNode( true ); document.frames[0].document.getElementById( 'nr' + document.frames[0].pNumber ).removeNode( true ); } document.frames[0].pNumber --; } } //----------------------------------------------------------------------------- function grid_view( flg ) { //グリッド表示切り替え if( flg ) { gr = Math.round( document.forms[0].grids.value ); sX = document.getElementById( 'size_x' ).value; sY = document.getElementById( 'size_y' ).value; no = 0; while( no <= sX ) { document.frames[0].document.getElementById( 'Tool' ).insertAdjacentHTML('beforeend', ('')); no += gr; } no = 0; while( no <= sY ) { document.frames[0].document.getElementById( 'Tool' ).insertAdjacentHTML('beforeend', ('')); no += gr; } } else { document.frames[0].document.getElementById( 'Tool' ).innerHTML = ""; } } //----------------------------------------------------------------------------- //レイヤー管理 var layer_num = 1; //レイヤー管理番号 var layer_count = 1; //レイヤー数 var layer_act = 0; //アクティブなレイヤー番号 function layer_active( Num ) { //アクティブ if( document.getElementById( 'L'+layer_act ) ) { document.getElementById( 'L'+layer_act ).style.backgroundColor = ""; } layer_act = Num; document.getElementById( 'L'+Num ).style.backgroundColor = "#ff7799"; for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { //履歴表示更新 if( document.getElementById( 'H'+lp ) ) { if( document.getElementById( 'H'+lp ).lay == layer_act ) { document.getElementById( 'H'+lp ).style.display = ''; } else { document.getElementById( 'H'+lp ).style.display = 'none'; } } } } //----------------------------------------------------------------------------- function layer_new() { //作成 tmp = layer_num.toString(10); while( tmp.length < 2 ) { tmp = '0'+tmp; } layer.innerHTML = '
 '+tmp+' No Name
' + layer.innerHTML; if( document.frames[0].document.getElementById( 'Tool' ) ) { //ツール用レイヤー tmp = document.frames[0].document.getElementById( 'Tool' ).innerHTML document.frames[0].document.getElementById( 'Tool' ).removeNode( true ); } document.frames[0].document.body.innerHTML = document.frames[0].document.body.innerHTML + '\n\n'; //idsは不変キー if( document.forms[0].gridview.checked ) { grid_view( true ); }else{ grid_view( false ); } layer_num ++; layer_count ++; } //----------------------------------------------------------------------------- function layer_delete( Num, force ) { //削除 if( layer_count <= 1 ) return; if( Num == '' ) Num = layer_act; if( !force ) { if( !confirm( "カレントレイヤー("+Num+"."+document.getElementById( 'LN' + Num ).innerHTML+")を削除します。" ) ) { return; } } document.getElementById( 'L' + Num ).removeNode( true ); document.frames[0].document.getElementById( 'L' + Num ).removeNode( true ); layer_count --; history_layer_set( Num, Num ); //履歴も削除する if( !document.forms[0].elements['C'+layer_act] ) { for( var lp = 0; lp < layer_num; lp ++ ) { if( document.forms[0].elements['C'+lp] ) { layer_active( lp ); return; } } } } //----------------------------------------------------------------------------- function layer_rename( str ) { //名称変更 var Cur = document.getElementById( 'LN' + layer_act ); if( str == "" ) { var str = prompt( "レイヤーの名称を入力して下さい.", Cur.innerHTML ); } if( str != null ) { Cur.innerHTML = str; } } //----------------------------------------------------------------------------- function layer_status_clear() { //ステータス初期化 var Cur = document.frames[0].document.getElementById( 'L'+layer_act ); Cur.style.left = 0; Cur.style.top = 0; Cur.style.width = 100; Cur.style.height = 100; Cur.style.rotation = 0; } //----------------------------------------------------------------------------- function layer_all_on() { //アクティブ以外全て表示 for( var lp = 0; lp < layer_num; lp ++ ) { if( lp == layer_act ) continue; if( document.forms[0].elements['C'+lp] ) { document.forms[0].elements['C'+lp].checked = true; document.frames[0].document.getElementById( 'L'+lp ).style.display = ''; } } } //----------------------------------------------------------------------------- function layer_all_off() { //アクティブ以外非表示 for( var lp = 0; lp < layer_num; lp ++ ) { if( lp == layer_act ) continue; if( document.forms[0].elements['C'+lp] ) { document.forms[0].elements['C'+lp].checked = false; document.frames[0].document.getElementById( 'L'+lp ).style.display = 'none'; } } } //----------------------------------------------------------------------------- function layer_on_off( Num ) { //表示/非表示 if( document.forms[0].elements['C'+Num].checked ) { document.frames[0].document.getElementById( 'L'+Num ).style.display = ''; } else { document.frames[0].document.getElementById( 'L'+Num ).style.display = 'none'; } } //----------------------------------------------------------------------------- function layer_updown( vct ) { //0:上 1:下に移動 var flg = 0, st, stp; if( vct == 0 ) { st = 0; stp = 1; } else { st = layer_num-1; stp = -1; } for( var lp = st; lp < layer_num && lp >= 0; lp = lp+stp ) { if( lp == layer_act ) { flg = 1; if( document.forms[0].elements['C'+lp] ) { org = lp; history_layer_set( lp, layer_num ); } } else if( flg == 1 ) { if( document.forms[0].elements['C'+lp] ) { tmp = document.frames[0].document.getElementById( 'L'+org ).innerHTML; document.frames[0].document.getElementById( 'L'+org ).innerHTML = document.frames[0].document.getElementById( 'L'+lp ).innerHTML; document.frames[0].document.getElementById( 'L'+lp ).innerHTML = tmp; tmp = document.frames[0].document.getElementById( 'L'+org ).ids; //不変キーの交換 document.frames[0].document.getElementById( 'L'+org ).ids = document.frames[0].document.getElementById( 'L'+lp ).ids; document.frames[0].document.getElementById( 'L'+lp ).ids = tmp; history_layer_set( lp, org ); history_layer_set( layer_num, lp ); tmp = document.getElementById( 'LN'+org ).innerHTML; document.getElementById( 'LN'+org ).innerHTML = document.getElementById( 'LN'+lp ).innerHTML; document.getElementById( 'LN'+lp ).innerHTML = tmp; layer_active( lp ); return; } } } } //----------------------------------------------------------------------------- function layer_marge() { //纏める var upper = "", down = ""; if( !confirm( "カレントレイヤーに表示中のレイヤーを纏めます。" ) ) { return; } for( var lp = 0; lp < layer_num; lp ++ ) { if( lp == layer_act ) continue; if( document.forms[0].elements['C'+lp] ) { if( document.forms[0].elements['C'+lp].checked ) { if( lp < layer_act ) { down = down + document.frames[0].document.getElementById( 'L'+lp ).innerHTML; } else { upper = upper + document.frames[0].document.getElementById( 'L'+lp ).innerHTML; } history_layer_set( lp, layer_act ); //履歴の管理レイヤーを変更する layer_delete( lp.toString(10), true ); //レイヤーを削除する } } } document.frames[0].document.getElementById( 'L'+layer_act ).innerHTML = down + document.frames[0].document.getElementById( 'L'+layer_act ).innerHTML + upper; } //----------------------------------------------------------------------------- //履歴管理 function history_on() { //履歴全表示 for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.getElementById( 'H' + lp ) ) { document.getElementById( 'H' + lp ).style.display = ''; } } } //----------------------------------------------------------------------------- function parts_source_code() { //選択した履歴ソースコード var src = ''; for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.forms[0].elements['HC'+lp] ) { if( document.forms[0].elements['HC'+lp].checked ) { document.frames[0].document.getElementById('nr' + lp).lay = document.getElementById( 'H'+lp ).lay; //レイヤー情報を内包しとく src += document.frames[0].document.getElementById('nr' + lp).outerHTML; } } } while( src.indexOf( "
", 0 ) >= 0 ) { src = src.replace( "
", "" ); } while( src.indexOf( "", 0 ) >= 0 ) { src = src.replace( "", "" ); } while( src.indexOf( '', 0 ) >= 0 ) { src = src.replace( '', "" ); } lp = src.indexOf( '= 0 ) { //Tool以降を削除 src = src.substring( 0, lp-1 ); } return src; } //----------------------------------------------------------------------------- function parts_load() { //パーツ一覧 window.open( 'fbs.cgi?prc=vml_parts', '', 'height=700,width=600,scrollbars=yes' ); } //----------------------------------------------------------------------------- function chip_load() { //チップ一覧 window.open( 'fbs.cgi?prc=chip_list', '', 'height=700,width=600,scrollbars=yes' ); } //----------------------------------------------------------------------------- function parts_save() { //選択した履歴を保存 var src = parts_source_code(); if( src == "" ) { alert( "保存するパーツを選択してください。" ); exit(); } save( src ); } //----------------------------------------------------------------------------- function parts_source() { //選択した履歴のソースを表示 var src = parts_source_code(); debug.innerHTML = ""; menu_open('info'); document.forms[0].elements['partsa'].focus(); document.forms[0].elements['partsa'].select(); } //----------------------------------------------------------------------------- var source_edit_no = 0; function source_edit() { //選択した履歴のソースを編集モード var src = ''; for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.forms[0].elements['HC'+lp] ) { if( document.forms[0].elements['HC'+lp].checked ) { src = document.frames[0].document.getElementById('nr' + lp).outerHTML; source_edit_no = lp; break; } } } while( src.indexOf( "
", 0 ) >= 0 ) { src = src.replace( "
", "" ); } while( src.indexOf( "", 0 ) >= 0 ) { src = src.replace( "", "" ); } while( src.indexOf( '', 0 ) >= 0 ) { src = src.replace( '', "" ); } debug.innerHTML = ""; debug.innerHTML += ''; menu_open('info'); document.forms[0].elements['partsa'].focus(); } //----------------------------------------------------------------------------- function source_edit_save() { //選択した履歴のソース編集を確定 var src = ''; src = document.forms[0].elements['partsa'].value; lp = src.indexOf( "\n", 0 ); while( lp >= 0 ) { src = src.substring( 0, lp ) + "
" + src.substring( lp+1, src.length ); lp = src.indexOf( "\n", 0 ); } document.frames[0].document.getElementById('nr' + source_edit_no).outerHTML = src; debug.innerHTML = ""; menu_close('info'); } //----------------------------------------------------------------------------- var BackNr; var BackHs; function history_cut() { //選択した履歴をカット if( !confirm( "選択した履歴を切り取ります。前回切り取ったデータは失われます。" ) ) { return; } BackNr = ''; BackHs = ''; for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.forms[0].elements['HC'+lp] ) { if( document.forms[0].elements['HC'+lp].checked ) { BackNr += document.frames[0].document.getElementById('nr' + lp).outerHTML; BackHs += document.getElementById( 'H' + lp ).outerHTML; document.frames[0].document.getElementById('nr' + lp).removeNode(true); document.getElementById( 'H' + lp ).removeNode( true ); } } } } //----------------------------------------------------------------------------- function history_paste() { //カットした履歴をペースト document.frames[0].document.getElementById( 'L'+layer_act ).innerHTML += BackNr; document.getElementById( 'history' ).innerHTML = BackHs + document.getElementById( 'history' ).innerHTML; BackNr = ''; BackHs = ''; history_move_act(); } //----------------------------------------------------------------------------- function history_move_act() { //選択した履歴をアクティブレイヤーに移動 for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.forms[0].elements['HC'+lp] ) { if( document.forms[0].elements['HC'+lp].checked ) { document.getElementById( 'H' + lp ).lay = layer_act; } } } } //----------------------------------------------------------------------------- function history_delete() { //選択した履歴削除 if( !confirm( "選択した履歴を削除します。" ) ) { return; } for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.forms[0].elements['HC'+lp] ) { if( document.forms[0].elements['HC'+lp].checked ) { document.frames[0].document.getElementById('nr' + lp).removeNode(true); document.getElementById( 'H' + lp ).removeNode( true ); } } } } //----------------------------------------------------------------------------- function history_layer_set( Num, Set ) { //指定したレイヤーの履歴変更 for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.getElementById( 'H' + lp ) ) { if( document.getElementById( 'H' + lp ).lay == Num ) { if( Num == Set ) { //削除 document.getElementById( 'H' + lp ).removeNode( true ); } else { //管理レイヤー変更 document.getElementById( 'H' + lp ).lay = Set; } } } } } //----------------------------------------------------------------------------- function history_revers() { //表示中の履歴のチェック状態を反転 for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.getElementById( 'H'+lp ) ) { if( document.getElementById( 'H'+lp ).style.display == '' ) { if( document.forms[0].elements['HC'+lp].checked ) { document.forms[0].elements['HC'+lp].checked = false; } else { document.forms[0].elements['HC'+lp].checked = true; } } } } } //----------------------------------------------------------------------------- function history_checked( bool ) { //全履歴のチェック状態操作 for( var lp = 1; lp <= document.frames[0].pNumber; lp ++ ) { if( document.getElementById( 'H' + lp ) ) { if( document.getElementById( 'H' + lp ).style.display == '' || bool == false ) { if( document.forms[0].elements['HC'+lp] ) { document.forms[0].elements['HC'+lp].checked = bool; } } } } } //----------------------------------------------------------------------------- var tmpThis=0; function mapchip( cpX, cpY ) { //マップチップ選択 selbox.style.top = 400+cpY*16; selbox.style.left = 173+cpX*16; document.frames[0].cpX = cpX; document.frames[0].cpY = cpY; selchip.innerHTML = ''; selchip.style.display = ""; } function chipview( cpX, cpY ) { //マップチップ表示 chip.innerHTML = '
'; chip.style.top = document.body.scrollTop + event.clientY-cpY*32 - 54; chip.style.left = document.body.scrollLeft + event.clientX-cpX*32 - 54; chip.style.display = ""; } function map_chk( th ) { if( th.value == "t_map" ) { document.forms[0].grid.checked = true; selchip.style.display = ""; } else { selchip.style.display = "none"; } } //----------------------------------------------------------------------------- //パレット管理 var palet_table; function palet_choose( obj ) { //パレット選択 var pal = Dlg.chooseColorDlg( obj.value ); pal = '00000' + pal.toString( '16' ); pal = pal.substring( pal.length - 6, pal.length ); obj.value = '#' + pal; } //----------------------------------------------------------------------------- function palet_gen( ir, ig, ib ) { //パレットジェネレート if( ir < 0 || ig < 0 || ib < 0 ) { Rev = 1; } else { Rev = 0; } for( val = 0; val < 5; val ++ ) { rr = ir == 255 ? 255 : ((val*52)*ir); gg = ig == 255 ? 255 : ((val*52)*ig); bb = ib == 255 ? 255 : ((val*52)*ib); if( ir < 0 ) rr += 255; if( ig < 0 ) gg += 255; if( ib < 0 ) bb += 255; for( var lp = 1; lp < 6; lp ++ ) { str = ( (Math.round(rr*lp/5)*65536) + (Math.round(gg*lp/5)*256) + Math.round(bb*lp/5) ).toString(16); while( str.length < 6 ) { str = "0" + str; } palet_table[9-lp] += ''; } if( Rev ) { tmp = (4-val); } else { tmp = (val); } for( lp = 1; lp < 5; lp ++ ) { rr += 42; gg += 42; bb += 42; if( ir == 0 ) rr += lp+tmp*4; if( ig == 0 ) gg += lp+tmp*4; if( ib == 0 ) bb += lp+tmp*4; if( rr > 238+tmp*(4-lp) ) { rr = ir == 255 ? rr : 238+tmp*(4-lp); } if( gg > 238+tmp*(4-lp) ) { gg = ig == 255 ? gg : 238+tmp*(4-lp); } if( bb > 238+tmp*(4-lp) ) { bb = ib == 255 ? bb : 238+tmp*(4-lp); } if( rr > 255 ) rr = 255; if( gg > 255 ) gg = 255; if( bb > 255 ) bb = 255; str = ( (rr*65536) + (gg*256) + (bb) ).toString(16); while( str.length < 6 ) { str = "0" + str; } palet_table[4-lp] += ''; } } } //----------------------------------------------------------------------------- function palet_write() { //パレット表示 palet_table = new Array(); palet_table[8] = ''; palet_table[7] = ''; palet_table[6] = ''; palet_table[5] = ''; palet_table[4] = ''; palet_table[3] = ''; palet_table[2] = ''; palet_table[1] = ''; palet_table[0] = 'X'; palet_gen( 255, 1, 0 ); palet_gen( -1, 255, 0 ); palet_gen( 0, 255, 1 ); palet_gen( 0, -1, 255 ); palet_gen( 1, 0, 255 ); palet_gen( 255, 0, -1 ); for( lp = 0; lp < 9; lp ++ ) { document.writeln( '' ); document.writeln( palet_table[lp] ); document.writeln( '' ); } } //----------------------------------------------------------------------------- function Dex( c ) { //1桁の16進数を10進数で返す switch( c ) { case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; case 'a': case 'A': return 10; case 'b': case 'B': return 11; case 'c': case 'C': return 12; case 'd': case 'D': return 13; case 'e': case 'E': return 14; case 'f': case 'F': return 15; } } //----------------------------------------------------------------------------- function grad_rep() { //グラデーションレパート var rr, gg, bb, ir, ig, ib, xr, xg, xb; Pal = document.getElementById('color3_code').value; tmp = Pal.length; rr = Dex( Pal.charAt(tmp-5) ) + Dex( Pal.charAt(tmp-6) )*16; gg = Dex( Pal.charAt(tmp-3) ) + Dex( Pal.charAt(tmp-4) )*16; bb = Dex( Pal.charAt(tmp-1) ) + Dex( Pal.charAt(tmp-2) )*16; Pal = document.getElementById('color4_code').value; tmp = Pal.length; ir = Dex( Pal.charAt(tmp-5) ) + Dex( Pal.charAt(tmp-6) )*16; ig = Dex( Pal.charAt(tmp-3) ) + Dex( Pal.charAt(tmp-4) )*16; ib = Dex( Pal.charAt(tmp-1) ) + Dex( Pal.charAt(tmp-2) )*16; xr = ir-rr; xg = ig-gg; xb = ib-bb; Pal = ""; for( lp = 0; lp < 26; lp ++ ) { tr = Math.round( rr + (xr/26)*lp ); tg = Math.round( gg + (xg/26)*lp ); tb = Math.round( bb + (xb/26)*lp ); if( tr > 255 ) tr = 255; if( tg > 255 ) tg = 255; if( tb > 255 ) tb = 255; if( tr < 0 ) tr = 0; if( tg < 0 ) tg = 0; if( tb < 0 ) tb = 0; tmp = tr*65536 + tg*256 + tb; tmp = tmp.toString(16); while( tmp.length < 6 ) { tmp = '0'+tmp; } Pal += ''; } Pal += "\n"; Pal += ""; for( lp = 1; lp < 14; lp ++ ) { tr = Math.round( rr - (xr/13)*lp ); tg = Math.round( gg - (xg/13)*lp ); tb = Math.round( bb - (xb/13)*lp ); if( tr > 255 ) tr = 255; if( tg > 255 ) tg = 255; if( tb > 255 ) tb = 255; if( tr < 0 ) tr = 0; if( tg < 0 ) tg = 0; if( tb < 0 ) tb = 0; tmp = tr*65536 + tg*256 + tb; tmp = tmp.toString(16); while( tmp.length < 6 ) { tmp = '0'+tmp; } Pal += ''; } for( lp = 13; lp > 0; lp -- ) { tr = Math.round( ir + (xr/13)*lp ); tg = Math.round( ig + (xg/13)*lp ); tb = Math.round( ib + (xb/13)*lp ); if( tr > 255 ) tr = 255; if( tg > 255 ) tg = 255; if( tb > 255 ) tb = 255; if( tr < 0 ) tr = 0; if( tg < 0 ) tg = 0; if( tb < 0 ) tb = 0; tmp = tr*65536 + tg*256 + tb; tmp = tmp.toString(16); while( tmp.length < 6 ) { tmp = '0'+tmp; } Pal += ''; } Pal += ""; document.getElementById('gradPal').innerHTML = "" + Pal + "
"; activePickupColor(); } //----------------------------------------------------------------------------- function palet_rep( Num, Pal ) { //パレットレパート var rr, gg, bb, aa, ir, ig, ib; tmp = Pal.length; rr = Dex( Pal.charAt(tmp-5) ) + Dex( Pal.charAt(tmp-6) )*16; gg = Dex( Pal.charAt(tmp-3) ) + Dex( Pal.charAt(tmp-4) )*16; bb = Dex( Pal.charAt(tmp-1) ) + Dex( Pal.charAt(tmp-2) )*16; aa = Math.round( (rr + gg + bb)/3 ); //平均値 ir = Math.round( (rr - aa)/8 ); ig = Math.round( (gg - aa)/8 ); ib = Math.round( (bb - aa)/8 ); var str = ''; for( var val = 0; val < 3; val ++ ) { str += ''; for( var lp = 1; lp <= 4; lp ++ ) { tr = Math.round( rr+Math.abs( ir*(25-(lp*2+val*8)) ) ); tg = Math.round( gg+Math.abs( ig*(25-(lp*2+val*8)) ) ); tb = Math.round( bb+Math.abs( ib*(25-(lp*2+val*8)) ) ); if( tr > 255 ) tr = 255; if( tg > 255 ) tg = 255; if( tb > 255 ) tb = 255; if( tr < 0 ) tr = 0; if( tg < 0 ) tg = 0; if( tb < 0 ) tb = 0; tmp = tr*65536 + tg*256 + tb; tmp = tmp.toString(16); while( tmp.length < 6 ) { tmp = '0'+tmp; } str += ''; } str += '\n'; } for( var val = 0; val < 3; val ++ ) { str += ''; for( var lp = 1; lp <= 4; lp ++ ) { tr = Math.round( rr-Math.abs( ir*(lp*2+val*8) ) ); tg = Math.round( gg-Math.abs( ig*(lp*2+val*8) ) ); tb = Math.round( bb-Math.abs( ib*(lp*2+val*8) ) ); if( tr > 255 ) tr = 255; if( tg > 255 ) tg = 255; if( tb > 255 ) tb = 255; if( tr < 0 ) tr = 0; if( tg < 0 ) tg = 0; if( tb < 0 ) tb = 0; tmp = tr*65536 + tg*256 + tb; tmp = tmp.toString(16); while( tmp.length < 6 ) { tmp = '0'+tmp; } str += ''; } str += '\n'; } for( var val = 0; val < 2; val ++ ) { str += ''; for( var lp = 1; lp <= 4; lp ++ ) { tr = rr+( ir*(17-(lp*2+val*8)) ); tg = gg+( ig*(17-(lp*2+val*8)) ); tb = bb+( ib*(17-(lp*2+val*8)) ); if( tr > 255 ) tr = 255; if( tg > 255 ) tg = 255; if( tb > 255 ) tb = 255; if( tr < 0 ) tr = 0; if( tg < 0 ) tg = 0; if( tb < 0 ) tb = 0; tmp = tr*65536 + tg*256 + tb; tmp = tmp.toString(16); while( tmp.length < 6 ) { tmp = '0'+tmp; } str += ''; } str += '\n'; } for( var val = 0; val < 2; val ++ ) { str += ''; for( var lp = 1; lp <= 4; lp ++ ) { tr = rr-( ir*(lp+val*4) ); tg = gg-( ig*(lp+val*4) ); tb = bb-( ib*(lp+val*4) ); if( tr > 255 ) tr = 255; if( tg > 255 ) tg = 255; if( tb > 255 ) tb = 255; if( tr < 0 ) tr = 0; if( tg < 0 ) tg = 0; if( tb < 0 ) tb = 0; tmp = tr*65536 + tg*256 + tb; tmp = tmp.toString(16); while( tmp.length < 6 ) { tmp = '0'+tmp; } str += ''; } str += '\n'; } str += '
'; document.getElementById( 'pal_'+Num ).innerHTML = str; document.getElementById( 'col_'+Num ).bgColor = Pal; activePickupColor(); } //----------------------------------------------------------------------------- //メニュー開閉管理 function menu_open( str ) { //開く var vorm = document.getElementById( str ); vorm.style.display = ''; vorm = document.getElementById( str + '_o' ); vorm.style.display = 'none'; vorm = document.getElementById( str + '_c' ); vorm.style.display = ''; } //----------------------------------------------------------------------------- function menu_close( str ) { //閉じる var vorm = document.getElementById( str ); vorm.style.display = 'none'; vorm = document.getElementById( str + '_o' ); vorm.style.display = ''; vorm = document.getElementById( str + '_c' ); vorm.style.display = 'none'; } //----------------------------------------------------------------------------- function key_event() { //キーイベント keyCode = event.keyCode; if( keyCode == 65 ) { //a if( cpX > 0 ) cpX --; mapchip( cpX, cpY ) } if( keyCode == 68 ) { //d if( cpX < 29 ) cpX ++; mapchip( cpX, cpY ) } if( keyCode == 87 ) { //w if( cpY > 0 ) cpY --; mapchip( cpX, cpY ) } if( keyCode == 83 ) { //s if( cpY < 15 ) cpY ++; mapchip( cpX, cpY ) } if( keyCode == 88 ) { //x palet_cross(); } } //----------------------------------------------------------------------------- //初期処理 window.onerror = function(){ return true; } window.onload = activePickupColor; document.writeln(''); document.writeln(''); document.writeln(''); //-----------------------------------------------------------------------------

このページを表示するには Internet Explorer 6以上 8以下が必要です。