From d4f617a703e45244fb4a29ab690623babaf7ff38 Mon Sep 17 00:00:00 2001 From: Adhityaa Date: Tue, 5 Jun 2018 15:31:14 +0530 Subject: [PATCH] frontend: prefix cdn and origin with commento --- api/router_static.go | 4 ++-- frontend/js/dashboard-domain.js | 8 ++++---- frontend/js/dashboard-import.js | 2 +- frontend/js/dashboard-installation.js | 2 +- frontend/js/dashboard-moderation.js | 4 ++-- frontend/js/dashboard-statistics.js | 2 +- frontend/js/login.js | 2 +- frontend/js/self.js | 2 +- frontend/js/signup.js | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/api/router_static.go b/api/router_static.go index 19dc7ae..772a118 100644 --- a/api/router_static.go +++ b/api/router_static.go @@ -46,8 +46,8 @@ func initStaticRouter(router *mux.Router) error { prefix := "" if dir == "js" { - prefix = "window.origin='" + os.Getenv("ORIGIN") + "';\n" - prefix += "window.cdn='" + os.Getenv("CDN_PREFIX") + "';\n" + prefix = "window.commento_origin='" + os.Getenv("ORIGIN") + "';\n" + prefix += "window.commento_cdn='" + os.Getenv("CDN_PREFIX") + "';\n" } asset[p] = prefix + string(contents); diff --git a/frontend/js/dashboard-domain.js b/frontend/js/dashboard-domain.js index 9488329..5855674 100644 --- a/frontend/js/dashboard-domain.js +++ b/frontend/js/dashboard-domain.js @@ -42,7 +42,7 @@ } global.buttonDisable("#add-site-button"); - global.post(global.origin + "/api/domain/new", json, function(resp) { + global.post(global.commento_origin + "/api/domain/new", json, function(resp) { global.buttonEnable("#add-site-button"); $("#new-domain-name").val(""); @@ -69,7 +69,7 @@ session: global.cookieGet("session"), }; - global.post(global.origin + "/api/domain/list", json, function(resp) { + global.post(global.commento_origin + "/api/domain/list", json, function(resp) { if (!resp.success) { global.globalErrorShow(resp.message); return; @@ -111,7 +111,7 @@ domain: domain, }; - global.post(global.origin + "/api/domain/update", json, function(resp) { + global.post(global.commento_origin + "/api/domain/update", json, function(resp) { if (callback !== undefined) callback(resp.success); @@ -130,7 +130,7 @@ domain: domain, }; - global.post(global.origin + "/api/domain/delete", json, function(resp) { + global.post(global.commento_origin + "/api/domain/delete", json, function(resp) { if (!resp.success) { global.globalErrorShow(resp.message); return; diff --git a/frontend/js/dashboard-import.js b/frontend/js/dashboard-import.js index ca37911..c7010ef 100644 --- a/frontend/js/dashboard-import.js +++ b/frontend/js/dashboard-import.js @@ -18,7 +18,7 @@ } global.buttonDisable("#disqus-import-button"); - global.post(global.origin + "/api/import/disqus", json, function(resp) { + global.post(global.commento_origin + "/api/import/disqus", json, function(resp) { global.buttonEnable("#disqus-import-button"); if (!resp.success) { diff --git a/frontend/js/dashboard-installation.js b/frontend/js/dashboard-installation.js index 1effff6..58559f2 100644 --- a/frontend/js/dashboard-installation.js +++ b/frontend/js/dashboard-installation.js @@ -6,7 +6,7 @@ var html = '' + '
\n' + - '