1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-30 11:06:37 -04:00

frontend: use gulp, eslint, code refactor

Apologies in advance for the insanely huge commit. This commit is
primarily based on Anton Linevych's amazing work found here [1]. While
he had gone through the pains of making small, atomic changes to each
file, I had put off reviewing the PR for a long time. By the time I
finally got around to it, the project had changed so much that it didn't
make sense to keep the commits the same way. So I've cherry-picked most
of his commits, with some changes here and there, and I've squashed them
into one commit.

[1] https://gitlab.com/linevych/commento-ce/tree/feature/frontend_building_improvements
This commit is contained in:
Anton Linevych
2018-06-24 04:01:21 +02:00
committed by Adhityaa Chandrasekar
parent e4f71fe402
commit 9e3935b3b2
30 changed files with 5059 additions and 395 deletions

View File

@ -1,13 +1,15 @@
(function (global, document) {
"use strict";
(document);
// Shows messages produced from email confirmation attempts.
function displayConfirmedEmail() {
var confirmed = global.paramGet("confirmed");
if (confirmed == "true") {
if (confirmed === "true") {
$("#msg").html("Successfully confirmed! Login to continue.")
}
else if (confirmed == "false") {
} else if (confirmed === "false") {
$("#err").html("That link has expired.")
}
}
@ -17,7 +19,7 @@
function displayChangedPassword() {
var changed = global.paramGet("changed");
if (changed == "true") {
if (changed === "true") {
$("#msg").html("Password changed successfully! Login to continue.")
}
}
@ -26,7 +28,7 @@
function displaySignedUp() {
var signedUp = global.paramGet("signedUp");
if (signedUp == "true") {
if (signedUp === "true") {
$("#msg").html("Registration successful! Login to continue.")
}
}
@ -42,11 +44,11 @@
// Logs the user in and redirects to the dashboard.
global.login = function() {
var all_ok = global.unfilledMark(["#email", "#password"], function(el) {
var allOk = global.unfilledMark(["#email", "#password"], function(el) {
el.css("border-bottom", "1px solid red");
});
if (!all_ok) {
if (!allOk) {
global.textSet("#err", "Please make sure all fields are filled");
return;
}