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

Commit

Permalink
Merge pull request #316 from IDotD/idrinth
Browse files Browse the repository at this point in the history
fixes #315
  • Loading branch information
w20k authored Apr 24, 2017
2 parents 2c07b34 + c339bea commit 34011d5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/mods/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ idrinth.settings = {
/**
*
* @param {String} field
* @param {String|Booleab|Number} value
* @param {String|Boolean|Number} value
* @returns {undefined}
*/
change: function ( field, value ) {
Expand Down
16 changes: 15 additions & 1 deletion src/mods/tier.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ idrinth.tier = {
},
makeButton (
'copy',
'idrinth.core.copyToClipboard.text("' + boss.name + '(NM): OS ' + idrinth.ui.formatNumber ( boss.os.nm ) + ', FS ' + idrinth.ui.formatNumber ( boss.fs.nm ) + ', Tiers ' + formattedList ( boss.nm ) + ' by IDotD")'
'idrinth.core.copyToClipboard.text("' + boss.name + '(NM): OS ' + idrinth.ui.formatNumber ( boss.os.nm ) + ', AP ' + idrinth.ui.formatNumber ( boss.ap ) + ', Tiers ' + formattedList ( boss.nm ) + ' by IDotD")'
),
makeButton (
'tag',
Expand Down Expand Up @@ -470,5 +470,19 @@ idrinth.tier = {
type: document.getElementById ( 'idrinth-tierlist-typesearch' ).value,
list: idrinth.tier.list
} );
},
/**
*
* @param {Boolean} yes
* @returns {undefined}
*/
allCheck: function ( yes ) {
var boxes = document.getElementById ( 'idrinth-raid-may-join-list' ).getElementsByTagName ( 'input' );
for (var counter = boxes.length - 1; counter >= 0; counter--) {
if ( boxes[counter].getAttribute ( 'type' ) === 'checkbox' && boxes[counter].checked !== yes ) {
boxes[counter].checked = yes;
idrinth.settings.change ( ( boxes[counter].getAttribute ( 'id' ) ).replace ( /idrinth-/, '' ), yes );
}
}
}
};
62 changes: 51 additions & 11 deletions src/mods/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1056,17 +1056,57 @@ idrinth.ui = {
* @returns {Array}
*/
var buildRaidJoinList = function () {
return [ {
content: idrinth.text.get ( "raids.clickCopy" ),
type: 'strong'
}, {
id: 'idrinth-raid-link-list'
}, {
content: idrinth.text.get ( "raids.disableSpecific" ),
type: 'strong'
}, {
id: 'idrinth-raid-may-join-list'
} ];
/**
*
* @param {Array} list
* @param {String} header
* @returns {object}
*/
var wrap = function ( list, header ) {
return {
children: [
{
type: 'strong',
content: idrinth.text.get ( "raids." + header )
},
{
children: list
}
],
css: 'idrinth-openclick'
};
};
return [
wrap ( [ {
id: 'idrinth-raid-link-list'
} ],
"clickCopy"
),
wrap ( [ {
content: idrinth.text.get ( "raids.disable.none" ),
type: 'button',
attributes: [
{
name: 'onclick',
value: 'idrinth.tier.allCheck(false)'
}, {
name: 'style',
value: 'width:50%;'
} ]
}, {
content: idrinth.text.get ( "raids.disable.all" ),
type: 'button',
attributes: [
{
name: 'onclick',
value: 'idrinth.tier.allCheck(true)'
}, {
name: 'style',
value: 'width:50%;'
} ]
}, {
id: 'idrinth-raid-may-join-list'
} ], "disableSpecific" ) ];
};
return makeTabs ( {
'Actions': buildActions (),
Expand Down

0 comments on commit 34011d5

Please sign in to comment.