[ka-Map-users] code changes in cvs

Paul Spencer pspencer at dmsolutions.ca
Tue Sep 27 14:44:26 EDT 2005


All,

once again, I've made some fairly substantial changes in code  
structure to accommodate some of the work I am doing.  This time, I  
have changed how objects are declared in the javascript source.

Originally, I had code that declared objects and used
var kaMap()
{
     this.aFunction = kaMap_aFunction;
}

function kaMap_aFunction()
{
}

As Ben Nolan pointed out, this pollutes the global namespace in  
javascript.  Rather than take the full plunge into using prototype.js  
(), I've changed the references to:

var kaMap()
{
}

kaMap.prototype.aFunction = function()
{
}

I have also moved some of the core DHTMLapi functions into the kaMap  
class and modified (hopefully) all of the references to these  
functions appropriately for the internal use of these files.

I've still left DHTMLapi.js in the index.html file as its functions  
are used there to layout the page (and I don't think it is  
appropriate to move all that code into kaMap)

If anyone has built a kaTool-based tool, you'll need to add a little  
loop at the bottom of your constructor to copy the prototype  
properties (and you should probably switch to using prototype at this  
time).  See kaTool and kaQuery for examples.

There is no substantial change to functionality, and everything  
appears to work.  However, it should be considered somewhat unstable  
at this point so test heavily and let me know :)

Cheers

Paul

+-----------------------------------------------------------------+
|Paul Spencer                           pspencer at dmsolutions.ca   |
+-----------------------------------------------------------------+
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
+-----------------------------------------------------------------+






More information about the ka-Map-users mailing list