Ignore:
Timestamp:
01/11/11 12:32:58 (13 years ago)
Author:
gaba
Message:

tooltips

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

Legend:

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

    r1033 r1051  
    153153        <div id="detail">               
    154154        </div> 
     155       
    155156</div>
    156157<div id="bubble">
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js

    r1046 r1051  
    4646                init();         
    4747                loadWelcomeMessage();
     48                loadTooltiptable();
    4849                // Collections and terms loaded after WorkspaceProfile is loaded
    4950                loadWorkspaceProfiles();
     
    5152                //loadTerms();
    5253                //handleQueryInput();
     54                //createTooltip()
    5355               
    5456                loadComponentsRegistry();       
     
    438440                }
    439441        });
     442        createTooltip(qs);
    440443}
    441444
     
    551554                        }
    552555             });
     556               
    553557        }
    554        
    555558
    556559}
     
    597600                                loadTerms();
    598601                                handleQueryInput();
     602                                createTooltip(null);
    599603                });
    600604
     
    604608                                jsonw = preprocessJSON(data);
    605609                                loadQuerysets(jsonw["WorkspaceProfile"]["Querysets"],"user");
     610                                //createTooltip(this);
    606611        });
    607612
     
    616621                                        }
    617622                                       
    618                                        
     623                                        createTooltip($(this));
    619624                                        $("#collections .treeview").treeview({
    620625                                                animated: "fast",
     
    704709                                                //$('#collection_list').attr("value",collection_text);
    705710                                                collections_widget.load(collections);
    706                                                
    707711                                        });// end of treeview click
    708712        });// end of collection callback       
     
    724728                                                //notifyUser($("#model_terms .treeview"),'debug');
    725729                                                notifyUser("loaded: #model_terms .treeview",'debug');
     730                                                createTooltip(this);
    726731                                                }       
    727732                        );     
     
    795800                                                        collapsed: false
    796801                                                });
     802                                                createTooltip(this);
    797803                                                notifyUser($("#components .treeview"),'debug');
    798804                                                }       
     
    10081014
    10091015                $('#collection_list').attr("value",query.getcollectiontext("name"));
    1010                 columns_widget.load(query.columns);
     1016       
     1017                columns_widget.load(query.columns.split(','));
    10111018                //$('#columns_list').attr("value",query.columns);
    10121019                $('#input-simplequery').attr("value",query.squery);     
     
    16061613         
    16071614};
     1615
     1616
     1617 function loadTooltiptable() {
     1618 
     1619                 var uri = window.location.pathname + "static/info.xml";
     1620                 
     1621                 $.get(uri,function(data, textStatus){
     1622                        $(data).find('#commands').find('dt').each(function(){
     1623                                tooltiptable[$(this).attr("id")] = $(this).text();
     1624                                //$(this).next('dd').text();
     1625                        });
     1626                 },'html');
     1627 
     1628 };
     1629 
     1630/*
     1631 function showTooltip(_data, textStatus, xmlhttpreq) { 
     1632                        if (xmlhttpreq.responseXML != null){
     1633                                var isinfo = xmlhttpreq.responseXML.baseURI.split("/static/info.xml?id=");
     1634                                if (isinfo != "undefined"){
     1635                                        if ( isinfo.length = 2){
     1636                                                var infoid = new RegExp('[\\?]id=([^&#]*)').exec(xmlhttpreq.responseXML.baseURI);
     1637                                                infoid = infoid[1] || 0;
     1638                                                var ttext;
     1639                                               
     1640                                                if ($(_data).find('#' + infoid).length > 0){
     1641                                                        ttext = $(_data).find('#' + infoid);
     1642                                                } else {
     1643                                                        if (infoid.split(".").length > 1) {
     1644                                                                ttext = $(_data).find('#' + infoid.split(".")[1]);
     1645                                                        }
     1646                                                }
     1647                                                if (ttext.length > 0) {
     1648                                                        var s = $(ttext).text();
     1649                                                        var s2 = $(ttext).next('dd').text();
     1650                                                        tooltip.show($(ttext).attr("id") + "  " + s, 200);
     1651
     1652                                                }
     1653                                        }
     1654                                }               
     1655                        }
     1656 }
     1657*/
     1658 
     1659                 
     1660function createTooltip(parentwidget) {
     1661       
     1662         var ccmd;
     1663         if (parentwidget == null) {
     1664                 ccmd = $('.cmd');
     1665         } else {
     1666                 ccmd = $(parentwidget).find('.cmd');
     1667         }
     1668         $(ccmd).mouseover(function(){
     1669                 // command name
     1670                 var cmd = $(this).attr("class");
     1671                 cmd = cmd.substring(cmd.indexOf("cmd_"));
     1672                 cmd = cmd.split(" ")[0];
     1673                 
     1674                 // command place
     1675                 var place = "";
     1676                 if ($(this).parents('.content').length > 0) {
     1677                         place = $(this).parents('.content').attr("id") + ".";
     1678                 }
     1679                 if ($(this).parents('.block').length > 0) {
     1680                         place = $(this).parents('.block').attr("id") + ".";
     1681                 }
     1682                 
     1683
     1684                 // find tho tooltiptext
     1685                 var a = place + cmd;
     1686               
     1687                 if (tooltiptable[a] != null) {
     1688                        s = tooltiptable[a];
     1689                 } else {
     1690                        if (tooltiptable[cmd] != null) {
     1691                                s = tooltiptable[cmd];
     1692                        } else {
     1693                                s = a;
     1694                        }
     1695                 }
     1696                 tooltip.show(s);
     1697         });
     1698         $(ccmd).mouseout(function(){
     1699                 tooltip.hide();
     1700         });
     1701
     1702 };
     1703 
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_model.js

    r1038 r1051  
    323323                $(this).parent().hide();
    324324        });
    325         */     
     325        */
     326        createTooltip(this.container);
    326327 };
    327328
     
    416417                                       
    417418                                        q_header.find('.columns-wrapper').hide();
     419                                        createTooltip($(this));
    418420                                });
    419421
  • MDService2/trunk/MDService2/WebContent/scripts/mdservice_widgets.js

    r980 r1051  
    11
    2 
     2 
    33function NotifyMessage(dt, msg){
    44        this.dt = dt;
     
    266266
    267267
    268 
    269 
     268// TOOLTIP
     269var tooltiptable = {};
     270
     271var tooltip=function(){
     272         var id = 'tt';
     273         var top = 3;
     274         var left = 3;
     275         var maxw = 300;
     276         var speed = 10;
     277         var timer = 20;
     278         var endalpha = 95;
     279         var alpha = 0;
     280         var tt,t,c,b,h;
     281         var ie = document.all ? true : false;
     282         return{
     283
     284        show:function(v,w){
     285                 if(tt == null){
     286                         tt  = document.createElement('div');
     287                         tt.setAttribute('id',id);
     288                         document.body.appendChild(tt);
     289                         tt.style.opacity  = 0;
     290                         tt.style.filter  = 'alpha(opacity=0)';
     291                         document.onmousemove  = this.pos;
     292                        }
     293                        tt.style.display  = 'block';
     294                        tt.innerHTML = v;
     295                        tt.style.width  = w ? w + 'px' : 'auto';
     296
     297                        if(!w  && ie){
     298                         tt.style.width  = tt.offsetWidth;
     299                        }
     300
     301                        if(tt.offsetWidth  > maxw){tt.style.width = maxw + 'px';}
     302
     303                        h =  parseInt(tt.offsetHeight) + top;
     304                        clearInterval(tt.timer);
     305                        tt.timer =  setInterval(function(){tooltip.fade(1);},timer);
     306          },
     307         
     308          pos:function(e){
     309           var u = ie ? event.clientY + document.documentElement.scrollTop : e.pageY;
     310           var l = ie ? event.clientX + document.documentElement.scrollLeft : e.pageX;
     311           tt.style.top = (u + h) + 'px'; //(u - h) + 'px';
     312           tt.style.left = (l + left) + 'px';
     313          },
     314         
     315          fade:function(d){
     316           var a = alpha;
     317           if((a != endalpha && d == 1) || (a != 0 && d == -1)){
     318            var i = speed;
     319           if(endalpha - a < speed && d == 1){
     320            i = endalpha - a;
     321           }else if(alpha < speed && d == -1){
     322             i = a;
     323           }
     324           alpha = a + (i * d);
     325           tt.style.opacity = alpha * .01;
     326           tt.style.filter = 'alpha(opacity=' + alpha + ')';
     327          }else{
     328            clearInterval(tt.timer);
     329             if(d == -1){tt.style.display = 'none'};
     330          }
     331         },
     332       
     333         hide:function(){
     334                 if (tt != undefined) {
     335                         clearInterval(tt.timer);
     336                         tt.timer = setInterval(function(){tooltip.fade(-1);},timer);
     337                 }
     338          }
     339         };
     340        }();
     341
     342
  • MDService2/trunk/MDService2/WebContent/style/cmds-ui.css

    r1046 r1051  
    113113.columns-wrapper { right:0px;}
    114114
     115/* ************* */
     116/* tooltip */
     117#tt {
     118 position:absolute;
     119 display:block;
     120 /*padding:2px 12px 3px 7px;*/
     121 margin-left:5px;
     122 background:#A6C9E2;
     123 color:#000;
     124 }
     125
     126
    115127/* command icons */
    116128
Note: See TracChangeset for help on using the changeset viewer.