Help with ajax needed

Posts from previous Beta sessions

Help with ajax needed

Postby poetter » Tue Oct 02, 2007 5:46 pm

Hi,

Anaxent brought up the idea of building ArmorySyncs status page in ajax. I Think thats a very interesting idea, but i have no idea of ajax and the framework inside roster2.

Non of the addons are using it, just found the menu, but did not realy get an idea how to use it.

What do i have to place on the mainpage to use ajax and how do i have to implement backend and return messages?

cu poetter
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Help with ajax needed

Postby zanix » Wed Oct 03, 2007 12:01 am

I dunno either to be honest
PleegWat built the menu config
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Help with ajax needed

Postby Anaxent » Wed Oct 03, 2007 1:22 am

Here is a good starting place
http://www.dhtmlgoodies.com/index.html? ... ic-content

this ajax script will load content dynamically from an external file which woudl mean the main page of armory sync would load the current armorysync page
Im not to sure on how the cmslink will come in yet as I have not used ajax in roster either, but that does not say it can not be done.
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

Help with ajax needed

Postby PleegWat » Wed Oct 03, 2007 1:47 am

There is an ajax access file in roster that's used by the menu config. Firstly, note that this is an external file, you should not use makelink() with it, and it may (will) wreak havoc with more advanced roster ports (EG ports that also take over the DB layer).

From the client side, there is a function loadXMLDoc(url,post).
The url should contain the url to thesite.com/roster/ajax.php?addon=ArmorySync. You are allowed to add extra GET parameters.
The post contains the POST variables, name1=value1&name2=value2 etc.

Naturally, neither of these can contain entity encoding
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Help with ajax needed

Postby poetter » Wed Oct 03, 2007 2:22 am

Allright, thx for your hints. Im getting closer to it.

Right now i have added some file. ajax.php in armorysync root with the $ajaxfuncs array and armorysync.php in armorysync/ajax with the ajax methods. additional some js code in armorysync/js doing the js client part.

I started to replace single html elements with ajax results. after finding out how to replace the different elements that started out real good.

Now i have come to a point where i need to replace the "Next to update" String in the status table head. I found out that there are no addon locales loaded when you do a ajax request. can someone confirm that?
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Help with ajax needed

Postby Anaxent » Wed Oct 03, 2007 4:01 am

Ah right Pleegwat I forget when using ajax we are only loading an external file almost as if it were in an iframe which would not require the need to use the makelink functions at all good call. And on that note I wonder if making bridges could be easier by just loading the external roster files via ajax..hmm

another good place to get ideas on how to use ajax is http://www.ajaxrain.com/
Last edited by Anaxent on Wed Oct 03, 2007 5:13 am, edited 1 time in total.
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

Help with ajax needed

Postby poetter » Wed Oct 03, 2007 5:09 am

This patch will resolve the problem with missing locales in addon ajax:

Code: Select all
--- D:/xampp/roster.com/htdocs/ajax.php.org   Tue Oct 02 23:05:44 2007
+++ D:/xampp/roster.com/htdocs/ajax.php   Tue Oct 02 23:06:04 2007
@@ -40,6 +40,12 @@
    // Check if addon is active
    if( $addon['active'] == '1' )
    {
+      // Include addon's locale files if they exist
+      foreach( $roster->multilanguages as $lang )
+      {
+         $roster->locale->add_locale_file($addon['locale_dir'] . $lang . '.php',$lang);
+      }
+      
       // Include addon's conf.php file
       if( file_exists($addon['conf_file']) )
       {
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Help with ajax needed

Postby Anaxent » Wed Oct 03, 2007 6:19 am

I have just come across a very neat IDE editor designed for js, html, and css
http://aptana.com/
Video Demos if it in use
http://www.aptana.tv/
User avatar
Anaxent
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 642
Joined: Tue Jul 04, 2006 6:27 am
Location: Phoenix, Az

Help with ajax needed

Postby poetter » Wed Oct 03, 2007 6:24 am

Im using ActiveStates Komodo. Bets thing is the remote debugger. Try it out! Its worth it.
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Help with ajax needed

Postby zanix » Wed Oct 03, 2007 7:27 am

http://www.activestate.com/Products/komodo_ide/
For those that are lazy and don't like to use Google for some weird reason

EDIT: Too bad it isn't free
Last edited by zanix on Wed Oct 03, 2007 7:35 am, edited 1 time in total.
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Help with ajax needed

Postby poetter » Wed Oct 03, 2007 7:41 am

I got it guys. Was able to replace all elements of the status screen, including overlib and the progress bar. had to ship around some things cause ajax is settled in util scope :-(

Now i need some code cleanup and advanced testing. think i will upload the stuff tomorrow evening.

BTW.: I will need the patch i posted above.
Last edited by poetter on Wed Oct 03, 2007 7:42 am, edited 1 time in total.
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Help with ajax needed

Postby zanix » Wed Oct 03, 2007 8:01 am

patched svn[1375]
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Help with ajax needed

Postby poetter » Wed Oct 03, 2007 8:08 am

thx
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Help with ajax needed

Postby zanix » Wed Oct 03, 2007 8:09 am

I can't wait to see what you came up with ..... :bounce:
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: Help with ajax needed

Postby poetter » Wed Oct 03, 2007 8:20 am

Hmmm, guess i killed blizzards server 8)

http://eu.wowarmory.com/character-sheet ... &locale=de

May by i should increase reload times :D
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Next

Return to Archived

Who is online

Users browsing this forum: No registered users and 1 guest

cron