Hallo,
folgenden Code habe ich hier. Das rot markierte geht nicht, das orange markierte geht aber und der rest geht auch. (Die Stellen sind ganz rechts unten)
}
folgenden Code habe ich hier. Das rot markierte geht nicht, das orange markierte geht aber und der rest geht auch. (Die Stellen sind ganz rechts unten)
Code:
var fWinLineNr=0;
var fWinUser={};
var docTds = document.getElementsByTagName("td");
function fWinStream(){
for(i=fWinLineNr;i<docTds.length;i++){
a=lineData(docTds[i])
if(!!a && a[0]==2 && !!(docTds[i].innerHTML.match(/ fl.stert<.span>:/i))){
/(\w+) fl.stert<.span>/i.exec(docTds[i].innerHTML);
nick = RegExp.$1;
//alert(nick+" an dich");
if(!!fWinUser[nick]){
fWinUser[nick].messages[fWinUser[nick].messages.length] = docTds[i].innerHTML.replace(/ flüstert/, "");
fWinUser[nick].lineNr.push(i);
if(!!fWinUser[nick]["fWin"] && !fWinUser[nick]["fWin"].closed && !!fWinUser[nick]["fWin"].name){
var newTbl=fWinUser[nick]["fWin"].document.createElement("table");
var newTbody=fWinUser[nick]["fWin"].document.createElement("tbody");
var newTr=fWinUser[nick]["fWin"].document.createElement("tr");
var newTd=fWinUser[nick]["fWin"].document.createElement("td");
newTd.setAttribute("id", "td"+i);
newTr.appendChild(newTd);
newTbody.appendChild(newTr);
newTbl.appendChild(newTbody);
fWinUser[nick].fWin.document.getElementById("fluesterStream").appendChild(newTbl);
fWinUser[nick].fWin.document.getElementById("td"+i).innerHTML=fWinUser[nick].messages[fWinUser[nick].messages.length-1];
if(!fWinUser[nick].showInStream){
docTds[i].parentNode.parentNode.parentNode.style.display="none";
}
}
}
}
else if(!!(docTds[i].innerHTML.match(/Du fl.sterst an /i))){
/Du fl.sterst an (\w+)<.span>/i.exec(docTds[i].innerHTML);
nick = RegExp.$1;
//alert("du an "+nick);
if(!!fWinUser[nick]){
fWinUser[nick].messages[fWinUser[nick].messages.length]=docTds[i].innerHTML.replace("Du flüsterst an "+nick, myNick);
fWinUser[nick].lineNr.push(i);
if(!!fWinUser[nick]["fWin"] && !fWinUser[nick]["fWin"].closed && !!fWinUser[nick]["fWin"].name){
var newTbl=fWinUser[nick]["fWin"].document.createElement("table");
var newTbody=fWinUser[nick]["fWin"].document.createElement("tbody");
var newTr=fWinUser[nick]["fWin"].document.createElement("tr");
var newTd=fWinUser[nick]["fWin"].document.createElement("td");
newTd.setAttribute("id", "td"+i);
newTr.appendChild(newTd);
newTbody.appendChild(newTr);
newTbl.appendChild(newTbody);
fWinUser[nick].fWin.document.getElementById("fluesterStream").appendChild(newTbl);
fWinUser[nick].fWin.document.getElementById("td"+i).innerHTML=fWinUser[nick].messages[fWinUser[nick].messages.length-1];
if(!fWinUser[nick].showInStream){
docTds[i].parentNode.parentNode.parentNode.style.display="none";
}
}
}
}
}
fWinLineNr=i;
}
window.setInterval("fWinStream()", 500);
function fWinShowHide(show, nick){
fWinUser[nick].showInStream = show;
for(i=0; i<fWinUser[nick].lineNr.length; i++){
docTds[fWinUser[nick].lineNr[i]].parentNode.parentNode.parentNode.style.display=show?(document.all?"block":"table-cell"):"none";
}
}
function starteFWin(nick){
if(!fWinUser[nick]){
fWinUser[nick]={"messages":[], "fWin":{}, "lineNr":[], "showInStream":false};
var a;
for(i=0;i<docTds.length;i++){
a=lineData(docTds[i]);
if(!!a && a[0]==2 && a[2]==nick && docTds[i].innerHTML.match(/ fl.stert<.span>:/i)){
fWinUser[nick].messages.push(docTds[i].innerHTML.replace(/ fl.stert/, ""));
fWinUser[nick].lineNr.push(i);
}
else if( docTds[i].innerHTML.match("Du flüsterst an "+nick+"</")){
fWinUser[nick].messages.push(docTds[i].innerHTML.replace("Du flüsterst an "+nick, myNick));
fWinUser[nick].lineNr.push(i);
}
}
}
if(!!fWinUser[nick]["fWin"] && !fWinUser[nick]["fWin"].closed && !!fWinUser[nick]["fWin"].name){
fWinUser[nick]["fWin"].close();
}
fWinUser[nick]["fWin"] = window.open("about:blank", "fWin", "width=300,height=300,scrollbars=yes");
fWinUser[nick]["fWin"].document.write("<html><head><title>Flüsterfenster mit "+nick+"</title>"+
"<link rel='stylesheet' type='text/css' href='http://server"+chatData[0]+".webkicks.de/"+chatData[1]+"/style_stream.css'><script language='javascript'>window.setInterval('window.scrollBy(0,50)',100)</script></head><body><table style='width:100%;height:100%'><tbody>"+
"<tr style='height:100%'><td style='overflow:scroll; vertical-align:top;' id='fluesterStream'>"+
"<table><tbody><tr><td>"+fWinUser[nick].messages.join("</td></tr></tbody></table><table><tbody><tr><td>")+"</td></tr></tbody></table>"+
"</td></tr><tr><td>"+
"<form name='fForm' onsubmit='opener.sendeText(\"/f "+nick+" \"+this.fMessage.value); this.fMessage.value=\"\"; return false;'>"+
"im Stream anzeigen?<input type='checkbox' name='showHide' onclick='opener.fWinShowHide(this.checked, \""+nick+"\")'><input name='fMessage' class='input'><input type='submit' class='submit' value='Senden' style=[COLOR="#ff8c00"]font-family:Verdana;[/COLOR] [COLOR="Red"]font-size:8pt; font-weight: bold[/COLOR]></form></td></tr>"+
"</tbody></table></body></html>");