Ignore:
Timestamp:
20/03/08 16:23:37 (12 years ago)
Author:
cbyrom
Message:

Tidy up javascript classes - adding javadoc style comments (view using JsDoc?) +
remove redundant code.

Location:
TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/capabilities.js

    r3613 r3662  
    1 // Various objects for wrappering capabilities and web map context documents 
    2 // - borrowed from the DCIP code to use in the view functionality for WMC and granules data 
    3 // C Byrom 
     1/** 
     2 * Various objects for wrappering capabilities and web map context documents 
     3 * - borrowed from the DCIP code to use in the view functionality for WMC and granules data 
     4 * C Byrom 
     5 */ 
    46 
    57// For resolving XML Namespaces in XPath expressions 
     
    3436 
    3537 
    36 // 
    37 // Class for accessing a GetCapabilities document 
    38 // 
     38/** 
     39 * Class to wrapper a GetCapabilities document and expose 
     40 * useful properties easily 
     41 */ 
    3942WMSC.Capabilities = function(domElement) { 
    4043    this.dom = domElement; 
     
    8386}; 
    8487 
    85 // 
    86 // Class for accessing layer capabilities. 
    87 // 
     88/** 
     89 * Class to wrapper a WMC Layer document and expose 
     90 * useful properties easily 
     91 */ 
    8892WMSC.Layer = function(node) { 
    8993    this.node = node; 
     
    168172 
    169173 
    170 // 
    171 // Class for accessing layer dimensions 
    172 // 
     174/** 
     175 * Class to wrapper a WMC Layers dimension document and expose 
     176 * useful properties easily 
     177 */ 
    173178WMSC.Dimension = function(node) { 
    174179    this.node = node; 
     
    194199 
    195200 
    196 // 
    197 // Class for accessing a WebMapContext document 
    198 // 
     201/** 
     202 * Class to wrapper a WebMapContext document and expose 
     203 * useful properties easily 
     204 * @author C Byrom 
     205 */ 
    199206WMSC.WebMapContext = function(domElement)  
    200207{ 
     
    203210WMSC.WebMapContext.prototype =  
    204211{ 
    205  
     212        /** 
     213         * Evaluate an XPATH expression on a specified dom node 
     214         * @param expr: XPATH expression to use 
     215         * @param node: node to evaluate expr on 
     216         */ 
    206217    evaluate: function(expr, node)  
    207218    { 
     
    212223    }, 
    213224 
     225        /** 
     226         * Retrieve the general title of the WMC doc 
     227         * @return WMC Title string 
     228         */ 
    214229    getTitle: function()  
    215230    { 
     
    221236    }, 
    222237     
     238        /** 
     239         * Retrieve the sublayers of the WMC doc 
     240         * @return array of WMCS.Layer objects 
     241         */ 
    223242    getSubLayers: function() 
    224243    { 
     
    235254    }  
    236255}; 
    237  
    238  
    239 // 
    240 // Class for accessing layer list capabilities. 
    241 // - NB, this is used in web map contexts 
    242 // 
    243 WMSC.LayerList = function(node)  
    244 { 
    245     this.node = node; 
    246 }; 
    247 WMSC.LayerList.prototype =  
    248 { 
    249     getLayers: function()  
    250     { 
    251                 var layers = []; 
    252                 var children = this.node.childNodes; 
    253                 for (var i=0; i<children.length; i++)  
    254                 { 
    255                 if (children[i].nodeName == 'Layer') 
    256                                 layers[layers.length] = new WMSC.Layer(children[i]); 
    257             } 
    258                 return layers; 
    259     } 
    260 }; 
    261  
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/dragAndDrop.js

    r3607 r3662  
    1 // Customisation of the YUI drag and drop control - allowing list elements to 
    2 // be reordered by dragging and dropping them. 
    3 // - NB, this is used to allow map layers to be re-organised in the view tab -  
    4 // hence the updateVisLayers call when an item has been dragged and dropped 
    5 //  
    6 // C Byrom 
     1/** Customisation of the YUI drag and drop control - allowing list elements to 
     2 * be reordered by dragging and dropping them. 
     3 * - NB, this is used to allow map layers to be re-organised in the view tab -  
     4 * hence the updateVisLayers call when an item has been dragged and dropped 
     5 *  
     6 * @author C Byrom 
     7 */ 
    78(function() { 
    89 
     
    1112var DDM = YAHOO.util.DragDropMgr; 
    1213 
    13 ////////////////////////////////////////////////////////////////////////////// 
    14 // example app 
    15 ////////////////////////////////////////////////////////////////////////////// 
     14/** 
     15 * Set up the basic control; NB, this predefines 10 drag and drop list elements 
     16 * - to use these, just define a html list element with a matching id - i.e. 'li_1' to 'li_10' 
     17 */ 
    1618YAHOO.example.DDApp = { 
    1719    init: function() { 
     
    2628 
    2729 
    28 ////////////////////////////////////////////////////////////////////////////// 
    29 // custom drag and drop implementation 
    30 ////////////////////////////////////////////////////////////////////////////// 
    31  
     30/** 
     31 * DDList object to use in the drag and drop control 
     32 * 
     33 * @param id: id to call this DDList 
     34 * @param sGroup: supergroup of the element 
     35 * @param config: additional config data 
     36 */ 
    3237YAHOO.example.DDList = function(id, sGroup, config) { 
    3338 
     
    4247}; 
    4348 
     49/** 
     50 * Extended drag and drop control - overriding methods to allow 
     51 * use in a list environment 
     52 */ 
    4453YAHOO.extend(YAHOO.example.DDList, YAHOO.util.DDProxy, { 
    4554 
    46     startDrag: function(x, y) { 
     55    startDrag: function(x, y)  
     56    { 
    4757        this.logger.log(this.id + " startDrag"); 
    4858 
     
    5969    }, 
    6070 
    61     endDrag: function(e) { 
     71        /** 
     72         * Event handler to be used when list item has been dragged and dropped 
     73         * NB, this includes a call to update the displayed map layers to  
     74         * ensure these are displayed in the order matching the list now that 
     75         * it has been altered 
     76         * @param e: event 
     77         */ 
     78    endDrag: function(e)  
     79    { 
    6280 
    6381        var srcEl = this.getEl(); 
     
    89107    }, 
    90108 
    91     onDragDrop: function(e, id) { 
     109    onDragDrop: function(e, id)  
     110    { 
    92111 
    93112        // If there is one drop interaction, the li was dropped either on the list, 
     
    111130                DDM.refreshCache(); 
    112131            } 
    113  
    114132        } 
    115133    }, 
    116134 
    117     onDrag: function(e) { 
     135    onDrag: function(e)  
     136    { 
    118137 
    119138        // Keep track of the direction of the drag for use during onDragOver 
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/public/js/ndgJavascript.js

    r3538 r3662  
    1  
    2 // This code modified from http://www.nmcmahon.co.uk/ajax/tutorial.php 
    3 // which was copyright 2005-2006 to Niall McMahon, although I expect 
    4 // there is nothing in these lines of code which is not duplicated everywhere 
    5  
     1/** 
     2 * This code modified from http://www.nmcmahon.co.uk/ajax/tutorial.php 
     3 * which was copyright 2005-2006 to Niall McMahon, although I expect 
     4 * there is nothing in these lines of code which is not duplicated everywhere 
     5 */ 
    66function createRequestObject() { 
    77  
     
    7474   } 
    7575} 
    76   
    77 // Set all checkboxes in a table to be the same state as the checkbox passed in  
     76 
     77/** 
     78 * Set all checkboxes in a table to be the same state as the checkbox passed in 
     79 * @param abox: the 'select all' checkbox - NB, the other checkboxes will be set to the same 
     80 *                              state as this one 
     81 * @param tableID: the ID of the parent table containing the checkboxes 
     82 */  
    7883function selectAll(abox, tableID)  
    7984{ 
Note: See TracChangeset for help on using the changeset viewer.