Geneone Updates

December 3rd, 2005

I’ve just upgraded Geneone running at neonDragon.net to the latest build.

Javascript Rewrite
I’ve rewritten most of the Javascript code, now utilitizing the awesome prototype.js. Some of the Javascript has also been moved into objects for tidyness. Prototype has allowed the Javascript to become a lot cleaner, going from this:

function callLocalRestService(service, method, args, callback) {
    try {
        if (window.XMLHttpRequest) {
            restReq = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
            restReq = new ActiveXObject("Microsoft.XMLHTTP");
        }
       
        url = geneurl + ‘ws.php?service=’+service+’&method=’+method;
        for (var i in args) {
            url += ‘&’+i+’='+args[i];
        }
       
        restReq.onreadystatechange = callback;
        restReq.open ("GET", url);
        restReq.send (null);
    } catch (e) {
        alert(e);
    }
}

function callbackfunc() {
    if (restReq.readyState == 4) {
        if (restReq.status == 200) {
            …
        }
    }
}

To something like this: 

function callWebService(service, method, params, callback) {
    try {
        url = geneurl + ‘ws.php?service=’+service+’&method=’+method;
        new Ajax.Request(url, {method: ‘post’, parameters: params, onComplete: callback});
    } catch (e) {
        alert(e);
    }
}

The callback no longer needs to check the readyState and status of the request. And there is one less global variable as Prototype passes the request object as a parameter to the callback function. I ‘m now using Prototype’s Event.observe to attack onload events, and you will now get an error message when you submit a form without entering a required field.

Take a look at the global.js file

Dynamic Objects
I’ve written a new dynamic object. This allows you to use PHP to generate the contents of a page on the fly and perform any processing on data if you want to. The great thing about dynamic objects is that they can fit in with the hierarchal structure of the rest of your website. Combined with the properties system of objects (dynamic objects could grab values of properties and generate the resulting output), it gives a really easy way of adding new types of custom content to Geneone.

The Evolution Site should be putting dynamic objects to the test over the next few days. 

  • Updated to TinyMCE 2.0.1. See changelog.
  • Updated to the latest version of the hAtom spec. atomfeed -> feed, atomentry -> entry.
  • Breadcrumbs now show description of objects as tooltips.
  • Custom "Edit" pages for different types of objects.
  • Uncategorized
  • Comments(3)
  1. Yahoo! adds JSON support
  2. Prototype.js
  3. Prototype.js 1.4 Size
  4. Geneone Updates
  5. Geneone Updates: Forum Icons

3 Responses to “Geneone Updates”

  1. Sexysoraon 04 Dec 2005 at 12:20 am

    The first thing i noticed is that the site seems slightly quicker..

  2. Sunny Boyon 04 Dec 2005 at 9:07 am

    Have you taken a look at XOAD? It’s a PHP OO implementation of Ajax. Although I don’t understand even 30% of it, it looks good. Check it out!

  3. Khloon 04 Dec 2005 at 10:38 am

    You can attribute the speed increases to the immense server at neonDragon.net coupled with the fact it’s no longer running 3 Half Life servers :) And super cool PHP caching.

    Regarding XOAD, it looks like another framework/library to me. I’m still a long way away from building a 100% "Ajax" website. I believe people are using "Ajax" for the sake of it rather than using "Ajax" to solve existing problems. For one insanely banal use of "Ajax", look at AjaxWhois. With Prototype’s awesomeness, I can’t think of many particularly good reasons to use another framework :)

Trackback URI | Comments RSS

Leave a Reply