From cc9b7f193a68f1aa6073a4e807d56e40a57adade Mon Sep 17 00:00:00 2001 From: robdy Date: Thu, 28 Jun 2018 23:39:51 +0200 Subject: [PATCH 1/5] added banlist hover backend --- assets/banCtrl.js | 12 +++++++++++- assets/views/home/banuser.ejs | 22 +++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/assets/banCtrl.js b/assets/banCtrl.js index fce48d60..affe1401 100644 --- a/assets/banCtrl.js +++ b/assets/banCtrl.js @@ -10,6 +10,7 @@ module.exports = function ($scope, io) { banMessage: ($scope.query.banMessage || '') + messageAddition, banlistEntry: $scope.query.banlistEntry || '', tradeNote: $scope.query.tradeNote || '', + tradeNoteDescription: $scope.query.tradeNoteDescription || '', duration: $scope.query.duration || '', knownAlt: $scope.query.knownAlt || '', additionalFCs: $scope.query.additionalFCs || '' @@ -18,6 +19,7 @@ module.exports = function ($scope, io) { $scope.banError = ""; $scope.indexOk = {}; $scope.indexSpin = {}; + $scope.tradeNoteFull = ""; $scope.focus = { gavegot: false @@ -81,12 +83,20 @@ module.exports = function ($scope, io) { } FCs = $scope.banInfo.additionalFCs.match(/(\d{4}-){2}\d{4}/g); } + + if ($scope.banInfo.tradeNote == "Some" && $scope.banInfo.tradeNoteDescription) { + $scope.tradeNoteFull = "[" + $scope.banInfo.tradeNoteDescription + "](#b " + $scope.banInfo.tradeNote + " (hover)" ; + } + else { + $scope.tradeNoteFull = $scope.banInfo.tradeNote; + } + var post = { "username": $scope.banInfo.username, "banNote": $scope.banInfo.banNote, "banMessage": $scope.banInfo.banMessage, "banlistEntry": $scope.banInfo.banlistEntry, - "tradeNote": $scope.banInfo.tradeNote, + "tradeNote": $scope.tradeNoteFull, "duration": parseInt($scope.banInfo.duration), "knownAlt": $scope.banInfo.knownAlt, "additionalFCs": FCs diff --git a/assets/views/home/banuser.ejs b/assets/views/home/banuser.ejs index 9627b4a9..183d6269 100644 --- a/assets/views/home/banuser.ejs +++ b/assets/views/home/banuser.ejs @@ -27,9 +27,29 @@ - + + + + + + + + + + + From 50db4dce5c64f74e33cd157d7cef4dfe0be08710 Mon Sep 17 00:00:00 2001 From: robdy Date: Wed, 4 Jul 2018 22:22:23 +0200 Subject: [PATCH 2/5] fixed styling --- assets/banCtrl.js | 2 +- assets/views/home/banuser.ejs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/banCtrl.js b/assets/banCtrl.js index affe1401..b8f1648f 100644 --- a/assets/banCtrl.js +++ b/assets/banCtrl.js @@ -85,7 +85,7 @@ module.exports = function ($scope, io) { } if ($scope.banInfo.tradeNote == "Some" && $scope.banInfo.tradeNoteDescription) { - $scope.tradeNoteFull = "[" + $scope.banInfo.tradeNoteDescription + "](#b " + $scope.banInfo.tradeNote + " (hover)" ; + $scope.tradeNoteFull = "[" + $scope.banInfo.tradeNoteDescription + "](#b \"" + $scope.banInfo.tradeNote + " (hover)\")" ; } else { $scope.tradeNoteFull = $scope.banInfo.tradeNote; diff --git a/assets/views/home/banuser.ejs b/assets/views/home/banuser.ejs index 183d6269..5593cb53 100644 --- a/assets/views/home/banuser.ejs +++ b/assets/views/home/banuser.ejs @@ -27,18 +27,18 @@ - - + From aca6249dd04d9f0e445482bfb49acb265f70391a Mon Sep 17 00:00:00 2001 From: robdy Date: Sat, 7 Jul 2018 21:07:13 +0200 Subject: [PATCH 4/5] show hover only for some --- assets/views/home/banuser.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/views/home/banuser.ejs b/assets/views/home/banuser.ejs index 5b17fa43..802c0fb1 100644 --- a/assets/views/home/banuser.ejs +++ b/assets/views/home/banuser.ejs @@ -44,7 +44,7 @@ - From 35454239ca73b601fa995f1a157f2f4cbb76541f Mon Sep 17 00:00:00 2001 From: robdy Date: Sat, 7 Jul 2018 22:36:08 +0200 Subject: [PATCH 5/5] add checking if hover is empty --- assets/banCtrl.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/banCtrl.js b/assets/banCtrl.js index b8f1648f..fb68eda0 100644 --- a/assets/banCtrl.js +++ b/assets/banCtrl.js @@ -36,6 +36,12 @@ module.exports = function ($scope, io) { return; } + if ($scope.banInfo.tradeNote == "Some" && !$scope.banInfo.tradeNoteDescription) { + $scope.banError = "Please specify details for hover."; + $scope.indexSpin.ban = false; + return; + } + var names = ['username', 'knownAlt']; for (let i = 0; i < names.length; i++) {