From 6c48bb53773944b0f0439b7d6a52ce5fad6b082c Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Tue, 11 Apr 2017 22:03:55 +0200 Subject: [PATCH] fix absolute paths in cts.js - breaks with redirect in sub-directory --- web/htdocs/scripts/cts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/htdocs/scripts/cts.js b/web/htdocs/scripts/cts.js index 453dd2b..b53f540 100644 --- a/web/htdocs/scripts/cts.js +++ b/web/htdocs/scripts/cts.js @@ -133,7 +133,7 @@ var CTS = new Class({ }, readRegisters: function(regs, callback, formated) { - var opts = {'onFailure':requestFailure, 'url': '/cts/cts.pl?' + (formated ? "format" : "read") + ',' + Array.from(regs).join(",")}; + var opts = {'onFailure':requestFailure, 'url': 'cts.pl?' + (formated ? "format" : "read") + ',' + Array.from(regs).join(",")}; if (callback) { opts['onSuccess'] = callback; return (new Request.JSON(opts)).send(); @@ -147,7 +147,7 @@ var CTS = new Class({ writeRegisters: function(values) { var arrValues = []; Object.each(values, function(v,r) {arrValues.push(r); arrValues.push(v)}); - var myUrl = '/cts/cts.pl?write,' + encodeURIComponent( arrValues.join(',') ); + var myUrl = 'cts.pl?write,' + encodeURIComponent( arrValues.join(',') ); (new Request.JSON({ url: myUrl, onSuccess: function(json, text) { -- 2.43.0