Merge pull request #779 from DanielNoord/lintingandtoggle

Linting and new toggle
This commit is contained in:
Daniël van Noord authored and GitHub committed 2021-04-30 20:44:57 +02:00
commit 134828692a
33 files changed
+235 -351

No files matched your search

+6 -28
View File
@@ -11,24 +11,15 @@
"BeautifyAll": "readonly",
"PlaySound": "readonly"
},
"extends": [
"airbnb-base",
"plugin:prettier/recommended"
],
"extends": ["airbnb-base", "prettier"],
"parserOptions": {
"ecmaVersion": 12
},
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"overrides": [
{
"files": [
"src/**/*.{ts,tsx}"
],
"extends": [
"plugin:@typescript-eslint/recommended"
],
"files": ["src/**/*.{ts,tsx}"],
"extends": ["plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"rules": {
"import/extensions": "off", // To allow importing .ts without errors
@@ -36,11 +27,7 @@
}
}
],
"ignorePatterns": [
"*CookieMonster*.js",
"dist/*",
"node_modules/*"
],
"ignorePatterns": ["*CookieMonster*.js", "dist/*", "node_modules/*"],
"rules": {
"import/no-mutable-exports": "off", // We need to this throughout Cookie Monster
"no-plusplus": [
@@ -56,15 +43,6 @@
"object": true,
"array": false
}
], // Importing arrays and then destructuring them seems to fail
"max-len": [
1,
{
"code": 100,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
]
] // Importing arrays and then destructuring them seems to fail
}
}
+1
View File
@@ -1,4 +1,5 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "all"
}
+1 -1
View File
@@ -1,2 +1,2 @@
/*! For license information please see CookieMonster.js.LICENSE.txt */
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
+1 -1
View File
@@ -1,2 +1,2 @@
/*! For license information please see CookieMonster.js.LICENSE.txt */
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
(()=>{var e={877:function(e){!function(t,o){"use strict";"object"!=typeof e.exports?o(t):e.exports=t.document?o(t):function(e){if(!e.document)throw new Error("jscolor needs a window with document");return o(e)}}("undefined"!=typeof window?window:this,(function(e){"use strict";var t,o,n,i,a=((i={initialized:!1,instances:[],readyQueue:[],register:function(){void 0!==e&&e.document&&e.document.addEventListener("DOMContentLoaded",i.pub.init,!1)},installBySelector:function(t,o){if(!(o=o?i.node(o):e.document))throw new Error("Missing root node");for(var n=o.querySelectorAll(t),a=new RegExp("(^|\\s)("+i.pub.lookupClass+")(\\s*(\\{[^}]*\\})|\\s|$)","i"),r=0;r<n.length;r+=1){var l,s;if(!(n[r].jscolor&&n[r].jscolor instanceof i.pub)&&(void 0===n[r].type||"color"!=n[r].type.toLowerCase()||!i.isColorAttrSupported)&&(null!==(l=i.getDataAttr(n[r],"jscolor"))||n[r].className&&(s=n[r].className.match(a)))){var c=n[r],d="";null!==l?d=l:s&&(console.warn('Installation using class name is DEPRECATED. Use data-jscolor="" attribute instead.'+i.docsRef),s[4]&&(d=s[4]));var p=null;if(d.trim())try{p=i.parseOptionsStr(d)}catch(e){console.warn(e+"\n"+d)}try{new i.pub(c,p)}catch(e){console.warn(e)}}}},parseOptionsStr:function(e){var t=null;try{t=JSON.parse(e)}catch(o){if(!i.pub.looseJSON)throw new Error("Could not parse jscolor options as JSON: "+o);try{t=new Function("var opts = ("+e+'); return typeof opts === "object" ? opts : {};')()}catch(e){throw new Error("Could not evaluate jscolor options: "+e)}}return t},getInstances:function(){for(var e=[],t=0;t<i.instances.length;t+=1)i.instances[t]&&i.instances[t].targetElement&&e.push(i.instances[t]);return e},createEl:function(t){var o=e.document.createElement(t);return i.setData(o,"gui",!0),o},node:function(t){if(!t)return null;if("string"==typeof t){var o=t,n=null;try{n=e.document.querySelector(o)}catch(e){return console.warn(e),null}return n||console.warn("No element matches the selector: %s",o),n}return i.isNode(t)?t:(console.warn("Invalid node of type %s: %s",typeof t,t),null)},isNode:function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},nodeName:function(e){return!(!e||!e.nodeName)&&e.nodeName.toLowerCase()},removeChildren:function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},isTextInput:function(e){return e&&"input"===i.nodeName(e)&&"text"===e.type.toLowerCase()},isButton:function(e){if(!e)return!1;var t=i.nodeName(e);return"button"===t||"input"===t&&["button","submit","reset"].indexOf(e.type.toLowerCase())>-1},isButtonEmpty:function(e){switch(i.nodeName(e)){case"input":return!e.value||""===e.value.trim();case"button":return""===e.textContent.trim()}return null},isPassiveEventSupported:function(){var t=!1;try{var o=Object.defineProperty({},"passive",{get:function(){t=!0}});e.addEventListener("testPassive",null,o),e.removeEventListener("testPassive",null,o)}catch(e){}return t}(),isColorAttrSupported:(n=e.document.createElement("input"),!(!n.setAttribute||(n.setAttribute("type","color"),"color"!=n.type.toLowerCase()))),dataProp:"_data_jscolor",setData:function(){var e=arguments[0];if(3===arguments.length){var t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={},o=arguments[2];return t[a=arguments[1]]=o,!0}if(2===arguments.length&&"object"==typeof arguments[1]){t=e.hasOwnProperty(i.dataProp)?e[i.dataProp]:e[i.dataProp]={};var n=arguments[1];for(var a in n)n.hasOwnProperty(a)&&(t[a]=n[a]);return!0}throw new Error("Invalid arguments")},removeData:function(){var e=arguments[0];if(!e.hasOwnProperty(i.dataProp))return!0;for(var t=1;t<arguments.length;t+=1){var o=arguments[t];delete e[i.dataProp][o]}return!0},getData:function(e,t,o){if(!e.hasOwnProperty(i.dataProp)){if(void 0===o)return;e[i.dataProp]={}}var n=e[i.dataProp];return n.hasOwnProperty(t)||void 0===o||(n[t]=o),n[t]},getDataAttr:function(e,t){var o="data-"+t;return e.getAttribute(o)},setDataAttr:function(e,t,o){var n="data-"+t;e.setAttribute(n,o)},_attachedGroupEvents:{},attachGroupEvent:function(e,t,o,n){i._attachedGroupEvents.hasOwnProperty(e)||(i._attachedGroupEvents[e]=[]),i._attachedGroupEvents[e].push([t,o,n]),t.addEventListener(o,n,!1)},detachGroupEvents:function(e){if(i._attachedGroupEvents.hasOwnProperty(e)){for(var t=0;t<i._attachedGroupEvents[e].length;t+=1){var o=i._attachedGroupEvents[e][t];o[0].removeEventListener(o[1],o[2],!1)}delete i._attachedGroupEvents[e]}},preventDefault:function(e){e.preventDefault&&e.preventDefault(),e.returnValue=!1},captureTarget:function(e){e.setCapture&&(i._capturedTarget=e,i._capturedTarget.setCapture())},releaseTarget:function(){i._capturedTarget&&(i._capturedTarget.releaseCapture(),i._capturedTarget=null)},triggerEvent:function(t,o,n,a){if(t){var r=null;return"function"==typeof Event?r=new Event(o,{bubbles:n,cancelable:a}):(r=e.document.createEvent("Event")).initEvent(o,n,a),!!r&&(i.setData(r,"internal",!0),t.dispatchEvent(r),!0)}},triggerInputEvent:function(e,t,o,n){e&&i.isTextInput(e)Line truncated
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["webpack://cookiemonster-mod/./node_modules/@eastdesire/jscolor/jscolor.js","webpack://cookiemonster-mod/webpack/bootstrap","webpack://cookiemonster-mod/webpack/runtime/compat get default export","webpack://cookiemonster-mod/webpack/runtime/define property getters","webpack://cookiemonster-mod/webpack/runtime/hasOwnProperty shorthand","webpack://cookiemonster-mod/./src/Config/VariablesAndData.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleWrinklerButtons.js","webpack://cookiemonster-mod/./src/Data/Scales.ts","webpack://cookiemonster-mod/./src/Main/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/Beautify.js","webpack://cookiemonster-mod/./src/Cache/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimAuraMult.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetSellMultiplier.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimEff.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHas.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasGod.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimModifyBuidlingPrice.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/SellBuilding.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Buildings.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Upgrades.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/FormatTime.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/GetTimeColour.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetCPS.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetWrinkConfigBank.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/CreateDOMElements.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/BottomBar.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/UpdateBackground.js","webpack://cookiemonster-mod/./src/Config/SpecificToggles.js","webpack://cookiemonster-mod/./src/Cache/Dragon/CacheDragonAuras.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitAchievement.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitialBuildingData.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitUpgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/CopyData.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/CreateTooltip.js","webpack://cookiemonster-mod/./src/Cache/PP/ColourOfPP.js","webpack://cookiemonster-mod/./src/Cache/CPS/GetCPSBuffMult.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/SimWin.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CalculateGains.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetHeavenlyMultiplier.js","webpack://cookiemonster-mod/./src/Data/Gamedata.ts","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasAchiev.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CheckOtherAchiev.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuildingBonusIncome.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleToolWarnPos.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/UpdateTooltips.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Building.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Upgrade.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/SugarLump.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetLumpColour.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Grimoire.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Warnings.js","webpack://cookiemonster-mod/./src/Disp/DrawHook.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/TimerBar.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/WrinklerTooltips.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Refreshmenu.js","webpack://cookiemonster-mod/./src/Main/ClickHook.js","webpack://cookiemonster-mod/./src/Cache/CPS/AverageQueue.js","webpack://cookiemonster-mod/./src/Cache/CPS/CPS.js","webpack://cookiemonster-mod/./src/Cache/PP/Building.js","webpack://cookiemonster-mod/./src/Cache/PP/PP.js","webpack://cookiemonster-mod/./src/Cache/PP/Upgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuilding.js","webpack://cookiemonster-mod/./src/Cache/PrLine truncated
{"version":3,"sources":["webpack://cookiemonster-mod/./node_modules/@eastdesire/jscolor/jscolor.js","webpack://cookiemonster-mod/webpack/bootstrap","webpack://cookiemonster-mod/webpack/runtime/compat get default export","webpack://cookiemonster-mod/webpack/runtime/define property getters","webpack://cookiemonster-mod/webpack/runtime/hasOwnProperty shorthand","webpack://cookiemonster-mod/./src/Config/VariablesAndData.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleWrinklerButtons.js","webpack://cookiemonster-mod/./src/Data/Scales.ts","webpack://cookiemonster-mod/./src/Main/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/Beautify.js","webpack://cookiemonster-mod/./src/Cache/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/VariablesAndData.js","webpack://cookiemonster-mod/./src/Disp/VariablesAndData.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimAuraMult.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetSellMultiplier.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimEff.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHas.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasGod.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimModifyBuidlingPrice.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/SellBuilding.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Buildings.js","webpack://cookiemonster-mod/./src/Disp/BuildingsUpgrades/Upgrades.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/FormatTime.js","webpack://cookiemonster-mod/./src/Disp/BeautifyAndFormatting/GetTimeColour.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetCPS.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetWrinkConfigBank.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/CreateDOMElements.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/BottomBar.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/UpdateBackground.js","webpack://cookiemonster-mod/./src/Config/SpecificToggles.js","webpack://cookiemonster-mod/./src/Cache/Dragon/CacheDragonAuras.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitAchievement.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetTieredCpsMult.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitialBuildingData.js","webpack://cookiemonster-mod/./src/Sim/InitializeData/InitUpgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/CopyData.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/CreateTooltip.js","webpack://cookiemonster-mod/./src/Cache/PP/ColourOfPP.js","webpack://cookiemonster-mod/./src/Cache/CPS/GetCPSBuffMult.js","webpack://cookiemonster-mod/./src/Sim/SimulationData/SimWin.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CalculateGains.js","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimGetHeavenlyMultiplier.js","webpack://cookiemonster-mod/./src/Data/Gamedata.ts","webpack://cookiemonster-mod/./src/Sim/ReplacedGameFunctions/SimHasAchiev.js","webpack://cookiemonster-mod/./src/Sim/Calculations/CheckOtherAchiev.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuildingBonusIncome.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/CalculateGrimoireRefillTime.js","webpack://cookiemonster-mod/./src/Config/Toggles/ToggleToolWarnPos.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/UpdateTooltips.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Building.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Upgrade.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/SugarLump.js","webpack://cookiemonster-mod/./src/Disp/HelperFunctions/GetLumpColour.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Grimoire.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/GardenPlots.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/HarvestAll.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/WrinklerButton.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/PantheonGods.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/TypesOfTooltips/Warnings.js","webpack://cookiemonster-mod/./src/Disp/DrawHook.js","webpack://cookiemonster-mod/./src/Disp/InfoBars/TimerBar.js","webpack://cookiemonster-mod/./src/Disp/Tooltips/WrinklerTooltips.js","webpack://cookiemonster-mod/./src/Disp/MenuSections/Refreshmenu.js","webpack://cookiemonster-mod/./src/Main/ClickHook.js","webpack://cookiemonster-mod/./src/Cache/CPS/AverageQueue.js","webpack://cookiemonster-mod/./src/Cache/CPS/CPS.js","webpack://cookiemonster-mod/./src/Cache/PP/Building.js","webpack://cookiemonster-mod/./src/Cache/PP/PP.js","webpack://cookiemonster-mod/./src/Cache/PP/Upgrade.js","webpack://cookiemonster-mod/./src/Sim/SimulationEvents/BuyBuilding.js","webpack://cookiemonster-mod/./src/Cache/PrLine truncated
+8 -72
View File
@@ -14,14 +14,13 @@
"devDependencies": {
"@types/chai": "^4.2.16",
"@types/mocha": "^8.2.2",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.21.0",
"chai": "^4.3.4",
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.3.1",
"esm": "^3.2.25",
"mocha": "^8.3.2",
"npm-run-all": "^4.1.5",
@@ -1420,9 +1419,9 @@
}
},
"node_modules/eslint-config-prettier": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz",
"integrity": "sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz",
"integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==",
"dev": true,
"bin": {
"eslint-config-prettier": "bin/cli.js"
@@ -1539,27 +1538,6 @@
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true
},
"node_modules/eslint-plugin-prettier": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz",
"integrity": "sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==",
"dev": true,
"dependencies": {
"prettier-linter-helpers": "^1.0.0"
},
"engines": {
"node": ">=6.0.0"
},
"peerDependencies": {
"eslint": ">=5.0.0",
"prettier": ">=1.13.0"
},
"peerDependenciesMeta": {
"eslint-config-prettier": {
"optional": true
}
}
},
"node_modules/eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
@@ -1749,12 +1727,6 @@
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"node_modules/fast-diff": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
"integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
"dev": true
},
"node_modules/fast-glob": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
@@ -3461,18 +3433,6 @@
"node": ">=10.13.0"
}
},
"node_modules/prettier-linter-helpers": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
"integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
"dev": true,
"dependencies": {
"fast-diff": "^1.1.2"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@@ -5947,9 +5907,9 @@
}
},
"eslint-config-prettier": {
"version": "8.1.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz",
"integrity": "sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw==",
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz",
"integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==",
"dev": true,
"requires": {}
},
@@ -6055,15 +6015,6 @@
}
}
},
"eslint-plugin-prettier": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.3.1.tgz",
"integrity": "sha512-Rq3jkcFY8RYeQLgk2cCwuc0P7SEFwDravPhsJZOQ5N4YI4DSg50NyqJ/9gdZHzQlHf8MvafSesbNJCcP/FF6pQ==",
"dev": true,
"requires": {
"prettier-linter-helpers": "^1.0.0"
}
},
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
@@ -6203,12 +6154,6 @@
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"fast-diff": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz",
"integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==",
"dev": true
},
"fast-glob": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
@@ -7466,15 +7411,6 @@
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
"dev": true
},
"prettier-linter-helpers": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz",
"integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==",
"dev": true,
"requires": {
"fast-diff": "^1.1.2"
}
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+2 -3
View File
@@ -47,14 +47,13 @@
"devDependencies": {
"@types/chai": "^4.2.16",
"@types/mocha": "^8.2.2",
"@typescript-eslint/eslint-plugin": "^4.21.0",
"@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.21.0",
"chai": "^4.3.4",
"eslint": "^7.23.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.3.1",
"esm": "^3.2.25",
"mocha": "^8.3.2",
"npm-run-all": "^4.1.5",
+1 -3
View File
@@ -6,8 +6,6 @@ import { FavouriteSettings } from '../../Disp/VariablesAndData';
*/
export default function ToggleFavouriteSetting(config) {
if (FavouriteSettings.includes(config))
FavouriteSettings = FavouriteSettings.filter(function (ele) {
return ele !== config;
});
FavouriteSettings = FavouriteSettings.filter((ele) => ele !== config);
else FavouriteSettings.push(config);
}
@@ -0,0 +1,20 @@
import { CMOptions } from '../VariablesAndData';
/**
* This function toggles the upgrade to be always expanded
* It is called by a change in CM.Options.ToolWarnPos
* and upon creation of the warning tooltip by CM.Disp.UpdateTooltipWarnings()
*/
export default function ToggleUpgradeSectionsAlwaysExpanded() {
Object.values(document.getElementsByClassName('storeSection')).forEach((section) => {
if (CMOptions.UpgradesNeverCollapse || section.id === 'products') {
section.style.height = 'auto'; // eslint-disable-line no-param-reassign
} else if (section.id === 'vaultUpgrades') {
section.style.height = '30px'; // eslint-disable-line no-param-reassign
} else if (section.id === 'upgrades') {
section.style.height = '60px'; // eslint-disable-line no-param-reassign
} else {
section.style.height = '60px'; // eslint-disable-line no-param-reassign
}
});
}
+41 -49
View File
@@ -7,6 +7,7 @@ import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
import ToggleUpgradeSectionsAlwaysExpanded from '../Config/Toggles/ToggleUpgradeSectionsAlwaysExpanded';
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
import { CMOptions } from '../Config/VariablesAndData';
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
@@ -68,7 +69,7 @@ const Config = {
],
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
true,
function () {
() => {
SimDoSims = true; // eslint-disable-line no-unused-vars
},
),
@@ -87,7 +88,7 @@ const Config = {
],
'Change how long numbers are formatted',
false,
function () {
() => {
RefreshScale();
},
),
@@ -97,7 +98,7 @@ const Config = {
['1 decimals', '2 decimals', '3 decimals'],
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
false,
function () {
() => {
RefreshScale();
},
),
@@ -107,7 +108,7 @@ const Config = {
['. for decimals (standard)', '. for thousands'],
'Set the separator used for decimals and thousands',
false,
function () {
() => {
RefreshScale();
},
),
@@ -132,7 +133,7 @@ const Config = {
['Detailed time OFF', 'Detailed time ON'],
'Change how time is displayed in certain statistics and tooltips',
true,
function () {
() => {
ToggleDetailedTime();
},
),
@@ -151,7 +152,7 @@ const Config = {
['Building colours OFF', 'Building colours ON'],
'Colour code buildings',
true,
function () {
() => {
UpdateBuildings();
},
),
@@ -242,7 +243,7 @@ const Config = {
['Bottom bar OFF', 'Bottom bar ON'],
'Building information',
true,
function () {
() => {
ToggleBotBar();
},
),
@@ -252,7 +253,7 @@ const Config = {
['Timer bar OFF', 'Timer bar ON'],
'Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
true,
function () {
() => {
ToggleTimerBar();
},
),
@@ -262,32 +263,24 @@ const Config = {
['Timer bar position (top left)', 'Timer bar position (bottom)'],
'Placement of the timer bar',
false,
function () {
() => {
ToggleTimerBarPos();
},
),
TimerBarOverlay: new SettingStandard(
'bool',
'BarsDisplay',
[
'Timer bar overlay OFF',
'Timer bar overlay only seconds',
'Timer bar overlay full',
],
['Timer bar overlay OFF', 'Timer bar overlay only seconds', 'Timer bar overlay full'],
'Overlay on timers displaying seconds and/or percentage left',
true,
),
UpBarColour: new SettingStandard(
'bool',
'BarsDisplay',
[
'Upgrade colours/bar OFF',
'Upgrade colours with bar ON',
'Upgrade colours without bar ON',
],
['Upgrade colours/bar OFF', 'Upgrade colours with bar ON', 'Upgrade colours without bar ON'],
'Colour code upgrades and optionally add a counter bar',
false,
function () {
() => {
ToggleUpgradeBarAndColour();
},
),
@@ -297,7 +290,7 @@ const Config = {
['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'],
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
true,
function () {
() => {
ToggleUpgradeBarFixedPos();
},
),
@@ -311,7 +304,7 @@ const Config = {
],
'Sort the display of buildings in either default order or by PP',
false,
function () {
() => {
UpdateBuildings();
},
),
@@ -321,10 +314,20 @@ const Config = {
['Sort upgrades: default', 'Sort upgrades: PP'],
'Sort the display of upgrades in either default order or by PP',
false,
function () {
() => {
UpdateUpgrades();
},
),
UpgradesNeverCollapse: new SettingStandard(
'bool',
'BarsDisplay',
['Upgrades always expanded OFF', 'Upgrades always expanded ON'],
'Toggle to make the upgrades sections always expanded to the size needed to display all upgrades',
true,
() => {
ToggleUpgradeSectionsAlwaysExpanded();
},
),
DragonAuraInfo: new SettingStandard(
'bool',
'BarsDisplay',
@@ -345,7 +348,7 @@ const Config = {
['Golden cookie timer OFF', 'Golden cookie timer ON'],
'A timer on the golden cookie when it has been spawned',
true,
function () {
() => {
ToggleGCTimer();
},
),
@@ -355,7 +358,7 @@ const Config = {
['Favicon OFF', 'Favicon ON'],
'Update favicon with golden/wrath cookie',
true,
function () {
() => {
UpdateFavicon();
},
),
@@ -365,7 +368,7 @@ const Config = {
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
'Show buttons for popping wrinklers at bottom of cookie section',
true,
function () {
() => {
ToggleWrinklerButtons();
},
),
@@ -375,7 +378,7 @@ const Config = {
['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'],
'Show buttons for hiding and showing the buildings and upgrades sections in the right column',
true,
function () {
() => {
ToggleSectionHideButtons();
},
),
@@ -384,10 +387,7 @@ const Config = {
TooltipBuildUpgrade: new SettingStandard(
'bool',
'Tooltip',
[
'Building/upgrade tooltip information OFF',
'Building/upgrade tooltip information ON',
],
['Building/upgrade tooltip information OFF', 'Building/upgrade tooltip information ON'],
'Extra information in building/upgrade tooltips',
true,
),
@@ -447,10 +447,7 @@ const Config = {
ToolWarnBon: new SettingStandard(
'bool',
'Tooltip',
[
'Calculate tooltip warning with bonus CPS OFF',
'Calculate tooltip warning with bonus CPS ON',
],
['Calculate tooltip warning with bonus CPS OFF', 'Calculate tooltip warning with bonus CPS ON'],
'Calculate the warning with or without the bonus CPS you get from buying',
true,
),
@@ -460,7 +457,7 @@ const Config = {
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
'Placement of the warning boxes',
false,
function () {
() => {
ToggleToolWarnPos();
},
),
@@ -573,7 +570,7 @@ const Config = {
['Notification OFF', 'Notification ON'],
'Create a notification when golden cookie spawns',
true,
function () {
() => {
CheckNotificationPermissions(CMOptions.GCNotification);
},
),
@@ -609,7 +606,7 @@ const Config = {
['Notification OFF', 'Notification ON'],
'Create a notification when fortune cookie is on the ticker',
true,
function () {
() => {
CheckNotificationPermissions(CMOptions.FortuneNotification);
},
),
@@ -645,7 +642,7 @@ const Config = {
['Notification OFF', 'Notification ON'],
'Create a notification on season popup',
true,
function () {
() => {
CheckNotificationPermissions(CMOptions.SeaNotification);
},
),
@@ -707,7 +704,7 @@ const Config = {
['Notification OFF', 'Notification ON'],
'Create a notification when magic reaches maximum',
true,
function () {
() => {
CheckNotificationPermissions(CMOptions.MagicNotification);
},
),
@@ -743,7 +740,7 @@ const Config = {
['Notification OFF', 'Notification ON'],
'Create a notification when a wrinkler appears',
true,
function () {
() => {
CheckNotificationPermissions(CMOptions.WrinklerNotification);
},
),
@@ -779,7 +776,7 @@ const Config = {
['Notification OFF', 'Notification ON'],
'Create a notification when the maximum amount of wrinklers has appeared',
true,
function () {
() => {
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
},
),
@@ -802,12 +799,7 @@ const Config = {
'Play a sound when the maximum amount of wrinklers has appeared',
true,
),
WrinklerMaxVolume: new SettingVolume(
'vol',
'NotificationWrinkMax',
[],
'Volume',
),
WrinklerMaxVolume: new SettingVolume('vol', 'NotificationWrinkMax', [], 'Volume'),
WrinklerMaxSoundURL: new SettingStandard(
'url',
'NotificationWrinkMax',
@@ -833,7 +825,7 @@ const Config = {
],
"Show stars before each setting which allows selecting it for a 'favourites' section at the top of the Cookie Monster settings. Setting this to Locked removes the stars but shows the 'favourites' section",
true,
function () {
() => {
Game.UpdateMenu();
},
),
+1
View File
@@ -35,6 +35,7 @@ const ConfigDefault: {
UpgradeBarFixedPos: 1,
SortBuildings: 0,
SortUpgrades: 0,
UpgradesNeverCollapse: 0,
DragonAuraInfo: 1,
GrimoireBar: 1,
GCTimer: 1,
+4 -8
View File
@@ -70,16 +70,14 @@ export default function UpdateBuildings() {
return o;
});
arr.sort(function (a, b) {
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
ColoursOrdering.indexOf(b.color)
? 1
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
? -1
: a.pp < b.pp
? -1
: 0;
});
: 0);
} else if (CMOptions.SortBuildings === 2) {
arr = Object.keys(target).map((k) => {
const o = target[k];
@@ -88,16 +86,14 @@ export default function UpdateBuildings() {
return o;
});
arr.sort(function (a, b) {
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
ColoursOrdering.indexOf(b.color)
? 1
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
? -1
: a.pp < b.pp
? -1
: 0;
});
: 0);
}
for (let x = 0; x < arr.length; x++) {
+2 -4
View File
@@ -79,15 +79,13 @@ export default function UpdateUpgrades() {
}
if (CMOptions.SortUpgrades) {
arr.sort(function (a, b) {
return ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
? 1
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
? -1
: a.pp < b.pp
? -1
: 0;
});
: 0);
} else {
arr.sort((a, b) => a.price - b.price);
}
@@ -20,9 +20,7 @@ export default function CreateWrinklerButtons() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('wb', 'PopAll');
},
() => CreateTooltip('wb', 'PopAll'),
'this',
);
Game.tooltip.wobble();
@@ -43,9 +41,7 @@ export default function CreateWrinklerButtons() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('wb', 'PopFattest');
},
() => CreateTooltip('wb', 'PopFattest'),
'this',
);
Game.tooltip.wobble();
@@ -68,13 +68,11 @@ export default function AddMissingAchievements() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return (function () {
() => (function () {
return CrateTooltipLockedAchievements(
Game.AchievementsById[id],
);
})();
},
})(),
'top',
);
Game.tooltip.wobble();
+3 -3
View File
@@ -21,17 +21,17 @@ export default function Flash(mode, config, forced) {
l('CMFlashScreen').style.opacity = '0.5';
if (mode === 3) {
l('CMFlashScreen').style.display = 'inline';
setTimeout(function () {
setTimeout(() => {
Flash(2, config, true);
}, 1000 / Game.fps);
} else {
setTimeout(function () {
setTimeout(() => {
Flash(0, config, true);
}, 1000 / Game.fps);
}
} else if (mode === 2) {
l('CMFlashScreen').style.opacity = '1';
setTimeout(function () {
setTimeout(() => {
Flash(1, config, true);
}, 1000 / Game.fps);
} else if (mode === 0) l('CMFlashScreen').style.display = 'none';
+3 -13
View File
@@ -54,13 +54,7 @@ export function TooltipCreateWarningSection() {
TooltipWarn.style.bottom = 'auto';
TooltipWarn.id = 'CMDispTooltipWarningParent';
const create = function (
boxId,
color,
labelTextFront,
labelTextBack,
deficitId,
) {
const create = function (boxId, color, labelTextFront, labelTextBack, deficitId) {
const box = document.createElement('div');
box.id = boxId;
box.style.display = 'none';
@@ -182,18 +176,14 @@ export function TooltipCreateCalculationSection(tooltip) {
tooltip.appendChild(time);
if (TooltipType === 'b') {
tooltip.appendChild(
TooltipCreateHeader('Production left till next achievement'),
);
tooltip.appendChild(TooltipCreateHeader('Production left till next achievement'));
tooltip.lastChild.id = 'CMTooltipProductionLeftHeader'; // eslint-disable-line no-param-reassign
const production = document.createElement('div');
production.id = 'CMTooltipProductionLeft';
tooltip.appendChild(production);
}
if (TooltipType === 'b') {
tooltip.appendChild(
TooltipCreateHeader('Buildings (price / PP) left till next achievement'),
);
tooltip.appendChild(TooltipCreateHeader('Buildings (price / PP) left till next achievement'));
tooltip.lastChild.id = 'CMTooltipNextAchievementHeader'; // eslint-disable-line no-param-reassign
const production = document.createElement('div');
production.id = 'CMTooltipNextAchievement';
@@ -14,9 +14,7 @@ export default function ReplaceTooltipGrimoire() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('g', `${i}`);
},
() => CreateTooltip('g', `${i}`),
'this',
);
Game.tooltip.wobble();
@@ -17,9 +17,7 @@ export default function ReplaceTooltipUpgrade() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('u', `${i}`);
},
() => CreateTooltip('u', `${i}`),
'store',
);
Game.tooltip.wobble();
+7 -19
View File
@@ -21,9 +21,7 @@ function ReplaceTooltipBuild() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('b', `${i}`);
},
() => CreateTooltip('b', `${i}`),
'store',
);
Game.tooltip.wobble();
@@ -42,9 +40,7 @@ function ReplaceTooltipLump() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('s', 'Lump');
},
() => CreateTooltip('s', 'Lump'),
'this',
);
Game.tooltip.wobble();
@@ -61,9 +57,7 @@ function ReplaceTooltipGarden() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('ha', 'HarvestAllButton');
},
() => CreateTooltip('ha', 'HarvestAllButton'),
'this',
);
Game.tooltip.wobble();
@@ -75,9 +69,7 @@ function ReplaceTooltipGarden() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]);
},
() => CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]),
'this',
);
Game.tooltip.wobble();
@@ -93,9 +85,7 @@ function ReplaceTooltipPantheon() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('pag', i);
},
() => CreateTooltip('pag', i),
'this',
);
Game.tooltip.wobble();
@@ -106,12 +96,10 @@ function ReplaceTooltipPantheon() {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('pas', [
() => CreateTooltip('pas', [
i,
Game.Objects.Temple.minigame.slot[i],
]);
},
]),
'this',
);
Game.tooltip.wobble();
@@ -69,7 +69,7 @@ export default function ReplaceNative() {
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
l('bigCookie').addEventListener(
'click',
function () {
() => {
FixMouseY(Game.ClickCookie);
},
false,
+1 -4
View File
@@ -1,8 +1,5 @@
import CacheDragonAuras from '../../Cache/Dragon/CacheDragonAuras';
import {
CacheDragonAura,
CacheDragonAura2,
} from '../../Cache/VariablesAndData';
import { CacheDragonAura, CacheDragonAura2 } from '../../Cache/VariablesAndData';
import { CreateBotBarBuildingColumn } from '../../Disp/InfoBars/CreateDOMElements';
import InitAchievement from '../InitializeData/InitAchievement';
import InitialBuildingData from '../InitializeData/InitialBuildingData';
+8 -8
View File
@@ -5,28 +5,28 @@ import { l, Game } from '../../GlobalsForTesting';
import ToggleBotBar from '../../../src/Config/Toggles/ToggleBotBar';
import { CMOptions } from '../../../src/Config/VariablesAndData';
describe('ToggleBotBar', function () {
describe('ToggleBotBar', () => {
global.l = l;
global.Game = Game;
beforeEach(function () {
beforeEach(() => {
global.domids = {};
ToggleBotBar();
});
describe('BotBar = 0', function () {
before(function () {
describe('BotBar = 0', () => {
before(() => {
CMOptions.BotBar = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMBotBar.style.display, 'none'); // eslint-disable-line no-undef
});
});
describe('BotBar = 1', function () {
before(function () {
describe('BotBar = 1', () => {
before(() => {
CMOptions.BotBar = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMBotBar.style.display, ''); // eslint-disable-line no-undef
});
});
@@ -6,27 +6,27 @@ import { CMOptions } from '../../../src/Config/VariablesAndData';
import ToggleDetailedTime from '../../../src/Config/Toggles/ToggleDetailedTime';
import { BackupFunctions } from '../../../src/Main/VariablesAndData';
describe('ToggleDetailedTime', function () {
describe('ToggleDetailedTime', () => {
global.Game = Game;
beforeEach(function () {
beforeEach(() => {
ToggleDetailedTime();
});
describe('DetailedTime = 0', function () {
before(function () {
describe('DetailedTime = 0', () => {
before(() => {
CMOptions.DetailedTime = 0;
BackupFunctions.sayTime = 'BackupFunctions.sayTime';
});
it('Set correct time function', function () {
it('Set correct time function', () => {
assert.equal(Game.sayTime, 'BackupFunctions.sayTime');
});
});
describe('DetailedTime = 1', function () {
before(function () {
describe('DetailedTime = 1', () => {
before(() => {
CMOptions.DetailedTime = 1;
});
it('Set correct time function', function () {
it('Set correct time function', () => {
assert.equal(Game.sayTime.name, 'CMSayTime');
});
});
@@ -4,12 +4,12 @@ import { assert } from 'chai';
import ToggleFavouriteSetting from '../../../src/Config/Toggles/ToggleFavourites';
import { FavouriteSettings } from '../../../src/Disp/VariablesAndData';
describe('ToggleFavouriteSetting', function () {
beforeEach(function () {
describe('ToggleFavouriteSetting', () => {
beforeEach(() => {
global.domids = {};
});
// TODO: Can't write test for checking existing config due to Babel/Typescript problem
it('New config', function () {
it('New config', () => {
FavouriteSettings.push('TestConfig');
ToggleFavouriteSetting('TestConfig2');
assert.deepEqual(FavouriteSettings, ['TestConfig', 'TestConfig2']);
+8 -8
View File
@@ -7,10 +7,10 @@ import ToggleGCTimer from '../../../src/Config/Toggles/ToggleGCTimer';
import { GCTimers } from '../../../src/Disp/VariablesAndData';
import { CacheGoldenShimmersByID } from '../../../src/Cache/VariablesAndData';
describe('ToggleGCTimer', function () {
describe('ToggleGCTimer', () => {
global.l = l;
beforeEach(function () {
beforeEach(() => {
global.domids = {};
GCTimers[0] = { style: {} };
GCTimers[1] = { style: {} };
@@ -23,20 +23,20 @@ describe('ToggleGCTimer', function () {
ToggleGCTimer();
});
describe('GCTimer = 0', function () {
before(function () {
describe('GCTimer = 0', () => {
before(() => {
CMOptions.GCTimer = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(GCTimers[0].style.display, 'none');
assert.equal(GCTimers[1].style.display, 'none');
});
});
describe('GCTimer = 1', function () {
before(function () {
describe('GCTimer = 1', () => {
before(() => {
CMOptions.GCTimer = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(GCTimers[0].style.display, 'block');
assert.equal(GCTimers[0].style.left, 'Test00');
assert.equal(GCTimers[0].style.top, 'Test01');
@@ -5,27 +5,27 @@ import { l } from '../../GlobalsForTesting';
import { CMOptions } from '../../../src/Config/VariablesAndData';
import ToggleSectionHideButtons from '../../../src/Config/Toggles/ToggleSectionHideButtons';
describe('ToggleSectionHideButtons', function () {
describe('ToggleSectionHideButtons', () => {
global.l = l;
beforeEach(function () {
beforeEach(() => {
global.domids = {};
ToggleSectionHideButtons();
});
describe('HideSectionsButtons = 0', function () {
before(function () {
describe('HideSectionsButtons = 0', () => {
before(() => {
CMOptions.HideSectionsButtons = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMSectionHidButtons.style.display, 'none'); // eslint-disable-line no-undef
});
});
describe('HideSectionsButtons = 1', function () {
before(function () {
describe('HideSectionsButtons = 1', () => {
before(() => {
CMOptions.HideSectionsButtons = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMSectionHidButtons.style.display, ''); // eslint-disable-line no-undef
});
});
@@ -5,29 +5,29 @@ import { l } from '../../GlobalsForTesting';
import { CMOptions } from '../../../src/Config/VariablesAndData';
import ToggleToolWarnPos from '../../../src/Config/Toggles/ToggleToolWarnPos';
describe('ToggleToolWarnPos', function () {
describe('ToggleToolWarnPos', () => {
global.l = l;
beforeEach(function () {
beforeEach(() => {
global.domids = {};
ToggleToolWarnPos();
});
describe('ToolWarnPos = 0', function () {
before(function () {
describe('ToolWarnPos = 0', () => {
before(() => {
CMOptions.ToolWarnPos = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMDispTooltipWarningParent.style.top, 'auto'); // eslint-disable-line no-undef
assert.equal(domids.CMDispTooltipWarningParent.style.margin, '4px -4px'); // eslint-disable-line no-undef
assert.equal(domids.CMDispTooltipWarningParent.style.padding, '3px 4px'); // eslint-disable-line no-undef
});
});
describe('ToolWarnPos = 1', function () {
before(function () {
describe('ToolWarnPos = 1', () => {
before(() => {
CMOptions.ToolWarnPos = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMDispTooltipWarningParent.style.right, 'auto'); // eslint-disable-line no-undef
assert.equal(domids.CMDispTooltipWarningParent.style.margin, '4px'); // eslint-disable-line no-undef
assert.equal(domids.CMDispTooltipWarningParent.style.padding, '4px 3px'); // eslint-disable-line no-undef
@@ -5,36 +5,36 @@ import { l, Game } from '../../GlobalsForTesting';
import { CMOptions } from '../../../src/Config/VariablesAndData';
import ToggleUpgradeBarAndColor from '../../../src/Config/Toggles/ToggleUpgradeBarAndColour';
describe('ToggleUpgradeBarAndColor', function () {
describe('ToggleUpgradeBarAndColor', () => {
global.l = l;
global.Game = Game;
beforeEach(function () {
beforeEach(() => {
global.domids = {};
ToggleUpgradeBarAndColor();
});
describe('UpBarColor = 0', function () {
before(function () {
describe('UpBarColor = 0', () => {
before(() => {
CMOptions.UpBarColor = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
});
});
describe('UpBarColor = 1', function () {
before(function () {
describe('UpBarColor = 1', () => {
before(() => {
CMOptions.UpBarColor = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMUpgradeBar.style.display, ''); // eslint-disable-line no-undef
});
});
describe('UpBarColor = 2', function () {
before(function () {
describe('UpBarColor = 2', () => {
before(() => {
CMOptions.UpBarColor = 2;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
});
});
@@ -5,27 +5,27 @@ import { l } from '../../GlobalsForTesting';
import { CMOptions } from '../../../src/Config/VariablesAndData';
import ToggleUpgradeBarFixedPos from '../../../src/Config/Toggles/ToggleUpgradeBarFixedPos';
describe('ToggleUpgradeBarFixedPos', function () {
describe('ToggleUpgradeBarFixedPos', () => {
global.l = l;
beforeEach(function () {
beforeEach(() => {
global.domids = {};
ToggleUpgradeBarFixedPos();
});
describe('UpgradeBarFixedPos = 0', function () {
before(function () {
describe('UpgradeBarFixedPos = 0', () => {
before(() => {
CMOptions.UpgradeBarFixedPos = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMUpgradeBar.style.position, ''); // eslint-disable-line no-undef
});
});
describe('UpgradeBarFixedPos = 1', function () {
before(function () {
describe('UpgradeBarFixedPos = 1', () => {
before(() => {
CMOptions.UpgradeBarFixedPos = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.CMUpgradeBar.style.position, 'sticky'); // eslint-disable-line no-undef
assert.equal(domids.CMUpgradeBar.style.top, '0px'); // eslint-disable-line no-undef
});
@@ -5,56 +5,56 @@ import { l, Game } from '../../GlobalsForTesting';
import { CMOptions } from '../../../src/Config/VariablesAndData';
import ToggleWrinklerButtons from '../../../src/Config/Toggles/ToggleWrinklerButtons';
describe('ToggleWrinklerButtons', function () {
describe('ToggleWrinklerButtons', () => {
global.l = l;
global.Game = Game;
beforeEach(function () {
beforeEach(() => {
global.domids = {};
ToggleWrinklerButtons();
});
describe('WrinklerButtons = 0', function () {
before(function () {
describe('WrinklerButtons = 0', () => {
before(() => {
CMOptions.WrinklerButtons = 0;
});
describe('Game.elderWrath = 0', function () {
before(function () {
describe('Game.elderWrath = 0', () => {
before(() => {
Game.elderWrath = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
});
});
describe('Game.elderWrath = 1', function () {
before(function () {
describe('Game.elderWrath = 1', () => {
before(() => {
Game.elderWrath = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
});
});
});
describe('WrinklerButtons = 1', function () {
before(function () {
describe('WrinklerButtons = 1', () => {
before(() => {
CMOptions.WrinklerButtons = 1;
});
describe('Game.elderWrath = 0', function () {
before(function () {
describe('Game.elderWrath = 0', () => {
before(() => {
Game.elderWrath = 0;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
});
});
describe('Game.elderWrath = 1', function () {
before(function () {
describe('Game.elderWrath = 1', () => {
before(() => {
Game.elderWrath = 1;
});
it('Toggle style correctly', function () {
it('Toggle style correctly', () => {
assert.equal(domids.PopAllNormalWrinklerButton.style.display, ''); // eslint-disable-line no-undef
assert.equal(domids.PopFattestWrinklerButton.style.display, ''); // eslint-disable-line no-undef
});
+33 -33
View File
@@ -4,102 +4,102 @@ import { assert } from 'chai';
import FormatTime from '../../src/Disp/BeautifyAndFormatting/FormatTime';
import { CMOptions } from '../../src/Config/VariablesAndData';
describe('FormatTime', function () {
it('Format when time is Infinity', function () {
describe('FormatTime', () => {
it('Format when time is Infinity', () => {
assert.equal(FormatTime(Infinity, 0), Infinity);
});
it('Format when time is negative', function () {
it('Format when time is negative', () => {
assert.equal(FormatTime(-1, 0), 'Negative time period');
});
describe('TimeFormat = 0', function () {
before(function () {
describe('TimeFormat = 0', () => {
before(() => {
CMOptions.TimeFormat = 0;
});
describe('Longformat = 0', function () {
it('Format when time is 0', function () {
describe('Longformat = 0', () => {
it('Format when time is 0', () => {
assert.equal(FormatTime(0, 0), '0s');
});
it('Format when time is 1 second', function () {
it('Format when time is 1 second', () => {
assert.equal(FormatTime(1, 0), '1s');
});
it('Format when time is over 1 minute', function () {
it('Format when time is over 1 minute', () => {
assert.equal(FormatTime(61, 0), '1m, 1s');
});
it('Format when time is over 1 hour', function () {
it('Format when time is over 1 hour', () => {
assert.equal(FormatTime(3601, 0), '1h, 0m, 1s');
});
it('Format when time is over 1 day', function () {
it('Format when time is over 1 day', () => {
assert.equal(FormatTime(86401, 0), '1d, 0h, 0m, 1s');
});
it('Format when time is over 1 year', function () {
it('Format when time is over 1 year', () => {
assert.equal(FormatTime(31536001, 0), '1y, 0d, 0h, 0m, 1s');
});
it('Format when time is over >9000 days', function () {
it('Format when time is over >9000 days', () => {
assert.equal(FormatTime(777600001, 0), '>9000d');
});
it('Format when time is over >99.9 years', function () {
it('Format when time is over >99.9 years', () => {
assert.equal(FormatTime(3155760001, 0), '>9000d');
});
});
describe('Longformat = 1', function () {
it('Format when time is 0', function () {
describe('Longformat = 1', () => {
it('Format when time is 0', () => {
assert.equal(FormatTime(0, 1), '0 seconds');
});
it('Format when time is 1 second', function () {
it('Format when time is 1 second', () => {
assert.equal(FormatTime(1, 1), '1 second');
});
it('Format when time is over 1 minute', function () {
it('Format when time is over 1 minute', () => {
assert.equal(FormatTime(61, 1), '1 minute, 1 second');
});
it('Format when time is over 1 hour', function () {
it('Format when time is over 1 hour', () => {
assert.equal(FormatTime(3601, 1), '1 hour, 0 minutes, 1 second');
});
it('Format when time is over 1 day', function () {
it('Format when time is over 1 day', () => {
assert.equal(
FormatTime(86401, 1),
'1 day, 0 hours, 0 minutes, 1 second',
);
});
it('Format when time is over 1 year', function () {
it('Format when time is over 1 year', () => {
assert.equal(
FormatTime(31536001, 1),
'1 year, 0 days, 0 hours, 0 minutes, 1 second',
);
});
it('Format when time is over >9000 days', function () {
it('Format when time is over >9000 days', () => {
assert.equal(FormatTime(777600001, 1), 'Over 9000 days!');
});
it('Format when time is over >99.9 years', function () {
it('Format when time is over >99.9 years', () => {
assert.equal(FormatTime(3155760001, 1), 'Over 9000 days!');
});
});
});
describe('TimeFormat = 1', function () {
before(function () {
describe('TimeFormat = 1', () => {
before(() => {
CMOptions.TimeFormat = 1;
});
it('Format when time is 0', function () {
it('Format when time is 0', () => {
assert.equal(FormatTime(0, 0), '00:00:00:00:00');
});
it('Format when time is 1 second', function () {
it('Format when time is 1 second', () => {
assert.equal(FormatTime(1, 0), '00:00:00:00:01');
});
it('Format when time is over 1 minute', function () {
it('Format when time is over 1 minute', () => {
assert.equal(FormatTime(61, 0), '00:00:00:01:01');
});
it('Format when time is over 1 hour', function () {
it('Format when time is over 1 hour', () => {
assert.equal(FormatTime(3601, 0), '00:00:01:00:01');
});
it('Format when time is over 1 day', function () {
it('Format when time is over 1 day', () => {
assert.equal(FormatTime(86401, 0), '00:01:00:00:01');
});
it('Format when time is over 1 year', function () {
it('Format when time is over 1 year', () => {
assert.equal(FormatTime(31536001, 0), '01:00:00:00:01');
});
it('Format when time is over >9000 days', function () {
it('Format when time is over >9000 days', () => {
assert.equal(FormatTime(777600001, 0), '24:240:00:00:01');
});
it('Format when time is over >99.9 years', function () {
it('Format when time is over >99.9 years', () => {
assert.equal(FormatTime(3155760001, 0), 'XX:XX:XX:XX:XX');
});
});
+12 -12
View File
@@ -4,41 +4,41 @@ import { expect } from 'chai';
import GetTimeColour from '../../src/Disp/BeautifyAndFormatting/GetTimeColour';
import { CMOptions } from '../../src/Config/VariablesAndData';
describe('GetTimeColour', function () {
it('Format when time is less than 60', function () {
describe('GetTimeColour', () => {
it('Format when time is less than 60', () => {
expect(GetTimeColour(59).color).to.deep.equal('Yellow');
});
it('Format when time is more than 60', function () {
it('Format when time is more than 60', () => {
expect(GetTimeColour(61).color).to.deep.equal('Orange');
});
it('Format when time is more than 300', function () {
it('Format when time is more than 300', () => {
expect(GetTimeColour(301).color).to.deep.equal('Red');
});
describe('TimeFormat = 0', function () {
before(function () {
describe('TimeFormat = 0', () => {
before(() => {
CMOptions.TimeFormat = 0;
});
it('Format when time is 0', function () {
it('Format when time is 0', () => {
expect(GetTimeColour(0)).to.deep.equal({ text: 'Done!', color: 'Green' });
});
it('Format when time is negative', function () {
it('Format when time is negative', () => {
expect(GetTimeColour(-1)).to.deep.equal({
text: 'Done!',
color: 'Green',
});
});
});
describe('TimeFormat = 1', function () {
before(function () {
describe('TimeFormat = 1', () => {
before(() => {
CMOptions.TimeFormat = 1;
});
it('Format when time is 0', function () {
it('Format when time is 0', () => {
expect(GetTimeColour(0)).to.deep.equal({
text: '00:00:00:00:00',
color: 'Green',
});
});
it('Format when time is negative', function () {
it('Format when time is negative', () => {
expect(GetTimeColour(-1)).to.deep.equal({
text: '00:00:00:00:00',
color: 'Green',