Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding url nav
  • Loading branch information
unknown authored and unknown committed Feb 13, 2010
1 parent 97a8e76 commit 29bcd31
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 8 deletions.
12 changes: 11 additions & 1 deletion css/default.css
Expand Up @@ -9,14 +9,24 @@ ul.nav li { float: left; list-style: none; }
ul.nav li a, ul.nav li span { float: left; padding: 0 1em; font-size: 1.3em; text-decoration: none; }
ul.nav li a:hover { text-decoration: underline; }

#urlnav { position: fixed; top: 9px; right: 9px; float: right; padding: 0; margin: 0; }
#urlnav li { clear: both; overflow: hidden; padding: 0; margin: 0; }
#urlnav li a { background: transparent url(/i/089.png) no-repeat center center; overflow: hidden; width: 32px; height: 32px; padding: 0; margin: 0; text-indent: -9999px;}
#urlnav li a:hover { background-color: #eee; }

#urlnav li.top a { background-image: url(/i/194.png); }
#urlnav li.bottom a { background-image: url(/i/193.png); }
#urlnav li.clear a { background-image: url(/i/150.png); }
#urlnav li.permalink a { background-image: url(/i/089.png); }

.wrapper { padding: 20px; }

.hdr { float: left; }
.hdr h1 { float: left; }
.hdr a.back { float: left; }
.hdr ul.nav { margin-left: 20px; }

ul.lines { clear: both; }
ul.lines { clear: both; margin: 0 30px 20px 20px; }
ul.lines li { list-style: none; font-family: "Courier New",monospace; line-height: 1.6em; font-size: 1.1em; clear: left; background: #eee; }
ul.lines li:hover span.t, ul.lines li.hover span.t { background: #efe; }
ul.lines li.action { color:#9C009C; }
Expand Down
Binary file added i/089.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added i/150.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added i/193.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added i/194.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions index.php
Expand Up @@ -15,21 +15,19 @@
<html>
<head>
<title><?=$title?></title>

<link rel="stylesheet" type="text/css" href="/css/default.css" media="screen" />

<script type="text/javascript" src="/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="/js/jquery.plugins.js"></script>
<script type="text/javascript" src="/js/global.js"></script>
</head>
<body><div class="wrapper">
<body><a name="top"></a><div class="wrapper">
<?
if(isset($_REQUEST['date'])) {
$logdate = $_REQUEST['date'];
$filename = $logdir.'/'.$logprefix.'.log.'.$logdate;
$lines = file_exists($filename) ? file($filename) : null;
}
if(isset($_REQUEST['date']) && count($lines)) { ?>
if(isset($_REQUEST['date']) && count($lines)) { ?>
<div class="hdr">
<h1><?=$title?> - <?=$logdate?></h1>
<ul class="nav">
Expand Down Expand Up @@ -79,6 +77,12 @@
}
?>
</ul>
<ul class="nav" id="urlnav">
<li class="top"><a href='#top' title="Top">Top</a></li>
<li class="bottom"><a href='#bottom' title="Bottom">Bottom</a></li>
<li class="clear"><a href='#' title="Clear Selection">Clear Selection</a></li>
<li class="permalink"><a href='/' title="Permalink">Permalink</a></li>
</ul>
<?
} else {
$files = scandir($logdir);
Expand All @@ -90,6 +94,6 @@
}
}
?>
</div></body>
</div><a name="bottom"></a></body>
</html>

14 changes: 12 additions & 2 deletions js/global.js
Expand Up @@ -7,8 +7,9 @@ $(document).ready(function(){
if(segs[1].substr(0,1) == 'h') {
$(segs[1].substr(1).split(',')).each(function(i,id){
$('#'+id).toggleClass('selected');
})
});
}
$('#urlnav li.permalink a').attr('href',hash);
}

$('ul.lines li').hover(function(){ $(this).toggleClass('hover'); });
Expand All @@ -23,9 +24,18 @@ $(document).ready(function(){
});
var hash = sel_ids[0]+'/h'+sel_ids.join(',');
window.location.hash = hash;
$('#urlnav li.permalink a').attr('href','#'+hash);
} else {
window.location.hash = '';
window.location.hash = '#none';
}
});
$('#urlnav li.clear a').click(function(e){
$('ul.lines li.selected').removeClass('selected');
window.location.hash = null;
$('#urlnav li.permalink a').attr('href','#');
});
$('#urlnav li.permalink a').click(function(e){
window.location = $(this).attr('href');
});

});

0 comments on commit 29bcd31

Please sign in to comment.