Changeset 1233


Ignore:
Timestamp:
04/22/11 14:55:18 (13 years ago)
Author:
gaba
Message:

UI changes , corrections

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

Legend:

Unmodified
Added
Removed
  • MDService2/trunk/MDService2/WebContent/index.jsp

    r1229 r1233  
    117117                                                        <!-- ------------------------------------- -->
    118118       
    119                                                        
     119                       
     120                       
    120121<!-- QUERYLIST BLOCK -->
    121122<div id="querylistblock" class="cmds-ui-block">
     
    161162<div id="terms_autocomplete"></div>
    162163
     164
    163165</body>
     166
    164167</html>
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js

    r1229 r1233  
    502502};
    503503
    504 Query.prototype.updateColumns = function(slid){
    505         if (selectionlistset.getselectionlist(slid).autoSelected()){
     504Query.prototype.updateColumns = function(selectionlist){
     505        if (selectionlist != undefined){
     506                if (selectionlist.autoSelected()){
    506507                        this.columns = "";
    507508                } else
    508509                {
    509                         this.columns = selectionlistset.getselectionlist(slid).listwidget.getListText();
    510                 }
    511 };
     510                        this.columns = selectionlist.listwidget.getListText();
     511                }
     512        }
     513};
     514
    512515Query.prototype.next = function(pages){
    513516        var start = 0;
     
    729732        sl.listwidget.add(new ListItem($(elem).closest('.treecol').children('.column-elem').text()));
    730733       
    731         $(elem).data('query').updateColumns(slid);
     734        //$(elem).data('query').updateColumns(slid);
    732735
    733736};
     
    770773                }
    771774                */
     775                /*
    772776                var slid = $(this).closest('.detail-wrapper').find('.selectionlist-widget').attr("id");
    773777                if (slid != undefined){
    774                         $(this).data('query').updateColumns(slid);
     778                        $(this).data('query').updateColumns($(this).data('detail'));
    775779                }
     780                */
     781                $(this).data('query').updateColumns($(this).data('selectionlist'));
    776782                $(this).data('query').resubmit();
    777783        });
     
    803809        });
    804810        //q_header.find('.cmd_add').click(function(){
    805         q_header.find('.cmd_columns').data('query', query);
     811        //q_header.find('.cmd_columns').data('query', query);
    806812        q_header.find('.cmd_columns').click(function(){
    807813                query_wrapper_add_column($(this));
    808                 $(this).data('query').resubmit();
     814                //$(this).data('query').resubmit();
    809815        });
    810816        q_header.find('.columns-wrapper').hide();
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui.js

    r1229 r1233  
    5858                searchclauseset.addsearchclause(new SearchClause("","",""),"",0,0);
    5959                createInfos();
     60               
     61                detailcaller.calldetail(undefined, "info");
    6062       
    6163});
     
    6769       
    6870        $('.cmds-ui-block').children('.header').children('.cmd_info').click(function(){
    69                 var a = $(this).parent().next().attr('id');
    70                 var uri = window.location.pathname + "static/info.xml";
    71                 $.get(uri,{"id":a}, showDetail,'html');
     71                //var a = $(this).parent().next().attr('id');
     72                //var uri = window.location.pathname + "static/info.xml";
     73                //$.get(uri,{"id":a}, showDetail,'html');
     74                detailcaller.calldetail($(this));
    7275                return false;
    7376        });     
     
    134137               
    135138                var uri = $(this).attr('href'); // + " body";
    136                 notifyUser('internal-link: ' + uri,'debug' );
    137                 $.get(uri, showDetail,'html');
     139                //notifyUser('internal-link: ' + uri,'debug' );
     140                //$.get(uri, showDetail,'html');
     141                detailcaller.calldetail(undefined, "record", uri);
    138142        });
    139143
     
    705709        var query_elem = undefined;
    706710        var record_elem = undefined;
     711        var info_elem = undefined;
    707712       
    708713        $('#detailblock').children('.content').children().each(function(){
     
    718723                if ($(this).attr("id") == "detail_record"){
    719724                        record_elem = this;
     725                }
     726                if ($(this).attr("id") == "detail_info"){
     727                        info_elem = this;
    720728                }
    721729        });
     
    724732                        $('#detailblock').children('.content').append(elem);
    725733                } else {
    726                         if (did == "detail_index") {
     734                        if (did == "detail_info") {
    727735                                $('#detailblock').children('.content').prepend(elem);
    728736                        } else {
    729                                 if (did == "detail_query") {
    730                                         if (index_elem != undefined) {
    731                                                 $(index_elem).after(elem);
     737                                if (did == "detail_index") {
     738                                        if (info_elem != undefined) {
     739                                                $(info_elem).after(elem);
    732740                                        } else {
    733741                                                if (record_elem != undefined) {
     
    738746                                        }
    739747                                } else {
    740                                         $('#detailblock').children('.content').append(elem);
     748                                        if (did == "detail_query") {
     749                                                if (index_elem != undefined) {
     750                                                        $(index_elem).after(elem);
     751                                                } else {
     752                                                        if (record_elem != undefined) {
     753                                                                $(record_elem).before(elem);
     754                                                        } else {
     755                                                                $('#detailblock').children('.content').prepend(elem);
     756                                                        }
     757                                                }
     758                                        } else {
     759                                                $('#detailblock').children('.content').append(elem);
     760                                        }
    741761                                }
    742762                        }
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui_detail.js

    r1229 r1233  
    77 */
    88
    9 function Detail(detailwidget, name) {
     9function Detail(detailwidget, name, url) {
    1010        this.detailwidget = detailwidget;
    1111       
     
    1414        this.content_wrapper = '';
    1515       
    16         this.url = undefined;
     16        this.url = url;
    1717        this.type = undefined;
    1818        this.name = name;
     
    2323         
    2424};
    25 Detail.prototype.update = function(detailwidget){
     25Detail.prototype.update = function(detailwidget, url){
    2626        this.detailwidget = detailwidget;
    2727        this.temp_id = "";
     28        this.url = url;
    2829        this.setData();
    2930       
     
    3233       
    3334        var widget = this.detailwidget;
    34         /*
    35         if ($(widget).parents('.result').length > 0){
    36                 this.name = "record";
    37         } else {
    38                 if ($(widget).parents('.result-summary').length > 0) {
    39                         this.name = "values";
    40                 } else {
    41                         if ($(widget).closest('.ui-widget').attr('name') == 'query'){
    42                                 this.name = 'query';
    43                         } else {
    44                                 if  ($(widget).closest('.c-widget').attr('id') == 'collections-widget'){
    45                                         this.name = 'collections';
    46                                 }
    47                         }
    48                 }
    49         }
    50         */
     35       
    5136        this.type = blocks_settings[this.name].detail.type;
    5237        switch (this.name){
     
    6348        case 'record':
    6449                this.content = undefined;
    65                 this.url = $(widget).parent().find("a").attr('href');
     50                if (widget != undefined){
     51                        this.url = $(widget).parent().find("a").attr('href');
     52                }
    6653                break;
    6754        case 'values':
     
    7562                this.content = undefined;
    7663                this.url = 'terms/htmldetail/?q=all';
     64                break;
     65        case 'info':
     66                this.content = undefined;
     67                if (this.detailwidget == undefined){
     68                        this.url = '/MDService2/docs/xml/welcome #welcome';
     69                } else {
     70                        //var a = $(this).parent().next().attr('id');
     71                        this.url = window.location.pathname + "static/info.xml";
     72                }
    7773                break;
    7874        default:
     
    10399                                "<a class='cmd cmd_link' target='_blank' href='" + query.link("fullpage") + "' >link</a>";
    104100                        $(this.content).find('.cmds').append($(links));
    105                         //enrich selectionlist
     101                        //enrich with selectionlist
    106102                        var selectionlist  = new SelectionList($(this.content).find('.columns-selected'));
    107103                        selectionlistset.add(selectionlist);
     104                        //selectionlist.listwidget.query = query;
    108105                        selectionlist.load(jsonw["WorkspaceProfile"]["CustomTermsets"]);
     106                        $(this.content).find('.cmd_reload').data('selectionlist',selectionlist);
    109107                        if (query.columns == ""){
    110108                                var autolist = "";
     
    145143        if (this.url != undefined){
    146144                $(this.content_wrapper).show();
    147                 $(this.content_wrapper).find('.detail-content').load(this.url,function(){
     145                $(this.content_wrapper).find('.detail-content').data('id', $(this.detailwidget).parent().next().attr('id'));
     146                $(this.content_wrapper).find('.detail-content').load(this.url,function(responseText, textStatus, XMLHttpRequest){
     147                        //find info data
     148                        if ($(this).data('id') != null){
     149                                if ($(this).data('id').length > 0){
     150                                        $(this).html($(this).find('#' + $(this).data('id') + '-info'));
     151                                }
     152                        }
    148153                        var get = $(this).parent().find('.cmd_get');                           
    149154                        get.removeClass('cmd_get');
     
    203208                        get.addClass('cmd_up');
    204209                }
    205         default:
     210        default://pane ?
    206211        };
    207212               
     
    234239        container: '#detaillist',
    235240               
    236         calldetail: function(widget){
    237                 var name;
     241        calldetail: function(widget,name, url){
     242                //var name;
    238243                var detail;
    239                 var content, url;
    240                
    241                 name = this.getdetailname(widget) ;
    242                 if (name == undefined) {
    243                         alert("detail name -  undefined");
    244                         return;
     244                var content;//, url;
     245               
     246                if (name == undefined){
     247                        name = this.getdetailname(widget) ;
     248                        if (name == undefined) {
     249                                alert("detail name -  undefined");
     250                                return;
     251                        }
    245252                }
    246253                // test for values
     
    255262                if (detail == undefined) {
    256263                        //content = this.getdetailcontent(name, widget);
    257                         detail = new Detail( widget, name );
     264                        detail = new Detail( widget, name, url);
    258265                        this.adddetail(detail);
    259266                } else {
    260267                        detail.close();
    261268                        //content = this.getdetailcontent(name, widget);
    262                         detail.update( widget );
     269                        detail.update( widget , url);
    263270                }
    264271               
     
    303310                                                        if ($(widget).prev().hasClass("value-input")){
    304311                                                                name = 'values';
     312                                                        } else {
     313                                                                if ($(widget).hasClass("cmd_info")){
     314                                                                        name = 'info';
     315                                                                }
    305316                                                        }
    306317                                                }
     
    479490        }
    480491}
     492/*
     493function updateColumnsFromDetail(query){
     494        var detail = detailcaller.getdetail("detail_query");
     495        if (detail != undefined){
     496                if (query.listid == detail.temp_id){
     497                       
     498                        if (selectionlistset.getselectionlist(slid).autoSelected()){
     499                                this.columns = "";
     500                        } else
     501                        {
     502                                this.columns = selectionlistset.getselectionlist(slid).listwidget.getListText();
     503                        }
     504                }
     505        }
     506}
     507*/
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui_helpers.js

    r1223 r1233  
    365365        if (q["bookmark"] == "1") {
    366366                var uri = "/MDService2/record/htmldetail/" + q["querystring"];
    367                 showDetail(null,'html');
    368                 $.get(uri, showDetail,'html');
     367                detailcaller.calldetail(undefined, "record", uri);
     368                //var uri = "/MDService2/record/htmldetail/" + q["querystring"];
     369                //showDetail(null,'html');
     370                //$.get(uri, showDetail,'html');
    369371        } else {
    370372                //hideWelcomeMessage();
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui_load.js

    r1229 r1233  
    544544        saveWorkspace("USER");
    545545}
     546
     547/*
     548function loadWelcomeMessage(){ 
     549        $('#welcomedetail').load("/MDService2/docs/xml/welcome #welcome", function() { //profile.collections.base_uri,
     550                $('#welcome').addClass("ui-helper-reset ui-corner-all ui-widget-content");
     551        });
     552}
     553*/
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_ui_settings.js

    r1219 r1233  
    308308                        type: "pane"
    309309                }
     310        },
     311        info:{
     312                id: "#info",
     313                detail: {
     314                        parent: "",
     315                        type: "pane"
     316                }
    310317        }
    311318};
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_widgets.js

    r1229 r1233  
    7979        this.type = type;
    8080       
     81        //this.query = undefined;
    8182        //this.init();
    8283       
     
    179180                lv.remove(colid);
    180181                //resubmit query
     182                /*
    181183                if (lvid.beginsWith("sl")){
    182184                        q.query.updateColumns(sl);
    183185                        q.query.resubmit();
    184186                }
     187                */
    185188                /*
    186189                if ($(this).parent().parent().parent().attr('class') == 'query-columns'){
Note: See TracChangeset for help on using the changeset viewer.