The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Problem with chatbox auto-login javascript

2 posters

Go down

Solved Problem with chatbox auto-login javascript

Post by Van-Helsing February 24th 2015, 2:01 pm

Hello,
I am using the following javascript for chatbox members auto-login but it conflicts other javascripts is there a way to fix it?

Code:

$(function() {
    var chatbox_window = document.getElementById('frame_chatbox');
    var iframewindow = chatbox_window.contentWindow ? chatbox_window.contentWindow : chatbox_window.contentDocument.defaultView;
    var chat = iframewindow.chatbox;
    function check_logged()
    {
        if( !chat.connected ) {
            chat.connect();
        }
    }
    check_logged();
    setInterval(function() {
        check_logged();
    }, 3000);

});


Last edited by Black-Shadow on February 24th 2015, 2:39 pm; edited 1 time in total
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Ange Tuteur February 24th 2015, 2:18 pm

Hi @Black-shadow,

Try this instead :
Code:
$(window).load(function() {
  var chatbox_script = function() {
    setTimeout(function(){ $('#chatbox_option_co:visible').click() }, 1000);
  };
  var s=document.createElement('script');s.text="("+chatbox_script.toString()+")();";$('object[data^="/chatbox/index.forum"],iframe[src^="/chatbox/index.forum"]').each(function(){try{$(this.contentDocument||this.contentWindow.document).find("#chatbox").closest("html").find("head").first().each(function(){this.appendChild(s.cloneNode(true))})}catch(a){}})
});
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Van-Helsing February 24th 2015, 2:23 pm

Hi Ange Tuteur,
It seems working is there a way to hide the options archive/login/logout due the members are always connect in chatbox?
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Ange Tuteur February 24th 2015, 2:28 pm

Add the following code to your stylesheet.
Administration Panel > Display > Colors > CSS stylesheet
Code:
a[href="/chatbox/index.forum?archives=1"], #chatbox_option_disco { display:none }
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Van-Helsing February 24th 2015, 2:40 pm

Thank you very much Ange it seems solved.
~1~
Van-Helsing
Van-Helsing
Hyperactive

Male Posts : 2431
Reputation : 116
Language : English, Greek

http://itexperts.forumgreek.com/

Back to top Go down

Solved Re: Problem with chatbox auto-login javascript

Post by Ange Tuteur February 24th 2015, 3:05 pm

You're welcome ^^

Topic arhived

Have a nice day Smile
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum