From dc12ed3ee6aa7741b2c65c4ec3397a191676ba8a Mon Sep 17 00:00:00 2001 From: Harold Rodriguez Date: Sat, 9 Nov 2013 14:49:32 -0500 Subject: [PATCH 1/3] Update README.markdown --- README.markdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index bcc0fee..94e4af3 100644 --- a/README.markdown +++ b/README.markdown @@ -1,3 +1,8 @@ +## Recursive Reloadr + +This version of reloadr looks at directories recursively, so you can just supply "*.ext" to Reloadr, and it will refresh regardless of deep-nested directory structures. +It also adds localStorage support for enabling/disabling Reloadr. + # Reloadr ## The Problem @@ -51,4 +56,4 @@ All options are, um, optional, but Reloadr won't actually *do* anything if you d This is kind of a quick and dirty hack. I'd like to add some features to make usage easier, but still keep it simple. Here are some ideas: -- Scan the document's HEAD to find CSS and JS urls to poll. \ No newline at end of file +- Scan the document's HEAD to find CSS and JS urls to poll. From b55b38a064e1c07b6d364629458d35603a7f6e02 Mon Sep 17 00:00:00 2001 From: Harold Rodriguez Date: Sat, 9 Nov 2013 14:50:53 -0500 Subject: [PATCH 2/3] add localstorage enable/disable support --- reloadr.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reloadr.js b/reloadr.js index 659f3aa..8cbb7b3 100644 --- a/reloadr.js +++ b/reloadr.js @@ -21,14 +21,17 @@ TO USE: include reloadr.js and tell it what to check: ]); */ + var Reloadr = { options: { frequency: 2000, client: [], server: [], - path: '/reloadr.php' + path: '/reloadr.php', }, req: new XMLHttpRequest(), + disable: function(){ localStorage.setItem("reloadrDisabled", "true"); }, + enable: function(){ localStorage.setItem("reloadrDisabled", "false"); }, timeout: null, watch: function(options) { this.go.call(this, options); }, go: function(options) { @@ -49,6 +52,8 @@ var Reloadr = { }, this.options.frequency); }, ajax: function(url, callback) { + if (localStorage.getItem("reloadrDisabled")==="true") return; + this.req.open("GET", url, false); this.req.setRequestHeader('If-Modified-Since', window._Reloadr_LoadTime.toUTCString()); this.req.send(null); From 11d2560f049883188cab82fa6fa924b041963732 Mon Sep 17 00:00:00 2001 From: Harold Rodriguez Date: Sat, 9 Nov 2013 14:51:23 -0500 Subject: [PATCH 3/3] make reloadr recursively check directories --- reloadr.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/reloadr.php b/reloadr.php index 6070f63..3087daf 100644 --- a/reloadr.php +++ b/reloadr.php @@ -1,14 +1,15 @@