forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Sat Nov 18, 2017 4:33 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Adding AJAX
PostPosted: Fri Mar 20, 2009 11:29 pm 
Offline

Joined: Wed Mar 18, 2009 11:39 pm
Posts: 11
Now that there is some serious discussion, I decided to move away from the old thread.

I'm working on the basic AJAX-tab interface right now. I have it working on the chat, and I'm trying to expand it to other tabs. The code is thankfully pretty short, as I'm using Prototype.

Speaking of which, we should continue the discussion of JS frameworks. Although I'd prefer to use prototype, I will switch to a framework-less system if need be.


Top
 Profile  
 
 Post subject: Re: Adding AJAX
PostPosted: Sat Mar 21, 2009 7:39 am 
Offline

Joined: Wed Oct 08, 2008 12:47 pm
Posts: 726
Personally I think everything should be hand-coded. I've never found libraries save much time when doing Javascript stuff, and (as well as making licensing easier to sort out) you have more control over efficiently doing exactly what you want.
As for the chat - this was done once in the past and had to be removed because it gave so many requests.

In my opinion, the best candidate for AJAX is the opening and viewing of the main forum. This would save enough server load and user time to make it worth the effort I think. However, it's probably not worth doing at the moment as Kestas has a lot of changes being worked on...


Top
 Profile  
 
 Post subject: Re: Adding AJAX
PostPosted: Sat Mar 21, 2009 12:40 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
I'm not sure, I wouldn't want to duplicate effort unnecessarily if Prototype does a good job. The question is will it fit in neatly into the existing code, some frameworks prefer you do things in a certain way and it can be a pain to only use the pieces you want

If that's not a problem then i say go for whatevers easiest


Top
 Profile  
 
 Post subject: Re: Adding AJAX
PostPosted: Sat Mar 21, 2009 5:14 pm 
Offline

Joined: Wed Mar 18, 2009 11:39 pm
Posts: 11
How about this, I'll prototype with prototype (sorry, had to be said :P) and then once it's done we can go from there. Prototype, at least the way I'm using it, is easy enough to re-write.


You said that the chat used to be AJAX but caused a load on the server? Let me clarify: I only made the chat tabs AJAX, it's not continually polling the server asking for new messages like a real chat client. Instead, you can just tab between Global, England, &c without having to reload the entire page. I would think that this would save resources as it doesn't have to render the rest of the page multiple times.

I did start work on the forum, and the major parts are working. (You can load an entire of the thread or post to one wo/ reloading the entire page) Should I wait for Kestas?


Top
 Profile  
 
 Post subject: Re: Adding AJAX
PostPosted: Sun Mar 22, 2009 1:27 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
I think ultimately there'll have to be a waiting period for it to be added into an official release. I do still have quite some work to do before it's ready and I wouldn't want to back-port this feature to 0.82. I hate locking people out of the code while waiting for me to finish an update, but CVS isn't worth the hassle at the moment :(


Top
 Profile  
 
 Post subject: Re: Adding AJAX
PostPosted: Sun Mar 22, 2009 2:44 pm 
Offline

Joined: Wed Mar 18, 2009 11:39 pm
Posts: 11
Sounds good, let me know when you're ready ;-)


Top
 Profile  
 
 Post subject: Re: Adding AJAX
PostPosted: Sun Oct 11, 2009 5:39 pm 
Offline

Joined: Wed Sep 09, 2009 2:37 pm
Posts: 156
Was there any work on this? Because I'm about to do the same thing


Top
 Profile  
 
 Post subject: Re: Adding AJAX
PostPosted: Mon Oct 12, 2009 3:37 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
I would like to have an auto-update feature, but the biggest emphasis is on server resource use. There'd have to be server-side code that, on a change, writes to a static file (.txt, .js, etc) which people can request via AJAX to see if any updates have happened. We used to have AJAX to keep games up to date which just queried board.php , but even with way, way fewer users Dreamhost had to take the site down while I removed it (something they've never had to do since)

There are some applications for AJAX where they wouldn't increase server resource use, such as entering new orders and submitting chat messages. Chat messages probably wouldn't be too much trouble, but the order validation/insertion code is closely tied with the HTML it produces, so there'd have to be some reworking of that code (but on the plus side that'd have other advantages besides AJAX-compatibility). Also it probably wouldn't be an option to send order updates one at a time as they're entered, again because of resource use.
I was hoping to get a JavaScript order generator going to get around this problem; letting users fill out all their orders client-side using JavaScript, then submitted all at once, would be much better for users and save server resources. Problem is that's quite a tricky problem

Let me know if theres' anything in particular you're interested in, but keep performance in mind when going over ideas unless you're on a dedicated server

edit: Looking at your instant message thread looks like you're one step ahead as usual :!:


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group