// Chat-Mods (C) 2008 Sven van Bolt // ----- 8< --== lib_php_emu.js.php ==-- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- function html_specialchars(text) { text = text.replace(/&/g, '&'); text = text.replace(/>/g, '>'); text = text.replace(/'); text = text.replace(/</g, '<'); text = text.replace(/&/g, '&'); text = text.replace(/"/g, '"'); return text; } // ----- >8 --== lib_php_emu.js.php ==-- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- // ----- 8< --== mod_ds-bridge.js.php ==-- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- function ds_bridge__nick2fsnick(nick) { var wordsep_re = /^(.*[a-z])([A-Z].*)$/; var wordsep_m = true; while (wordsep_m != null) { wordsep_m = wordsep_re.exec(nick); if (wordsep_m != null) { nick = wordsep_m[1] + '_' + wordsep_m[2]; } } nick = nick.toLowerCase(); return nick; } // ----- >8 --== mod_ds-bridge.js.php ==-- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- // ----- 8< --== mod_ds-bridge.js.php ==-- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- // ----- >8 --== mod_ds-bridge.js.php ==-- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- // ----- 8< --== mod_sendtext.js.php ==-- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- function sendtext_helper_form() { if (document.forms['schreibe_ohne_utf8'] != null) { return false; } document.writeln('
'); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln(' '); document.writeln('
'); return true; } function sendtext_write(some_text) { if (document.forms['schreibe_ohne_utf8'] == null) { prompt('Kann Text nicht senden: Hilfsformular fehlt!', some_text); return false; } with (document.forms['schreibe_ohne_utf8']) { elements['text2'].value = some_text; submit(); } return false; // make it usable for onclick=... } var sendtext_sendlog = new Array(); var sendtext_orig_handler = null; function sendtext_submit_handler() { var text = document.forms[0].elements['text2'].value; if ( (text != '') && (text != sendtext_sendlog[0]) ) { // MSIE 5 kann leider noch kein unshift() und pop() für Arrays. :-D // neueste Einträge oben. var newlog = new Array(text); var keep = sendtext_sendlog.length; if (keep > 8) { keep = 8; } for (var kidx = 0; kidx < keep; kidx++) { newlog[kidx + 1] = sendtext_sendlog[kidx]; } sendtext_sendlog = newlog; sendtext_gen_sendlog(); } return sendtext_orig_handler(); // zum Schluss, weil es je nach /clearedit den text2 löscht. } function sendtext_add_sendlog() { with (document.getElementsByTagName('body')[0]) // MSIE 5 bugg0rt, wenn ich tiefer als body ansetze. { innerHTML = innerHTML.replace(/(]*value="?Go!"?[^<>]*>)/i, '$1 '); } sendtext_orig_handler = resetinput; resetinput = sendtext_submit_handler; sendtext_gen_sendlog(); } function sendtext_gen_sendlog() { var html = ''; document.getElementById('sendlog').innerHTML = html; } function sendtext_select_sendlog() { with (document.forms[0].elements['sendlog2']) { if (selectedIndex > 0) { var text = prompt('Soll der Text an die Eingabezeile angehängt werden?', options[selectedIndex].value) if (text != null) { document.forms[0].elements['text2'].value += text; } selectedIndex = 0; } } document.forms[0].elements['text2'].focus(); return false; } // ----- >8 --== mod_sendtext.js.php ==-- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- // ----- 8< --== mod_chatlog.js.php ==-- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- var anti_stream_stop__prev_font_count = 0; var anti_stream_stop__last_event_time = 0; var anti_stream_stop__event_timeout = 150; // im Normalfall sendet Fidion spätestens nach 102 Sekunden idle die "User im Raum ...:" Info. // Wenn die also nach 150 Sekunden noch immer nicht kommt, hängt der Chat wohl. function replace_jap_smileys(html) { var anfang = ''; while(true) { var fund = jap_smiley_re.exec(html); if (fund == null) { return anfang + html; } var jsm = html_decode(fund[2]); try { jsm = encodeURIComponent(jsm); } catch(msie5_doesnt_support_it) { jsm = jsm.replace(/%/g, '%25'); jsm = jsm.replace(/&/g, '%26'); jsm = jsm.replace(/'/g, '%27'); jsm = jsm.replace(/"/g, '%22'); } jsm = jsm.replace(/%C2(%B0)/g, '$1'); anfang += fund[1] + '[jap. Smiley]'; html = fund[fund.length - 1]; } } function chat_frame_addons(update_interval, first_call) { var now_uts = Math.floor((new Date).getTime() / 1000); try { var texte = document.getElementsByTagName('font'); var tcnt = texte.length; if (tcnt != anti_stream_stop__prev_font_count) { anti_stream_stop__prev_font_count = tcnt; anti_stream_stop__last_event_time = now_uts; } for (var tidx = 0; tidx < tcnt; tidx++) { chat_frame_process_line(texte[tidx], update_interval, first_call); } if (update_interval > 0) { if (now_uts > anti_stream_stop__last_event_time + anti_stream_stop__event_timeout) { location.reload(); } setTimeout('chat_frame_addons(' + update_interval + ', false);', update_interval); } return true; } finally { return false; } } function chat_frame_process_line(line, update_interval, first_call) { // wurde das Element bereits gelöscht, vllt. durch vorige Ersetzungen? if (typeof(line) == 'undefined') { return false; } // nur Elemente auf der Hauptebene if (line.parentNode.tagName.toLowerCase() != 'body') { return false; } var pubdir = '!em $2 ($1)'); // geheime benannte Smileys: if (admin_text) { html = html.replace(/&&(x-[a-z\-_0-9]+);/g, pubdir + 'smileys/$1.gif" alt="" title="">'); } // Sparkling Nicknames (Anspielung auf Twilight) html = html.replace(/^<[bB]>([^\<\>]+):<\/[bB]> ([^ ])/, '$1: $2'); // benannte Smileys: html = html.replace(/&&([a-wyz\-_0-9][a-z\-_0-9]*);/g, pubdir + 'smileys/$1.gif" alt="[Smiley: $1]" title="Smiley: $1">'); // Deko-Icons: html = html.replace(/&(u|g|ft)\.([a-z\-_0-9]+);/g, pubdir + 'deko-icons/$1-$2.gif" alt="[Deko-Icon: $1.$2]" title="Deko-Icon: $1.$2">'); // jap. Smileys: html = replace_jap_smileys(html); // Admin-Status verbergen: if (html.substr(0, 16).toLowerCase() == 'user im raum ') { html = html.replace(/]+> \(Admin\)<\/font>/ig, ''); } // (veraltet) geschützte Animexx-Bilder-Links ausbessern // html = html.replace(/]+>http:\/\/datamexx\.onlinewelten\.com\/\w+\/\w+\/\w+\/([^<>]+)<\/a>/i, 'http://animexx.onlinewelten.com/pic_redirect.php?url=/$1'); if (String(line.style.backgroundColor) == '') { // Moderatoren, z.B. Nightsky|Scarletsedusa|Eriol // if ( html.search(/^(MakoChan|Camelie|La-vie-en-rose|Quini|Janoir):<\/B> /i) > -1 ) { line.style.backgroundColor = '#FFE4C8'; } } if (String(line.innerHTML) != html) { line.innerHTML = html; } } line['prevlen'] = html.length; return true; } /** Support für jap. Smileys **/ var JAPANESE_SMILEY_DETECT_RE = '(~|=|)(|�?39;|\')([\\^\\-:;xo0\\*\\+~]|>|<)(\\,?)(_{0,20}|\\.)\\4([\\^\\-:;xo0\\*\\+~]|>|<)\\2(~|=|)((?:[:;\\*°#"]|�?39;|\'|"|°){0,4})';var old_msie_bugfix_re = JAPANESE_SMILEY_DETECT_RE.replace(/\(\?:/g, '('); var jap_smiley_re = new RegExp('^(.*)\\{(' + old_msie_bugfix_re + ')\\}(.*)$', 'i'); // ----- >8 --== mod_chatlog.js.php ==-- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- // ----- 8< --== mod_userlist.js.php ==-- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- // Achtung: Diese Datei wurde/wird automatisch generiert! var genlist_userdata_record_length = 1; var genlist_userdata_uid2nick = new Object(); var nick_icons = new Object(); nick_icons['Hugo:469'] = 'flugel-w'; nick_icons['Eriol:391'] = 'note'; nick_icons['Bommel:391'] = 'flugel-s'; nick_icons['Emoriol:391'] = 'ukreuz-s'; nick_icons['ScarletSedusa:486'] = 'krone-s'; nick_icons['Aimi:856'] = 'note'; nick_icons['Aitashi:1088'] = 'note'; nick_icons['Angelic:478'] = 'note'; nick_icons['Anomalie:1023'] = 'note'; nick_icons['Arashi:1009'] = 'note'; nick_icons['Artemisia:512'] = 'note'; nick_icons['Aurwen:592'] = 'note'; nick_icons['Azami-shiba:822'] = 'note'; nick_icons['Bia-chan:622'] = 'note'; nick_icons['Camelie:509'] = 'note'; nick_icons['Caramell-chan:824'] = 'note'; nick_icons['Celestial-rose:4'] = 'note'; nick_icons['Chocolate-hime:34778'] = 'note'; nick_icons['Christian:1156'] = 'note'; nick_icons['Coquetrie:580'] = 'note'; nick_icons['Delfina:1041'] = 'note'; nick_icons['Diepii:1101'] = 'note'; nick_icons['Duplica:608'] = 'note'; nick_icons['Elisana:1178'] = 'note'; nick_icons['Everlin:1187'] = 'note'; nick_icons['Haarspray:310'] = 'note'; nick_icons['Hyenaurun:2311'] = 'note'; nick_icons['Icemoon:1196'] = 'note'; nick_icons['Janoir:528'] = 'note'; nick_icons['Julaz:612'] = 'note'; nick_icons['Kantorka:524'] = 'note'; nick_icons['Kayo:1096'] = 'note'; nick_icons['Kikuri:797'] = 'note'; nick_icons['Klein-karamell:960'] = 'note'; nick_icons['Ku-ten:510'] = 'note'; nick_icons['Kyuketsuki:1043'] = 'note'; nick_icons['La-vie-en-rose:477'] = 'note'; nick_icons['Lala:511'] = 'note'; nick_icons['Lestaire:1022'] = 'note'; nick_icons['Maho:667'] = 'note'; nick_icons['Makochan:467'] = 'note'; nick_icons['Melwen:837'] = 'note'; nick_icons['Meredy:1103'] = 'note'; nick_icons['Milchkaffee:978'] = 'note'; nick_icons['Minako:980'] = 'note'; nick_icons['Minchen:1229'] = 'note'; nick_icons['Moriel:1099'] = 'note'; nick_icons['Nancy:1019'] = 'note'; nick_icons['Nessera:1094'] = 'note'; nick_icons['Nightsky:466'] = 'note'; nick_icons['Oishiimono:472'] = 'note'; nick_icons['Pankeki:1098'] = 'note'; nick_icons['Purincessu:1027'] = 'note'; nick_icons['Quini:470'] = 'note'; nick_icons['Ricebunny:2161066'] = 'note'; nick_icons['Rommily:1090'] = 'note'; nick_icons['Saturnine:1092'] = 'note'; nick_icons['Sayoko:963'] = 'note'; nick_icons['Selaya:493'] = 'note'; nick_icons['Senyo:959'] = 'note'; nick_icons['Siana-lee:828'] = 'note'; nick_icons['Snowwhite:1032'] = 'note'; nick_icons['Tabsi:965'] = 'note'; nick_icons['Vanilla:1093'] = 'note'; nick_icons['William:1175'] = 'note'; nick_icons['Windprinzessin:805'] = 'note'; function mod_genlist(code) { var reclen = (/var interval = (\d+);/).exec(code); if (reclen == null) { return code; // Mod würde fehlschlagen => unverändert abbrechen } else { genlist_userdata_record_length = Number(reclen[1]); } code = code.replace(/(function\s+genlist\s*\(([^\(\)]*)\)\s*\{)/, '$1 if (custom_genlist($2)) { return true; }'); return code; } function custom_genlist(liste, aktion) { switch (aktion) { case 'chatuserliste': custom_genlist_chatuserliste(liste); return true; } return false; } function custom_genlist_chatuserliste(liste) { document.writeln(''); var user_cnt = Math.floor(liste.length / genlist_userdata_record_length); user_cnt -= 0; for (user_idx = 0; user_idx < user_cnt; user_idx++) { var ud_base = user_idx * genlist_userdata_record_length; var uid = Number(liste[ud_base + 0]); var nickname = String(liste[ud_base + 2]); var away = ( String(liste[ud_base + 5]) == 'y' ); var ulevel = String(liste[ud_base + 6]); genlist_userdata_uid2nick[uid] = nickname; var bgcolor = color[user_idx % color.length]; var fsnick = ds_bridge__nick2fsnick(nickname); document.writeln(''); document.writeln(''); document.writeln(''); document.writeln(' '); document.writeln(' '); document.writeln(''); } document.writeln('
'); document.writeln(''); var deko_icon = ''; if (nick_icons[nickname + ':' + uid] != null) { deko_icon = nick_icons[nickname + ':' + uid]; } var afk_mode = ''; if (away) { afk_mode = 'afk'; } switch (nickname) { case 'Eriol': case 'Eriol-mobile': if (afk_mode == '') { afk_mode = 'semi-afk'; } break; case 'Ifurita': case 'La-vie-en-rose': case 'MakoChan': case 'Nightsky': case 'Quini': // if (afk_mode == '') { afk_mode = 'ds-red'; } break; case 'Hugo': afk_mode = 'bot'; break; } switch (afk_mode) { case 'semi-afk': document.writeln('(semi-afk)'); break; case 'afk': document.writeln('(afk)'); break; case 'bot': document.writeln('(Chatbot)'); break; case 'ds-red': document.writeln('(Red.)'); break; case 'mod': document.writeln('(Mod)'); break; case '': break; default: document.writeln('(' + afk_mode + ')'); break; } document.writeln(''); document.write(' ' + nickname + ''); if (deko_icon != '') { document.write(' ' + deko_icon + ''); } document.writeln('
'); document.writeln('

^-- Klicke oben auf einen Nickname, um mehr Infos zu sehen.

'); sendtext_helper_form(); } function udet_toggle(uid) { var uts = document.getElementById('usertoggle_' + uid).style; var uds = document.getElementById('udet_' + uid).style; if (uds.display == '') { uds.display = 'none'; uts.fontWeight = ''; } else { uds.display = ''; uts.fontWeight = 'bold'; } return false; } function udet_whisper(uid) { alert('Früher konntest du hier direkt flüstern, aber das funktionierte oft nicht.\n' + 'Benutze daher lieber den Befehl "/t Nick Text", wobei vom Nick auch die Anfangsbuchstaben ausreichen.'); /* var nick = genlist_userdata_uid2nick[uid]; var text = prompt('An ' + nick + ' flüstern:', ''); if (text != null) { sendtext_write('/msg ' + nick + ' ' + text); } */ return false; } function udet_chat_acc_popup(uid) { var popup_url = 'http://' + chatserver + '/user.php?http_host=dunkelsuess.mainchat.de&id=' + id + '&schau_raum=1&aktion=zeig&user=' + uid; var popup_win = uid + '_' + genlist_userdata_uid2nick[uid]; window.open(popup_url, popup_win, 'resizable=yes,scrollbars=yes,width=320,height=450'); return false; } function userdetail_popup_enhancements() { } // ----- >8 --== mod_userlist.js.php ==-- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- // ----- 8< --== mod_colorbar.js.php ==-- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- var colorbar_colors = new Array( '000000', '444444', '888888', // grau '880000', 'FF0000', 'FF7777', // rot '884400', 'FF8800', 'CCAA00', // orange und gelb '008800', '00DD00', '55CC55', // grün '000088', '0000FF', '5555FF', // blau '550055', 'AA00AA', 'FF00FF', 'FF55FF', 'AA55AA' // lila und rosa ); function replace_color_bar() { var bodyTag = document.getElementsByTagName('body'); bodyTag = bodyTag[0]; with (bodyTag) { innerHTML = innerHTML.replace(/]+>[^\n]+<\/td>/ig, ''); innerHTML = innerHTML.replace(/(Farbe:<\/b> <\/font>)/i, '$1'); } var colorBar = document.getElementById('color-select'); if (colorBar != null) { var html = ''; for (var cidx = 0; cidx < colorbar_colors.length; cidx++) { var color = colorbar_colors[cidx]; html += '   '; } html += ' [eigene]'; colorBar.innerHTML = html; } } function setColor(color) { if (color === true) { color = prompt('Eigene Farbe (als 6 Hex-Ziffern, d.h. 0-9 und A-F):', ''); if (color === null) { return false; } } color = String(color).replace(/[^0-9a-fA-F]/g, ''); if (color.length != 6) { alert('Das ist keine gültige Farbe: ' + color); return false; } location.href = String(document.URL).replace(/\&farbe=\w+/, '') + '&farbe=' + color; return false; } // ----- >8 --== mod_colorbar.js.php ==-- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- >8 ----- var chatserver = document.URL; chatserver = chatserver.replace(/^.+\/\//, ''); chatserver = chatserver.replace(/\/.*$/, ''); /** Frame-Unterscheidung **/ var frame_name = String(document.URL); frame_name = frame_name.replace(/^http:\/\/[^\/]+\.de\//, ''); frame_name = frame_name.replace(/\.php\?.+$/, ''); document.writeln(''); switch (frame_name) { case 'log': window.onload = function() { chat_frame_addons(0, true); }; break; case 'chat': setTimeout('chat_frame_addons(500, true);', 0); break; case 'user': if (document.URL.indexOf('&aktion=chatuserliste') > -1) { document.writeln('' + mod_genlist(String(genlist)) + ''); } if (document.URL.indexOf('&aktion=zeig') > -1) { window.onload = userdetail_popup_enhancements; } break; case 'interaktiv': // document.writeln(''); // Werbung killen break; case 'eingabe': window.onload = function() { replace_color_bar(); sendtext_add_sendlog(); }; break; }