Changeset 1020


Ignore:
Timestamp:
12/23/10 21:55:01 (13 years ago)
Author:
gaba
Message:

bookmark - loading - getclass

File:
1 edited

Legend:

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

    r1016 r1020  
    138138function showDetail(data, textStatus) {
    139139        try {
    140                 //notifyUser("receiving data:",'debug');
    141                 //notifyUser(data,'debug');
    142                
    143                 $('#detail-float').html(data);
    144                 var title =  $('#detail-float').find('.inner_title').attr("value");
    145                 $('#detail-float').dialog( "option", "title", title );
    146                
    147                 //ui-state-default
    148                
    149                 $('#detail-float').dialog('open');
    150                 $('#detail-float').siblings('div.ui-dialog-titlebar').addClass('ui-state-default');
    151                 $('#detail-float').siblings('div.ui-dialog-titlebar').children().remove();
    152                 var x = '<span class="cmd cmd_del ui-dialog-titlebar-del "/><span class="cmd cmd_up ui-dialog-titlebar-up"/><span>' + title +'</span>';
    153                 $('#detail-float').siblings('div.ui-dialog-titlebar').prepend(x);
    154                
    155                 notifyUser("query processed:" + textStatus);
    156                 } catch (e) {
     140               
     141                if (data ==  null){
     142                        var blankdata = "<html><\html>";
     143                        var title = "";
     144                        $('#detail-float').html(blankdata);
     145
     146                        if ( $('#detail-float').dialog("isOpen")) {
     147                                var up = $('#detail-float').siblings('div.ui-dialog-titlebar').find('.ui-dialog-titlebar-up');
     148                                up.removeClass('.cmd_up .ui-dialog-titlebar-up');
     149                                up.addClass('.cmd_get .ui-dialog-titlebar-get');
     150                                var down = $('#detail-float').siblings('div.ui-dialog-titlebar').find('.ui-dialog-titlebar-down');
     151                                down.removeClass('.cmd_down .ui-dialog-titlebar-down');
     152                                down.addClass('.cmd_get .ui-dialog-titlebar-get');
     153                               
     154                                $('#detail-float').siblings('div.ui-dialog-titlebar').find('.ui-dialog-title').text(title);
     155                        } else {
     156                                $('#detail-float').dialog('open');
     157                                $('#detail-float').siblings('div.ui-dialog-titlebar').addClass('ui-state-default');
     158                                $('#detail-float').siblings('div.ui-dialog-titlebar').children().remove();
     159                                var x = '<span class="cmd cmd_del ui-dialog-titlebar-del "/><span class="cmd cmd_get ui-dialog-titlebar-get"/><span class="ui-dialog-title">' + "" +'</span>';
     160                                $('#detail-float').siblings('div.ui-dialog-titlebar').prepend(x);
     161
     162                        }
     163
     164                } else
     165                {
     166                        $('#detail-float').html(data);
     167                        var title =  $('#detail-float').find('.inner_title').attr("value");
     168                        $('#detail-float').dialog( "option", "title", title );
     169                       
     170                        if ( $('#detail-float').dialog("isOpen")) {
     171                                var get = $('#detail-float').siblings('div.ui-dialog-titlebar').find('.cmd_get');
     172                                get.removeClass('cmd_get');
     173                                get.removeClass('ui-dialog-titlebar-get');
     174                                get.addClass('cmd_up');
     175                                get.addClass('ui-dialog-titlebar-up');
     176                               
     177                                $('#detail-float').siblings('div.ui-dialog-titlebar').find('.ui-dialog-title').text(title);
     178                        } else {
     179                                //ui-state-default
     180                                $('#detail-float').dialog('open');
     181                                $('#detail-float').siblings('div.ui-dialog-titlebar').addClass('ui-state-default');
     182                                $('#detail-float').siblings('div.ui-dialog-titlebar').children().remove();
     183                                var x = '<span class="cmd cmd_del ui-dialog-titlebar-del "/><span class="cmd cmd_up ui-dialog-titlebar-up"/><span class="ui-dialog-title">' + title +'</span>';
     184                                $('#detail-float').siblings('div.ui-dialog-titlebar').prepend(x);
     185                               
     186                                notifyUser("query processed:" + textStatus);                           
     187                        }
     188                }
     189        } catch (e) {
    157190                        notifyUser(e,'debug');
    158                 }       
     191        }       
    159192}
    160193
     
    369402                        var str = $(this).parent().parent().parent().find('a').attr("href");
    370403                        var iq = parseInt(str.substring(7));
     404                       
    371405                        jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"][iq].name = $(this).val();
    372406                        saveWorkspace("USER");
     
    493527
    494528function saveWorkspace(type){
    495 
    496529        var JSONText = JSON.stringify(jsonw["WorkspaceProfile"]);
    497530        //var JSONText = JSON.stringify({"aa.a":"r"});
     
    13771410        if (q["bookmark"] == "1") {
    13781411                var uri = "http://localhost:8080/MDService2/record/htmldetail/" + q["querystring"];
     1412                showDetail(null,'html');
    13791413                $.get(uri, showDetail,'html');
    13801414        } else {
Note: See TracChangeset for help on using the changeset viewer.