track searches that return no results

This commit is contained in:
r888888888
2016-02-02 16:25:14 -08:00
parent 16ea72df01
commit fe4cb7f3ba
9 changed files with 93 additions and 0 deletions

View File

@@ -99,6 +99,21 @@
return string.replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
}
Danbooru.get_url_parameter = function(sParam) {
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : sParameterName[1];
}
}
};
String.prototype.hash = function() {
var hash = 5381, i = this.length;