From fd8d75b5033f2dc0aebae8112db6e63e4ef180f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Mon, 24 Apr 2017 09:33:22 +0200 Subject: [PATCH 1/6] fixes #315 AP instead of FS --- src/mods/tier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mods/tier.js b/src/mods/tier.js index f99aa6e..a62f034 100644 --- a/src/mods/tier.js +++ b/src/mods/tier.js @@ -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', From fe12f6e13810d70a7ce3090cb1b0d7825ee91101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Mon, 24 Apr 2017 09:52:16 +0200 Subject: [PATCH 2/6] fixes #286 --- src/mods/settings.js | 2 +- src/mods/tier.js | 14 ++++++++++++++ src/mods/ui.js | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/mods/settings.js b/src/mods/settings.js index 9fc1c2f..d8efb83 100644 --- a/src/mods/settings.js +++ b/src/mods/settings.js @@ -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 ) { diff --git a/src/mods/tier.js b/src/mods/tier.js index a62f034..1d2b5e5 100644 --- a/src/mods/tier.js +++ b/src/mods/tier.js @@ -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('name'),yes); + } + } } }; \ No newline at end of file diff --git a/src/mods/ui.js b/src/mods/ui.js index 52122e6..abbe6b5 100644 --- a/src/mods/ui.js +++ b/src/mods/ui.js @@ -1064,6 +1064,14 @@ idrinth.ui = { }, { content: idrinth.text.get ( "raids.disableSpecific" ), type: 'strong' + }, { + content: idrinth.text.get ( "raids.disable.none" ), + type: 'button', + attributes: [{name:'onclick',value:'idrinth.tier.allCheck(false)'}] + }, { + content: idrinth.text.get ( "raids.disable.all" ), + type: 'button', + attributes: [{name:'onclick',value:'idrinth.tier.allCheck(false)'}] }, { id: 'idrinth-raid-may-join-list' } ]; From 6f51f967031e7208fa7bf17d2b59a9ed07b62a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Mon, 24 Apr 2017 10:22:06 +0200 Subject: [PATCH 3/6] formatting and code fixes --- src/mods/tier.js | 10 +++++----- src/mods/ui.js | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/mods/tier.js b/src/mods/tier.js index 1d2b5e5..b57b900 100644 --- a/src/mods/tier.js +++ b/src/mods/tier.js @@ -476,12 +476,12 @@ idrinth.tier = { * @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) { + 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('name'),yes); + idrinth.settings.change ( boxes[counter].getAttribute ( 'name' ), yes ); } } } diff --git a/src/mods/ui.js b/src/mods/ui.js index abbe6b5..f4d4a99 100644 --- a/src/mods/ui.js +++ b/src/mods/ui.js @@ -1067,11 +1067,25 @@ idrinth.ui = { }, { content: idrinth.text.get ( "raids.disable.none" ), type: 'button', - attributes: [{name:'onclick',value:'idrinth.tier.allCheck(false)'}] + 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(false)'}] + attributes: [ + { + name: 'onclick', + value: 'idrinth.tier.allCheck(true)' + }, { + name: 'style', + value: 'width:50%;' + } ] }, { id: 'idrinth-raid-may-join-list' } ]; From 64aeda9e7d99f47deef6d8462b1a927b197c5a51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Mon, 24 Apr 2017 10:30:17 +0200 Subject: [PATCH 4/6] getting actual name of raid --- src/mods/tier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mods/tier.js b/src/mods/tier.js index b57b900..22b773f 100644 --- a/src/mods/tier.js +++ b/src/mods/tier.js @@ -481,7 +481,7 @@ idrinth.tier = { 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 ( 'name' ), yes ); + idrinth.settings.change ( (boxes[counter].getAttribute ( 'id' )).replace(/idrinth-/), yes ); } } } From fe2b12a0d3b955aaf92d0ba617b22ff2a05b402e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Mon, 24 Apr 2017 10:33:47 +0200 Subject: [PATCH 5/6] if there was a fix for stupidity... --- src/mods/tier.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mods/tier.js b/src/mods/tier.js index 22b773f..23e7563 100644 --- a/src/mods/tier.js +++ b/src/mods/tier.js @@ -481,7 +481,7 @@ idrinth.tier = { 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 ); + idrinth.settings.change ( ( boxes[counter].getAttribute ( 'id' ) ).replace ( /idrinth-/, '' ), yes ); } } } From c339beaa3e41d1613e41114d2b1ac7b734296ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Mon, 24 Apr 2017 10:43:27 +0200 Subject: [PATCH 6/6] wrapping raid-tab parts --- src/mods/ui.js | 80 +++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/src/mods/ui.js b/src/mods/ui.js index f4d4a99..1cb4c13 100644 --- a/src/mods/ui.js +++ b/src/mods/ui.js @@ -1056,39 +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' - }, { - content: idrinth.text.get ( "raids.disable.none" ), - type: 'button', - attributes: [ + /** + * + * @param {Array} list + * @param {String} header + * @returns {object} + */ + var wrap = function ( list, header ) { + return { + children: [ { - name: 'onclick', - value: 'idrinth.tier.allCheck(false)' - }, { - name: 'style', - value: 'width:50%;' - } ] - }, { - content: idrinth.text.get ( "raids.disable.all" ), - type: 'button', - attributes: [ + type: 'strong', + content: idrinth.text.get ( "raids." + header ) + }, { - name: 'onclick', - value: 'idrinth.tier.allCheck(true)' - }, { - name: 'style', - value: 'width:50%;' - } ] - }, { - id: 'idrinth-raid-may-join-list' - } ]; + 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 (),