forked from rDrama/rDrama
fix undisabling elements
parent
1f0ebdad0b
commit
0c6866ed84
|
@ -81,11 +81,11 @@ for (const element of change_submit) {
|
||||||
element.onchange = () => {element.form.submit()};
|
element.onchange = () => {element.form.submit()};
|
||||||
}
|
}
|
||||||
|
|
||||||
const undisableelement = document.querySelectorAll('[undisableelement]');
|
const undisable_element = document.querySelectorAll('[data-undisable_element]');
|
||||||
for (const element of undisableelement) {
|
for (const element of undisable_element) {
|
||||||
if (element.dataset.nonce != nonce) continue
|
if (element.dataset.nonce != nonce) continue
|
||||||
element.oninput = () => {
|
element.oninput = () => {
|
||||||
document.getElementById(element.dataset.undisableelement).disabled = false;
|
document.getElementById(element.dataset.undisable_element).disabled = false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<form action="/admin/ban_domain" method="post">
|
<form action="/admin/ban_domain" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v|formkey}}">
|
<input type="hidden" name="formkey" value="{{v|formkey}}">
|
||||||
<input autocomplete="off" name="domain" placeholder="Enter domain here.." class="form-control" required>
|
<input autocomplete="off" name="domain" placeholder="Enter domain here.." class="form-control" required>
|
||||||
<input autocomplete="off" name="reason" placeholder="Enter ban reason here.." data-nonce="{{g.nonce}}" data-undisableelement="ban-submit" class="form-control mt-2">
|
<input autocomplete="off" name="reason" placeholder="Enter ban reason here.." data-nonce="{{g.nonce}}" data-undisable_element="ban-submit" class="form-control mt-2">
|
||||||
<input autocomplete="off" id="ban-submit" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" class="btn btn-primary mt-2" value="Ban domain" disabled>
|
<input autocomplete="off" id="ban-submit" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" class="btn btn-primary mt-2" value="Ban domain" disabled>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -213,7 +213,7 @@
|
||||||
<input autocomplete="off" type="text" class="form-control mb-2" id="2fa_input" name="2fa_token" placeholder="# # # # # #" required>
|
<input autocomplete="off" type="text" class="form-control mb-2" id="2fa_input" name="2fa_token" placeholder="# # # # # #" required>
|
||||||
|
|
||||||
<label for="2fa_input_password">Password</label>
|
<label for="2fa_input_password">Password</label>
|
||||||
<input autocomplete="off" type="password" class="form-control mb-2" id="2fa_input_password" name="password" data-nonce="{{g.nonce}}" data-undisablelement="toggle2faButton" required>
|
<input autocomplete="off" type="password" class="form-control mb-2" id="2fa_input_password" name="password" data-nonce="{{g.nonce}}" data-undisable_element="toggle2faButton" required>
|
||||||
{% set action = "Enable" %}
|
{% set action = "Enable" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert alert-warning" role="alert">
|
<div class="alert alert-warning" role="alert">
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
<input autocomplete="off" type="password" class="form-control mb-2" id="2fa_input_password" name="password" required>
|
<input autocomplete="off" type="password" class="form-control mb-2" id="2fa_input_password" name="password" required>
|
||||||
|
|
||||||
<label for="2fa_input">6-digit code</label>
|
<label for="2fa_input">6-digit code</label>
|
||||||
<input autocomplete="off" type="text" class="form-control mb-2" id="2fa_input" name="2fa_remove" placeholder="# # # # # #" data-nonce="{{g.nonce}}" data-undisablelement="toggle2faButton" required>
|
<input autocomplete="off" type="text" class="form-control mb-2" id="2fa_input" name="2fa_remove" placeholder="# # # # # #" data-nonce="{{g.nonce}}" data-undisable_element="toggle2faButton" required>
|
||||||
{% set action = "Disable" %}
|
{% set action = "Disable" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
<form id="ban-{{deviceType}}" class="my-3 {% if u.is_suspended %}d-none{% endif %}" action="/ban_user/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this)">
|
<form id="ban-{{deviceType}}" class="my-3 {% if u.is_suspended %}d-none{% endif %}" action="/ban_user/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this)">
|
||||||
<input type="hidden" name="formkey" value="{{v|formkey}}">
|
<input type="hidden" name="formkey" value="{{v|formkey}}">
|
||||||
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Ban Reason" data-nonce="{{g.nonce}}" data-undisablelement="user-ban-submit-{{deviceType}}" required>
|
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Ban Reason" data-nonce="{{g.nonce}}" data-undisable_element="user-ban-submit-{{deviceType}}" required>
|
||||||
<input autocomplete="off" style="font-size:11px" type="number" step="any" class="form-control" name="days" placeholder="Days (blank = permanent)">
|
<input autocomplete="off" style="font-size:11px" type="number" step="any" class="form-control" name="days" placeholder="Days (blank = permanent)">
|
||||||
<div class="custom-control custom-checkbox mb-1">
|
<div class="custom-control custom-checkbox mb-1">
|
||||||
<input autocomplete="off" type="checkbox" id="alts-2-{{deviceType}}" class="custom-control-input" name="alts" value="1">
|
<input autocomplete="off" type="checkbox" id="alts-2-{{deviceType}}" class="custom-control-input" name="alts" value="1">
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
|
|
||||||
<form id="shadowban-{{deviceType}}" class="my-3 {% if u.shadowbanned %}d-none{% endif %}" action="/shadowban/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this)">
|
<form id="shadowban-{{deviceType}}" class="my-3 {% if u.shadowbanned %}d-none{% endif %}" action="/shadowban/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this)">
|
||||||
<input type="hidden" name="formkey" value="{{v|formkey}}">
|
<input type="hidden" name="formkey" value="{{v|formkey}}">
|
||||||
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Shadowban Reason" data-nonce="{{g.nonce}}" data-undisablelement="user-shadowban-submit-{{deviceType}}" required>
|
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Shadowban Reason" data-nonce="{{g.nonce}}" data-undisable_element="user-shadowban-submit-{{deviceType}}" required>
|
||||||
<input autocomplete="off" id="user-shadowban-submit-{{deviceType}}" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" class="btn btn-danger" value="Shadowban user" disabled>
|
<input autocomplete="off" id="user-shadowban-submit-{{deviceType}}" type="submit" data-nonce="{{g.nonce}}" data-onclick="disable(this)" class="btn btn-danger" value="Shadowban user" disabled>
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue