projects
/
vchess.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
504f9ff
)
Cosmetics, mostly, and a few small bugs fixes
author
Benjamin Auder
<benjamin.auder@somewhere>
Thu, 7 May 2020 17:57:34 +0000
(19:57 +0200)
committer
Benjamin Auder
<benjamin.auder@somewhere>
Thu, 7 May 2020 17:57:34 +0000
(19:57 +0200)
client/src/App.vue
patch
|
blob
|
blame
|
history
client/src/components/UpsertUser.vue
patch
|
blob
|
blame
|
history
client/src/data/challengeCheck.js
patch
|
blob
|
blame
|
history
client/src/router.js
patch
|
blob
|
blame
|
history
client/src/views/MyGames.vue
patch
|
blob
|
blame
|
history
server/models/Problem.js
patch
|
blob
|
blame
|
history
server/package.json
patch
|
blob
|
blame
|
history
server/routes/all.js
patch
|
blob
|
blame
|
history
diff --git
a/client/src/App.vue
b/client/src/App.vue
index
4b34488
..
5556ae3
100644
(file)
--- a/
client/src/App.vue
+++ b/
client/src/App.vue
@@
-142,7
+142,7
@@
input[type="checkbox"]:focus
outline: 0
input[type=checkbox]:checked:before
outline: 0
input[type=checkbox]:checked:before
- top: -5px
;
+ top: -5px
height: 18px
table
height: 18px
table
diff --git
a/client/src/components/UpsertUser.vue
b/client/src/components/UpsertUser.vue
index
6fc6774
..
24e3c41
100644
(file)
--- a/
client/src/components/UpsertUser.vue
+++ b/
client/src/components/UpsertUser.vue
@@
-163,7
+163,8
@@
export default {
if (this.stage == "Login") {
const type = this.nameOrEmail.indexOf("@") >= 0 ? "email" : "name";
error = checkNameEmail({ [type]: this.nameOrEmail });
if (this.stage == "Login") {
const type = this.nameOrEmail.indexOf("@") >= 0 ? "email" : "name";
error = checkNameEmail({ [type]: this.nameOrEmail });
- } else error = checkNameEmail(this.user);
+ }
+ else error = checkNameEmail(this.user);
if (error) {
alert(this.st.tr[error]);
return;
if (error) {
alert(this.st.tr[error]);
return;
diff --git
a/client/src/data/challengeCheck.js
b/client/src/data/challengeCheck.js
index
a535b88
..
fbfb445
100644
(file)
--- a/
client/src/data/challengeCheck.js
+++ b/
client/src/data/challengeCheck.js
@@
-16,7
+16,8
@@
export function checkChallenge(c) {
// Allow custom FEN (and check it) only for individual challenges
if (c.fen.length > 0 && !!c.to) {
if (!V.IsGoodFen(c.fen)) return "Errors in FEN";
// Allow custom FEN (and check it) only for individual challenges
if (c.fen.length > 0 && !!c.to) {
if (!V.IsGoodFen(c.fen)) return "Errors in FEN";
- } else c.fen = "";
+ }
+ else c.fen = "";
return "";
}
return "";
}
diff --git
a/client/src/router.js
b/client/src/router.js
index
c51c886
..
04c8f06
100644
(file)
--- a/
client/src/router.js
+++ b/
client/src/router.js
@@
-1,6
+1,5
@@
import Vue from "vue";
import Router from "vue-router";
import Vue from "vue";
import Router from "vue-router";
-import Hall from "./views/Hall.vue";
Vue.use(Router);
Vue.use(Router);
@@
-14,7
+13,7
@@
const router = new Router({
{
path: "/",
name: "hall",
{
path: "/",
name: "hall",
- component:
Hall
+ component:
loadView("Hall")
},
{
path: "/variants",
},
{
path: "/variants",
diff --git
a/client/src/views/MyGames.vue
b/client/src/views/MyGames.vue
index
a29e0e9
..
1363204
100644
(file)
--- a/
client/src/views/MyGames.vue
+++ b/
client/src/views/MyGames.vue
@@
-112,7
+112,7
@@
export default {
},
mounted: function() {
const adjustAndSetDisplay = () => {
},
mounted: function() {
const adjustAndSetDisplay = () => {
- // showType is the last type viwed by the user (default)
+ // showType is the last type vi
e
wed by the user (default)
let showType = localStorage.getItem("type-myGames") || "live";
// Live games, my turn: highest priority:
if (this.liveGames.some(g => !!g.myTurn)) showType = "live";
let showType = localStorage.getItem("type-myGames") || "live";
// Live games, my turn: highest priority:
if (this.liveGames.some(g => !!g.myTurn)) showType = "live";
@@
-183,7
+183,7
@@
export default {
setDisplay: function(type, e) {
this.display = type;
localStorage.setItem("type-myGames", type);
setDisplay: function(type, e) {
this.display = type;
localStorage.setItem("type-myGames", type);
- let elt =
e ? e.target : document.getElementById(type + "Games"
);
+ let elt =
(!!e ? e.target : document.getElementById(type + "Games")
);
elt.classList.add("active");
elt.classList.remove("somethingnew"); //in case of
for (let t of ["live","corr","import"]) {
elt.classList.add("active");
elt.classList.remove("somethingnew"); //in case of
for (let t of ["live","corr","import"]) {
@@
-252,7
+252,8
@@
export default {
if (thing == "turn") {
game.myTurn = !game.myTurn;
if (game.myTurn) this.tryShowNewsIndicator(type);
if (thing == "turn") {
game.myTurn = !game.myTurn;
if (game.myTurn) this.tryShowNewsIndicator(type);
- } else game.myTurn = false;
+ }
+ else game.myTurn = false;
// TODO: forcing refresh like that is ugly and wrong.
// How to do it cleanly?
this.$refs[type + "games"].$forceUpdate();
// TODO: forcing refresh like that is ugly and wrong.
// How to do it cleanly?
this.$refs[type + "games"].$forceUpdate();
@@
-357,7
+358,8
@@
export default {
moreGames.forEach(g => g.type = "corr");
this.decorate(moreGames);
this.corrGames = this.corrGames.concat(moreGames);
moreGames.forEach(g => g.type = "corr");
this.decorate(moreGames);
this.corrGames = this.corrGames.concat(moreGames);
- } else this.hasMore["corr"] = false;
+ }
+ else this.hasMore["corr"] = false;
if (!!cb) cb();
}
}
if (!!cb) cb();
}
}
@@
-372,7
+374,8
@@
export default {
localGames.forEach(g => g.type = "live");
this.decorate(localGames);
this.liveGames = this.liveGames.concat(localGames);
localGames.forEach(g => g.type = "live");
this.decorate(localGames);
this.liveGames = this.liveGames.concat(localGames);
- } else this.hasMore["live"] = false;
+ }
+ else this.hasMore["live"] = false;
if (!!cb) cb();
});
}
if (!!cb) cb();
});
}
@@
-384,7
+387,8
@@
export default {
this.cursor["import"] = importGames[L - 1].created - 1;
importGames.forEach(g => g.type = "import");
this.importGames = this.importGames.concat(importGames);
this.cursor["import"] = importGames[L - 1].created - 1;
importGames.forEach(g => g.type = "import");
this.importGames = this.importGames.concat(importGames);
- } else this.hasMore["import"] = false;
+ }
+ else this.hasMore["import"] = false;
if (!!cb) cb();
});
}
if (!!cb) cb();
});
}
diff --git
a/server/models/Problem.js
b/server/models/Problem.js
index
9978d76
..
eef4270
100644
(file)
--- a/
server/models/Problem.js
+++ b/
server/models/Problem.js
@@
-81,7
+81,7
@@
const ProblemModel = {
safeRemove: function(id, uid, devs) {
db.serialize(function() {
safeRemove: function(id, uid, devs) {
db.serialize(function() {
- let whereClause = "WHERE id = " +
prob.
id;
+ let whereClause = "WHERE id = " + id;
if (!devs.includes(uid)) whereClause += " AND uid = " + uid;
const query =
"DELETE FROM Problems " +
if (!devs.includes(uid)) whereClause += " AND uid = " + uid;
const query =
"DELETE FROM Problems " +
diff --git
a/server/package.json
b/server/package.json
index
faadbd6
..
a8c9e44
100644
(file)
--- a/
server/package.json
+++ b/
server/package.json
@@
-13,8
+13,6
@@
"morgan": "~1.9.1",
"node-cron": "^2.0.3",
"nodemailer": "^5.1.1",
"morgan": "~1.9.1",
"node-cron": "^2.0.3",
"nodemailer": "^5.1.1",
- "pug": "^2.0.4",
- "sanitize-html": "^1.23.0",
"serve-favicon": "~2.5.0",
"sqlite3": "^4.2.0",
"ws": "^6.2.1"
"serve-favicon": "~2.5.0",
"sqlite3": "^4.2.0",
"ws": "^6.2.1"
diff --git
a/server/routes/all.js
b/server/routes/all.js
index
979b0d9
..
b7dcc1a
100644
(file)
--- a/
server/routes/all.js
+++ b/
server/routes/all.js
@@
-1,5
+1,4
@@
let router = require("express").Router();
let router = require("express").Router();
-const access = require("../utils/access");
router.use("/", require("./challenges"));
router.use("/", require("./games"));
router.use("/", require("./challenges"));
router.use("/", require("./games"));