Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit fe12f6e

Browse files
committed
fixes #286
1 parent fd8d75b commit fe12f6e

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/mods/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ idrinth.settings = {
310310
/**
311311
*
312312
* @param {String} field
313-
* @param {String|Booleab|Number} value
313+
* @param {String|Boolean|Number} value
314314
* @returns {undefined}
315315
*/
316316
change: function ( field, value ) {

src/mods/tier.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,5 +470,19 @@ idrinth.tier = {
470470
type: document.getElementById ( 'idrinth-tierlist-typesearch' ).value,
471471
list: idrinth.tier.list
472472
} );
473+
},
474+
/**
475+
*
476+
* @param {Boolean} yes
477+
* @returns {undefined}
478+
*/
479+
allCheck: function(yes) {
480+
var boxes = document.getElementById('idrinth-raid-may-join-list').getElementsByTagName('input');
481+
for(var counter=boxes.length-1;counter>=0;counter--) {
482+
if(boxes[counter].getAttribute('type')==='checkbox' && boxes[counter].checked!==yes) {
483+
boxes[counter].checked = yes;
484+
idrinth.settings.change (boxes[counter].getAttribute('name'),yes);
485+
}
486+
}
473487
}
474488
};

src/mods/ui.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,14 @@ idrinth.ui = {
10641064
}, {
10651065
content: idrinth.text.get ( "raids.disableSpecific" ),
10661066
type: 'strong'
1067+
}, {
1068+
content: idrinth.text.get ( "raids.disable.none" ),
1069+
type: 'button',
1070+
attributes: [{name:'onclick',value:'idrinth.tier.allCheck(false)'}]
1071+
}, {
1072+
content: idrinth.text.get ( "raids.disable.all" ),
1073+
type: 'button',
1074+
attributes: [{name:'onclick',value:'idrinth.tier.allCheck(false)'}]
10671075
}, {
10681076
id: 'idrinth-raid-may-join-list'
10691077
} ];

0 commit comments

Comments
 (0)