View Issue Details

IDProjectCategoryView StatusLast Update
793RackTablesdefaultpublic2013-05-19 19:32
ReporterKvantum Assigned Toandriyanov  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionno change required 
Product Version0.20.3 
Summary793: Add Back to Top button
DescriptionHi.
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
TagsNo 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() ?>
interface.php.0.20.3.diff (2,506 bytes)   
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
pi.css.0.20.3.diff (533 bytes)   
up-arrow-left.png (2,400 bytes)   
up-arrow-left.png (2,400 bytes)   
up-arrow-right.png (2,390 bytes)   
up-arrow-right.png (2,390 bytes)   

Activities

andriyanov

andriyanov

2013-05-19 17:26

reporter   ~0001427

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.

Issue History

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