Well would like to intergrate the chat with toolbar
Like SystemFri 15 Oct 2021, 04:50
Auto Save MessagesFri 26 Feb 2021, 13:31
New tutorial questionMon 15 Feb 2021, 08:12
Support iOS Emojis (and other platforms)Sun 14 Feb 2021, 01:25
Does anybody have the original Avacweb Chat CSS?Tue 09 Feb 2021, 13:40
Page 1 of 1 •
how to add awc chat to forumotion toolbar
Shadow
Status : No status yet...
Posts : 232
Join date : 2011-11-09
Location : Serbia
Posts : 232
Join date : 2011-11-09
Location : Serbia
Wed 27 Mar 2013, 16:28
Rukiafan
Status : No status yet...
Posts : 533
Join date : 2012-07-20
Posts : 533
Join date : 2012-07-20
Wed 27 Mar 2013, 19:25
I would like this feature as well!
Mr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!
Posts : 1587
Join date : 2013-01-04
Posts : 1587
Join date : 2013-01-04
Thu 28 Mar 2013, 01:26
A clickable link?
You can just do this...
Let me know
You can just do this...
- Code:
[panda=js]
$(function() {
$('#fa_menu').before('<span class="chat_toggle" onclick="avacweb_chat.toggle()">Chat</span>');
});
Let me know
Rhino.Freak
Status : Moved on to Phpbb
Posts : 222
Join date : 2013-03-05
Age : 27
Location : India
Posts : 222
Join date : 2013-03-05
Age : 27
Location : India
Thu 28 Mar 2013, 05:38
that didn't work, sorry
Shadow
Status : No status yet...
Posts : 232
Join date : 2011-11-09
Location : Serbia
Posts : 232
Join date : 2011-11-09
Location : Serbia
Thu 28 Mar 2013, 19:56
It doesnt works for me :/Mr.Easybb wrote:[quotelink="http://www.avacweb.com/t1138-how-to-add-awc-chat-to-forumotion-toolbar#11027"]A clickable link?
You can just do this...
- Code:
[panda=js]
$(function() {
$('#fa_menu').before('<span class="chat_toggle" onclick="avacweb_chat.toggle()">Chat</span>');
});
Let me know
puppycheese
Status : No status yet...
Posts : 446
Join date : 2013-02-12
Age : 30
Location : New Jersey
Posts : 446
Join date : 2013-02-12
Age : 30
Location : New Jersey
Thu 28 Mar 2013, 20:01
me either I gave it a shot. But it didn't work. it was in the same spot and It also made the chat unclickable.
Shadow
Status : No status yet...
Posts : 232
Join date : 2011-11-09
Location : Serbia
Posts : 232
Join date : 2011-11-09
Location : Serbia
Tue 02 Apr 2013, 17:24
BUMP
Mr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!
Posts : 1587
Join date : 2013-01-04
Posts : 1587
Join date : 2013-01-04
Tue 02 Apr 2013, 18:17
You may need to add a time out to this, so do this
If it doesn't work right, just change the 300 to like 500 if that doesn't work let me know ok.
- Code:
[panda=js]
$(function() {
setTimeout(function() {
$('#fa_menu').before('<span class="chat_toggle" onclick="avacweb_chat.toggle()">Chat</span>');
},300);
});
If it doesn't work right, just change the 300 to like 500 if that doesn't work let me know ok.
Rukiafan
Status : No status yet...
Posts : 533
Join date : 2012-07-20
Posts : 533
Join date : 2012-07-20
Wed 03 Apr 2013, 18:29
Still not working, although the text "chat" does appear on the toolbar now, it's still not a clickable link.
Mr.Easybb
Status : Love this site, that's why I'm back each day again... lol Samantha's co-owner now. Well deserved!
Posts : 1587
Join date : 2013-01-04
Posts : 1587
Join date : 2013-01-04
Wed 03 Apr 2013, 23:15
It won't be a "clickable" link, you should still be able to click it though. To make it look like a clickable add this to the CSS
- Code:
[panda=css].chat_toggle {
cursor:pointer;
}
Schiggysboard
Status : No status yet...
Posts : 145
Join date : 2012-01-08
Posts : 145
Join date : 2012-01-08
Tue 18 Aug 2015, 11:45
Would be interested in it, too! For forumotion chatbox I'm using the following code, so that the number of users beeing in chat will display in toolbar. Also it's clickable, so that the chatbox opens in a window with configured width & height.
Is anyone able to edit this code, so that it works with AWC? @LGForum maybe?
I would be very grateful!
- Code:
- Code:
[panda=js]$(function(){$(function(){
var config = {
width : '700px',
height : '350px',
mod_icon : 'default',
msgnotif : true,
timestamp : true,
connection_logs : true
},
fa_chat = cre('IFRAME'), fa_button = cre('A'), fa_members = cre('SPAN'), fa_style = cre('STYLE'), fa_right = getId('fa_right'), frame,
css = '#fa_chat_button{line-height:30px;padding:0 5px;color:#FFF;cursor:pointer;} .fa_actif{background:#FFF !important;color:#000 !important;} .fa_new{background:#FF8 !important;color:#000 !important;} #fa_chat{background:#FFF;width:'+config.width+';height:'+config.height+';border:1px solid #000;border-top:none;position:absolute;top:30px;right:39px;}';
if (!fa_right || !_userdata.session_logged_in) return;
// set stylesheet
fa_style.type = 'text/css';
if (fa_style.styleSheet) fa_style.styleSheet.cssText = css;
else fa_style.appendChild(document.createTextNode(css));
document.getElementsByTagName('HEAD')[0].appendChild(fa_style);
// members attributes
fa_members.id = 'fa_members';
fa_members.innerHTML = '(0)';
// fa_button attributes
fa_button.innerHTML = 'Chat ';
fa_button.id = 'fa_chat_button';
fa_button.className = 'rightHeaderLink';
fa_button.appendChild(fa_members);
fa_right.insertBefore(fa_button,fa_right.lastChild);
// fa_chat attributes
fa_chat.id = 'fa_chat';
fa_chat.src = '/chatbox';
fa_chat.style.display = 'none';
fa_right.insertBefore(fa_chat,fa_right.lastChild);
fa_chat.onload = function() {
if (fa_chat.contentDocument) frame = fa_chat.contentDocument;
else if (fa_chat.contentWindow) frame = fa_chat.contentWindow.document;
var memb_thn = getLength('chatbox_members','LI'), memb_now = memb_thn,
msg_thn = getLength('chatbox','P'), msg_now = msg_thn;
// set some data..
fa_members.innerHTML = '('+memb_thn+')';
// kill the interval if archives are enabled
var a = frame.getElementsByTagName('A');
for (i=0; i<a.length; i++) if (/archives/.test(a[i].href)) a[i].onclick = function() { window.clearInterval(fa_chat_refresh) };
// execute code in an interval
fa_chat_refresh = window.setInterval(function() {
// START chat members
memb_now = getLength('chatbox_members','LI'), msg_now = getLength('chatbox','P');
if (memb_now > memb_thn || memb_now < memb_thn) {
memb_thn = memb_now;
fa_members.innerHTML = '('+memb_now+')'
}
// END chat members
// START chat notification
if (config.msgnotif) {
if (msg_now > msg_thn || msg_now < msg_thn) {
if (!/fa_new/.test(fa_button.className) && chatState(/none/) && !/none/.test(frame.getElementById('chatbox_option_autorefresh').style.display)) fa_button.className += ' fa_new';
msg_thn = msg_now;
}
}
// END chat notification
// START timestamp
if (!config.timestamp) {
var date = frame.getElementsByTagName('SPAN'),i;
for (i=0; i<date.length; i++) if (/date-and-time/.test(date[i].className) && date[i].style.display != 'none') date[i].style.display = 'none';
}
// END timestamp
// START connection logs
if (!config.connection_logs) {
var logs = frame.getElementsByTagName('SPAN'),i;
for (i=0; i<logs.length; i++) if (/red/i.test(logs[i].style.color) || /green/i.test(logs[i].style.color)) if (!/none/.test(logs[i].parentNode.parentNode.style.display)) logs[i].parentNode.parentNode.style.display = 'none';
}
// END connection logs
// START mod icon
if (config.mod_icon.toLowerCase() != 'default') {
var s = frame.getElementsByTagName('STRONG'),i;
for (i=0; i<s.length; i++) if (/@/.test(s[i].innerHTML) && s[i].innerHTML.length === 1 && !/msg/.test(s[i].parentNode.parentNode.className)) s[i].innerHTML = config.mod_icon;
}
// END mod icon
},1);
};
// toggle chat display
fa_button.onclick = function() {
if (/welcome/.test(fa_right.className)) removeClass(fa_right, /welcome/);
if (/notification/.test(fa_right.className)) removeClass(fa_right, /notification/);
if (chatState(/none/)) {
fa_chat.style.display = 'block';
fa_button.className += ' fa_actif';
if (/fa_new/.test(fa_button.className)) removeClass(fa_button, /fa_new/);
frame.getElementById('chatbox').scrollTop = 99999;
} else hideChat();
};
// hide chat when toolbar options clicked
getId('fa_welcome').onclick = function() { hideChat() };
getId('fa_notifications').onclick = function() { hideChat() };
getId('fa_hide').onclick = function() { hideChat() };
// chatbox functions
function hideChat() { if (chatState(/block/)) fa_chat.style.display = 'none'; removeClass(fa_button, /fa_actif/) };
function chatState(reg) { return reg.test(fa_chat.style.display) };
function getLength(id, tag) { return frame.getElementById(id).getElementsByTagName(tag).length };
// basic functions
function getId(id) { return document.getElementById(id) };
function cre(el) { return document.createElement(el) };
function removeClass(el, reg) { el.className = el.className.replace(reg,''); };
})});
Is anyone able to edit this code, so that it works with AWC? @LGForum maybe?
I would be very grateful!
LGforum
Status : Working to restore AWC!
Posts : 2806
Join date : 2011-10-05
Age : 30
Location : UK
Posts : 2806
Join date : 2011-10-05
Age : 30
Location : UK
Mon 14 Sep 2015, 16:11
The function for toggling the chat now is [ic]avacweb_chat.settings.toggle('open')[/ic] so the onclick event for the linjk will need to be that, then it should work.
Sponsored content
|
|