lovelle / jquery-chat

100% Javascript realtime chat like facebook/gmail web style built with jQuery + Node.js + Socket.IO
http://jquery-chat.net/
MIT License
305 stars 132 forks source link

How can I activate a function where you can navigate between tabs? #32

Closed devfernandogabs closed 8 years ago

devfernandogabs commented 8 years ago

Ok, my question is: how can I activate a function where you can navigate between tabs in order to keep the same user and email, in this moment if you open a new tab you automatically create a new instance of the chat; I edited your code to load the user and email of the person logged inside in my application successfully but when I tried to open a new tab I don't know how can I preserve the same information.

I know we need to change something in these lines but what? haha. Thanks so much for your answer and for your plugin, excellent work!

r.sismember(users_key, recv.user, function(err, reply) { if (reply) { socket.emit('custom_error', { message: 'The user '+ recv.user +' is already logged' }); return; } });

// The user is already logged if (users[recv.user]) { socket.emit('custom_error', { message: 'The user '+ recv.user +' is already logged' }); return; }

lovelle commented 8 years ago

Hi, sorry buy I do not understand what you mean with "navigate between navs"

I think you can do this right now on the client side, but probably I'm not understanding what are you trying to do.

please be more specific.

Bye.

ferenczAndras commented 8 years ago

If I understand you have the same problem as I had.. the easiest way is to create a spa app with angular js or React. Elsewhere you have to check whether any window was opened and if so than reopen it.

lovelle commented 8 years ago

if @devfernandogabs means what @ferenczAndras is saying, I think this won't be listed to do it, because the app have to be a spa one.

Maybe spa app should be documented in Readme as a requirement?

devfernandogabs commented 8 years ago

ok @lovelle let me explain better: when you enter for first time inside to the website, you'll see the chat and you can communicate without problems, but when you enter to another intern link in the website, the chat resets all information, included conversations, I wanted to know if there is a way to save that information and avoid to loose it, but reading what @ferenczAndras is explaining, all we need is to create a spa app, anyway, I'll study the code and check if there is another way to solve that problem . :)

lovelle commented 8 years ago

ok @devfernandogabs, Maybe there is another halfway solution, but I think is better to have a spa, instead of starting to do "strange things" like these one.

Closing due there is not a bug nor a feature request approved. Thanks, Bye.