Module: nagvis Branch: master Commit: 4714251bc8add535c3983cc97bf1cf83568b8a21 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=4714251bc8add535c3983cc97bf1cf83568b8a21
Author: LaMi <[email protected]> Date: Sun Mar 28 13:13:11 2010 +0200 #231 Objects in WUI are highlighted on mouseover now using a border --- share/frontend/wui/classes/WuiMap.php | 2 +- share/frontend/wui/js/wui.js | 40 ++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/share/frontend/wui/classes/WuiMap.php b/share/frontend/wui/classes/WuiMap.php index 8e716d2..74baafc 100644 --- a/share/frontend/wui/classes/WuiMap.php +++ b/share/frontend/wui/classes/WuiMap.php @@ -277,7 +277,7 @@ class WuiMap extends GlobalMap { $style = ''; } - return "<img id=\"icon_".$obj['type']."_".$obj['id']."\" src=\"".$obj['htmlPath'].$obj['icon'].$obj['iconParams']."\" ".$style." alt=\"".$obj['type']."_".$obj['id']."\" onmousedown=\"contextMouseDown(event);\" oncontextmenu=\"return contextShow(event);\" />"; + return "<img id=\"icon_".$obj['type']."_".$obj['id']."\" src=\"".$obj['htmlPath'].$obj['icon'].$obj['iconParams']."\" ".$style." alt=\"".$obj['type']."_".$obj['id']."\" onmouseover=\"toggleBorder(this, 1)\" onmouseout=\"toggleBorder(this, 0)\" onmousedown=\"contextMouseDown(event);\" oncontextmenu=\"return contextShow(event);\" />"; } /** diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js index 23b32d5..6a486f3 100644 --- a/share/frontend/wui/js/wui.js +++ b/share/frontend/wui/js/wui.js @@ -468,14 +468,6 @@ function deleteMapObject(objId) { } } -// simple function to ask to confirm before we restore a map -function confirm_restore() { - if(confirm(printLang(lang['confirmRestore'],''))) { - document.location.href='./form_handler.php?myaction=map_restore&map='+mapname; - } - return true; -} - /** * formSubmit() * @@ -655,3 +647,35 @@ function toggleFieldType(sName, sValue) { return bReturn; } + +/** + * toggleBorder() + * + * Highlights an object by show/hide a border around the icon + * + * @param Object Object to draw the border arround + * @param Integer Enable/Disabled border + * @author Lars Michelsen <[email protected]> + */ +function toggleBorder(oObj, state){ + var sColor = '#dddddd'; + var iWidth = 3; + + var oContainer = oObj.parentNode; + + var top = parseInt(oContainer.style.top.replace('px', '')); + var left = parseInt(oContainer.style.left.replace('px', '')); + + if(state === 1) { + oObj.style.border = iWidth + "px solid " + sColor; + oContainer.style.top = (top - iWidth) + 'px'; + oContainer.style.left = (left - iWidth) + 'px'; + } else { + oObj.style.border = "none"; + oContainer.style.top = (top + iWidth) + 'px'; + oContainer.style.left = (left + iWidth) + 'px'; + } + + oObj = null; + oContainer = null; +} ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
