Changeset 1051 for MDService2/trunk/MDService2/WebContent
- Timestamp:
- 01/11/11 12:32:58 (13 years ago)
- Location:
- MDService2/trunk/MDService2/WebContent
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/WebContent/index.jsp
r1033 r1051 153 153 <div id="detail"> 154 154 </div> 155 155 156 </div> 156 157 <div id="bubble"> -
MDService2/trunk/MDService2/WebContent/scripts/mdservice2_ui.js
r1046 r1051 46 46 init(); 47 47 loadWelcomeMessage(); 48 loadTooltiptable(); 48 49 // Collections and terms loaded after WorkspaceProfile is loaded 49 50 loadWorkspaceProfiles(); … … 51 52 //loadTerms(); 52 53 //handleQueryInput(); 54 //createTooltip() 53 55 54 56 loadComponentsRegistry(); … … 438 440 } 439 441 }); 442 createTooltip(qs); 440 443 } 441 444 … … 551 554 } 552 555 }); 556 553 557 } 554 555 558 556 559 } … … 597 600 loadTerms(); 598 601 handleQueryInput(); 602 createTooltip(null); 599 603 }); 600 604 … … 604 608 jsonw = preprocessJSON(data); 605 609 loadQuerysets(jsonw["WorkspaceProfile"]["Querysets"],"user"); 610 //createTooltip(this); 606 611 }); 607 612 … … 616 621 } 617 622 618 623 createTooltip($(this)); 619 624 $("#collections .treeview").treeview({ 620 625 animated: "fast", … … 704 709 //$('#collection_list').attr("value",collection_text); 705 710 collections_widget.load(collections); 706 707 711 });// end of treeview click 708 712 });// end of collection callback … … 724 728 //notifyUser($("#model_terms .treeview"),'debug'); 725 729 notifyUser("loaded: #model_terms .treeview",'debug'); 730 createTooltip(this); 726 731 } 727 732 ); … … 795 800 collapsed: false 796 801 }); 802 createTooltip(this); 797 803 notifyUser($("#components .treeview"),'debug'); 798 804 } … … 1008 1014 1009 1015 $('#collection_list').attr("value",query.getcollectiontext("name")); 1010 columns_widget.load(query.columns); 1016 1017 columns_widget.load(query.columns.split(',')); 1011 1018 //$('#columns_list').attr("value",query.columns); 1012 1019 $('#input-simplequery').attr("value",query.squery); … … 1606 1613 1607 1614 }; 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 1660 function 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 323 323 $(this).parent().hide(); 324 324 }); 325 */ 325 */ 326 createTooltip(this.container); 326 327 }; 327 328 … … 416 417 417 418 q_header.find('.columns-wrapper').hide(); 419 createTooltip($(this)); 418 420 }); 419 421 -
MDService2/trunk/MDService2/WebContent/scripts/mdservice_widgets.js
r980 r1051 1 1 2 2 3 3 function NotifyMessage(dt, msg){ 4 4 this.dt = dt; … … 266 266 267 267 268 269 268 // TOOLTIP 269 var tooltiptable = {}; 270 271 var 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 113 113 .columns-wrapper { right:0px;} 114 114 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 115 127 /* command icons */ 116 128
Note: See TracChangeset
for help on using the changeset viewer.