Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix to config loading/getting

  • Loading branch information...
commit 0eb0f8c717127ef6f8afbc570d71582e876eb187 1 parent a03f932
@marstall authored
Showing with 13 additions and 4 deletions.
  1. +4 −4 shim.js
  2. +9 −0 views/shim.ejs
View
8 shim.js
@@ -281,7 +281,7 @@ function handle_attach(req,res)
load_config = function()
{
- CONFIG={}
+ CONFIG=null
try
{
config_text = fs.readFileSync('config.json','utf8')
@@ -306,7 +306,7 @@ load_config = function()
}
initialize_slideshow = function() {
- if (!CONFIG.slideshow) return
+ if (!CONFIG || CONFIG.slideshow) return
setInterval(function(){
console.log("slideshow set to "+slideshow_index+"/"+CONFIG.slideshow.paths[slideshow_index])
Path = CONFIG.slideshow.path_base+"/"+CONFIG.slideshow.paths[slideshow_index]+"?"+set_string
@@ -361,7 +361,7 @@ server = http.createServer(function (req, res)
}
else
{
- console.log (" %%%%%%%%%%%%%% no shim "+req.url)
+// console.log (" %%%%%%%%%%%%%% no shim "+req.url)
var proxy = new httpProxy.HttpProxy();
if (res.statusCode>=300 && res.statusCode<400)
{
@@ -405,7 +405,7 @@ function handle_cookies(host,req)
if (x.length>1)
{
name = x[0].trim();
- if (CONFIG.excluded_cookies[name]!=null) next;
+ if (CONFIG && (CONFIG.excluded_cookies[name]!=null)) next;
value = x[1].trim();
if (value.length>0) existing_cookies[name]=value
// console.log("new cookie:"+name+":"+value)
View
9 views/shim.ejs
@@ -134,11 +134,20 @@ shim = function()
});
},
+ disable_refresh:function(context)
+ {
+ // disable any <meta http-equiv="Refresh" content="900;url=?refresh=true">
+ if (!context) context=this
+ refresh_meta = jQuery("a[http_equiv=Refresh]")
+ alert(refresh_meta).attr("content")
+ }
+
init:function()
{
connected=false;
original_title=document.title
this.change_urls(this);
+ this.disable_refresh(this)
//setInterval(this.change_urls(this),1000);
try
Please sign in to comment.
Something went wrong with that request. Please try again.