frontend: use camelCase instead of snake_case
This commit is contained in:
parent
91c2d047d5
commit
ef21599109
@ -49,8 +49,8 @@ func initStaticRouter(router *mux.Router) error {
|
|||||||
|
|
||||||
prefix := ""
|
prefix := ""
|
||||||
if dir == "/js" {
|
if dir == "/js" {
|
||||||
prefix = "window.commento_origin='" + os.Getenv("ORIGIN") + "';\n"
|
prefix = "window.commentoOrigin='" + os.Getenv("ORIGIN") + "';\n"
|
||||||
prefix += "window.commento_cdn='" + os.Getenv("CDN_PREFIX") + "';\n"
|
prefix += "window.commentoCdn='" + os.Getenv("CDN_PREFIX") + "';\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
gzip := (os.Getenv("GZIP_STATIC") == "true")
|
gzip := (os.Getenv("GZIP_STATIC") == "true")
|
||||||
|
@ -50,8 +50,8 @@
|
|||||||
var ID_FOOTER = "commento-footer";
|
var ID_FOOTER = "commento-footer";
|
||||||
|
|
||||||
|
|
||||||
var origin = global.commento_origin;
|
var origin = global.commentoOrigin;
|
||||||
var cdn = global.commento_cdn;
|
var cdn = global.commentoCdn;
|
||||||
var root = null;
|
var root = null;
|
||||||
var cssOverride = undefined;
|
var cssOverride = undefined;
|
||||||
var isAuthenticated = false;
|
var isAuthenticated = false;
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
global.buttonDisable("#add-site-button");
|
global.buttonDisable("#add-site-button");
|
||||||
global.post(global.commento_origin + "/api/domain/new", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/domain/new", json, function(resp) {
|
||||||
global.buttonEnable("#add-site-button");
|
global.buttonEnable("#add-site-button");
|
||||||
|
|
||||||
$("#new-domain-name").val("");
|
$("#new-domain-name").val("");
|
||||||
@ -69,7 +69,7 @@
|
|||||||
session: global.cookieGet("session"),
|
session: global.cookieGet("session"),
|
||||||
};
|
};
|
||||||
|
|
||||||
global.post(global.commento_origin + "/api/domain/list", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/domain/list", json, function(resp) {
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
global.globalErrorShow(resp.message);
|
global.globalErrorShow(resp.message);
|
||||||
return;
|
return;
|
||||||
@ -111,7 +111,7 @@
|
|||||||
domain: domain,
|
domain: domain,
|
||||||
};
|
};
|
||||||
|
|
||||||
global.post(global.commento_origin + "/api/domain/update", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/domain/update", json, function(resp) {
|
||||||
if (callback !== undefined)
|
if (callback !== undefined)
|
||||||
callback(resp.success);
|
callback(resp.success);
|
||||||
|
|
||||||
@ -130,7 +130,7 @@
|
|||||||
domain: domain,
|
domain: domain,
|
||||||
};
|
};
|
||||||
|
|
||||||
global.post(global.commento_origin + "/api/domain/delete", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/domain/delete", json, function(resp) {
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
global.globalErrorShow(resp.message);
|
global.globalErrorShow(resp.message);
|
||||||
return;
|
return;
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
global.buttonDisable("#disqus-import-button");
|
global.buttonDisable("#disqus-import-button");
|
||||||
global.post(global.commento_origin + "/api/domain/import/disqus", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/domain/import/disqus", json, function(resp) {
|
||||||
global.buttonEnable("#disqus-import-button");
|
global.buttonEnable("#disqus-import-button");
|
||||||
|
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
var html = '' +
|
var html = '' +
|
||||||
'<div id="commento"></div>\n' +
|
'<div id="commento"></div>\n' +
|
||||||
'<script src="' + window.commento_cdn + '/js/commento.js"><\/script>\n' +
|
'<script src="' + window.commentoCdn + '/js/commento.js"><\/script>\n' +
|
||||||
'';
|
'';
|
||||||
|
|
||||||
$("#code-div").text(html);
|
$("#code-div").text(html);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
if (idx == -1) {
|
if (idx == -1) {
|
||||||
data.domains[data.cd].moderators.push({"email": email, "timeAgo": "just now"});
|
data.domains[data.cd].moderators.push({"email": email, "timeAgo": "just now"});
|
||||||
global.buttonDisable("#new-mod-button");
|
global.buttonDisable("#new-mod-button");
|
||||||
global.post(global.commento_origin + "/api/domain/moderator/new", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/domain/moderator/new", json, function(resp) {
|
||||||
global.buttonEnable("#new-mod-button");
|
global.buttonEnable("#new-mod-button");
|
||||||
|
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
@ -68,7 +68,7 @@
|
|||||||
|
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
data.domains[data.cd].moderators.splice(idx, 1);
|
data.domains[data.cd].moderators.splice(idx, 1);
|
||||||
global.post(global.commento_origin + "/api/domain/moderator/delete", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/domain/moderator/delete", json, function(resp) {
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
global.globalErrorShow(resp.message);
|
global.globalErrorShow(resp.message);
|
||||||
return
|
return
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(".view").hide();
|
$(".view").hide();
|
||||||
post(global.commento_origin + "/api/domain/statistics", json, function(resp) {
|
post(global.commentoOrigin + "/api/domain/statistics", json, function(resp) {
|
||||||
$("#statistics-view").show();
|
$("#statistics-view").show();
|
||||||
|
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
global.buttonDisable("#reset-button");
|
global.buttonDisable("#reset-button");
|
||||||
global.post(global.commento_origin + "/api/owner/send-reset-hex", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/owner/send-reset-hex", json, function(resp) {
|
||||||
global.buttonEnable("#reset-button");
|
global.buttonEnable("#reset-button");
|
||||||
|
|
||||||
global.textSet("#err", "");
|
global.textSet("#err", "");
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
global.buttonDisable("#login-button");
|
global.buttonDisable("#login-button");
|
||||||
global.post(global.commento_origin + "/api/owner/login", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/owner/login", json, function(resp) {
|
||||||
global.buttonEnable("#login-button");
|
global.buttonEnable("#login-button");
|
||||||
|
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
global.buttonDisable("#reset-button");
|
global.buttonDisable("#reset-button");
|
||||||
global.post(global.commento_origin + "/api/owner/reset-password", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/owner/reset-password", json, function(resp) {
|
||||||
global.buttonEnable("#reset-button");
|
global.buttonEnable("#reset-button");
|
||||||
|
|
||||||
global.textSet("#err", "");
|
global.textSet("#err", "");
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"session": global.cookieGet("session"),
|
"session": global.cookieGet("session"),
|
||||||
};
|
};
|
||||||
|
|
||||||
global.post(global.commento_origin + "/api/owner/self", json, function(resp) {
|
global.post(global.commentoOrigin + "/api/owner/self", json, function(resp) {
|
||||||
if (!resp.success || !resp.loggedIn) {
|
if (!resp.success || !resp.loggedIn) {
|
||||||
document.location = "/login";
|
document.location = "/login";
|
||||||
return;
|
return;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
global.buttonDisable("#signup-button");
|
global.buttonDisable("#signup-button");
|
||||||
post(global.commento_origin + "/api/owner/new", json, function(resp) {
|
post(global.commentoOrigin + "/api/owner/new", json, function(resp) {
|
||||||
global.buttonEnable("#signup-button")
|
global.buttonEnable("#signup-button")
|
||||||
|
|
||||||
if (!resp.success) {
|
if (!resp.success) {
|
||||||
|
Loading…
Reference in New Issue
Block a user