mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-20 12:11:05 -05:00
remember where user was grepping my last
This commit is contained in:
@@ -14,8 +14,8 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||
<ul class="breadcrumb">
|
<ul class="breadcrumb">
|
||||||
<li><a href="/">Home</a> <span class="divider">/</span></li>
|
<li><a id="home" href="/">Home</a> <span class="divider">/</span></li>
|
||||||
<li id="name" class="active">You are here</li>
|
<li id="name" class="active">You are here</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="well">
|
<div class="well">
|
||||||
|
|||||||
21
index.shtml
21
index.shtml
@@ -6,6 +6,27 @@
|
|||||||
<meta content="width=device-width, initial-scale=1,maximum-scale=1.0;" name=viewport>
|
<meta content="width=device-width, initial-scale=1,maximum-scale=1.0;" name=viewport>
|
||||||
<link rel="stylesheet" href="/bootstrap/docs/assets/css/bootstrap.css">
|
<link rel="stylesheet" href="/bootstrap/docs/assets/css/bootstrap.css">
|
||||||
<link rel="stylesheet" type="text/css" href="style.css">
|
<link rel="stylesheet" type="text/css" href="style.css">
|
||||||
|
<script>
|
||||||
|
function getCookie( oName ) {
|
||||||
|
var splitcookie = document.cookie.split( "; " ), x, cookiepair;
|
||||||
|
for( x = 0; x < splitcookie.length; x = x + 1 ) {
|
||||||
|
cookiepair = splitcookie[x].split( "=" );
|
||||||
|
if( cookiepair[0] === encodeURIComponent( oName ) ) {
|
||||||
|
if( cookiepair[1] ) {
|
||||||
|
return decodeURIComponent( cookiepair[1] );
|
||||||
|
} else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
user = getCookie("u");
|
||||||
|
if (user) { window.location.replace("/u/" + user); }
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
5
main.js
5
main.js
@@ -22,7 +22,6 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$("input[type=search]").change(function() {
|
$("input[type=search]").change(function() {
|
||||||
query = this.value;
|
query = this.value;
|
||||||
console.log(query);
|
|
||||||
window.location.search = query;
|
window.location.search = query;
|
||||||
grep(query);
|
grep(query);
|
||||||
});
|
});
|
||||||
@@ -40,5 +39,7 @@ $(document).ready(function() {
|
|||||||
$("#source").html(footer);
|
$("#source").html(footer);
|
||||||
document.title = "Greptweet " + NAME;
|
document.title = "Greptweet " + NAME;
|
||||||
|
|
||||||
});
|
document.cookie = 'u=' + NAME + '; expires=Thu, 2 Aug 2021 20:47:11 UTC; path=/';
|
||||||
|
$("#home").click(function(){ document.cookie = 'u=' + NAME + '; expires=Thu, 2 Aug 2001 20:47:11 UTC; path=/'; });
|
||||||
|
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user