Hello again! Since i have installed AWChat, after some time of staying on my forum's index, my mozzile firefox browser tab title changes to "undefinded". Why is that?
Maybe my AWChat Js can help:
It's quite long, i know, but i put all the plugins in the same js . Any help ? Thanks!
Maybe my AWChat Js can help:
- Code:
var avacweb_chat_config = {
version : '1-7',
new_chat_title : 'Free Stuff Forum Chatbox',
light_up_color : 'orange',
auto_log_in : 'open',
archives : 1,
sound_file : 'http://www.freesfx.co.uk/rx2/mp3s/2/1305_1256857800.mp3',
stylesheet : 'http://chat.avacweb.net/avacweb_chat.css',
disable_timeout : 0,
allow_private_messaging : 1,
allow_user_resize : 1,
message_hook : [],
user_hook : [],
commands : {},
events : {},
add_event : function(type, fn) {
type = /^on/.test(type) ? type : 'on' + type;
type in this.events ? this.events[type].push(fn) : this.events[type] = [fn];
}
};
document.write('<script type="text/javascript" src="http://chat.avacweb.net/v' + avacweb_chat_config.version + '.js" id="achat_script"></script>');
avacweb_chat_config.message_hook.push(function(row, username, user_id, user, msg) {
msg.innerHTML = msg.innerHTML.replace(/\b(ma-ta|idiot|mata|pula|pizda|coi|coaie|vagin|fuck|dracu|drac|prost|tacto)\b/gi, '[CENZURAT]');
});
avacweb_chat_config.add_event('onlogin', function(e) {
if( !this.cookie('intro') ) { //using avacweb_chat's built in cookie function.
this.popup('Salut! Bine ai venit pe chatul forumului FreeStuff! Scrie /cmd pentru a vedea o listă cu comenzile disponibile. Enjoy!');
this.cookie('intro', true);
}
});
avacweb_chat_config.add_event('onnew', function(e) {
e.preventDefault(); // prevent the default notifications taking place.
document.title = 'Mesaj Nou!'; // change the tab title to let the user know of the new message
});
avacweb_chat_config.add_event('onopen', function(e) {
document.title = avacweb_chat.original_page_title; // now they have opened the chat, put the title back to normal. Luckily avacweb_chat saves it ;)
});
avacweb_chat_translation = {
'log in' : 'Log In',
'log out': 'Deloghează-te',
'chat' : 'Chat',
'on' : 'On',
'off' : 'Off',
'close' : 'Închide',
'smilies': 'Smilies',
'colors' : 'Culori',
'send' : 'Trimite',
'archives' : 'Arhive',
'message': 'Mesaj',
'refresh': 'Reîmprospătează',
'you are disconnected. click log in to join the chat.' : 'Ești deconectat. Click pe Log In ca să te alături chatului.',
'user options' : 'Opțiunile utilizatorului',
'color' : 'Culoare',
'sound' : 'Sunet',
'bold' : 'Îngroșat',
'underline' : 'Subliniat',
'strike' : 'Tăiat',
'italic' : 'Italic',
'private message' : 'Mesaj privat',
'loading smilies...' : 'Încarc smilies...',
'this command is not available or does not exist' : 'Această comandă nu este disponibilă sau nu există.',
'user not found' : 'Utilizatorul nu este găsit',
'view profile' : 'Vezi profilul',
'send private message' : 'Trimite PM',
'kick from chat' : 'Dă-l afară de pe chat',
'remove from moderators' : 'Șterge Moderatorul',
'send friend request' : 'Trimite cerere de prietenie',
'add to moderators' : 'Fă-l Moderator',
'away' : 'Plecat',
'reading' : 'Citesc',
'start private conversation' : 'Începe conversație privată',
'conversation with' : 'Conversație cu',
'public' : 'Public'
};
avacweb_chat_config.message_hook.push(function(row, username, userid, usr, msg) {
row.innerHTML += '<span class="awc-quote" onclick="parent.avacweb_chat.quote_msg(\'' + username.replace(/'/g, "\\'") + '\', this.parentNode)">Citează</span>';
});
avacweb_chat_config.add_event('onload', function() {
avacweb_chat.quote_msg = function(user, row) {
avacweb_chat.insert_text( '[quote="' + user + '"]' + $('.msg', row).text() + '[/quote]' );
};
});
(function(awc) {
('Avacweb chat Plug in Poke System');
//add out poke command :)
awc.commands.poke = {
description : '/poke username - "Ciupește" un user ca să îi atragi atenția. Această comandă este sensibilă la majuscule.',
run : function(msg) {
var uid = avacweb_chat.get_user_data(msg).id;
if(!uid) {
avacweb_chat.popup(msg + ' ' + avacweb_chat.t('nu este pe chat.'));
return false;
}
//store the user id's and send in a table
return '[table class="achat_poke" rel="' + uid + '|' + avacweb_chat.user('id') + '][tr][td][/td][/tr][/table]';
}
};
awc.message_hook.push(function(row, username, user_id, user, msg) {
var poke = $('.achat_poke', row)[0]; // look for the poke table
if(!poke) return;
var users = poke.getAttribute('rel').split('|'), poker = parseInt(users[1]), poked = parseInt(users[0]), time = $('.date-and-time', row)[0].innerHTML;
if(!avacweb_chat.user('id') || !poker || !poked) return row.innerHTML = '';
if(poked == avacweb_chat.user('id')) {
if( !avacweb_chat.pokes[time] ) { //check if we've already alerted of this poke
avacweb_chat.pokes[time] = 1;
document.title = avacweb_chat.get_user_data(poker).name + ' ' + avacweb_chat.t('Te-a Ciupit') + '!';
document.getElementById('achat_sound').innerHTML = '<embed src="' + avacweb_chat.sound_file + '" hidden="true" autostart="true" loop="false" />';
}
row.innerHTML = '<span class="poke">' + avacweb_chat.get_user_data(poker).name + ' ' + avacweb_chat.t('te-a ciupit') + '!</span> ' + time;
}
else if(poker == avacweb_chat.user('id')) {
row.innerHTML = '<span class="poke">' + avacweb_chat.t('L-ai ciupit pe') + ' ' + avacweb_chat.get_user_data(poked).name + '.</span>' + time;
}
else {
row.innerHTML = '';
row.style.display = 'none';
}
});
awc.add_event('onload', function() {
avacweb_chat.pokes = {}, cookie = avacweb_chat.cookie('pokes');
if(JSON && cookie) avacweb_chat.pokes = JSON.parse(cookie);
});
awc.add_event('onnew', function() {
if(JSON && avacweb_chat.pokes) {
avacweb_chat.cookie('pokes', JSON.stringify(avacweb_chat.pokes), 0);
}
});
})(avacweb_chat_config);
avacweb_chat_config.commands.system = {
description : '/system mesaj - postează un mesaj de tip System',
run : function(text) {
if(text && text.length) {
return '[table class="system-message"][tr][td]' + text + '[/td][/tr][/table]';
}
return false;
}
};
avacweb_chat_config.commands.warning = {
description : '/warning mesaj - postează un mesaj de timp Atenționare',
run : function(text) {
if(text && text.length) {
return '[table class="warning-message"][tr][td]' + text + '[/td][/tr][/table]';
}
return false;
}
};
avacweb_chat_config.message_hook.push(function(row) {
var m = $('.system-message, .warning-message', row)[0];
if(m) {
var msg = m.getElementsByTagName('td')[0].innerHTML;
row.innerHTML = '<div class="' + m.className + '">' + msg + '</div>';
}
});
avacweb_chat_config.user_hook.push(function(row) {
var l = row.getElementsByTagName('a')[0];
if(l) {
l.setAttribute('onclick', 'if(event) event.preventDefault(); ' + l.getAttribute('oncontextmenu'));
l.removeAttribute('oncontextmenu');
}
});
avacweb_chat_config.message_hook.push(function(row, username, user_id, user) {
user.innerHTML = user.innerHTML.replace(/@(?=\W)/, '[Mod]'); //perform @ replacement
});
avacweb_chat_config.user_hook.push(function(row, username, user_id) {
var u = row.getElementsByTagName('a')[0];
if(u) u.innerHTML = u.innerHTML.replace(/@(?=\W)/, '[Mod]'); //perform @ replacement
});
It's quite long, i know, but i put all the plugins in the same js . Any help ? Thanks!