OpenLayers OpenLayers

Changeset 7125

Show
Ignore:
Timestamp:
05/09/08 11:02:31 (3 months ago)
Author:
tschaub
Message:

keep filter at top, parse query

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/examples/example-list.html

    r7119 r7125  
    1313            } 
    1414            .ex_container{ 
    15                 border-bottom: 1px solid grey
     15                border-bottom: 1px solid #cccccc
    1616            } 
    1717            .ex_container a { 
     
    4545                width: 30%; 
    4646                height: 100%; 
     47            } 
     48            #filter { 
     49                top: 0px; 
     50                height: 50px; 
     51                padding: 10px 1em 10px 1em; 
     52            } 
     53            #examples { 
     54                border-top: 1px solid #cccccc; 
     55                position: absolute; 
     56                width: 30%; 
     57                top: 70px; 
     58                bottom: 0px; 
    4759                overflow: auto; 
    48             } 
    49             #instructions { 
    50                 padding: 0.5em 1em 0; 
     60                list-style: none; 
     61                margin: 0; 
     62                padding: 0; 
     63            } 
     64            #examples ul { 
     65                list-style: none; 
     66                margin: 0; 
     67                padding: 0; 
     68            } 
     69            #examples ul li { 
     70                display: block; 
     71                margin: 0; 
     72                padding: 0; 
    5173            } 
    5274            #exwin { 
     
    5678                width: 70%; 
    5779                height: 100%; 
    58                 border: 1px solid grey; 
     80                border: none; 
     81                border-left: 1px solid #cccccc; 
    5982                margin: 0; 
    6083            } 
     
    149172                listExamples(info.examples); 
    150173            } 
     174             
     175            function parseQuery() { 
     176                var params = {}; 
     177                var list = window.location.search.substring(1).split("&"); 
     178                for(var i=0; i<list.length; ++i) { 
     179                    var pair = list[i].split("="); 
     180                    if(pair.length == 2) { 
     181                        params[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]); 
     182                    } 
     183                } 
     184                if(params["q"]) { 
     185                    var input = document.getElementById("keywords"); 
     186                    input.value = params["q"]; 
     187                    inputChange.call(input); 
     188                } 
     189            } 
    151190            window.onload = function() { 
    152191                template = new Jugl.Template("template"); 
     
    155194                document.getElementById("exwin").src = "../examples/example.html"; 
    156195                document.getElementById("keywords").onkeyup = inputChange 
     196                parseQuery(); 
    157197            }; 
    158198        </script> 
     
    160200    <body> 
    161201        <div id="toc"> 
    162             <p id="instructions"> 
    163                 <label for="keywords">Filter by keywords</label><br /> 
    164                 <input type="text" id="keywords" /> 
    165                 <span id="count"></span> 
    166                 <a href="javascript:void showAll();">show all</a> 
    167             </p> 
     202            <div id="filter"> 
     203                <p> 
     204                    <label for="keywords">Filter by keywords</label><br /> 
     205                    <input type="text" id="keywords" /> 
     206                    <span id="count"></span><br /> 
     207                    <a href="javascript:void showAll();">show all</a> 
     208                </p> 
     209            </div> 
    168210            <div id="examples"></div> 
    169211        </div> 
    170         <iframe id="exwin" name="exwin"></iframe>         
     212        <iframe id="exwin" name="exwin" frameborder="0"></iframe>         
    171213        <div style="display: none;"> 
    172             <div id="template"> 
    173                 <div class="ex_container" jugl:repeat="example examples"> 
     214            <ul id="template"> 
     215                <li class="ex_container" jugl:repeat="example examples"> 
    174216                    <a jugl:attributes="href example.link" target="exwin"> 
    175217                        <h5 class="ex_title"> 
     
    184226                        </p> 
    185227                    </a> 
    186                 </div
    187             </div
     228                </li
     229            </ul
    188230        </div> 
    189231    </body>