Ignore:
Timestamp:
04/28/11 22:25:00 (13 years ago)
Author:
gaba
Message:

info-detail, samplequeries

Location:
MDService2/trunk/MDService2/WebContent
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_helpers.js

    r1219 r1260  
    88// url params reading
    99var params;
    10 function getUrlVars()
     10function getUrlVars(url)
    1111{
     12        if (url == undefined){
     13                url = window.location.href;
     14        }
    1215    var vars = [], hash;
    13     var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
     16    var hashes = url.slice(url.indexOf('?') + 1).split('&');
    1417    for(var i = 0; i < hashes.length; i++)
    1518    {
     
    1922    }
    2023    return vars;
    21 }
    22 
     24    //return getUrlVars(window.location.href);
     25};
    2326
    2427
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui.js

    r1252 r1260  
    159159        });
    160160
     161        $('.detail-content a').live('click',  function(event) {
     162               
     163                event.preventDefault();         
     164                var uri = $(this).attr('href'); // + " body";
     165                if (uri.indexOf("?") > 0) { //($(this).attr("target") == "query"){
     166                        var urlparams = getUrlVars(uri);
     167                        loadQueryFromUriParams(urlparams);
     168                } else {
     169                        var type = $(this).parents('.detail-wrapper').attr("id");
     170                        type = type.substring(7,type.length);
     171                //      $.get(uri, showDetail,'html'); */
     172                        detailcaller.calldetail(undefined, type, uri);
     173                }
     174        });
    161175        $('.result a.external, .mdrecord-detail a.external').live('click',  function(event) {
    162176               
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui_detail.js

    r1234 r1260  
    7171                this.content = undefined;
    7272                if (this.detailwidget == undefined){
    73                         this.url = '/MDService2/docs/xml/welcome #welcome';
     73                        if (this.url == undefined) {
     74                                this.url = '/MDService2/docs/xml/welcome #welcome';
     75                        }
     76                        if (this.url == null) {
     77                                this.url = '/MDService2/docs/xml/welcome #welcome';
     78                        }
     79
    7480                } else {
    7581                        //var a = $(this).parent().next().attr('id');
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui_load.js

    r1252 r1260  
    432432}
    433433
    434 function loadQueryFromUriParams(){
    435        
    436         var q = url_params["q"];
    437         var squery = url_params["squery"];
    438         var collection = url_params["collection"];
    439         var startItem = url_params["startItem"];
    440         var maximumItems = url_params["maximumItems"];
    441         var repository = url_params["repository"];
    442         var columns = url_params["columns"];
     434function loadQueryFromUriParams(local_uri){
     435        var url;
     436       
     437        if (local_uri == undefined){
     438                url = url_params;
     439        } else {
     440                url = local_uri;
     441        }
     442        var q = url["q"];
     443        var squery = url["squery"];
     444        var collection = url["collection"];
     445        var startItem = url["startItem"];
     446        var maximumItems = url["maximumItems"];
     447        var repository = url["repository"];
     448        var columns = url["columns"];
    443449        if ((q != undefined) || (squery != undefined) || (collection != undefined)) {
    444450                if (q == undefined) {
     
    460466                }
    461467                if (repository == undefined) {
    462                         repository = 1;
     468                        repository = getSelectedRepository();
    463469                }
    464470                if (collection == undefined){
  • MDService2/trunk/MDService2/WebContent/static/queries.xml

    r1085 r1260  
    66                        <dd><p>just one word like:</p>
    77                                <ul>           
    8                                         <li><a href="/MDService2/?squery=system">system</a></li>
    9                                         <li><a href="/MDService2/?squery=-year-olds">-year-olds</a> - a bug there (don't use '-'!)</li>
    10                                         <li><a href="/MDService2/?squery=acquisition">acquisition</a></li>                     
     8                                        <li><a target="query" href="/MDService2/?squery=system">system</a></li>
     9                                        <li><a class="query" href="/MDService2/?squery=-year-olds">-year-olds</a> - a bug there (don't use '-'!)</li>
     10                                        <li><a class="query" href="/MDService2/?squery=acquisition">acquisition</a></li>                       
    1111                                </ul>
    1212                        </dd>
     
    1414                        <dd>
    1515                                <ul>
    16                                         <li><a href="/MDService2/?squery=/?squery=child%20%7C%20acquisition">child | acquisition</a></li>
     16                                        <li><a class="query" href="/MDService2/?squery=/?squery=child%20%7C%20acquisition">child | acquisition</a></li>
    1717                                </ul>
    1818                        </dd>
     
    2020                        <dd>
    2121                                <ul>
    22                                         <li><a href="/MDService2/?squery=child%20acquisition">child acquisition</a></li>
    23                                         <li><a href="/MDService2/?squery=longitudinal%20study">longitudinal study</a></li>                     
     22                                        <li><a class="query" href="/MDService2/?squery=child%20acquisition">child acquisition</a></li>
     23                                        <li><a class="query" href="/MDService2/?squery=longitudinal%20study">longitudinal study</a></li>                       
    2424                                </ul>
    2525                        </dd>
Note: See TracChangeset for help on using the changeset viewer.