summaryrefslogtreecommitdiff
path: root/js/common.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-02-28 09:17:27 +0300
committerAndrew Dolgov <[email protected]>2017-02-28 09:17:27 +0300
commit27ef6e89501371b58b92a3b805ab31ba8fc79260 (patch)
treefea8f3daece8b5e30218497362051cae79fda456 /js/common.js
parent16d52ac49f7318620d3a84e172cf18917d70de1b (diff)
fix .urlParam(); make offline search/reset work similarly to online version
Diffstat (limited to 'js/common.js')
-rw-r--r--js/common.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/common.js b/js/common.js
index a400a17..9843c59 100644
--- a/js/common.js
+++ b/js/common.js
@@ -1,3 +1,12 @@
+$.urlParam = function(name){
+ try {
+ var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
+ return decodeURIComponent(results[1].replace(/\+/g, " ")) || 0;
+ } catch (e) {
+ return 0;
+ }
+}
+
function offline_remove(id, callback) {
if (confirm("Remove download?")) {