Changeset 5685 for cowsclient


Ignore:
Timestamp:
03/09/09 17:35:36 (10 years ago)
Author:
pnorton
Message:

Implemented the endpoint auto complete on the wmsvis page.

To do this I also migrated the YUI controls to version 2.70. I haven't removed the old YUI js code as more testing is needed.

The only YUI part not migrated is the treeview css as the images have changed in this version.

Location:
cowsclient/trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • cowsclient/trunk/cowsclient/controllers/wmsviz.py

    r5671 r5685  
    1818from cowsclient.lib.build_figure import build_figure 
    1919 
    20 import simplejson as json 
     20import cowsclient.lib.utils as utils 
     21 
    2122import urlparse 
    2223from cStringIO import StringIO 
     
    4546        """ 
    4647        log.debug('wmsviz controller') 
    47          
    4848         
    4949        g.helpIcon='layout/icons/help.png'  #needs to go in config 
     
    142142 
    143143 
    144              
    145         c.initialSetupJSON = json.dumps(initialSetup).replace('"', '\\"')  
     144        c.defaultWMSEndpoints =  utils.toJSON(utils.readEndpoints().get('WMS',None)) 
     145             
     146        c.initialSetupJSON = utils.toJSON(initialSetup)  
    146147 
    147148         
     
    153154        baseLayerObj = {"url":config['baselayer.url'], "params": params } 
    154155         
    155         c.baseLayerJSON = json.dumps(baseLayerObj).replace('"', '\\"')  
     156        c.baseLayerJSON = utils.toJSON(baseLayerObj)  
    156157         
    157158 
  • cowsclient/trunk/cowsclient/public/js/layerControl.js

    r5662 r5685  
    4747        this._selectedLayer = null; 
    4848                 
    49         this.tree = new YAHOO.widget.TreeView($(this.treeDiv)); 
     49        this.tree = new YAHOO.widget.TreeView(this.treeDiv); 
    5050        this.tree.subscribe('labelClick', this._selectTreeNode.bindAsEventListener(this)); 
    5151         
  • cowsclient/trunk/cowsclient/public/layout/ddc_vis.css

    r5626 r5685  
    5656/* Required to make things look like the main site.  The main site is somehow 
    5757   changing the styling in it's menu javascript. 
    58 */ 
     58 
    5959td { 
    6060  font-size: 12px; 
    6161} 
    6262 
     63*/ 
  • cowsclient/trunk/cowsclient/public/layout/wcdown.css

    r5671 r5685  
    33    padding:0; 
    44} 
    5  
    6  
    7 /* for the endpoint autocomplete box */ 
    8  
    9         /* custom styles for inline instances */ 
    10         .yui-skin-sam .yui-ac-input { position:static;width:20em; vertical-align:middle;} 
    11         .yui-skin-sam .yui-ac-container { width:20em;left:0px;} 
    12          
    13         /* needed for stacked instances for ie & sf z-index bug of absolute inside relative els */ 
    14         #breakfast_autocomplete { z-index:9001; } 
    15         #lunch_autocomplete { z-index:9000; } 
    16          
    17         /* buttons */ 
    18         .yui-ac .yui-button {vertical-align:middle;} 
    19         .yui-ac .yui-button button {background: url(./images/arrow-rt.png) center center no-repeat } 
    20         .yui-ac .open .yui-button button {background: url(./images/arrow-dn.png) center center no-repeat} 
    21  
    225 
    236#download_form_container { 
  • cowsclient/trunk/cowsclient/templates/wcsdown.html

    r5671 r5685  
    8888 
    8989<link rel="stylesheet" type="text/css" href="$g.server/layout/wcdown.css" /> 
     90<link rel="stylesheet" type="text/css" href="$g.server/layout/yui_autocomplete.css" /> 
    9091 
    9192 
     
    196197    <h1>test</h1> 
    197198     
    198      
     199    <div class="yui-ac"></div> 
     200    <div class="yui-skin-sam"></div> 
     201         
    199202    <span> 
    200203        <py:replace value="c.message">Message placeholder</py:replace> 
  • cowsclient/trunk/cowsclient/templates/wmsviz.html

    r5670 r5685  
    1717<!-- BEGIN: Yahoo Interface Library --> 
    1818<link type="text/css" rel="stylesheet" 
    19     href="$g.server/js/yui/treeview/assets/skins/sam/treeview.css"/>  
     19    href="$g.server/js/yui_2.7.0b/treeview/assets/skins/sam/treeview.css"/>  
    2020      
    2121<!-- Dependency source files -->   
    22 <script src = "$g.server/js/yui/yahoo/yahoo-min.js" ></script>  
    23 <script src = "$g.server/js/yui/event/event-min.js" ></script>  
     22<script src = "$g.server/js/yui_2.7.0b/yahoo/yahoo.js" ></script>  
     23<script type="text/javascript" src="$g.server/js/yui_2.7.0b/event/event.js"></script> 
    2424   
    2525<!-- TreeView source file -->   
    26 <script src = "$g.server/js/yui/treeview/treeview-min.js" ></script>  
     26<script src="$g.server/js/yui_2.7.0b/dom/dom.js" ></script> 
    2727 
    2828<!-- TreeView Menu Style --> 
    2929<link rel="stylesheet" type="text/css" href="$g.server/js/yui/treeview/assets/treeview-menu.css"/>  
    3030 
    31 <link rel="stylesheet" type="text/css" href="$g.server/js/yui/fonts/fonts-min.css?_yuiversion=2.5.0" /> 
     31 
     32<link rel="stylesheet" type="text/css" href="$g.server/js/yui_2.7.0b/fonts/fonts.css" /> 
    3233 
    3334<!-- needed for the drag and drop list --> 
    34 <script type="text/javascript" src="$g.server/js/yui/utilities/utilities.js" ></script> 
    35 <script type="text/javascript" src="$g.server/js/yui/dragdrop/dragdrop.js" ></script> 
     35<script type="text/javascript" src="$g.server/js/yui_2.7.0b/utilities/utilities.js" ></script> 
     36<script type="text/javascript" src="$g.server/js/yui_2.7.0b/dragdrop/dragdrop.js" ></script> 
    3637 
    3738 
    3839<link type="text/css" rel="stylesheet" href="$g.server/layout/drag_drop_style.css"/> 
    3940<script src = "$g.server/js/dragAndDrop.js" ></script>  
     41 
     42 
     43<!-- YUI imports for autocomplete --> 
     44 
     45<link rel="stylesheet" type="text/css" href="$g.server/js/yui_2.7.0b/button/assets/skins/sam/button.css" /> 
     46 
     47<link rel="stylesheet" type="text/css" href="$g.server/js/yui_2.7.0b/autocomplete/assets/skins/sam/autocomplete.css" /> 
     48 
     49<script type="text/javascript" src="$g.server/js/yui_2.7.0b/yahoo-dom-event/yahoo-dom-event.js"></script> 
     50<script type="text/javascript" src="$g.server/js/yui_2.7.0b/animation/animation.js"></script> 
     51<script type="text/javascript" src="$g.server/js/yui_2.7.0b/element/element.js"></script> 
     52<script type="text/javascript" src="$g.server/js/yui_2.7.0b/button/button.js"></script> 
     53<script type="text/javascript" src="$g.server/js/yui_2.7.0b/datasource/datasource.js"></script> 
     54<script type="text/javascript" src="$g.server/js/yui_2.7.0b/autocomplete/autocomplete.js"></script> 
     55     
     56<!-- End of autocomplete imports --> 
     57 
     58<script src="$g.server/js/yui_2.7.0b/treeview/treeview.js" ></script>  
    4059 
    4160<!-- END: Yahoo Interface Library --> 
     
    6988 
    7089<link rel="stylesheet" type="text/css" href="$g.server/layout/layer_properties.css" /> 
     90<link rel="stylesheet" type="text/css" href="$g.server/layout/yui_autocomplete.css" /> 
    7191 
    7292<script src="$g.server/js/layerInformation.js"></script> 
     
    83103 
    84104<!-- END: WMSC library --> 
    85  
    86105<script type="text/javascript"> 
    87106 
     
    91110var layerList = null; 
    92111var layerParameters = null; 
     112 
     113var defaultEndpoints = JSON.parse("${c.defaultWMSEndpoints}"); 
    93114 
    94115<?python 
     
    165186    } 
    166187 
    167  
     188    try { 
     189        // build endpoint autocomplete 
     190        makeCombobox("new_endpoint", "endpoint_toggle", "endpoint_options", defaultEndpoints); 
     191    } 
     192    catch( e ) { 
     193        WMSC.log(e); 
     194        throw e; // Allow existing code to handle 
     195    } 
    168196     
    169197} 
     
    189217</head> 
    190218 
    191 <body onload="init()" onunload="cleanup()"> 
     219<body onload="init()" onunload="cleanup()" class="yui-skin-sam"> 
     220 
    192221    <div id="entirepage"> 
    193222    <!--<div py:replace="header()"/>  --> 
     
    288317                <tr> 
    289318                        <td class="controlPanel"> 
     319                 
    290320                            <div> 
    291                     Add new WMS:<span py:replace="helpIcon('endpoint_help', 'div')"/> <input type="text" id="new_endpoint" > </input> <input type="button" id="add_new_endpoint" value="Add"/> 
     321                    Add new WMS:  
     322                    <span py:replace="helpIcon('endpoint_help', 'div')"> </span>  
     323                    <!-- <input type="text" id="new_endpoint" > </input>  -->  
     324                     
     325                     
     326                     
     327                    <div id="endpoint_autocomplete" style="display:inline;"> 
     328                        <input id="new_endpoint" type="text" ></input> <span id="endpoint_toggle"></span> 
     329                        <div id="endpoint_options"></div> 
     330                    </div > 
     331                     
     332                    <input type="button" id="add_new_endpoint" value="Add"/> 
    292333                </div> 
    293334                <div id="endpoint_help" class="hidden"> 
  • cowsclient/trunk/endpoints.txt

    r5671 r5685  
    66http://localhost:5000/cru_tmc/wms 
    77http://localhost:5000/ccip/wms 
     8http://localhost:5000/coastwms 
     9http://localhost:5000/globalpop/wms 
     10http://localhost:5000/landtype/wms3 
     11http://labs.metacarta.com/wms/vmap0 
     12http://ndg3beta.badc.rl.ac.uk/cows/demo_hadcm3/wms 
    813 
    914[WCS] 
Note: See TracChangeset for help on using the changeset viewer.