diff options
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/script.js | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/lib/scripts/script.js b/lib/scripts/script.js index 2421f3577..5ef9aef85 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -520,7 +520,7 @@ addInitEvent(function(){ /** * Display error for Windows Shares on browsers other than IE * - * Michael Klier <chi@chimeric.de> + * @author Michael Klier <chi@chimeric.de> */ function checkWindowsShares() { var elems = getElementsByClass('windows',document,'a'); @@ -539,8 +539,34 @@ function checkWindowsShares() { /** * Add the event handler for the Windows Shares check * - * Michael Klier <chi@chimeric.de> + * @author Michael Klier <chi@chimeric.de> */ addInitEvent(function(){ checkWindowsShares(); }); + +/** + * Highlight the section when hovering over the appropriate section edit button + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +addInitEvent(function(){ + var btns = getElementsByClass('btn_secedit',document,'form'); + for(var i=0; i<btns.length; i++){ + addEvent(btns[i],'mouseover',function(e){ + var tgt = e.target; + if(tgt.form) tgt = tgt.form; + tgt = tgt.parentNode.previousSibling; + if(tgt.nodeName != "DIV") tgt = tgt.previousSibling; + if(tgt.nodeName != "DIV") return; + tgt.className += ' section_highlight'; + }); + + addEvent(btns[i],'mouseout',function(e){ + var secs = getElementsByClass('section_highlight',document,'div'); + for(var j=0; j<secs.length; j++){ + secs[j].className = secs[j].className.replace(/ section_highlight/,''); + } + }); + } +}); |