Tweets from pichat

pichatTwo songs from the year I created my first web sites. http://t.co/8eHrOA9K + http://t.co/AuWb2etI #video #retro
About 1 day ago from pichat (Mark Seuffert)

Tweets from 600infos

600infosI HAVE NYANED FOR 888.4 SECONDS! http://t.co/JQYOZebv via @nyannyancat
About 1 week, 5 days ago from 600infos (Wolf)

Colorscheme Talk

modified javascript and CSS to display side colors, like in the windows gui.

need to modificate

  • creation of the color_scheme_xxx.css-files
  • stylesheet_layout.css-template
  • script_pichat.js-template

mod stylesheet_layout.css

wolf

stylesheet_layout.css
 
-- #sidebar { padding:0px 4px 0px 4px; }
++ #sidebar { padding:0px 4px 0px 6px; }
++ #sidebar li {list-style-type:none; padding:0px; margin:0; } 
++ #sidebar a {display:block; } /**/
/* wolf */

mod color_scheme_xxx.css

color_scheme_xxx.css
 
/* COLOR_TEXT_LINK */ 
/* delete: a:link { color:#(COLOR_TEXT_LINK); } */ 
/* delete: a:visited { color:#(COLOR_TEXT_LINK); } */ 
a { color:#0000C8; }
 
/* COLOR_TEXT_LINKACTIVE */ 
/* delete: a:hover { color:#(COLOR_TEXT_LINKACTIVE); } */ 
/* delete: a:active { color:#(COLOR_TEXT_LINKACTIVE); } */ 
a:hover, a:active, a:focus { color:#3ff; }
 
/* COLOR_TEXT_SIDEBACK + COLOR_TEXT_SIDETEXT (default) */ 
/* delete: .chatside { background-color:#FFFFFF; color:#000000; } */
/* delete: .chatsidetext, .chatsidetext a { color:#000000; } */
#sidebar { background-color:#eee; color:#33E;} 
 
/* COLOR_TEXT_SIDETEXT */ 
#sidebar a {color:#33E; } 
 
/* COLOR_TEXT_SIDEHEADING */ 
.chat-heading { color:#1D1; }
 
/* COLOR_TEXT_SIDEAWAY --- overwrite color if user is away */ 
.chatsa a:visited, .chatsa a:link { color:#C89868 !important; } 
 
/* COLOR_TEXT_SIDESELECTBACK + COLOR_TEXT_SIDESELECTTEXT  --- overwrite color if user is selected  */
#sidebar a:hover, #sidebar a:active, #sidebar a:focus { background-color:#FFFF99; color:#000 !important; } 
 
/* COLOR_TEXT_SELECTBACK  + COLOR_TEXT_SELECTTEXT */
::-moz-selection { background-color:#D70000; color:#0080C8; } /* Firefox */
::selection { background-color:#D70000; color:#0080C8; }  /* IE, Opera, etc. */
 
/*wolf*/

mod script_pichat.js

script_pichat.js
 
// Pichat default webchat templates pack, http://www.pichat.net
 
var pichat = 
{ 
	input:{}, output:{}, control:{}, 
	onChatClear: function(clearHistory, url) { if(mChatOK) { if(clearHistory) pichat.input.clearHistory(); output.location=url; pichat.control.sendClientInterface("CHAT_CLEAR"); } },
	onChatChatroom: function(chatroom) { if(mChatOK) { pichat.output.changeChatroom(chatroom); pichat.control.sendClientInterface("CHAT_CHATROOM", chatroom); } },
	onChatChatroomTopic: function(topic) { if(mChatOK) { pichat.output.changeChatroomTopic(topic); pichat.control.sendClientInterface("CHAT_CHATROOMTOPIC", topic); } },
	onChatChatroomList: function(list) { if(mChatOK) { pichat.output.changeChatroomList(list); pichat.control.sendClientInterface("CHAT_CHATROOMLIST", list); } },
	onChatUserList: function(list) { if(mChatOK) { pichat.output.addUsers(list); pichat.control.sendClientInterface("CHAT_USERLIST", list); } },
	onChatUserNumber: function(user) { if(mChatOK) { pichat.output.changeChatroomUserNumber(user); pichat.control.sendClientInterface("CHAT_USERNUMBER", user); } },
	onChatJoin: function(user) { if(mChatOK) { pichat.output.addUsers(user); pichat.control.sendClientInterface("CHAT_JOIN", user); } },
	onChatLeave: function(user) { if(mChatOK) { pichat.output.removeUser(user); pichat.control.sendClientInterface("CHAT_LEAVE", user); } },
	onChatPing: function(text) { if(mChatOK) { pichat.control.sendPingReply(text); pichat.control.sendClientInterface("CHAT_PING", text); } },
	onChatPong: function(text) { if(mChatOK) { pichat.control.sendClientInterface("CHAT_PONG", text); } },
	onChatNickChange: function(user) { if(mChatOK) { pichat.output.changeUser(user); pichat.control.sendClientInterface("CHAT_NICKCHANGE", user); } },
	onChatAwayChange: function(list) { if(mChatOK) { 
	// add function to change away state ### 2010-03-26 Wolf  
	pichat.output.changeAway(list); 
	pichat.control.sendClientInterface("CHAT_AWAYCHANGE", list); } },
	onChatServerPing: function(text) { if(mChatOK) { pichat.control.sendPingReply(text); pichat.control.sendClientInterface("CHAT_SERVER_PING", text); } },
	onChatColorScheme: function(name, path1, path2) { if(mChatOK) { pichat.output.changeColorScheme(name, path1, path2); pichat.control.sendClientInterface("CHAT_ACTION_CUSTOM", "ColorScheme", name); } },
	onChatAnimateBlink: function() { if(mChatOK) { pichat.control.startTitleAnimation(); pichat.control.sendClientInterface("CHAT_ACTION_CUSTOM", "AnimateBlink"); } },
	onChatSoundEffect: function(action, data) { if(mChatOK) { pichat.control.sendClientInterface("CHAT_ACTION_CUSTOM", "SoundEffect", action, data); } },
	onChatConnected: function() { if(mChatOK) { pichat.control.sendClientInterface("CHAT_NETWORK", "STATUS_CONNECTED_SESSION_OK"); } },
	onChatQuit: function(text) { if(mChatOK) { pichat.output.changeStatus(text); pichat.control.doScroll(); pichat.control.sendClientInterface("CHAT_NETWORK", "STATUS_CLOSED"); mChatOK = false; } }
}
 
pichat.input =
{
	captureEvents: function() { mInput = document.getElementById('chat-input'); document.form.onkeypress = pichat.input.keyPressed; document.form.onkeydown = pichat.input.keyDown; mInput.onfocus = pichat.control.setActiveWindow; mInput.onblur = pichat.control.setInactiveWindow; },
	focusInput: function() { if(mInput) { mInput.focus(); } },
	sendInput: function() { if(mInput) { document.form.submit(); pichat.input.addHistory(pichat.input.trimSpace(mInput.value)); pichat.control.enableScroll(); setTimeout("mInput.value = ''", 1); mInput.focus(); } return false; },
	addText: function(prefix, postfix) { pichat.input.focusInput(); if(mInput.setSelectionRange) { var startPos = mInput.selectionStart; var endPos = mInput.selectionEnd; var newPos = 0; if(startPos==endPos || !postfix) { mInput.value = mInput.value.substring(0, startPos)+prefix+mInput.value.substring(endPos, mInput.value.length); newPos = startPos+prefix.length; } else { var text = mInput.value.substr(startPos, endPos-startPos); mInput.value = mInput.value.substring(0, startPos)+prefix+text+postfix+mInput.value.substring(endPos, mInput.value.length); newPos = startPos+prefix.length+text.length+postfix.length; } mInput.setSelectionRange(newPos, newPos); } else if(document.selection) { var range = document.selection.createRange(); var rangeDup = range.duplicate(); rangeDup.moveToElementText(mInput); rangeDup.setEndPoint('EndToEnd', range); var startPos = rangeDup.text.length - range.text.length; var endPos = startPos + range.text.length; var newPos = 0; if(startPos==endPos || !postfix) { mInput.value = mInput.value.substring(0, startPos)+prefix+mInput.value.substring(endPos, mInput.value.length); newPos = startPos+prefix.length; } else { var text = mInput.value.substr(startPos, endPos-startPos); mInput.value = mInput.value.substring(0, startPos)+prefix+text+postfix+mInput.value.substring(endPos, mInput.value.length); newPos = startPos+prefix.length+text.length+postfix.length; } range.collapse(true); range.moveStart('character', newPos); range.select(); } return false; },	
	keyPressed: function (event) { var code = 0; if(event) code = event.which; else code = window.event.keyCode; if(code==13) return pichat.input.sendInput(); if(code>=32 && mInput.value.length+1>mMaxLength) return false; return true; },
	keyDown: function(event) { var code = 0; if(event) code = event.which; else code = window.event.keyCode; if(code==38) return pichat.input.upHistory(); if(code==40) return pichat.input.downHistory(); return true; },
	addHistory: function(text) { mHistoryPos = 0; var lines = mHistory.length; if(text.length && (!lines || text!=mHistory[lines-1])) { if(mHistory.length>=mMaxHistory) mHistory.shift(); mHistory.push(text); } },
	clearHistory: function() { mHistoryPos = 0; mHistory = []; },
	upHistory: function() { if(mHistoryPos<mHistory.length) { ++mHistoryPos; if(mHistoryPos==1) mHistoryLine = mInput.value; mInput.value = mHistory[mHistory.length-mHistoryPos]; pichat.input.positionInput(false); } else pichat.input.positionInput(true); return false; },
	downHistory: function() { if(mHistoryPos>0) { --mHistoryPos; if(!mHistoryPos) mInput.value = mHistoryLine; else mInput.value = mHistory[mHistory.length-mHistoryPos]; pichat.input.positionInput(false); } return false; },
	positionInput: function(start) { if(mInput.setSelectionRange) { var newPos = 0; if(!start) newPos = mInput.value.length; mInput.setSelectionRange(newPos, newPos); } else if (mInput.createTextRange) { var range = mInput.createTextRange(); range.collapse(start); range.select(); } },
	trimSpace: function(text) { var i = 0; for(i=0;i<text.length&&text.charAt(i)==" ";++i); text = text.substr(i); for(i=text.length;i&&text.charAt(i-1)==" ";--i); return text.substr(0,i); }
}
var mMaxLength = 1024, mMaxHistory = 100, mInput = 0, mHistoryPos = 0, mHistory = new Array, mHistoryLine = "";
 
pichat.output =
{ 
	changeChatroom: function(chatroom) { mChatroom = chatroom; pichat.output.clearUsers(); mTitleOriginal = chatroom==pichat.control.getTextString("chat_chatroom_default") ? pichat.control.getTextString("chat_server_name") : pichat.control.getTextString("chat_server_name")+pichat.control.getTextString("chat_t_chatroom_prefix")+chatroom; if(!mTitleAnimated) top.document.title = mTitleOriginal; pichat.output.changeTextNode("chat-statustitle", mTitleOriginal); pichat.output.changeTextNode("chat-statustext", ""); },
	changeChatroomTopic: function(topic) { mChatroomTopic = topic; if(topic=="") topic = pichat.control.getTextString("chat_server_welcome"); pichat.output.changeTextNode("chat-statustext", topic); },
	changeChatroomList: function(list) { var node = document.getElementById("chat-chatrooms"); while(node.firstChild) node.removeChild(node.firstChild); var div = document.createElement("div"); div.className = "chat-heading"; div.appendChild(document.createTextNode(pichat.control.getTextString("chat_t_chatrooms"))); node.appendChild(div); var chatrooms = list.split(","); for(var i=0;i<chatrooms.length;++i) { var data = chatrooms[i].split(":"); 
	// change div to li ### 2010-04-02 Wolf
	var li = document.createElement("li"); li.setAttribute("chatroom", data[1]); var link = document.createElement("a"); link.href = pichat.control.getCommandLink()+escape("/join "+data[1]); link.target = "dummy"; link.onclick = pichat.input.focusInput; link.appendChild(document.createTextNode(pichat.control.getTextStringFormated(data[0]==1?"chat_t_chatrooms_info1":"chat_t_chatrooms_info2", data[1], data[0]))); li.appendChild(link); node.appendChild(li); } },
	changeChatroomUserNumber: function(user) { var node = document.getElementById("chat-chatrooms"); var data = new Array(user, mChatroom); 
	// var obj new defined ### 2009-12-15 Wolf
	// change div to li ### 2010-04-02 Wolf
	for(var obj, i=0;obj=node.childNodes[i];++i) { if(obj.nodeName.toLowerCase()=="li" && obj.getAttribute("chatroom")==data[1]) { obj.firstChild.firstChild.data=pichat.control.getTextStringFormated(data[0]==1?"chat_t_chatrooms_info1":"chat_t_chatrooms_info2", data[1], data[0]); break; } } },
	clearUsers: function() { var node = document.getElementById("chat-chatusers"); while(node.firstChild) node.removeChild(node.firstChild); },
	addUsers: function(list) { var node = document.getElementById("chat-chatusers"); if(!node.firstChild) { var div = document.createElement("div"); div.className = "chat-heading"; div.appendChild(document.createTextNode(pichat.control.getTextString("chat_t_chatusers"))); node.appendChild(div); } var users = list.split(","); for(var i=0;i<users.length;++i) { if(isNaN(parseInt(users[i]))) break; 
	// change div to li ### 2010-04-02 Wolf
	var li = document.createElement("li"); 
	// check if user is STATUS_ONLINE and set className ### 2009-12-16 Wolf 
	// need li chatst and chatsa defined in the colorscheme CSS ### 2010-03-29 Wolf
	li.className = users[i].split(":")[0]==1 ? "chatst" : "chatsa";
	var link = document.createElement("a"); link.href = pichat.control.getCommandLink()+escape("/whois "+users[i].split(":")[1]); link.target = "dummy"; link.onclick = pichat.input.focusInput; link.appendChild(document.createTextNode(users[i].split(":")[1])); li.appendChild(link); node.appendChild(li); } pichat.output.sortUsers(); },
	removeUser: function(userData) { var node = document.getElementById("chat-chatusers"); var user = userData.split(":")[1]; 
	// var obj new defined ### 2009-12-16 Wolf
	// change div to li ### 2010-04-02 Wolf
	for(var obj, i=0;obj=node.childNodes[i];++i) { if(obj.nodeName.toLowerCase()=="li" && obj.firstChild.nodeName.toLowerCase()=="a" && obj.firstChild.firstChild.data==user) { node.removeChild(node.childNodes[i]); break; } } },
	changeUser: function(userData) { var node = document.getElementById("chat-chatusers"); var data = userData.split(","); 
	// var obj new defined ### 2009-12-16 Wolf
	// change div to li ### 2010-04-02 Wolf
	for(var obj, i=0;obj=node.childNodes[i];++i) { if(obj.nodeName.toLowerCase()=="li" && obj.firstChild.nodeName.toLowerCase()=="a" && obj.firstChild.firstChild.data==data[0]) { obj.firstChild.href = pichat.control.getCommandLink()+escape("/whois "+data[1].split(":")[1]); obj.firstChild.firstChild.data=data[1].split(":")[1]; break; } } pichat.output.sortUsers(); },
 
	// add complete new function changeAway ### 2010-03-26 Wolf
	changeAway: function(userList) { 
	  var users = userList.split(","); 
    for(var i=0;i<users.length;++i) { 
      if(isNaN(parseInt(users[i]))) break; 
      var node = document.getElementById("chat-chatusers"); 
      var user = users[i].split(":")[1]; 
      for(var obj, j=0;obj=node.childNodes[j];++j) { 
    // change div to li ### 2010-04-02 Wolf
        if(obj.nodeName.toLowerCase()=="li" && obj.firstChild.nodeName.toLowerCase()=="a" && obj.firstChild.firstChild.data==user) { 
          // check if user is STATUS_ONLINE or AWAY and change className ### 2010-03-26 Wolf
          // need li chatst and chatsa defined in the colorscheme CSS ### 2010-03-29 Wolf
         obj.className = users[i].split(":")[0]==1 ? "chatst" : "chatsa" ;
        } 
      } 
    }
  },
 
	sortUsers: function() { var node = document.getElementById("chat-chatusers"); var list = new Array; 
	// var obj new defined ### 2009-12-15 Wolf
	// change div to li ### 2010-04-02 Wolf
	for(var obj, i=0,j=0;obj=node.childNodes[i];++i) if(obj.nodeName.toLowerCase()=="li" && obj.firstChild.nodeName.toLowerCase()=="a") list[j++] = [obj.firstChild.firstChild.data.toLowerCase(),obj]; list.sort(function(a,b){return a[0]>b[0]?1:a[0]<b[0]?-1:0}); for(var i=list.length-1;i>=0;--i) node.insertBefore(list[i][1],node.childNodes[1]); },
	changeStatus: function(statusText) { pichat.output.changeTextNode("chat-statustext", statusText); },
	changeTextNode: function(id, text) { var node = document.getElementById(id); if(!node.firstChild) { node.appendChild(document.createTextNode(text)) } else { node.firstChild.nodeValue = text; } },
	changeColorScheme: function(name, path1, path2) { changeStyleSheet(name); output.changeStyleSheet(name); changeChatImages(path1, path2); output.changeChatImages(path1, path2); }
}
var mChatroom = "", mChatroomTopic = "";
 
pichat.control =
{ 
	initChat: function() { if(pichat.control.checkDom()) { mChatOK = true; pichat.control.enableScroll(); pichat.input.captureEvents(); pichat.input.focusInput(); } },
	setActiveWindow: function() { mActiveWindow = true; pichat.control.stopTitleAnimation(); },
	setInactiveWindow: function() { mActiveWindow = false; },
	enableScroll: function() { mScrollOK = true; setTimeout("pichat.control.doScroll()", 1); },
	disableScroll: function() { mScrollOK = false; },
	doScroll: function() { if(mScrollOK && mChatOK) { output.scrollBy(0, 9999); setTimeout("pichat.control.doScroll()", 50); } },
	startTitleAnimation: function() { if(!mTitleAnimated && !mActiveWindow) { mTitleAnimated = true; mTitleAnimationSteps = 72000; mTitleOriginal = top.document.title; setTimeout("pichat.control.doTitleAnimation()", 1); } else { mTitleAnimationSteps = 72000; } },
	stopTitleAnimation: function() { if(mTitleAnimated) { top.document.title = mTitleOriginal; mTitleAnimated = false; } },
	doTitleAnimation: function() { if(mTitleAnimated) { --mTitleAnimationSteps; if(mTitleAnimationSteps>0) { if(mTitleAnimationSteps&1) { top.document.title = mTitleOriginal; } else { top.document.title = pichat.control.getTextString("chat_t_message_blink")+" "+mTitleOriginal; } setTimeout("pichat.control.doTitleAnimation()", 500); } else { pichat.control.stopTitleAnimation(); } } },
	sendPingReply: function(text) { var d = new Date(); var timestamp = d.getTime()+d.getTimezoneOffset()*60000; top.dummy.location.href = pichat.control.getClientLink()+"&pingreply="+text+"&timestamp="+timestamp; },
	sendClientInterface: function(action) { handleChatClient(action, Array.prototype.slice.call(arguments, 1)); },
	checkDom: function() { return document.getElementById && document.createElement && document.createTextNode; },
	getCommandLink: function() { return getChatCommandLink(); },
	getClientLink: function() { return getChatClientLink(); },
	getTextString: function(key) { return getChatTextString(key); },
	getTextStringFormated: function(key) { var str = getChatTextString(key); for(var i=1;i<arguments.length;++i) str = str.replace("%s", arguments[i]); return str; }
}
var mChatOK = false, mScrollOK = false, mActiveWindow = true, mTitleAnimated = false, mTitleAnimationSteps = 0, mTitleOriginal = ""; 
 
/* wolf */

NEW Overview of Colornames and CSS

Farbcodes from default colorscheme Day

Colornames Value (RGB) CSS COMMENT
COLOR_TEXT_BACK 255,255,255 .chatnormal { background-color:#FFFFFF; }
COLOR_TEXT_NEUTRAL 0,0,0 body { color:#000000; }
.chatnormal { color:#000000; }
COLOR_TEXT_CHAT 0,0,0 .chat0n { color:#000000; }
.chat0b { color:#000000; }
also used for color0 (default)
COLOR_TEXT_STATUSNEGATIVE 215,0,0 .chat1n { color:#D70000; }
.chat1b { color:#D70000; }
also used for color1 (red)
COLOR_TEXT_STATUSPOSITIVE 0,150,0 .chat2n { color:#009600; }
.chat2b { color:#009600; }
also used for color2 (green)
COLOR_TEXT_STATUSNEUTRAL 0,0,200 .chat3n { color:#0000C8; }
.chat3b { color:#0000C8; }
also used for color3 (blue)
COLOR_TEXT_STATUSALT 230,175,0 .chat4n { color:#E6AF00; }
.chat4b { color:#E6AF00; }
also used for color4 (yellow)
COLOR_TEXT_LINK 0,0,200 a:link { color:#0000C8; }
a:visited { color:#0000C8; }

NEW :?:
a { color:#0000C8; }
COLOR_TEXT_LINKACTIVE 215,0,0 a:hover { color:#D70000; }
a:active { color:#D70000; }

NEW :?:
a:hover, a:active, a:focus { color:#D70000; }
COLOR_TEXT_TIMESTAMP 0,0,200 .chattn { color:#0000C8; }
COLOR_TEXT_NICKNAME 0,0,200 .chatnn { color:#0000C8; }
.chatnb { color:#0000C8; }
COLOR_TEXT_NICKNAMEOTHER 215,0,0 .chaton { color:#D70000; }
.chatob { color:#D70000; }
COLOR_TEXT_CHATOTHER 0,0,0 .chatcn { color:#000000;}
.chatcb { color:#000000; }
COLOR_TEXT_FILTER :?: n.a.
COLOR_TEXT_SELECTBACK :?: n.a.
NEW :?:
::-moz-selection { background-color:#D70000; }
::selection { background-color:#D70000; }
COLOR_TEXT_SELECTTEXT :?: n.a.
NEW :?:
::-moz-selection { color:#FFFFFF; }
::selection { color:#FFFFFF; }
COLOR_TEXT_INPUTBACK 255,255,255 .chatinput { background-color:#FFFFFF; }
COLOR_TEXT_INPUTTEXT 0,0,0 .chatinput { color:#000000; }
COLOR_TEXT_SIDEBACK 255,255,255 .chatside { background-color:#FFFFFF;}
NEW :?:
#sidebar { background-color:#FFFFFF; }
FIXME do not work at the moment!
COLOR_TEXT_SIDEHEADING 0,0,0 .chatside { color:#000000; }
NEW :?:
.chat-heading { color:#000000; }
COLOR_TEXT_SIDETEXT :?: n.a.
NEW :?:
#sidebar a { color:#ff0000; }
COLOR_TEXT_SIDEAWAY :?: n.a.
NEW :?:
.chatsa a:visited, .chatsa a:link { color:#0080C8 !important; }
COLOR_TEXT_SIDESELECTBACK :?: n.a.
NEW :?:
#sidebar a:hover, #sidebar a:active, #sidebar a:focus { background-color:#22e; }
COLOR_TEXT_SIDESELECTTEXT :?: n.a.
NEW :?:
#sidebar a:hover, #sidebar a:active, #sidebar a:focus { color:black; !important; }


NEW :?:
/*wolf*/


Translate
Advertisment
  • more about Pichat on http://www.pichat.net
  • C4 - Tiny chat software
  • http://600infos.de
  •    Counter:  09447  Online:  15  Your IP:  38.107.179.237  DNS:  unknown  Page generated in    0.36 sec.