diff --git a/html/js/scripts.js b/html/js/scripts.js index ac19a939d..f4b2e5f8d 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -2687,4 +2687,55 @@ function logout() var tmp_last = tmp_b.length - 1 var place_logout = tmp_place.replace(tmp_b[tmp_last], 'logout.php'); window.location.href = place_logout; +} +/** + * Create a div which can be used in a anchor + * @returns {undefined} + */ +function create_anchor_up() +{ + if ( $('up_top')) return; + + var newElt = new Element('div'); + newElt.setAttribute('id', 'up_top'); + newElt.innerHTML=''; + + var parent = $('info_div').parentNode; + parent.insertBefore(newElt, $('info_div')); + +} +/** + * Initialize the window to show the button "UP" if the window is scrolled + * vertically + * @returns {undefined} + */ +function init_scroll() +{ + var up=new Element('div',{"class":"inner_box", + "style":"padding:10px;left:auto;width:30px;height: auto;display:none;position:fixed;top:25px;right:20px;text-align:center", + id:"go_up" + }); + up.innerHTML=' '; + document.body.appendChild(up); + window.onscroll=function () { + if ( document.viewport.getScrollOffsets().top> 0) { + if ($('go_up').visible() == false) { + $('go_up').setOpacity(0.85); + $('go_up').show(); + } + } else { + $('go_up').hide(); + } + } +} +/** + * All the onload must be here otherwise the other will overwritten + * @returns {undefined} + */ +window.onload=function () +{ + console.log('loading'); + create_anchor_up(); + init_scroll(); + sorttable.init } \ No newline at end of file diff --git a/html/js/sorttable.js b/html/js/sorttable.js index c9f384c1f..cfe0ae4fd 100644 --- a/html/js/sorttable.js +++ b/html/js/sorttable.js @@ -386,7 +386,8 @@ if (/WebKit/i.test(navigator.userAgent)) { // sniff } /* for other browsers */ -window.onload = sorttable.init; +// Moved into scripts.js +//window.onload = sorttable.init; // written by Dean Edwards, 2005 // with input from Tino Zijdel, Matthias Miller, Diego Perini diff --git a/include/param_pcmn.inc.php b/include/param_pcmn.inc.php index 742c0a72e..cc6934521 100644 --- a/include/param_pcmn.inc.php +++ b/include/param_pcmn.inc.php @@ -129,6 +129,11 @@ for ($i=0; $i <$MaxRow; $i++): endfor; ?> +