hide historical view from admintools and reject keyboard shortcut if not
availeble
This commit is contained in:
parent
e1801e0ee5
commit
def4777573
|
@ -391,81 +391,83 @@ function Admintools() {
|
||||||
>
|
>
|
||||||
{(submitting) ? '...' : t`Submit`}
|
{(submitting) ? '...' : t`Submit`}
|
||||||
</button>
|
</button>
|
||||||
|
{(window.ssv && window.ssv.backupurl) && (
|
||||||
<br />
|
<div>
|
||||||
<div className="modaldivider" />
|
<br />
|
||||||
<h3 className="modaltitle">{t`Rollback to Date`}</h3>
|
<div className="modaldivider" />
|
||||||
<p className="modalcotext">
|
<h3 className="modaltitle">{t`Rollback to Date`}</h3>
|
||||||
{t`Rollback an area of the canvas to a set date (00:00 UTC)`}
|
<p className="modalcotext">
|
||||||
</p>
|
{t`Rollback an area of the canvas to a set date (00:00 UTC)`}
|
||||||
<input
|
</p>
|
||||||
type="date"
|
<input
|
||||||
value={date}
|
type="date"
|
||||||
requiredPattern="\d{4}-\d{2}-\d{2}"
|
value={date}
|
||||||
min={canvases[selectedCanvas].sd}
|
requiredPattern="\d{4}-\d{2}-\d{2}"
|
||||||
max={maxDate}
|
min={canvases[selectedCanvas].sd}
|
||||||
onChange={(evt) => {
|
max={maxDate}
|
||||||
selectDate(evt.target.value);
|
onChange={(evt) => {
|
||||||
}}
|
selectDate(evt.target.value);
|
||||||
/>
|
}}
|
||||||
<p className="modalcotext">
|
/>
|
||||||
Top-left corner (X_Y):
|
<p className="modalcotext">
|
||||||
<input
|
Top-left corner (X_Y):
|
||||||
value={tlrcoords}
|
<input
|
||||||
style={{
|
value={tlrcoords}
|
||||||
display: 'inline-block',
|
style={{
|
||||||
width: '100%',
|
display: 'inline-block',
|
||||||
maxWidth: '15em',
|
width: '100%',
|
||||||
}}
|
maxWidth: '15em',
|
||||||
type="text"
|
}}
|
||||||
placeholder="X_Y"
|
type="text"
|
||||||
onChange={(evt) => {
|
placeholder="X_Y"
|
||||||
const co = evt.target.value.trim();
|
onChange={(evt) => {
|
||||||
selectTLRCoords(co);
|
const co = evt.target.value.trim();
|
||||||
keptState.tlrcoords = co;
|
selectTLRCoords(co);
|
||||||
}}
|
keptState.tlrcoords = co;
|
||||||
/>
|
}}
|
||||||
</p>
|
/>
|
||||||
<p className="modalcotext">
|
</p>
|
||||||
Bottom-right corner (X_Y):
|
<p className="modalcotext">
|
||||||
<input
|
Bottom-right corner (X_Y):
|
||||||
value={brrcoords}
|
<input
|
||||||
style={{
|
value={brrcoords}
|
||||||
display: 'inline-block',
|
style={{
|
||||||
width: '100%',
|
display: 'inline-block',
|
||||||
maxWidth: '15em',
|
width: '100%',
|
||||||
}}
|
maxWidth: '15em',
|
||||||
type="text"
|
}}
|
||||||
placeholder="X_Y"
|
type="text"
|
||||||
onChange={(evt) => {
|
placeholder="X_Y"
|
||||||
const co = evt.target.value.trim();
|
onChange={(evt) => {
|
||||||
selectBRRCoords(co);
|
const co = evt.target.value.trim();
|
||||||
keptState.brrcoords = co;
|
selectBRRCoords(co);
|
||||||
}}
|
keptState.brrcoords = co;
|
||||||
/>
|
}}
|
||||||
</p>
|
/>
|
||||||
<button
|
</p>
|
||||||
type="button"
|
<button
|
||||||
onClick={() => {
|
type="button"
|
||||||
if (submitting) {
|
onClick={() => {
|
||||||
return;
|
if (submitting) {
|
||||||
}
|
return;
|
||||||
setSubmitting(true);
|
}
|
||||||
submitRollback(
|
setSubmitting(true);
|
||||||
date,
|
submitRollback(
|
||||||
selectedCanvas,
|
date,
|
||||||
tlrcoords,
|
selectedCanvas,
|
||||||
brrcoords,
|
tlrcoords,
|
||||||
(ret) => {
|
brrcoords,
|
||||||
setSubmitting(false);
|
(ret) => {
|
||||||
setResp(ret);
|
setSubmitting(false);
|
||||||
},
|
setResp(ret);
|
||||||
);
|
},
|
||||||
}}
|
);
|
||||||
>
|
}}
|
||||||
{(submitting) ? '...' : t`Submit`}
|
>
|
||||||
</button>
|
{(submitting) ? '...' : t`Submit`}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
{(userlvl === 1) && (
|
{(userlvl === 1) && (
|
||||||
<div>
|
<div>
|
||||||
<br />
|
<br />
|
||||||
|
@ -510,7 +512,6 @@ function Admintools() {
|
||||||
{(submitting) ? '...' : t`Submit`}
|
{(submitting) ? '...' : t`Submit`}
|
||||||
</button>
|
</button>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<div className="modaldivider" />
|
<div className="modaldivider" />
|
||||||
<h3 className="modaltitle">{t`Manage Moderators`}</h3>
|
<h3 className="modaltitle">{t`Manage Moderators`}</h3>
|
||||||
<p className="modalcotext">
|
<p className="modalcotext">
|
||||||
|
|
|
@ -62,7 +62,9 @@ function onKeyPress(event: KeyboardEvent) {
|
||||||
: t`Grid OFF`));
|
: t`Grid OFF`));
|
||||||
return;
|
return;
|
||||||
case 'h':
|
case 'h':
|
||||||
store.dispatch(toggleHistoricalView());
|
if (window.ssv && window.ssv.backupurl) {
|
||||||
|
store.dispatch(toggleHistoricalView());
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
case 'x':
|
case 'x':
|
||||||
store.dispatch(togglePixelNotify());
|
store.dispatch(togglePixelNotify());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user