From 2b75e2b7f5035abfb8da8ac10141329815fc8ce0 Mon Sep 17 00:00:00 2001 From: DCoded <dcoded@live.com> Date: Mon, 7 Sep 2020 16:17:45 -0400 Subject: [PATCH] Added rename() --- src/facilities/pit/pit.css | 3 ++- src/facilities/pit/pit.js | 23 +++++++++++++++++++++++ src/facilities/pit/pit.tw | 2 ++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/facilities/pit/pit.css b/src/facilities/pit/pit.css index d82c5fac1cd..4458c224ec8 100644 --- a/src/facilities/pit/pit.css +++ b/src/facilities/pit/pit.css @@ -2,6 +2,7 @@ margin-bottom: 1em; } -.pit-assign { +.pit-assign, +.pit-rename { margin-top: 1em; } diff --git a/src/facilities/pit/pit.js b/src/facilities/pit/pit.js index 62b74220771..4e634e3b3ee 100644 --- a/src/facilities/pit/pit.js +++ b/src/facilities/pit/pit.js @@ -42,6 +42,8 @@ App.Facilities.Pit.pit = function() { App.UI.DOM.appendNewElement("div", frag, scheduled()); } + App.UI.DOM.appendNewElement("div", frag, rename(), "pit-rename"); + App.UI.SlaveList.ScrollPosition.restore(); return frag; @@ -354,4 +356,25 @@ App.Facilities.Pit.pit = function() { return frag; } + + function rename() { + const + frag = new DocumentFragment(), + + renameDiv = App.UI.DOM.makeElement("div", '', "pit-rename"), + renameNote = App.UI.DOM.makeElement("span", '', "note"); + + renameDiv.append(`Rename ${V.pitName}: `); + renameNote.append(` Use a noun or similar short phrase`); + + renameDiv.append(App.UI.DOM.makeTextBox(V.pitName, newName => { + V.pitName = newName; + })); + + renameDiv.append(renameNote); + + frag.append(renameDiv); + + return frag; + } }; diff --git a/src/facilities/pit/pit.tw b/src/facilities/pit/pit.tw index 76b7a460958..118df77c8e1 100644 --- a/src/facilities/pit/pit.tw +++ b/src/facilities/pit/pit.tw @@ -341,4 +341,6 @@ $pitNameCaps is clean and ready, <<includeDOM App.UI.SlaveList.listSJFacilitySlaves(App.Entity.facilities.pit, passage(), false, {assign: "Select a slave to fight", remove: "Cancel a slave's fight"})>> */ +/* <br><br>Rename $pitName: <<textbox "$pitName" $pitName "Pit">> //Use a noun or similar short phrase// +*/ -- GitLab