forked from I2P_Developers/i2p.i2p
i2psnark:
- Set-all priority buttons (ticket #1376) - Move icons to resources dir, add js dir - Todo: more CSS
This commit is contained in:
93
apps/i2psnark/resources/js/folder.js
Normal file
93
apps/i2psnark/resources/js/folder.js
Normal file
@ -0,0 +1,93 @@
|
||||
function setupbuttons() {
|
||||
updatesetallbuttons();
|
||||
var form = document.forms[0];
|
||||
form.savepri.disabled = true;
|
||||
form.savepri.className = 'foo';
|
||||
}
|
||||
|
||||
function priorityclicked() {
|
||||
updatesetallbuttons();
|
||||
var form = document.forms[0];
|
||||
form.savepri.disabled = false;
|
||||
form.savepri.className = 'accept';
|
||||
}
|
||||
|
||||
function updatesetallbuttons() {
|
||||
var notNorm = false;
|
||||
var notHigh = false;
|
||||
var notSkip = false;
|
||||
var form = document.forms[0];
|
||||
for(i = 0; i < form.elements.length; i++) {
|
||||
var elem = form.elements[i];
|
||||
if (elem.type == 'radio') {
|
||||
if (!elem.checked) {
|
||||
if (elem.className == 'prinorm')
|
||||
notNorm = true;
|
||||
else if (elem.className == 'prihigh')
|
||||
notHigh = true;
|
||||
else
|
||||
notSkip = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (notNorm)
|
||||
document.getElementById('setallnorm').className = 'control';
|
||||
else
|
||||
document.getElementById('setallnorm').className = 'controld';
|
||||
if (notHigh)
|
||||
document.getElementById('setallhigh').className = 'control';
|
||||
else
|
||||
document.getElementById('setallhigh').className = 'controld';
|
||||
if (notSkip)
|
||||
document.getElementById('setallskip').className = 'control';
|
||||
else
|
||||
document.getElementById('setallskip').className = 'controld';
|
||||
}
|
||||
|
||||
function setallnorm() {
|
||||
var form = document.forms[0];
|
||||
for(i = 0; i < form.elements.length; i++) {
|
||||
var elem = form.elements[i];
|
||||
if (elem.type == 'radio') {
|
||||
if (elem.className === 'prinorm')
|
||||
elem.checked = true;
|
||||
}
|
||||
}
|
||||
document.getElementById('setallnorm').className = 'controld';
|
||||
document.getElementById('setallhigh').className = 'control';
|
||||
document.getElementById('setallskip').className = 'control';
|
||||
form.savepri.disabled = false;
|
||||
form.savepri.className = 'accept';
|
||||
}
|
||||
|
||||
function setallhigh() {
|
||||
var form = document.forms[0];
|
||||
for(i = 0; i < form.elements.length; i++) {
|
||||
var elem = form.elements[i];
|
||||
if (elem.type == 'radio') {
|
||||
if (elem.className === 'prihigh')
|
||||
elem.checked = true;
|
||||
}
|
||||
}
|
||||
document.getElementById('setallnorm').className = 'control';
|
||||
document.getElementById('setallhigh').className = 'controld';
|
||||
document.getElementById('setallskip').className = 'control';
|
||||
form.savepri.disabled = false;
|
||||
form.savepri.className = 'accept';
|
||||
}
|
||||
|
||||
function setallskip() {
|
||||
var form = document.forms[0];
|
||||
for(i = 0; i < form.elements.length; i++) {
|
||||
var elem = form.elements[i];
|
||||
if (elem.type == 'radio') {
|
||||
if (elem.className === 'priskip')
|
||||
elem.checked = true;
|
||||
}
|
||||
}
|
||||
document.getElementById('setallnorm').className = 'control';
|
||||
document.getElementById('setallhigh').className = 'control';
|
||||
document.getElementById('setallskip').className = 'controld';
|
||||
form.savepri.disabled = false;
|
||||
form.savepri.className = 'accept';
|
||||
}
|
Reference in New Issue
Block a user