View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 793 | RackTables | default | public | 2013-03-15 10:48 | 2013-05-19 19:32 |
| Reporter | Kvantum | Assigned To | andriyanov | ||
| Priority | normal | Severity | feature | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Product Version | 0.20.3 | ||||
| Summary | 793: Add Back to Top button | ||||
| Description | Hi. Sometimes generated pages to much long. It require "Back to Top" button. I try to make it by self. It helps a lot. files to modify: 1. pi.css 2. interface.php | ||||
| Tags | No tags attached. | ||||
| Attached Files | interface.php.0.20.3.diff (2,506 bytes)
*** /usr/src/RackTables-0.20.3/wwwroot/inc/interface.php 2012-12-19 21:30:47.000000000 +0500
--- /usr/local/share/RackTables/wwwroot/inc/interface.php 2013-03-15 14:47:28.000000000 +0500
***************
*** 97,104 ****
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title><?php echo getTitle ($pageno); ?></title>
<?php printPageHeaders(); ?>
</head>
! <body>
<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" class="maintable">
<tr class="mainheader"><td>
<?php echo getConfigVar ('enterprise') ?> RackTables <a href="http://racktables.org" title="Visit RackTables site"><?php echo CODE_VERSION ?></a><?php renderQuickLinks() ?>
--- 97,135 ----
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title><?php echo getTitle ($pageno); ?></title>
<?php printPageHeaders(); ?>
+ <script type="text/javascript">
+ $(function() {
+ $('#toTopLeft, #toTopRight').hide();
+ $("#toTopRightContainer").hover( function() {
+ $('#toTopRight').stop(true, true);
+ $('#toTopRight').fadeIn('fast');
+ }, function () {
+ $('#toTopRight').stop(true, true);
+ $('#toTopRight').fadeOut('slow');
+ });
+ $("#toTopLeftContainer").hover( function() {
+ $('#toTopLeft').stop(true, true);
+ $('#toTopLeft').fadeIn('fast');
+ }, function () {
+ $('#toTopLeft').stop(true, true);
+ $('#toTopLeft').fadeOut('slow');
+ });
+ $('#toTopLeft, #toTopRight').click( function() {
+ $('html, body').animate({scrollTop: 0}, 800);
+ });
+ $(window).scroll( function() {
+ clearTimeout($.data(this, 'scrollTimer'));
+ $.data(this, 'scrollTimer', setTimeout( function() {
+ $('#toTopLeft, #toTopRight').fadeOut('slow');
+ }, 250));
+ $('#toTopLeft, #toTopRight').fadeIn('slow');
+ });
+ });
+ </script>
</head>
! <body id="page-top">
! <div id="toTopLeftContainer"><a id="toTopLeft" href="#page-top" title="Back to Top"><img style="border: none;" src="/pix/up-arrow-left.png"/></a></div>
! <div id="toTopRightContainer"><a id="toTopRight" href="#page-top" title="Back to Top"><img style="border: none;" src="/pix/up-arrow-right.png"/></a></div>
<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" class="maintable">
<tr class="mainheader"><td>
<?php echo getConfigVar ('enterprise') ?> RackTables <a href="http://racktables.org" title="Visit RackTables site"><?php echo CODE_VERSION ?></a><?php renderQuickLinks() ?>
pi.css.0.20.3.diff (533 bytes)
*** /usr/src/RackTables-0.20.3/wwwroot/css/pi.css 2012-12-19 21:30:47.000000000 +0500
--- /usr/local/share/RackTables/wwwroot/css/pi.css 2013-03-15 14:42:48.000000000 +0500
***************
*** 782,784 ****
--- 783,801 ----
font-family: monospace;
font-style: italic;
}
+
+ #toTopRightContainer {
+ position: fixed;
+ bottom:5px;
+ right:5px;
+ width: 36px;
+ height: 32px;
+ }
+
+ #toTopLeftContainer {
+ position: fixed;
+ bottom:5px;
+ left:5px;
+ width: 36px;
+ height: 32px;
+ }
\ No newline at end of file
| ||||
|
I think the Home keyboard button is enough, so this patch will not be merged. However, you can rewrite it into plugin (simply call addJS function and inset div containers through DOM modification JS code), and it will be welcomed in racktables-contribs repository. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2013-03-15 10:48 | Kvantum | New Issue | |
| 2013-03-15 10:48 | Kvantum | File Added: interface.php.0.20.3.diff | |
| 2013-03-15 10:48 | Kvantum | File Added: pi.css.0.20.3.diff | |
| 2013-03-15 10:49 | Kvantum | File Added: up-arrow-left.png | |
| 2013-03-15 10:49 | Kvantum | File Added: up-arrow-right.png | |
| 2013-05-19 17:26 | andriyanov | Note Added: 0001427 | |
| 2013-05-19 17:26 | andriyanov | Status | new => closed |
| 2013-05-19 17:26 | andriyanov | Assigned To | => andriyanov |
| 2013-05-19 17:26 | andriyanov | Resolution | open => no change required |