From ac111bd2586adab0effa609dbac888ad85a8721f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 29 Nov 2016 13:09:44 +0100 Subject: [PATCH 01/21] assing missing link to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ed2040..7e006e2 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,4 @@ We prefer the usage of the [tracker](https://github.com/IDotD/Userscript/issues) ## How To Help -We can use helpers for the following: update and improve the wiki, help coding the userscript and testing any of the branches. For any of the later two have a look at the related documentation in the wiki. +We can use helpers for the following: update and improve the wiki, help coding the userscript and testing any of the branches. For any of the later two have a look at the related documentation in the [wiki](https://idotd.github.io/). From 34a8f580eeaf5bf9e0e0622fcadc2f0c8bd34e8b Mon Sep 17 00:00:00 2001 From: Ardenian Date: Tue, 6 Dec 2016 16:18:35 +0100 Subject: [PATCH 02/21] Update text.js fixes #235 --- src/mods/text.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mods/text.js b/src/mods/text.js index ab20894..5c60a2b 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -15,7 +15,7 @@ idrinth.text = { idrinth.text.initialized = true; return; } - idrinth.core.ajax.runHome ( 'lang-service/###RELOAD-VERSION###/', function ( file ) { + idrinth.core.ajax.runHome ( 'userscript-translation/'+language+'/###RELOAD-VERSION###/', function ( file ) { /** * * @param {object} to @@ -68,4 +68,4 @@ idrinth.text = { }; return getSub ( idrinth.text.data, key.split ( '.' ), getSub ); } -}; \ No newline at end of file +}; From 7fd27c8c53993e98ef6511c5ae078e94e5ed64e0 Mon Sep 17 00:00:00 2001 From: Ardenian Date: Tue, 6 Dec 2016 16:20:33 +0100 Subject: [PATCH 03/21] Update stable.js fixes #235 --- src/stable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/stable.js b/src/stable.js index bd1c1ec..bd03488 100644 --- a/src/stable.js +++ b/src/stable.js @@ -119,6 +119,7 @@ var idrinth = { idrinth.user.start ( ); idrinth.names.start ( ); idrinth.raids.start ( ); + idrinth.text.start() idrinth.tier.start (); idrinth.chat.start (); idrinth.war.start (); From 3b26782d7d1d5322ccb3394ddf34f800c3f1795b Mon Sep 17 00:00:00 2001 From: Ardenian Date: Tue, 6 Dec 2016 16:37:53 +0100 Subject: [PATCH 04/21] Update stable.js adding missing semicolon --- src/stable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stable.js b/src/stable.js index bd03488..1f1da6a 100644 --- a/src/stable.js +++ b/src/stable.js @@ -119,7 +119,7 @@ var idrinth = { idrinth.user.start ( ); idrinth.names.start ( ); idrinth.raids.start ( ); - idrinth.text.start() + idrinth.text.start ( ); idrinth.tier.start (); idrinth.chat.start (); idrinth.war.start (); From 3f53a4419d8bb2c22e38d5fc1a80333f31477ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 6 Dec 2016 17:39:21 +0100 Subject: [PATCH 05/21] Update stable.js putting calls into a better order --- src/stable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stable.js b/src/stable.js index 1f1da6a..eda7f33 100644 --- a/src/stable.js +++ b/src/stable.js @@ -115,11 +115,11 @@ var idrinth = { startInternal: function ( ) { var startModules = function () { idrinth.settings.start ( ); + idrinth.text.start ( ); idrinth.ui.start ( ); idrinth.user.start ( ); idrinth.names.start ( ); idrinth.raids.start ( ); - idrinth.text.start ( ); idrinth.tier.start (); idrinth.chat.start (); idrinth.war.start (); From accfa67fbaf8a8f07991bc4315b31b9e98611345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 6 Dec 2016 17:50:33 +0100 Subject: [PATCH 06/21] Update stable.js --- src/stable.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/stable.js b/src/stable.js index eda7f33..144978f 100644 --- a/src/stable.js +++ b/src/stable.js @@ -116,13 +116,20 @@ var idrinth = { var startModules = function () { idrinth.settings.start ( ); idrinth.text.start ( ); - idrinth.ui.start ( ); - idrinth.user.start ( ); - idrinth.names.start ( ); - idrinth.raids.start ( ); - idrinth.tier.start (); - idrinth.chat.start (); - idrinth.war.start (); + idrinth._tmp=window.setInterval(function() { + if(!idrinth.text.initialized) { + return; + } + window.clearInterval(idrinth._tmp); + delete idrinth['_tmp']; + idrinth.ui.start ( ); + idrinth.user.start ( ); + idrinth.names.start ( ); + idrinth.raids.start ( ); + idrinth.tier.start (); + idrinth.chat.start (); + idrinth.war.start (); + },123); }; if ( idrinth.platform === 'newgrounds' ) { try { From ab3c78951e73ed0bfec03488fb22d30c012a2d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 6 Dec 2016 17:55:09 +0100 Subject: [PATCH 07/21] Update stable.js --- src/stable.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/stable.js b/src/stable.js index 144978f..10fc71f 100644 --- a/src/stable.js +++ b/src/stable.js @@ -113,24 +113,6 @@ var idrinth = { }, platform: '', startInternal: function ( ) { - var startModules = function () { - idrinth.settings.start ( ); - idrinth.text.start ( ); - idrinth._tmp=window.setInterval(function() { - if(!idrinth.text.initialized) { - return; - } - window.clearInterval(idrinth._tmp); - delete idrinth['_tmp']; - idrinth.ui.start ( ); - idrinth.user.start ( ); - idrinth.names.start ( ); - idrinth.raids.start ( ); - idrinth.tier.start (); - idrinth.chat.start (); - idrinth.war.start (); - },123); - }; if ( idrinth.platform === 'newgrounds' ) { try { var frame = document.getElementById ( 'iframe_embed' ).getElementsByTagName ( 'iframe' )[0]; @@ -144,6 +126,24 @@ var idrinth = { } window.setTimeout ( idrinth.newgrounds.alarmCheck, 3333 ); } + idrinth.settings.start ( ); + idrinth.text.start ( ); + idrinth._tmp=window.setInterval(function() { + if(!idrinth.text.initialized) { + return; + } + var startModules = function () { + idrinth._tmp=window.setInterval(function() { + idrinth.ui.start ( ); + idrinth.user.start ( ); + idrinth.names.start ( ); + idrinth.raids.start ( ); + idrinth.tier.start (); + idrinth.chat.start (); + idrinth.war.start (); + }; + window.clearInterval(idrinth._tmp); + delete idrinth['_tmp']; startModules (); window.setTimeout ( function () { idrinth.core.multibind.add ( 'click', '.clipboard-copy', function ( element, event ) { @@ -154,6 +154,7 @@ var idrinth = { }, 1000 ); delete idrinth['start']; delete idrinth['startInternal']; + },123); }, start: function ( ) { 'use strict'; From 1f34a61dc2f5c5494d7354c13e49d9b436e253ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 6 Dec 2016 17:59:23 +0100 Subject: [PATCH 08/21] Update stable.js --- src/stable.js | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/stable.js b/src/stable.js index 10fc71f..ee29345 100644 --- a/src/stable.js +++ b/src/stable.js @@ -129,31 +129,27 @@ var idrinth = { idrinth.settings.start ( ); idrinth.text.start ( ); idrinth._tmp=window.setInterval(function() { - if(!idrinth.text.initialized) { - return; - } - var startModules = function () { - idrinth._tmp=window.setInterval(function() { - idrinth.ui.start ( ); - idrinth.user.start ( ); - idrinth.names.start ( ); - idrinth.raids.start ( ); - idrinth.tier.start (); - idrinth.chat.start (); - idrinth.war.start (); - }; - window.clearInterval(idrinth._tmp); - delete idrinth['_tmp']; - startModules (); - window.setTimeout ( function () { - idrinth.core.multibind.add ( 'click', '.clipboard-copy', function ( element, event ) { - idrinth.core.copyToClipboard.element ( element ); - element.parentNode.parentNode.removeChild ( element.parentNode ); - idrinth.core.log ( event + ' fired on ' + element ); - } ); - }, 1000 ); - delete idrinth['start']; - delete idrinth['startInternal']; + if(!idrinth.text.initialized) { + return; + } + idrinth.ui.start ( ); + idrinth.user.start ( ); + idrinth.names.start ( ); + idrinth.raids.start ( ); + idrinth.tier.start ( ); + idrinth.chat.start ( ); + idrinth.war.start ( ); + window.clearInterval(idrinth._tmp); + delete idrinth['_tmp']; + window.setTimeout ( function () { + idrinth.core.multibind.add ( 'click', '.clipboard-copy', function ( element, event ) { + idrinth.core.copyToClipboard.element ( element ); + element.parentNode.parentNode.removeChild ( element.parentNode ); + idrinth.core.log ( event + ' fired on ' + element ); + } ); + }, 1000 ); + delete idrinth['start']; + delete idrinth['startInternal']; },123); }, start: function ( ) { From 037d8591639cc5d867288d4e0e821760994827dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 6 Dec 2016 18:09:57 +0100 Subject: [PATCH 09/21] Update text.js --- src/mods/text.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mods/text.js b/src/mods/text.js index 5c60a2b..d66fc5e 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -35,6 +35,7 @@ idrinth.text = { } }; applyRecursive ( idrinth.text.data, JSON.parse ( file ), applyRecursive ); + idrinth.text.initialized = true; }, idrinth.text.start, idrinth.text.start, null, true ); }, /** From 27f8be37c735b9f5a9e0e00edfa5de4a4e061922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 6 Dec 2016 18:19:46 +0100 Subject: [PATCH 10/21] Update text.js --- src/mods/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mods/text.js b/src/mods/text.js index d66fc5e..ba6ce00 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -27,7 +27,7 @@ idrinth.text = { for (var prop in from) { if ( from.hasOwnProperty ( prop ) ) { if ( typeof to[prop] === 'string' && typeof from[prop] === 'string' ) { - to[prop] = file[prop]; + to[prop] = from[prop]; } else if ( typeof to[prop] === 'object' && typeof from[prop] === 'object' ) { func ( to[prop], from[prop], func ); } From 7ee33f649343f93c003e4c36088c9f09f4c02e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Tue, 6 Dec 2016 18:54:29 +0100 Subject: [PATCH 11/21] Update ui.js adding language setting - should be moved to being a select --- src/mods/ui.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mods/ui.js b/src/mods/ui.js index bf5c224..dc5f8f2 100644 --- a/src/mods/ui.js +++ b/src/mods/ui.js @@ -472,6 +472,11 @@ idrinth.ui = { type: 'checkbox', platforms: [ 'kongregate' ], label: "setting.enableExtCharInfo" + },{ + name: 'language', + rType: '#input', + type: 'text', + label: "setting.language" }, { name: 'minimalist', rType: '#input', From eb0282dae2da312566c8551abc54832c0029bae1 Mon Sep 17 00:00:00 2001 From: ardenian Date: Sun, 25 Dec 2016 17:53:01 +0100 Subject: [PATCH 12/21] Set setting language to preserve language Parse correct language file --- src/mods/text.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mods/text.js b/src/mods/text.js index 5c60a2b..5c73df8 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -15,6 +15,7 @@ idrinth.text = { idrinth.text.initialized = true; return; } + idrinth.settings.change( "language", language ); idrinth.core.ajax.runHome ( 'userscript-translation/'+language+'/###RELOAD-VERSION###/', function ( file ) { /** * @@ -41,7 +42,7 @@ idrinth.text = { * See languages/en.json for an example * @type {object} */ - data: JSON.parse ( '###LANG###' ), + data: JSON.parse ( language+'.json' ), /** * returns the translation of a provided key or an error-message if no * matching translation is found From 44db1cfb7ddbcf6d8d5003646578452fa6846556 Mon Sep 17 00:00:00 2001 From: Ardenian Date: Fri, 30 Dec 2016 16:34:05 +0100 Subject: [PATCH 13/21] reverse commit --- src/mods/text.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mods/text.js b/src/mods/text.js index fc07cd8..ba6ce00 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -15,7 +15,6 @@ idrinth.text = { idrinth.text.initialized = true; return; } - idrinth.settings.change( "language", language ); idrinth.core.ajax.runHome ( 'userscript-translation/'+language+'/###RELOAD-VERSION###/', function ( file ) { /** * @@ -43,7 +42,7 @@ idrinth.text = { * See languages/en.json for an example * @type {object} */ - data: JSON.parse ( language+'.json' ), + data: JSON.parse ( '###LANG###' ), /** * returns the translation of a provided key or an error-message if no * matching translation is found From 7d013947acf48e4b66c24e29a883d20b05eb8366 Mon Sep 17 00:00:00 2001 From: ardenian Date: Sun, 1 Jan 2017 16:31:28 +0100 Subject: [PATCH 14/21] addition lang and replacement of calls language --- src/mods/settings.js | 1 + src/mods/text.js | 3 ++- src/mods/ui.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mods/settings.js b/src/mods/settings.js index 33c2b84..3eb5ac3 100644 --- a/src/mods/settings.js +++ b/src/mods/settings.js @@ -21,6 +21,7 @@ idrinth.settings = { alarmActive: false, bannedRaids: { }, language: 'en', + lang : null, notification: { mention: true, message: true, diff --git a/src/mods/text.js b/src/mods/text.js index ba6ce00..f16981a 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -10,7 +10,8 @@ idrinth.text = { * @returns {undefined} */ start: function ( ) { - var language = idrinth.settings.get ( "language" ) || window.navigator.userLanguage || window.navigator.language; + var language = idrinth.settings.get( "lang" ) || window.navigator.userLanguage || window.navigator.language || idrinth.settings.get( "language" ); + idrinth.settings.change( "lang", language ); if ( language === 'en' ) { idrinth.text.initialized = true; return; diff --git a/src/mods/ui.js b/src/mods/ui.js index dc5f8f2..695593b 100644 --- a/src/mods/ui.js +++ b/src/mods/ui.js @@ -473,7 +473,7 @@ idrinth.ui = { platforms: [ 'kongregate' ], label: "setting.enableExtCharInfo" },{ - name: 'language', + name: 'lang', rType: '#input', type: 'text', label: "setting.language" From 8274fa6b1df818280cfa892314d862ef068b1629 Mon Sep 17 00:00:00 2001 From: Ardenian Date: Mon, 2 Jan 2017 16:38:12 +0100 Subject: [PATCH 15/21] Update settings.js remove language property --- src/mods/settings.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mods/settings.js b/src/mods/settings.js index 3eb5ac3..889460b 100644 --- a/src/mods/settings.js +++ b/src/mods/settings.js @@ -20,7 +20,6 @@ idrinth.settings = { alarmTime: '8:0', alarmActive: false, bannedRaids: { }, - language: 'en', lang : null, notification: { mention: true, @@ -168,4 +167,4 @@ idrinth.settings = { } } } -}; \ No newline at end of file +}; From 0aece27e43cbf73ffdd86f46f8308d8e51eee3e8 Mon Sep 17 00:00:00 2001 From: Ardenian Date: Mon, 2 Jan 2017 16:39:09 +0100 Subject: [PATCH 16/21] Update text.js remove call for "language" field in settings --- src/mods/text.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mods/text.js b/src/mods/text.js index f16981a..4d11bba 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -10,7 +10,7 @@ idrinth.text = { * @returns {undefined} */ start: function ( ) { - var language = idrinth.settings.get( "lang" ) || window.navigator.userLanguage || window.navigator.language || idrinth.settings.get( "language" ); + var language = idrinth.settings.get( "lang" ) || window.navigator.userLanguage || window.navigator.language; idrinth.settings.change( "lang", language ); if ( language === 'en' ) { idrinth.text.initialized = true; From 4f0cab7760fb4d8a7ca013f3eb9f654eeaedf28c Mon Sep 17 00:00:00 2001 From: Ardenian Date: Fri, 6 Jan 2017 01:23:53 +0100 Subject: [PATCH 17/21] Update ui.js fixing label of language setting input field --- src/mods/ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mods/ui.js b/src/mods/ui.js index 695593b..fd9ec69 100644 --- a/src/mods/ui.js +++ b/src/mods/ui.js @@ -476,7 +476,7 @@ idrinth.ui = { name: 'lang', rType: '#input', type: 'text', - label: "setting.language" + label: "setting.lang" }, { name: 'minimalist', rType: '#input', From 11501c261693f777d4d6277c6eb4b928a1fcb783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Fri, 6 Jan 2017 10:03:49 +0100 Subject: [PATCH 18/21] Update root.scss fixing the quest-info on armorgames by putting our script even higher up --- src/root.scss | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/root.scss b/src/root.scss index c07136b..b0aa02c 100644 --- a/src/root.scss +++ b/src/root.scss @@ -2,6 +2,10 @@ width:$size; height:$size; } +@mixin z-offset($offset) { + //make sure we are always above the default pages + z-index:10000000+$offset; +} @import "styles/mutik.scss"; /** * These styles modify pages changed by the script of IDotD @@ -11,7 +15,7 @@ background: rgba(204, 204, 204, 0.9); border-radius: 2px; width: 200px; - z-index: 100000; + @include z-offset(0); display: block; box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.65); } @@ -438,7 +442,7 @@ } #idrinth-chat { - z-index: 99999; + @include z-offset(1); } .idrinth-userinfo-box { @@ -451,7 +455,7 @@ box-shadow: 3px 3px 5px rgba(255, 255, 255, 0.9); margin: 0; max-width: 150px; - z-index: 120000; + @include z-offset(2); } .idrinth-userinfo-box > li { @@ -663,4 +667,4 @@ td.is-os { height:35px; border-top: 1px solid #fff; border-bottom: 1px solid #fff; -} \ No newline at end of file +} From a75b75f036ad7e683a0c94ab90c02b57e772cd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Fri, 6 Jan 2017 11:28:02 +0100 Subject: [PATCH 19/21] Update raids.js --- src/mods/raids.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mods/raids.js b/src/mods/raids.js index 7cfa4c0..ff38b83 100644 --- a/src/mods/raids.js +++ b/src/mods/raids.js @@ -42,7 +42,8 @@ idrinth.raids = { for (var key in list) { if ( list[key].delete ) { delHandler ( key ); - } else {//worst case: overwriting itself + } else { + //worst case: overwriting itself idrinth.raids.list[key] = list[key]; } } From 5013599624eb2a518bc2d0494a99e9b9b6385f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Fri, 6 Jan 2017 12:07:20 +0100 Subject: [PATCH 20/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e006e2..2c396dc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # IDotD -A script for dawn of the dragons, that works based on data provided to https://dotd.idrinth.de via UgUp +A script for dawn of the dragons, that works based on data provided to https://dotd.idrinth.de via UgUp. [![Codacy Badge](https://api.codacy.com/project/badge/Grade/e80204911a734a56a471ab9b9ac649db)](https://www.codacy.com/app/eldrim/IDotD?utm_source=github.com&utm_medium=referral&utm_content=Idrinth/IDotD&utm_campaign=Badge_Grade) [![Code Climate](https://codeclimate.com/github/Idrinth/IDotD/badges/gpa.svg)](https://codeclimate.com/github/Idrinth/IDotD) From 82e0d0405ef844c479ecc04a93bae16837142d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=C3=BCttner?= Date: Fri, 6 Jan 2017 12:34:49 +0100 Subject: [PATCH 21/21] Update text.js setting default if nothing else works --- src/mods/text.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mods/text.js b/src/mods/text.js index 4d11bba..1542446 100644 --- a/src/mods/text.js +++ b/src/mods/text.js @@ -10,9 +10,9 @@ idrinth.text = { * @returns {undefined} */ start: function ( ) { - var language = idrinth.settings.get( "lang" ) || window.navigator.userLanguage || window.navigator.language; + var language = idrinth.settings.get( "lang" ) || window.navigator.userLanguage || window.navigator.language || "en"; idrinth.settings.change( "lang", language ); - if ( language === 'en' ) { + if ( language === "en" ) { idrinth.text.initialized = true; return; }