//============================================ // SLS common data // // Color // Language // Icon //============================================ /* */ var isNN = !document.all; var CURRENT_TIME = Math.floor( ( new Date() ).getTime() / 1000 ); var THREAD_LIST = {}; var GROUP_LIST = {}; var THREAD_NUMBER = {}; var GROUP_NUMBER = {}; var HEAD_TOPIC = 0; var HEAD_GROUP = 0; var CALL_GROUP = 0; var TOTAL_THREAD = 0; var TOTAL_GROUP = 0; var SPAN_THREAD = 0; var SPAN_GROUP = 0; var SEND_URL = ""; var COLOR_LIST = ["black","gray","09f","blue","brown","darkorange","red","0c0","green","fuchsia","c06"]; var SEARCH_KEY = ""; var QUOTE_TEXT = ""; var RESPONSE_LIST = { MODE : 'view' }; var CONFIG_LIST = {}; //------------------- for tree open var HEADer_TAG = ""; var DIR_ICON = "../FaceBall/"; // Icon folder var ICON_LIST = { Basic : "Normal", Basic2 : "Normal2", AseAse : "Parspiration", VeryHot : "Very Hot", IraIra : "Very Hot!", Appare : "Brabo!", Yeah : "Yeah", IjiIji : "Shrink", LetsGo : "Let's Go !", Kya : "Awkward", Wink : "Wink", Uu : "Uu...", DevilStick : "Devil", UruUru : "Watery eye", UreshiNaki : "Happy Tear", UnUn : "Yes Yes", Uuun : "Ummm", Eee : "Eee", TereTere : "Shy", OiOi : "Check you", HeyYou : "Hey you!", ComeHere : "Come here", Vomit : "Vomit", Ooi : "Hey !", Okaimono : "Shopping", OSu : "Judo", Osumashi : "Cool", TakeCare : "Take care", FullMoon : "Full Moon", OK : "OK", MoguMogu : "Eating", Onegai : "Please", Bath : "Bath", OhMyGod : "Oh My God !", ZZZ : "ZZZ", GodDaikoku : "God of business", GodYebisu : "God of property", Gaan : "Shock", Kabuto : "Helmet", Singing : "Singing", BeerGlass : "Beer", Guiter : "Guiter", Kyahaha : "Laugh", CareerWoman : "Career Woman", Candle : "Candle", Gyoeee : "Ameizing !", Gyott : "Suprised", KyoroKyoro : "Look & Look", KiraKira : "Twincle eyes", Sneeze : "Sneeze", Kusun : "Tear", EatUp : "Satiety", Cracker : "Cracker", Xmas : "Xmas", Sniff : "Sniff", Mobile : "Mobile phone", MobileMail : "Mobile mail", Working : "Working", Coffee : "Coffee", Crying : "Crying", Lunch : "Lunch", KonRan : "Confusion", Sarfing : "Sarfing", Satt : "Hiding", Soccer : "Soccer", BuruBuru : "tremble", Monkey : "Monkey", Jee : "Gazing", Shiin : "Lost words", GoOut : "Go out !", Writing : "Writing", Swimming : "Swimming", Ski : "Ski", Shawer : "Shawer", Sooo : "Peeping", Cleaning : "Cleaning", AreYouOK : "Are you OK?", Kite : "Kite", TakoYaki : "Pasta ball", Tabako : "Cigarette", BirthdayCake : "Birthday", IeIe : "Defference", ChiChiChi : "Check again", NoNo : "No No", Fishing : "Casting", TsunTsun : "Piercing", Tennis : "Tennis", SunShine : "Weather:SunShine", Kumori : "Weather:Cloudy", Rain : "Weather:Rainy", Kaminari : "Weather:Thunder", SnowMan : "Weather:Show", Angel : "Angel", Dote : "Tumbling", Flying : "Flying", Secret : "Secret", NaniNani : "What ?", NamNam : "Amen", Niyari : "Nihilist", Goo : "understand ?", NemuNemu : "Sleepy", NoriNori : "Enjoy music !", LookOut : "Punch!", Hai : "Yes", Motorcycle : "Motorcycle", Running : "Running", PC : "PC", Hakushu : "Hands Clap", Nanto : "Gleam", HanaKuso : "Nose Wax", Bouquet : "Bouquet", Nosebleed : "Nosebleed", BunnyGirl : "Bunny girl", Hanetuki : "Shuttlecock", Hansei : "Reflection", ooo : "Fright", Peace : "Peace Sign", Hu : "Sigh", Pool : "Pool", Poogh : "Pooh", Hospital : "Hospital", HulaDance : "HulaDance", PunPun : "Angry", Akanbe : "Make Faces", PekoPeko : "Sorry", Hensou : "Disguise", Whistle : "Whistle", Boat : "Boat", HouHou : "Glasses", Ohoho : "Sneer with love", 'Poke-' : "Absent-minded", Hazukashi : "Shameful", 'HoHo-' : "Ah Oh", MushiMegane : "Found it !", MaJiDe : "Trouble", Witch : "Witch", ByeBye : "See you", KuruKuru : "Turning", Mukee : "Mortified", Mufu : "Chuckle", MemoMemo : "Memo", SweetPoteto : "SweetPoteto", Yodare : "Envious", Roger : "Yes Sir !", LoveLetter : "Love Letter", Cooking : "Cooking", Trip : "Trip", Waai : "Pleasure", Waan : "Tear Flow", WakuWakuWaku : "Exciting !", Forgot : "Forgot..", Hatena : "me ?", Nnnto : "Thinking", HoodMouse : "Hood:Mouse", HoodCow : "Hood:Cow", HoodTiger : "Hood:Tiger", HoodRabbit : "Hood:Rabbit", HoodDragon : "Hood:Dragon", HoodSnake : "Hood:Snake", HoodHorse : "Hood:Horse", HoodSheep : "Hood:Sheep", HoodMonkey : "Hood:Monkey", HoodCock : "Hood:Cock", HoodDog : "Hood:Dog", HoodBoar : "Hood:Boar", HoodDolphin : "Hood:Dolphin", HoodFrog : "Hood:Frog", HoodFox : "Hood:Fox", HoodGiraffe : "Hood:Giraffe", HoodBear : "Hood:Bear", HoodElephant : "Hood:Elephant", HoodRaccoon : "Hood:Raccoon", HoodCat : "Hood:Cat", HoodPanda : "Hood:Panda", HoodPig : "Hood:Pig", HoodPenguin : "Hood:Penguin", HoodLion : "Hood:Lion", FluitStrawberry : "Fluit:Strawberry", FluitSuika : "Fluit:Suika", FluitOrange : "Fluit:Orange", FluitMelon : "Fluit:Melon", FluitApple : "Fluit:Apple", PairKiss : "Pair:Kiss", PairNamida : "Pair:Tear", PairNakayoshi : "Pair:Friends", PairPunch : "Pair:Punch", PairYeah : "Pair:Promise", PairYoshiYoshi : "Pair:Comfort" }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // window double click //_________________________________________ document.ondblclick = function() { document.getElementById( "FLOAT_MENU" ).style.display = "block"; with( isNN ? CATCH_AXIS : event ){ callFloatBox( "FLOAT_MENU", document.body.scrollLeft + x -20, document.body.scrollTop + y -20 ); } } //=================================== // window onresize //=================================== window.onresize = function(){ var getHead = parseInt( document.getElementById( 'THREAD_SELECT' ).value ); if( !isNaN( getHead ) && 0 <= getHead ){ viewThread( getHead ); } }; //=============================== // change search //=============================== /* function changeSearch ( key, val ) { var getSearch = location.search; location.search = "?" + ( getSearch.replace( /^(\?|&)/, "" ) + "&" ).replace( new RegExp( key+"=[^&]*&", "g" ), "" ) + key + "=" + val; } */ //============================== // access //============================== function submitSLS( searchList ){ //--------------------------------- sending message if( searchList.MODE != 'view' ){ with( document.getElementById( 'PROMPT_BOX' ) ){ innerHTML = "sending now...."; style.display = "block"; } location.hash = "#PROMPT"; } //--------------------------------- call ajax sendRequest( doResponse, searchList, "POST", SEND_URL, true, true ); } //============================== // response //============================== function doResponse( XRobj ){ try{ eval( XRobj.responseText ); }catch( errorMSG ){ status = "eval error"; } viewMenu(); viewThread( HEAD_TOPIC ); var MODE_MSG = { 'new' : "new for admin", 'edit' : "edit", 'view' : false, 'post' : "You completed to send thread [].", 'right' : "right", 'kill' : "You completed to remove thread [].", 'up' : "`Specified thread []` was moved to the head of order.", 'down' : "`Specified thread []` was moved to the tail of order.", 'knave' : "knave", 'peace' : "peace", 'peel' : "peel", 'group' : "You completed to send group <>", 'JOIN' : "JOIN", 'join' : "You completed to join group to <>" }; //--------------------------- command response message with( RESPONSE_LIST ){ if( MODE != 'view' ){ var tx = ""; if( ERROR.length ){ alert( "Has error\n-------------\n" + ERROR.join( "\n\t* " ) ); }else if( MODE_MSG[ MODE ] ){ var message = MODE_MSG[ MODE ].replace( /\[\]/g, "[" + THREAD + "]" ).replace( /<>/g, "[" + PARENT + "]" ); //--------------------------------- sending message with( document.getElementById( 'PROMPT_BOX' ) ){ innerHTML = message + "
" + tx; // setTimeout( "document.getElementById('PROMPT_BOX').style.display = 'none';", 28000 ); // style.display = ""; } // alert( message ); }else{ alert( "OK [ " + MODE + " ]" ); } if( MODE.match( /post/ ) ){ with( document.getElementById( 'FORM_TOPIC' ) ){ var memoIcon = ICON.options[ ICON.selectedIndex ].value; reset(); ICON.value = memoIcon; } } if( !MODE.match( /join|JOIN|up|down/ ) ){ location.hash = "#TOPICs_TREE"; } } } SEND_LOCK = false; doResponseExtra(); } //=============================== // extra send topic //=============================== function doResponseExtra(){ return; } //================================================= // draw Usage //================================================= function drawUsageButton( thisArea ){ document.write( "" ); } //================================================= // draw attention //================================================= function drawAttention( attentionText ){ document.write( "| Thread | "; //---------------------------------------- thread selecter tagString += ""; tagString += ""; tagString += " | "; tagString += "Group"; tagString += ""; tagString += " | "; tagString += "|||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| "; tagString += ""; tagString += " | "; tagString += "";
tagString += "";
tagString += "
";
var headerTag = "";
//------------------ group nest
if( isMain ){
var groupNest = "";
if( THREAD_LIST[ THnum ].SERIAL[ 0 ] ){
var tempGroup = THREAD_LIST[ THnum ].SERIAL[ 0 ].PARENT;
while( tempGroup ){
if( GROUP_LIST[ tempGroup ] ){
with( GROUP_LIST[ tempGroup ] ){
groupNest = TITLE + " ⇒ " + groupNest;
tempGroup = GROUP;
}
}else{
groupNest = "[" + tempGroup + "]" + " ⇒ " + groupNest;
break;
}
}
headerTag += " ";
this.nestLebel --;
return( outputString );
}
//===================================
// open message
//===================================
function openThisMessage( SEnum, setMode ){
with( document.getElementById( "MESSAGE" + SEnum ).style ){
display = ( setMode == 0 ? ( display == "block" ) : ( 0 < setMode ) ) ? "none" : "block";
}
}
//===========================================
// make tag [ readers ]
//===========================================
function makeTagReader ( threadNumber ){
var readString = "";
if( !hasThread( threadNumber ) ){
return "";
}
var readString = "";
with( THREAD_LIST[ threadNumber ] ){
for( var SEnum in SERIAL ){
if( parseInt( SEnum ) < 2 ){
continue;
}
var getName = SERIAL[ SEnum ].NAME;
if( SERIAL[ SEnum ].MESSAGE == '' ){
readString += "" +
( SERIAL[ SEnum ].RIGHT
? ( "" + getName + "" )
: getName
) +
"";
}
}
}
if( readString != "" ){
readString = "" +
groupNest +
" ";
}
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
headerTag += "";
headerTag += ( SEnum == 1 ? "[" + THnum + "] " : "(" + SEnum + ") " );
if( hasGemLine ){
headerTag += "";
}
headerTag += "";
headerTag += trimTitle( TITLE, 28, "..." ).replace( searchRegExp, replaceString );
headerTag += "";
if( isMain ){
headerTag += " ";
headerTag += "";
}
headerTag += "" + NAME.replace( searchRegExp, replaceString ) + " (" + SAME + ")";
headerTag += "";
headerTag += ( new Date( DATE_WRITE * 1000 ) ).toLocaleString();
headerTag += "";
headerTag += " ";
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
var messageHTML = "";
//------------------------------ mail & link
if( MAIL != "" || LINK != "" ){
messageHTML += " ";
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
var messagePassDays = getPassDays( DATE_EDIT );
var messageTag = "
" ).replace( /'/g, "'").replace( /"/g, """ ).replace( / -+ /g, " " ); if( SEARCH_KEY ){ thisMSG = thisMSG.replace( searchRegExp, replaceString ); } var checkList = []; while( thisMSG.match( />>(\d+)/ ) ){ var callNum = RegExp.$1; thisMSG = thisMSG.replace( new RegExp( ">>" + callNum, "g" ), "⇒" + callNum + "" ); } messageHTML += " " + thisMSG + " ";
messageHTML += ""; messageHTML += " " + messageHTML + " ";
HEADer_TAG = headerTag;
outputString += ( SEnum == 1 ? "" : headerTag ) + messageTag;
// outputString += ( isRsSLS && SEnum == 1 ? "" : headerTag ) + messageTag;
// outputString += headerTag + messageTag;
//==========================================================================================================
//---------------------------------------------
// children tree
//---------------------------------------------
var childrenTag = "";
for( var Cnum in CHILDREN ){
childrenTag += makeThreadNestTag( THnum, CHILDREN[ Cnum ] );
}
if( childrenTag != "" ){
outputString += "" + childrenTag + " ";
}
}
outputString += "" +
" ";
}
return( readString );
}
//================================================
// send topic/group command to RsSLSaccess
//
// mode :
// [topic] post/edit/kill/head/back
// [group] post/edit/kill/head
// Fobj : form object
//================================================
function sendTopic( mode, Fobj ){
if( !Fobj ){
Fobj = document.getElementById( 'FORM_TOPIC' );
}
//--------------- input check
if( mode.match( /post|right/ ) && submitCheck( mode, Fobj ) ){
return;
}else if( mode == 'read' ){
mode = 'post';
}
var sendObj = {
MODE : mode,
PAGE : 'topic',
AREA : "",
GENRE : "",
LABEL : MODE_LABEL,
STYLE : "black",
SORT_THREAD : getSortKey(),
SEARCH : getSearchString(),
USE_GROUP : document.getElementById( 'USE_GROUP' ).checked ? 1 : 0,
GROUP : getUseGroup(),
HEAD_GROUP : getUseGroupHead()
};
with( Fobj ){
//--------------------------------------------
// new topic
//--------------------------------------------
if( sendObj.MODE == 'post' ){
//-------------------- hidden data
sendObj.THREAD = THREAD.value;
sendObj.SERIAL = SERIAL.value;
sendObj.PARENT = PARENT.value;
//-------------------- input data
sendObj.NAME = NAME.value;
sendObj.KEY = KEY.value;
sendObj.MAIL = MAIL.value;
sendObj.LINK = LINK.value;
sendObj.TITLE = TITLE.value;
sendObj.MESSAGE = MESSAGE.value;
sendObj.ICON = ICON.value;
for ( var pos=0; posReaders " +
readString +
"" + " /g, "\n" ); } } //============================ // trans reply title //============================ function transReplyTitle ( title ){ if( title.match( /^Re/ ) ){ return( title.match( /^Re\{(\d+)\}/ ) ? "Re{" + (parseInt(RegExp.$1)+1) + "} " + RegExp.rightContext : "Re{2} " + RegExp.rightContext.substring( 1 ) ); }else{ return( "Re:"+title ); } } //============================ // decode HTML string //============================ function decodeHTMLstring( text ){ return( text.replace( /</g, "<" ).replace( />/g, ">" ).replace( /"/g, "\"" ).replace( /⇒/g, ">>" ).replace( /&/g, "&" ).replace( / /g, "\n" ) ); } } //=============================== // for GEM_LINE @RsSLS //=============================== function formSetExtra( ThreadNumber, SerialNumber, isEditMode ){ } //============================ // reply set //============================ function replySet( ThreadNumber, ParentNumber ){ var Fobj = document.getElementById( 'FORM_TOPIC' ); if( !Fobj ){ return true; } //--------------------- set reply data formSet( ThreadNumber, ParentNumber, false ); // false:reply mode with( Fobj ){ THREAD.value = ThreadNumber; SERIAL.value = '0'; // as NEW PARENT.value = ParentNumber; SUBMIT_BUTTON.value = "Reply"; } //--------------------- goto input form location.hash = '#INPUT'; } //============================ // edit set //============================ function editSet( ThreadNumber, SerialNumber ){ var Fobj = document.getElementById( 'FORM_TOPIC' ); if( !Fobj ){ return true; } //--------------------- set Edit data var getList = THREAD_LIST[ ThreadNumber ].SERIAL[ SerialNumber ]; //--------------------- check password if( !getList.RIGHT ){ noRightMessage(); return; } formSet( ThreadNumber, SerialNumber, true ); // true:edit mode with( Fobj ){ THREAD.value = ThreadNumber; SERIAL.value = SerialNumber; PARENT.value = getList.PARENT; SUBMIT_BUTTON.value = "Edit"; MODE.value = "post"; } //--------------------- goto form location.hash='#INPUT'; } //====================================== // Icon change //====================================== function showIcon(){ with( document.getElementById( 'FORM_TOPIC' ) ){ SHOW_ICON.src = DIR_ICON + ICON.options[ ICON.selectedIndex ].value + ".gif"; } } //============================ // kill message //============================ function eraser( ThreadNumber, SerialNumber ){ var Fobj = document.getElementById( 'FORM_TOPIC' ); if( !Fobj ){ return true; } //--------------------- get data var getList = THREAD_LIST[ ThreadNumber ].SERIAL[ SerialNumber ]; //--------------------- check password if( !getList.RIGHT ){ noRightMessage(); return; } if( getList.MESSAGE && !confirm( "Delete this message OK ?" + ( getList.MESSAGE != '' ? "\n--------------\n" : "" ) + "[" + ThreadNumber + "] (" + SerialNumber + ") " + getList.NAME + "\n\n" + getList.MESSAGE.replace( /</g, "<" ).replace( />/g, ">" ).replace( / /g, "\n" ) ) ){ return; } with( Fobj ){ THREAD.value = ThreadNumber; SERIAL.value = SerialNumber; } sendTopic( 'kill', Fobj ); } //============================ // edit set //============================ function readSet( ThreadNumber ){ var Fobj = document.getElementById( 'FORM_TOPIC' ); if( !Fobj ){ return true; } //--------------------- set Edit data with( Fobj ){ THREAD.value = ThreadNumber; SERIAL.value = 0; // as NEW PARENT.value = 1; MAIL.value = ""; LINK.value = ""; TITLE.value = ""; MESSAGE.value = ""; document.applets[ FORM_APPLET ].setGemLineString( "" ); } sendTopic( 'read', Fobj ); } //============================ // move thread //============================ function moveThread( ThreadNumber, directionFlag ){ var Fobj = document.getElementById( 'FORM_TOPIC' ); if( !Fobj ){ return; } //--------------------- check password if( !THREAD_LIST[ ThreadNumber ].SERIAL[ 1 ].RIGHT ){ noRightMessage(); return; } //--------------------- set data if( !confirm( directionFlag ? "Do you want to make this topic done most up ?" : "Do you want to make this topic done down ?" ) ){ return; } with( Fobj ){ THREAD.value = ThreadNumber; } sendTopic( directionFlag ? 'up' : 'down', Fobj ); } //============================ // move group //============================ function moveGroup( directionFlag ){ var groupNumber = parseInt( document.getElementById( 'GROUP_SELECT' ).value ); if( isNaN( groupNumber ) || groupNumber < 0 ){ alert( "Target group was not found" ); return; } //--------------------- check password if( !GROUP_LIST[ groupNumber ].RIGHT ){ noRightMessage(); return; } //--------------------- set data if( !confirm( directionFlag ? "Do you want to make this GROUP done most up ?" : "Do you want to make this GROUP done down ?" ) ){ return; } var Gobj = document.getElementById( 'FORM_GROUP' ); if( !Gobj ){ return; } with( Gobj ){ SERIAL.value = groupNumber; } sendGroup( directionFlag ? 'up' : 'down', null ); } //==================================== // join thread to group //==================================== function joinGroup( mode ){ var Fobj = document.getElementById( 'FORM_TOPIC' ); if( !Fobj ){ return; } var getJoinGroup = parseInt( document.getElementById( 'GROUP_SELECT' ).value ); if( isNaN( getJoinGroup ) || getJoinGroup < 0 ){ alert( "Join group was not found" ); return; } var getJoinThread = THREAD_NUMBER[ document.getElementById( 'THREAD_SELECT' ).value ]; if( !getJoinThread ){ return; } //--------------------- check password if( !THREAD_LIST[ getJoinThread ].SERIAL[ 1 ].RIGHT ){ noRightMessage(); return; } if( isNaN( getJoinThread ) || !THREAD_LIST[ getJoinThread ] ){ alert( "Join thread was not found" ); return; } sendTopic( mode, null ); } //============================ // kill group //============================ function killGroup(){ var groupNumber = parseInt( document.getElementById( 'GROUP_SELECT' ).value ); if( isNaN( groupNumber ) || groupNumber < 0 ){ alert( "Target group was not found" ); return; } //--------------------- check password if( !GROUP_LIST[ groupNumber ].RIGHT ){ noRightMessage(); return; } //--------------------- check cheldren group if( GROUP_LIST[ groupNumber ].CHILDREN.length ){ alert( "Target group has children group.\nYou can not remove this group." ); return; } //--------------------- set data if( !confirm( "Do you want to remove this GROUP ?" ) ){ return; } var Gobj = document.getElementById( 'FORM_GROUP' ); if( !Gobj ){ return; } with( Gobj ){ SERIAL.value = groupNumber; } sendGroup( 'kill', null ); } //=================================== // confirm for page link //=================================== function confirm4Link(){ return( confirm( "You will go to other website.\nIt might possibly give you a big problem.\nEven if so, you can go there. Is it OK ?" ) ); } //================================================================================= // // button operation // //================================================================================= //=================================== // no right message //=================================== function noRightMessage(){ alert( "You have no right to edit this message" ); } //==================================== // view thread menu //==================================== function viewTableMenu () { tagString = "
| ||||||||||||||||||||||||||||||||||||