mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-21 20:41:06 -05:00
Appcache tweaks to handle queries, hopefully
This commit is contained in:
@@ -8,3 +8,7 @@ tweets.txt
|
|||||||
/bootstrap/docs/assets/img/glyphicons-halflings.png
|
/bootstrap/docs/assets/img/glyphicons-halflings.png
|
||||||
/style.css
|
/style.css
|
||||||
/jquery-1.7.2.min.js
|
/jquery-1.7.2.min.js
|
||||||
|
NETWORK:
|
||||||
|
/f/*
|
||||||
|
FALLBACK:
|
||||||
|
index.html
|
||||||
|
|||||||
9
main.js
9
main.js
@@ -24,7 +24,7 @@ function grep(query) {
|
|||||||
if (typeof applicationCache !== 'undefined' && applicationCache.status == 1) {
|
if (typeof applicationCache !== 'undefined' && applicationCache.status == 1) {
|
||||||
|
|
||||||
// If we have a cache, lets do this locally
|
// If we have a cache, lets do this locally
|
||||||
console.log("Using applicationCache");
|
console.log("Using applicationCache");
|
||||||
if (l.length > 0) {
|
if (l.length > 0) {
|
||||||
search(query, l);
|
search(query, l);
|
||||||
} else {
|
} else {
|
||||||
@@ -37,13 +37,13 @@ function grep(query) {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Client doesn't support appcache or it's not in sync, so lets search on the server
|
// Client doesn't support appcache or it's not in sync, so lets search on the server
|
||||||
console.log("Using grep.php");
|
console.log("Using grep.php");
|
||||||
$.getJSON("/u/" + NAME + "/grep.php?jsoncallback=?", {
|
$.getJSON("/u/" + NAME + "/grep.php?jsoncallback=?", {
|
||||||
q: query
|
q: query
|
||||||
},
|
},
|
||||||
function(data) {
|
function(data) {
|
||||||
search(query, data);
|
search(query, data);
|
||||||
});
|
}).error(function(x) { console.log("AJAX JSON-P error: " + x); });
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,8 +55,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
$("input[type=search]").change(function() {
|
$("input[type=search]").change(function() {
|
||||||
query = this.value;
|
query = this.value;
|
||||||
// TODO: APPCACHE BUG
|
window.location.search = query; // Triggers Reload the page to get source for: http://greptweet/u/kaihendry/?food
|
||||||
// window.location.search = query; // Triggers Reload the page to get source for: http://greptweet/u/kaihendry/?food
|
|
||||||
grep(query);
|
grep(query);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user