From 06c71f4e65a98167d02d0405d287a0efc0496999 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Thu, 20 Dec 2018 00:48:43 -0500 Subject: [PATCH] frontend: use commento namespace, event handlers, UI --- api/router_static.go | 4 +- frontend/dashboard.html | 36 +++---- frontend/forgot.html | 2 +- frontend/js/auth-common.js | 4 +- frontend/js/commento.js | 143 ++++++++++++++------------ frontend/js/dashboard-danger.js | 10 +- frontend/js/dashboard-domain.js | 14 +-- frontend/js/dashboard-general.js | 2 +- frontend/js/dashboard-import.js | 7 +- frontend/js/dashboard-installation.js | 2 +- frontend/js/dashboard-moderation.js | 8 +- frontend/js/dashboard-setting.js | 2 +- frontend/js/dashboard-statistics.js | 12 +-- frontend/js/dashboard.js | 14 +-- frontend/js/errors.js | 2 +- frontend/js/forgot.js | 4 +- frontend/js/http.js | 2 +- frontend/js/login.js | 10 +- frontend/js/logout.js | 4 +- frontend/js/reset.js | 6 +- frontend/js/self.js | 8 +- frontend/js/signup.js | 10 +- frontend/js/utils.js | 4 +- frontend/login.html | 8 +- frontend/logout.html | 2 +- frontend/reset-password.html | 2 +- frontend/sass/commento-input.scss | 15 --- frontend/sass/commento.scss | 37 ++++--- frontend/signup.html | 6 +- 29 files changed, 193 insertions(+), 187 deletions(-) diff --git a/api/router_static.go b/api/router_static.go index bcc6a99..ac7af10 100644 --- a/api/router_static.go +++ b/api/router_static.go @@ -53,8 +53,8 @@ func staticRouterInit(router *mux.Router) error { prefix := "" if dir == "/js" { - prefix = "window.commentoOrigin='" + os.Getenv("ORIGIN") + "';\n" - prefix += "window.commentoCdn='" + os.Getenv("CDN_PREFIX") + "';\n" + prefix = `window.commento = {origin: "` + os.Getenv("ORIGIN") + `", cdn: "` + os.Getenv("CDN_PREFIX") + `"}; +` } gzip := (os.Getenv("GZIP_STATIC") == "true") diff --git a/frontend/dashboard.html b/frontend/dashboard.html index b402c09..96da26a 100644 --- a/frontend/dashboard.html +++ b/frontend/dashboard.html @@ -21,10 +21,10 @@ @@ -41,7 +41,7 @@
- + Trouble logging in? Reset your password. Don't have an account yet? Sign up. diff --git a/frontend/logout.html b/frontend/logout.html index bb8bea3..b51e306 100644 --- a/frontend/logout.html +++ b/frontend/logout.html @@ -5,6 +5,6 @@ diff --git a/frontend/reset-password.html b/frontend/reset-password.html index 27e821b..e1e6aba 100644 --- a/frontend/reset-password.html +++ b/frontend/reset-password.html @@ -32,7 +32,7 @@
- + diff --git a/frontend/sass/commento-input.scss b/frontend/sass/commento-input.scss index 4fde262..454e020 100644 --- a/frontend/sass/commento-input.scss +++ b/frontend/sass/commento-input.scss @@ -188,18 +188,3 @@ textarea { .commento-button-margin { padding-bottom: 60px; } - -.commento-mod-tools-lock-button { - color: $gray-6; - background: none; - border: none; - font-weight: bold; - font-size: 12px; - text-transform: uppercase; - margin-left: 12px; - padding: 2px; -} - -.commento-mod-tools-lock-button:hover { - cursor: pointer; -} diff --git a/frontend/sass/commento.scss b/frontend/sass/commento.scss index ef40905..6e50321 100644 --- a/frontend/sass/commento.scss +++ b/frontend/sass/commento.scss @@ -5,13 +5,16 @@ } .commento-root { - font-family: "Source Sans Pro", "Segoe UI", Roboto, "Helvetica Neue", sans-serif; - font-size: 15px; - line-height: 1.5; - color: #50596c; overflow-x: hidden; - text-rendering: optimizeLegibility; - padding: 8px; + padding: 0px; + + * { + font-family: "Source Sans Pro", "Segoe UI", "Roboto", "Helvetica Neue", sans-serif; + font-size: 15px; + line-height: 1.5; + color: #50596c; + text-rendering: optimizeLegibility; + } @import "colors-main.scss"; @import "common-main.scss"; @@ -46,13 +49,24 @@ .commento-mod-tools { margin-bottom: 16px; + + button { + text-transform: uppercase; + color: $gray-7; + font-size: 13px; + font-weight: 700; + cursor: pointer; + margin-left: 12px; + background: none; + border: none; + } } .commento-mod-tools::before { - content: "Moderators"; + content: "Moderator Tools"; text-transform: uppercase; color: $indigo-8; - font-size: 12px; + font-size: 13px; font-weight: 700; } @@ -71,8 +85,8 @@ } .commento-avatar { - width: 34px; - height: 34px; + width: 38px; + height: 38px; border-radius: 50%; display: flex; justify-content: center; @@ -81,8 +95,7 @@ font-size: 22px; float: left; margin-right: 10px; - border: 1px solid #fff; - box-shadow: 0px 0px 0px 2px #f00; + border: 0px transparent; } .commento-avatar-img { diff --git a/frontend/signup.html b/frontend/signup.html index e881e4a..f869bee 100644 --- a/frontend/signup.html +++ b/frontend/signup.html @@ -16,8 +16,8 @@ @@ -54,7 +54,7 @@

- + Already have an account? Login instead.