//先にiconfunc.jsを読み込むこと //選択タグ切り替え関数 function ToggleCommentTab(pGroupNum, pTabNum) { //IEはDIVタグをタブごとに使うとタブが縦に表示されるため、一括で if(false){ // var retText = ""; // for(i=1;i "; // }else{ // retText += "| "+aTabName[i-1]+" "; // } // } // retText += " |"; // document.getElementById("gr"+pGroupNum+"tagtitle").innerHTML = retText; }else{ //※divやiは1ベース、aTabNameは0ベース(なのでi-1) for(i = 1; i < aTabName.length + 1; i++){ // if(aTabName.length |"; }else{ document.getElementById("gr"+pGroupNum+"tagtitle"+(i)).innerHTML = "▼"+aTabName[i-1]+"▼ |"; } //このタブを開く document.getElementById("gr"+pGroupNum+"-tab"+i).style.display = "block"; }else{ if(i == 1){ document.getElementById("gr"+pGroupNum+"tagtitle"+(i)).innerHTML = "| "; document.getElementById("gr"+pGroupNum+"tagtitle"+(i)).innerHTML += ""+aTabName[i-1]+" |"; }else { document.getElementById("gr"+pGroupNum+"tagtitle"+(i)).innerHTML = ""+aTabName[i-1]+" |"; } //他のタブは閉じる document.getElementById("gr"+pGroupNum+"-tab"+i).style.display = "none"; } } //document.getElementById("gr"+pGroupNum+"-tab").innerHTML = writecomcontent(pGroupNum,pTabNum); } } function writecomcontent(pGroupNum,pTabNum) { //IEの場合テーブルの中にテーブルをinnerHTMLで挿入できないので、テーブルなしのソースを返す if(false){ //IEの場合 var retText = ""; var gbIconNum = 0;//グローバルアイコンカウンタ var i = 0; var ii = 0; var tmpIconCount = writecontent_GetIconCount(pTabNum); var tmpLineCount = writecontent_GetIconLineCount(pTabNum); for(i = 0; i < tmpLineCount; i++){//行数の数だけ実行、行数はaTabName配列の要素数 for(ii = 0; ii < 18;){//列の数だけ実行 if(gbIconNum >= aIcon.length){ ii = 999; i = 999; }else if(pTabNum == aIcon[gbIconNum].tab){//表示すべきアイコンがまだある retText += "\""+ "; ii++; tmpIconCount--; }else if(pTabNum != aIcon[gbIconNum].tab){//違うタブの情報 if(tmpIconCount==0){//これ以降先に選択タブのアイコンは存在しない ii = 99; i=999; retText += "
\n"; return retText; } }else{//表示すべきアイコンはもうない ii = 99; i=999; retText += "
\n"; return retText; ii++; } gbIconNum++; } retText += "
\n"; } //alert(gbIconNum); }else if(false){ //Firefoxその他の場合 var retText = "\n";//タブ内のテーブル var gbIconNum = 0;//アイコンカウンタ var i = 0; var ii = 0; //alert(aIcon.length); for(i = 0; i < writecontent_GetIconLineCount(pTabNum); i++){//行数の数だけ実行、行数はaTabName配列の要素数 retText += "\n"; for(ii = 0; ii < 18;){//列の数だけ実行 if(gbIconNum >= aIcon.length){ ii = 999; i = 999; }else if(pTabNum == aIcon[gbIconNum].tab){//表示すべきアイコンがまだある retText += "\n"; ii++; }else if(pTabNum != aIcon[gbIconNum].tab){//違うタブの情報 }else{//表示すべきアイコンはもうない retText += "\n"; ii++; } gbIconNum++; } retText += "\n"; } retText += "
\""+
\n"; } if(true){ //Firefoxその他の場合 var retText = "\n";//タブ内のテーブル var gbIconNum = 0;//アイコンカウンタ var i = 0; var ii = 0; retText += ""; retText += "\n"; for(ii=0;ii<18;){//列の数だけ実行 if(gbIconNum >= aIcon.length){ ii = 999; i = 999; }else if(pTabNum == aIcon[gbIconNum].tab){//表示すべきアイコンがまだある retText += "\n"; // retText += "\n"; nCurX += aIcon[gbIconNum].width; if(nCurMaxY < aIcon[gbIconNum].height){ nCurMaxY = aIcon[gbIconNum].height; } ii++; }else if(pTabNum != aIcon[gbIconNum].tab){//違うタブの情報 }else{//表示すべきアイコンはもうない // retText += "\n"; ii++; } gbIconNum++; } nCurY += nCurMaxY; nCurMaxY = 0; nCurX = 0; } retText += "\n"; retText += ""; retText += ""; retText += "
"; retText += "\n"; retText += "\n"; var nCurX = 0; var nCurY = 0; var nCurMaxY = 0; //alert(aIcon.length); for(i = 0; i < writecontent_GetIconLineCount(pTabNum); i++){//行数の数だけ実行、行数はaTabName配列の要素数 // retText += "
\""+
\n"; } return retText; } //コメント欄のアイコンをクリックしたときに動作させる関数 function comiconclick(pGroupNum, pArrayNum) { //alert("ここにtextareaへの追加処理を書く"); //IEとFirefoxでtextareaのカーソル位置の判別方法が異なるため処理分岐 if(navigator.appName.indexOf("Microsoft") > -1){ //IEの場合 var target = document.getElementById("pass"); target.focus(); if (document.selection != null){ var sSel = document.selection.createRange().text; if (sSel){ document.selection.createRange().text = aIcon[pArrayNum].rep; }else{ document.selection.createRange().text = aIcon[pArrayNum].rep; } }else if(target.selectionStart || target.selectionStart == '0'){ var s = target.selectionStart; var e = target.selectionEnd; var str2 = target.value.substring(s,e); if (str2){ target.value = target.value.substring(0,s) + aIcon[pArrayNum].rep + target.value.substring(e,target.value.length); }else{ target.value = target.value.substring(0,s) + aIcon[pArrayNum].rep + target.value.substring(e,target.value.length); } target.focus(); }else{ target.value += aIcon[pArrayNum].rep; } }else{ var tmpFirstText = document.getElementById("pass").value.substring(0,document.getElementById("pass").selectionStart); var tmpEndText = document.getElementById("pass").value.substring(document.getElementById("pass").selectionEnd,document.getElementById("pass").value.length); document.getElementById("pass").value = tmpFirstText + aIcon[pArrayNum].rep + tmpEndText; } preview("previewcontent", document.getElementById("pass"), pGroupNum); } //タブアイコンセット表示用関数、引数にグループ番号を指定する function makecomtable(tabNum) { var retText = "
"; //IEの場合テーブルの中にテーブルをinnerHTMLで挿入できないので、テーブルなしのソースを返す if(false){ //IEの場合 //タブ表示 retText += "
| "; for(i=0;i"+aTabName[i]+" | \n"; } } retText += "
\n"; //タブの後のアイコン表示領域作成 retText += "
"; retText += "
\n"; }else{ //Firefoxその他の場合 retText += "\n"; //タブ表示 for(i = 0; i < aIcon.length; i++){ if(typeof(aTabName[i]) == "undefined"){ // retText += "\n"; }else{ if(i == 0){ retText += "\n"; }else{ retText += "\n"; } } } retText += "
\n"; retText += "
"; //タブの後のアイコン表示領域作成 for(var i = 1;i"+i+"\n"; } // retText += "\n"; // retText += "
\n"; // retText += "
\n"; } return retText; }