Merge pull request #779 from DanielNoord/lintingandtoggle
Linting and new toggle
This commit is contained in:
33 files changed
+235
-351
No files matched your search
+6
-28
@@ -11,24 +11,15 @@
|
|||||||
"BeautifyAll": "readonly",
|
"BeautifyAll": "readonly",
|
||||||
"PlaySound": "readonly"
|
"PlaySound": "readonly"
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": ["airbnb-base", "prettier"],
|
||||||
"airbnb-base",
|
|
||||||
"plugin:prettier/recommended"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 12
|
"ecmaVersion": 12
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": ["@typescript-eslint"],
|
||||||
"@typescript-eslint"
|
|
||||||
],
|
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": [
|
"files": ["src/**/*.{ts,tsx}"],
|
||||||
"src/**/*.{ts,tsx}"
|
"extends": ["plugin:@typescript-eslint/recommended"],
|
||||||
],
|
|
||||||
"extends": [
|
|
||||||
"plugin:@typescript-eslint/recommended"
|
|
||||||
],
|
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"rules": {
|
"rules": {
|
||||||
"import/extensions": "off", // To allow importing .ts without errors
|
"import/extensions": "off", // To allow importing .ts without errors
|
||||||
@@ -36,11 +27,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ignorePatterns": [
|
"ignorePatterns": ["*CookieMonster*.js", "dist/*", "node_modules/*"],
|
||||||
"*CookieMonster*.js",
|
|
||||||
"dist/*",
|
|
||||||
"node_modules/*"
|
|
||||||
],
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"import/no-mutable-exports": "off", // We need to this throughout Cookie Monster
|
"import/no-mutable-exports": "off", // We need to this throughout Cookie Monster
|
||||||
"no-plusplus": [
|
"no-plusplus": [
|
||||||
@@ -56,15 +43,6 @@
|
|||||||
"object": true,
|
"object": true,
|
||||||
"array": false
|
"array": false
|
||||||
}
|
}
|
||||||
], // Importing arrays and then destructuring them seems to fail
|
] // Importing arrays and then destructuring them seems to fail
|
||||||
"max-len": [
|
|
||||||
1,
|
|
||||||
{
|
|
||||||
"code": 100,
|
|
||||||
"ignoreComments": true,
|
|
||||||
"ignoreStrings": true,
|
|
||||||
"ignoreTemplateLiterals": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"printWidth": 100,
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"trailingComma": "all"
|
"trailingComma": "all"
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
/*! For license information please see CookieMonster.js.LICENSE.txt */
|
/*! 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
|
||||||
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
/*! For license information please see CookieMonster.js.LICENSE.txt */
|
/*! 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
|
||||||
Vendored
+1
-1
@@ -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
|
||||||
Generated
+8
-72
@@ -14,14 +14,13 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^4.2.16",
|
"@types/chai": "^4.2.16",
|
||||||
"@types/mocha": "^8.2.2",
|
"@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",
|
"@typescript-eslint/parser": "^4.21.0",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"eslint": "^7.23.0",
|
"eslint": "^7.23.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"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-import": "^2.22.1",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
|
||||||
"esm": "^3.2.25",
|
"esm": "^3.2.25",
|
||||||
"mocha": "^8.3.2",
|
"mocha": "^8.3.2",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
@@ -1420,9 +1419,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-config-prettier": {
|
"node_modules/eslint-config-prettier": {
|
||||||
"version": "8.1.0",
|
"version": "8.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz",
|
||||||
"integrity": "sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw==",
|
"integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"eslint-config-prettier": "bin/cli.js"
|
"eslint-config-prettier": "bin/cli.js"
|
||||||
@@ -1539,27 +1538,6 @@
|
|||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
||||||
"dev": true
|
"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": {
|
"node_modules/eslint-scope": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||||
@@ -1749,12 +1727,6 @@
|
|||||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||||
"dev": true
|
"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": {
|
"node_modules/fast-glob": {
|
||||||
"version": "3.2.5",
|
"version": "3.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
|
||||||
@@ -3461,18 +3433,6 @@
|
|||||||
"node": ">=10.13.0"
|
"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": {
|
"node_modules/process-nextick-args": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||||
@@ -5947,9 +5907,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-config-prettier": {
|
"eslint-config-prettier": {
|
||||||
"version": "8.1.0",
|
"version": "8.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz",
|
||||||
"integrity": "sha512-oKMhGv3ihGbCIimCAjqkdzx2Q+jthoqnXSP+d86M9tptwugycmTFdVR4IpLgq2c4SHifbwO90z2fQ8/Aio73yw==",
|
"integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {}
|
"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": {
|
"eslint-scope": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
|
||||||
@@ -6203,12 +6154,6 @@
|
|||||||
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
|
||||||
"dev": true
|
"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": {
|
"fast-glob": {
|
||||||
"version": "3.2.5",
|
"version": "3.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.5.tgz",
|
||||||
@@ -7466,15 +7411,6 @@
|
|||||||
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
|
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
|
||||||
"dev": true
|
"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": {
|
"process-nextick-args": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||||
|
|||||||
+2
-3
@@ -47,14 +47,13 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chai": "^4.2.16",
|
"@types/chai": "^4.2.16",
|
||||||
"@types/mocha": "^8.2.2",
|
"@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",
|
"@typescript-eslint/parser": "^4.21.0",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"eslint": "^7.23.0",
|
"eslint": "^7.23.0",
|
||||||
"eslint-config-airbnb-base": "^14.2.1",
|
"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-import": "^2.22.1",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
|
||||||
"esm": "^3.2.25",
|
"esm": "^3.2.25",
|
||||||
"mocha": "^8.3.2",
|
"mocha": "^8.3.2",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import { FavouriteSettings } from '../../Disp/VariablesAndData';
|
|||||||
*/
|
*/
|
||||||
export default function ToggleFavouriteSetting(config) {
|
export default function ToggleFavouriteSetting(config) {
|
||||||
if (FavouriteSettings.includes(config))
|
if (FavouriteSettings.includes(config))
|
||||||
FavouriteSettings = FavouriteSettings.filter(function (ele) {
|
FavouriteSettings = FavouriteSettings.filter((ele) => ele !== config);
|
||||||
return ele !== config;
|
|
||||||
});
|
|
||||||
else FavouriteSettings.push(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
@@ -7,6 +7,7 @@ import ToggleSectionHideButtons from '../Config/Toggles/ToggleSectionHideButtons
|
|||||||
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
import ToggleToolWarnPos from '../Config/Toggles/ToggleToolWarnPos';
|
||||||
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
|
import ToggleUpgradeBarAndColour from '../Config/Toggles/ToggleUpgradeBarAndColour';
|
||||||
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
import ToggleUpgradeBarFixedPos from '../Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||||
|
import ToggleUpgradeSectionsAlwaysExpanded from '../Config/Toggles/ToggleUpgradeSectionsAlwaysExpanded';
|
||||||
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
import ToggleWrinklerButtons from '../Config/Toggles/ToggleWrinklerButtons';
|
||||||
import { CMOptions } from '../Config/VariablesAndData';
|
import { CMOptions } from '../Config/VariablesAndData';
|
||||||
import UpdateBuildings from '../Disp/BuildingsUpgrades/Buildings';
|
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',
|
'Calculate times and average Cookies Per Second with (only the single non-shiny fattest) wrinklers',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
SimDoSims = true; // eslint-disable-line no-unused-vars
|
SimDoSims = true; // eslint-disable-line no-unused-vars
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -87,7 +88,7 @@ const Config = {
|
|||||||
],
|
],
|
||||||
'Change how long numbers are formatted',
|
'Change how long numbers are formatted',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -97,7 +98,7 @@ const Config = {
|
|||||||
['1 decimals', '2 decimals', '3 decimals'],
|
['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"`,
|
`Set the number of decimals used when applicable. This only works with Cookie Monster scales and not with "Game's Setting Scale"`,
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -107,7 +108,7 @@ const Config = {
|
|||||||
['. for decimals (standard)', '. for thousands'],
|
['. for decimals (standard)', '. for thousands'],
|
||||||
'Set the separator used for decimals and thousands',
|
'Set the separator used for decimals and thousands',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
RefreshScale();
|
RefreshScale();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -132,7 +133,7 @@ const Config = {
|
|||||||
['Detailed time OFF', 'Detailed time ON'],
|
['Detailed time OFF', 'Detailed time ON'],
|
||||||
'Change how time is displayed in certain statistics and tooltips',
|
'Change how time is displayed in certain statistics and tooltips',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleDetailedTime();
|
ToggleDetailedTime();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -151,7 +152,7 @@ const Config = {
|
|||||||
['Building colours OFF', 'Building colours ON'],
|
['Building colours OFF', 'Building colours ON'],
|
||||||
'Colour code buildings',
|
'Colour code buildings',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -242,7 +243,7 @@ const Config = {
|
|||||||
['Bottom bar OFF', 'Bottom bar ON'],
|
['Bottom bar OFF', 'Bottom bar ON'],
|
||||||
'Building information',
|
'Building information',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleBotBar();
|
ToggleBotBar();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -252,7 +253,7 @@ const Config = {
|
|||||||
['Timer bar OFF', 'Timer bar ON'],
|
['Timer bar OFF', 'Timer bar ON'],
|
||||||
'Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
'Bar with timers for golden cookie, season popup, Frenzy (Normal, Clot, Elder), Click Frenzy',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleTimerBar();
|
ToggleTimerBar();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -262,32 +263,24 @@ const Config = {
|
|||||||
['Timer bar position (top left)', 'Timer bar position (bottom)'],
|
['Timer bar position (top left)', 'Timer bar position (bottom)'],
|
||||||
'Placement of the timer bar',
|
'Placement of the timer bar',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
ToggleTimerBarPos();
|
ToggleTimerBarPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
TimerBarOverlay: new SettingStandard(
|
TimerBarOverlay: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'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',
|
'Overlay on timers displaying seconds and/or percentage left',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
UpBarColour: new SettingStandard(
|
UpBarColour: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'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',
|
'Colour code upgrades and optionally add a counter bar',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
ToggleUpgradeBarAndColour();
|
ToggleUpgradeBarAndColour();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -297,7 +290,7 @@ const Config = {
|
|||||||
['Upgrade bar fixed position OFF', 'Upgrade bar fixed position ON'],
|
['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',
|
'Lock the upgrade bar at top of the screen to prevent it from moving ofscreen when scrolling',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleUpgradeBarFixedPos();
|
ToggleUpgradeBarFixedPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -311,7 +304,7 @@ const Config = {
|
|||||||
],
|
],
|
||||||
'Sort the display of buildings in either default order or by PP',
|
'Sort the display of buildings in either default order or by PP',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
UpdateBuildings();
|
UpdateBuildings();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -321,10 +314,20 @@ const Config = {
|
|||||||
['Sort upgrades: default', 'Sort upgrades: PP'],
|
['Sort upgrades: default', 'Sort upgrades: PP'],
|
||||||
'Sort the display of upgrades in either default order or by PP',
|
'Sort the display of upgrades in either default order or by PP',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
UpdateUpgrades();
|
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(
|
DragonAuraInfo: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'BarsDisplay',
|
'BarsDisplay',
|
||||||
@@ -345,7 +348,7 @@ const Config = {
|
|||||||
['Golden cookie timer OFF', 'Golden cookie timer ON'],
|
['Golden cookie timer OFF', 'Golden cookie timer ON'],
|
||||||
'A timer on the golden cookie when it has been spawned',
|
'A timer on the golden cookie when it has been spawned',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleGCTimer();
|
ToggleGCTimer();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -355,7 +358,7 @@ const Config = {
|
|||||||
['Favicon OFF', 'Favicon ON'],
|
['Favicon OFF', 'Favicon ON'],
|
||||||
'Update favicon with golden/wrath cookie',
|
'Update favicon with golden/wrath cookie',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
UpdateFavicon();
|
UpdateFavicon();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -365,7 +368,7 @@ const Config = {
|
|||||||
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
|
['Extra wrinkler buttons OFF', 'Extra wrinkler buttons ON'],
|
||||||
'Show buttons for popping wrinklers at bottom of cookie section',
|
'Show buttons for popping wrinklers at bottom of cookie section',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleWrinklerButtons();
|
ToggleWrinklerButtons();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -375,7 +378,7 @@ const Config = {
|
|||||||
['Hide buildings/upgrades button OFF', 'Hide buildings/upgrades button ON'],
|
['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',
|
'Show buttons for hiding and showing the buildings and upgrades sections in the right column',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
ToggleSectionHideButtons();
|
ToggleSectionHideButtons();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -384,10 +387,7 @@ const Config = {
|
|||||||
TooltipBuildUpgrade: new SettingStandard(
|
TooltipBuildUpgrade: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'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',
|
'Extra information in building/upgrade tooltips',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@@ -447,10 +447,7 @@ const Config = {
|
|||||||
ToolWarnBon: new SettingStandard(
|
ToolWarnBon: new SettingStandard(
|
||||||
'bool',
|
'bool',
|
||||||
'Tooltip',
|
'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',
|
'Calculate the warning with or without the bonus CPS you get from buying',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
@@ -460,7 +457,7 @@ const Config = {
|
|||||||
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
|
['Tooltip warning position (left)', 'Tooltip warning position (bottom)'],
|
||||||
'Placement of the warning boxes',
|
'Placement of the warning boxes',
|
||||||
false,
|
false,
|
||||||
function () {
|
() => {
|
||||||
ToggleToolWarnPos();
|
ToggleToolWarnPos();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -573,7 +570,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when golden cookie spawns',
|
'Create a notification when golden cookie spawns',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.GCNotification);
|
CheckNotificationPermissions(CMOptions.GCNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -609,7 +606,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when fortune cookie is on the ticker',
|
'Create a notification when fortune cookie is on the ticker',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
CheckNotificationPermissions(CMOptions.FortuneNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -645,7 +642,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification on season popup',
|
'Create a notification on season popup',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.SeaNotification);
|
CheckNotificationPermissions(CMOptions.SeaNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -707,7 +704,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when magic reaches maximum',
|
'Create a notification when magic reaches maximum',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.MagicNotification);
|
CheckNotificationPermissions(CMOptions.MagicNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -743,7 +740,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when a wrinkler appears',
|
'Create a notification when a wrinkler appears',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
CheckNotificationPermissions(CMOptions.WrinklerNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -779,7 +776,7 @@ const Config = {
|
|||||||
['Notification OFF', 'Notification ON'],
|
['Notification OFF', 'Notification ON'],
|
||||||
'Create a notification when the maximum amount of wrinklers has appeared',
|
'Create a notification when the maximum amount of wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
function () {
|
() => {
|
||||||
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
CheckNotificationPermissions(CMOptions.WrinklerMaxNotification);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -802,12 +799,7 @@ const Config = {
|
|||||||
'Play a sound when the maximum amount of wrinklers has appeared',
|
'Play a sound when the maximum amount of wrinklers has appeared',
|
||||||
true,
|
true,
|
||||||
),
|
),
|
||||||
WrinklerMaxVolume: new SettingVolume(
|
WrinklerMaxVolume: new SettingVolume('vol', 'NotificationWrinkMax', [], 'Volume'),
|
||||||
'vol',
|
|
||||||
'NotificationWrinkMax',
|
|
||||||
[],
|
|
||||||
'Volume',
|
|
||||||
),
|
|
||||||
WrinklerMaxSoundURL: new SettingStandard(
|
WrinklerMaxSoundURL: new SettingStandard(
|
||||||
'url',
|
'url',
|
||||||
'NotificationWrinkMax',
|
'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",
|
"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,
|
true,
|
||||||
function () {
|
() => {
|
||||||
Game.UpdateMenu();
|
Game.UpdateMenu();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ const ConfigDefault: {
|
|||||||
UpgradeBarFixedPos: 1,
|
UpgradeBarFixedPos: 1,
|
||||||
SortBuildings: 0,
|
SortBuildings: 0,
|
||||||
SortUpgrades: 0,
|
SortUpgrades: 0,
|
||||||
|
UpgradesNeverCollapse: 0,
|
||||||
DragonAuraInfo: 1,
|
DragonAuraInfo: 1,
|
||||||
GrimoireBar: 1,
|
GrimoireBar: 1,
|
||||||
GCTimer: 1,
|
GCTimer: 1,
|
||||||
|
|||||||
@@ -70,16 +70,14 @@ export default function UpdateBuildings() {
|
|||||||
return o;
|
return o;
|
||||||
});
|
});
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
||||||
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
|
||||||
ColoursOrdering.indexOf(b.color)
|
ColoursOrdering.indexOf(b.color)
|
||||||
? 1
|
? 1
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
? -1
|
? -1
|
||||||
: a.pp < b.pp
|
: a.pp < b.pp
|
||||||
? -1
|
? -1
|
||||||
: 0;
|
: 0);
|
||||||
});
|
|
||||||
} else if (CMOptions.SortBuildings === 2) {
|
} else if (CMOptions.SortBuildings === 2) {
|
||||||
arr = Object.keys(target).map((k) => {
|
arr = Object.keys(target).map((k) => {
|
||||||
const o = target[k];
|
const o = target[k];
|
||||||
@@ -88,16 +86,14 @@ export default function UpdateBuildings() {
|
|||||||
return o;
|
return o;
|
||||||
});
|
});
|
||||||
|
|
||||||
arr.sort(function (a, b) {
|
arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
||||||
return ColoursOrdering.indexOf(a.color) > // eslint-disable-line no-nested-ternary
|
|
||||||
ColoursOrdering.indexOf(b.color)
|
ColoursOrdering.indexOf(b.color)
|
||||||
? 1
|
? 1
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
? -1
|
? -1
|
||||||
: a.pp < b.pp
|
: a.pp < b.pp
|
||||||
? -1
|
? -1
|
||||||
: 0;
|
: 0);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let x = 0; x < arr.length; x++) {
|
for (let x = 0; x < arr.length; x++) {
|
||||||
|
|||||||
@@ -79,15 +79,13 @@ export default function UpdateUpgrades() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CMOptions.SortUpgrades) {
|
if (CMOptions.SortUpgrades) {
|
||||||
arr.sort(function (a, b) {
|
arr.sort((a, b) => ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
return ColoursOrdering.indexOf(a.color) > ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
|
||||||
? 1
|
? 1
|
||||||
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
: ColoursOrdering.indexOf(a.color) < ColoursOrdering.indexOf(b.color) // eslint-disable-line no-nested-ternary
|
||||||
? -1
|
? -1
|
||||||
: a.pp < b.pp
|
: a.pp < b.pp
|
||||||
? -1
|
? -1
|
||||||
: 0;
|
: 0);
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
arr.sort((a, b) => a.price - b.price);
|
arr.sort((a, b) => a.price - b.price);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ export default function CreateWrinklerButtons() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('wb', 'PopAll'),
|
||||||
return CreateTooltip('wb', 'PopAll');
|
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
@@ -43,9 +41,7 @@ export default function CreateWrinklerButtons() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('wb', 'PopFattest'),
|
||||||
return CreateTooltip('wb', 'PopFattest');
|
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
|
|||||||
@@ -68,13 +68,11 @@ export default function AddMissingAchievements() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => (function () {
|
||||||
return (function () {
|
|
||||||
return CrateTooltipLockedAchievements(
|
return CrateTooltipLockedAchievements(
|
||||||
Game.AchievementsById[id],
|
Game.AchievementsById[id],
|
||||||
);
|
);
|
||||||
})();
|
})(),
|
||||||
},
|
|
||||||
'top',
|
'top',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
|
|||||||
@@ -21,17 +21,17 @@ export default function Flash(mode, config, forced) {
|
|||||||
l('CMFlashScreen').style.opacity = '0.5';
|
l('CMFlashScreen').style.opacity = '0.5';
|
||||||
if (mode === 3) {
|
if (mode === 3) {
|
||||||
l('CMFlashScreen').style.display = 'inline';
|
l('CMFlashScreen').style.display = 'inline';
|
||||||
setTimeout(function () {
|
setTimeout(() => {
|
||||||
Flash(2, config, true);
|
Flash(2, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
setTimeout(() => {
|
||||||
Flash(0, config, true);
|
Flash(0, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
}
|
}
|
||||||
} else if (mode === 2) {
|
} else if (mode === 2) {
|
||||||
l('CMFlashScreen').style.opacity = '1';
|
l('CMFlashScreen').style.opacity = '1';
|
||||||
setTimeout(function () {
|
setTimeout(() => {
|
||||||
Flash(1, config, true);
|
Flash(1, config, true);
|
||||||
}, 1000 / Game.fps);
|
}, 1000 / Game.fps);
|
||||||
} else if (mode === 0) l('CMFlashScreen').style.display = 'none';
|
} else if (mode === 0) l('CMFlashScreen').style.display = 'none';
|
||||||
|
|||||||
@@ -54,13 +54,7 @@ export function TooltipCreateWarningSection() {
|
|||||||
TooltipWarn.style.bottom = 'auto';
|
TooltipWarn.style.bottom = 'auto';
|
||||||
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
TooltipWarn.id = 'CMDispTooltipWarningParent';
|
||||||
|
|
||||||
const create = function (
|
const create = function (boxId, color, labelTextFront, labelTextBack, deficitId) {
|
||||||
boxId,
|
|
||||||
color,
|
|
||||||
labelTextFront,
|
|
||||||
labelTextBack,
|
|
||||||
deficitId,
|
|
||||||
) {
|
|
||||||
const box = document.createElement('div');
|
const box = document.createElement('div');
|
||||||
box.id = boxId;
|
box.id = boxId;
|
||||||
box.style.display = 'none';
|
box.style.display = 'none';
|
||||||
@@ -182,18 +176,14 @@ export function TooltipCreateCalculationSection(tooltip) {
|
|||||||
tooltip.appendChild(time);
|
tooltip.appendChild(time);
|
||||||
|
|
||||||
if (TooltipType === 'b') {
|
if (TooltipType === 'b') {
|
||||||
tooltip.appendChild(
|
tooltip.appendChild(TooltipCreateHeader('Production left till next achievement'));
|
||||||
TooltipCreateHeader('Production left till next achievement'),
|
|
||||||
);
|
|
||||||
tooltip.lastChild.id = 'CMTooltipProductionLeftHeader'; // eslint-disable-line no-param-reassign
|
tooltip.lastChild.id = 'CMTooltipProductionLeftHeader'; // eslint-disable-line no-param-reassign
|
||||||
const production = document.createElement('div');
|
const production = document.createElement('div');
|
||||||
production.id = 'CMTooltipProductionLeft';
|
production.id = 'CMTooltipProductionLeft';
|
||||||
tooltip.appendChild(production);
|
tooltip.appendChild(production);
|
||||||
}
|
}
|
||||||
if (TooltipType === 'b') {
|
if (TooltipType === 'b') {
|
||||||
tooltip.appendChild(
|
tooltip.appendChild(TooltipCreateHeader('Buildings (price / PP) left till next achievement'));
|
||||||
TooltipCreateHeader('Buildings (price / PP) left till next achievement'),
|
|
||||||
);
|
|
||||||
tooltip.lastChild.id = 'CMTooltipNextAchievementHeader'; // eslint-disable-line no-param-reassign
|
tooltip.lastChild.id = 'CMTooltipNextAchievementHeader'; // eslint-disable-line no-param-reassign
|
||||||
const production = document.createElement('div');
|
const production = document.createElement('div');
|
||||||
production.id = 'CMTooltipNextAchievement';
|
production.id = 'CMTooltipNextAchievement';
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ export default function ReplaceTooltipGrimoire() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('g', `${i}`),
|
||||||
return CreateTooltip('g', `${i}`);
|
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
|
|||||||
@@ -17,9 +17,7 @@ export default function ReplaceTooltipUpgrade() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('u', `${i}`),
|
||||||
return CreateTooltip('u', `${i}`);
|
|
||||||
},
|
|
||||||
'store',
|
'store',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ function ReplaceTooltipBuild() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('b', `${i}`),
|
||||||
return CreateTooltip('b', `${i}`);
|
|
||||||
},
|
|
||||||
'store',
|
'store',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
@@ -42,9 +40,7 @@ function ReplaceTooltipLump() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('s', 'Lump'),
|
||||||
return CreateTooltip('s', 'Lump');
|
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
@@ -61,9 +57,7 @@ function ReplaceTooltipGarden() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('ha', 'HarvestAllButton'),
|
||||||
return CreateTooltip('ha', 'HarvestAllButton');
|
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
@@ -75,9 +69,7 @@ function ReplaceTooltipGarden() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]),
|
||||||
return CreateTooltip('p', [`${coords[0]}`, `${coords[2]}`]);
|
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
@@ -93,9 +85,7 @@ function ReplaceTooltipPantheon() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('pag', i),
|
||||||
return CreateTooltip('pag', i);
|
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
@@ -106,12 +96,10 @@ function ReplaceTooltipPantheon() {
|
|||||||
Game.tooltip.dynamic = 1;
|
Game.tooltip.dynamic = 1;
|
||||||
Game.tooltip.draw(
|
Game.tooltip.draw(
|
||||||
this,
|
this,
|
||||||
function () {
|
() => CreateTooltip('pas', [
|
||||||
return CreateTooltip('pas', [
|
|
||||||
i,
|
i,
|
||||||
Game.Objects.Temple.minigame.slot[i],
|
Game.Objects.Temple.minigame.slot[i],
|
||||||
]);
|
]),
|
||||||
},
|
|
||||||
'this',
|
'this',
|
||||||
);
|
);
|
||||||
Game.tooltip.wobble();
|
Game.tooltip.wobble();
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export default function ReplaceNative() {
|
|||||||
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
|
l('bigCookie').removeEventListener('click', Game.ClickCookie, false);
|
||||||
l('bigCookie').addEventListener(
|
l('bigCookie').addEventListener(
|
||||||
'click',
|
'click',
|
||||||
function () {
|
() => {
|
||||||
FixMouseY(Game.ClickCookie);
|
FixMouseY(Game.ClickCookie);
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import CacheDragonAuras from '../../Cache/Dragon/CacheDragonAuras';
|
import CacheDragonAuras from '../../Cache/Dragon/CacheDragonAuras';
|
||||||
import {
|
import { CacheDragonAura, CacheDragonAura2 } from '../../Cache/VariablesAndData';
|
||||||
CacheDragonAura,
|
|
||||||
CacheDragonAura2,
|
|
||||||
} from '../../Cache/VariablesAndData';
|
|
||||||
import { CreateBotBarBuildingColumn } from '../../Disp/InfoBars/CreateDOMElements';
|
import { CreateBotBarBuildingColumn } from '../../Disp/InfoBars/CreateDOMElements';
|
||||||
import InitAchievement from '../InitializeData/InitAchievement';
|
import InitAchievement from '../InitializeData/InitAchievement';
|
||||||
import InitialBuildingData from '../InitializeData/InitialBuildingData';
|
import InitialBuildingData from '../InitializeData/InitialBuildingData';
|
||||||
|
|||||||
@@ -5,28 +5,28 @@ import { l, Game } from '../../GlobalsForTesting';
|
|||||||
import ToggleBotBar from '../../../src/Config/Toggles/ToggleBotBar';
|
import ToggleBotBar from '../../../src/Config/Toggles/ToggleBotBar';
|
||||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||||
|
|
||||||
describe('ToggleBotBar', function () {
|
describe('ToggleBotBar', () => {
|
||||||
global.l = l;
|
global.l = l;
|
||||||
global.Game = Game;
|
global.Game = Game;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
ToggleBotBar();
|
ToggleBotBar();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('BotBar = 0', function () {
|
describe('BotBar = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.BotBar = 0;
|
CMOptions.BotBar = 0;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMBotBar.style.display, 'none'); // eslint-disable-line no-undef
|
assert.equal(domids.CMBotBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('BotBar = 1', function () {
|
describe('BotBar = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.BotBar = 1;
|
CMOptions.BotBar = 1;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMBotBar.style.display, ''); // eslint-disable-line no-undef
|
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 ToggleDetailedTime from '../../../src/Config/Toggles/ToggleDetailedTime';
|
||||||
import { BackupFunctions } from '../../../src/Main/VariablesAndData';
|
import { BackupFunctions } from '../../../src/Main/VariablesAndData';
|
||||||
|
|
||||||
describe('ToggleDetailedTime', function () {
|
describe('ToggleDetailedTime', () => {
|
||||||
global.Game = Game;
|
global.Game = Game;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
ToggleDetailedTime();
|
ToggleDetailedTime();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('DetailedTime = 0', function () {
|
describe('DetailedTime = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.DetailedTime = 0;
|
CMOptions.DetailedTime = 0;
|
||||||
BackupFunctions.sayTime = 'BackupFunctions.sayTime';
|
BackupFunctions.sayTime = 'BackupFunctions.sayTime';
|
||||||
});
|
});
|
||||||
it('Set correct time function', function () {
|
it('Set correct time function', () => {
|
||||||
assert.equal(Game.sayTime, 'BackupFunctions.sayTime');
|
assert.equal(Game.sayTime, 'BackupFunctions.sayTime');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('DetailedTime = 1', function () {
|
describe('DetailedTime = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.DetailedTime = 1;
|
CMOptions.DetailedTime = 1;
|
||||||
});
|
});
|
||||||
it('Set correct time function', function () {
|
it('Set correct time function', () => {
|
||||||
assert.equal(Game.sayTime.name, 'CMSayTime');
|
assert.equal(Game.sayTime.name, 'CMSayTime');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import { assert } from 'chai';
|
|||||||
import ToggleFavouriteSetting from '../../../src/Config/Toggles/ToggleFavourites';
|
import ToggleFavouriteSetting from '../../../src/Config/Toggles/ToggleFavourites';
|
||||||
import { FavouriteSettings } from '../../../src/Disp/VariablesAndData';
|
import { FavouriteSettings } from '../../../src/Disp/VariablesAndData';
|
||||||
|
|
||||||
describe('ToggleFavouriteSetting', function () {
|
describe('ToggleFavouriteSetting', () => {
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
});
|
});
|
||||||
// TODO: Can't write test for checking existing config due to Babel/Typescript problem
|
// TODO: Can't write test for checking existing config due to Babel/Typescript problem
|
||||||
it('New config', function () {
|
it('New config', () => {
|
||||||
FavouriteSettings.push('TestConfig');
|
FavouriteSettings.push('TestConfig');
|
||||||
ToggleFavouriteSetting('TestConfig2');
|
ToggleFavouriteSetting('TestConfig2');
|
||||||
assert.deepEqual(FavouriteSettings, ['TestConfig', 'TestConfig2']);
|
assert.deepEqual(FavouriteSettings, ['TestConfig', 'TestConfig2']);
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import ToggleGCTimer from '../../../src/Config/Toggles/ToggleGCTimer';
|
|||||||
import { GCTimers } from '../../../src/Disp/VariablesAndData';
|
import { GCTimers } from '../../../src/Disp/VariablesAndData';
|
||||||
import { CacheGoldenShimmersByID } from '../../../src/Cache/VariablesAndData';
|
import { CacheGoldenShimmersByID } from '../../../src/Cache/VariablesAndData';
|
||||||
|
|
||||||
describe('ToggleGCTimer', function () {
|
describe('ToggleGCTimer', () => {
|
||||||
global.l = l;
|
global.l = l;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
GCTimers[0] = { style: {} };
|
GCTimers[0] = { style: {} };
|
||||||
GCTimers[1] = { style: {} };
|
GCTimers[1] = { style: {} };
|
||||||
@@ -23,20 +23,20 @@ describe('ToggleGCTimer', function () {
|
|||||||
ToggleGCTimer();
|
ToggleGCTimer();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('GCTimer = 0', function () {
|
describe('GCTimer = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.GCTimer = 0;
|
CMOptions.GCTimer = 0;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(GCTimers[0].style.display, 'none');
|
assert.equal(GCTimers[0].style.display, 'none');
|
||||||
assert.equal(GCTimers[1].style.display, 'none');
|
assert.equal(GCTimers[1].style.display, 'none');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('GCTimer = 1', function () {
|
describe('GCTimer = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.GCTimer = 1;
|
CMOptions.GCTimer = 1;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(GCTimers[0].style.display, 'block');
|
assert.equal(GCTimers[0].style.display, 'block');
|
||||||
assert.equal(GCTimers[0].style.left, 'Test00');
|
assert.equal(GCTimers[0].style.left, 'Test00');
|
||||||
assert.equal(GCTimers[0].style.top, 'Test01');
|
assert.equal(GCTimers[0].style.top, 'Test01');
|
||||||
|
|||||||
@@ -5,27 +5,27 @@ import { l } from '../../GlobalsForTesting';
|
|||||||
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
import { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||||
import ToggleSectionHideButtons from '../../../src/Config/Toggles/ToggleSectionHideButtons';
|
import ToggleSectionHideButtons from '../../../src/Config/Toggles/ToggleSectionHideButtons';
|
||||||
|
|
||||||
describe('ToggleSectionHideButtons', function () {
|
describe('ToggleSectionHideButtons', () => {
|
||||||
global.l = l;
|
global.l = l;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
ToggleSectionHideButtons();
|
ToggleSectionHideButtons();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('HideSectionsButtons = 0', function () {
|
describe('HideSectionsButtons = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.HideSectionsButtons = 0;
|
CMOptions.HideSectionsButtons = 0;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMSectionHidButtons.style.display, 'none'); // eslint-disable-line no-undef
|
assert.equal(domids.CMSectionHidButtons.style.display, 'none'); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('HideSectionsButtons = 1', function () {
|
describe('HideSectionsButtons = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.HideSectionsButtons = 1;
|
CMOptions.HideSectionsButtons = 1;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMSectionHidButtons.style.display, ''); // eslint-disable-line no-undef
|
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 { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||||
import ToggleToolWarnPos from '../../../src/Config/Toggles/ToggleToolWarnPos';
|
import ToggleToolWarnPos from '../../../src/Config/Toggles/ToggleToolWarnPos';
|
||||||
|
|
||||||
describe('ToggleToolWarnPos', function () {
|
describe('ToggleToolWarnPos', () => {
|
||||||
global.l = l;
|
global.l = l;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
ToggleToolWarnPos();
|
ToggleToolWarnPos();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('ToolWarnPos = 0', function () {
|
describe('ToolWarnPos = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.ToolWarnPos = 0;
|
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.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.margin, '4px -4px'); // eslint-disable-line no-undef
|
||||||
assert.equal(domids.CMDispTooltipWarningParent.style.padding, '3px 4px'); // eslint-disable-line no-undef
|
assert.equal(domids.CMDispTooltipWarningParent.style.padding, '3px 4px'); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('ToolWarnPos = 1', function () {
|
describe('ToolWarnPos = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.ToolWarnPos = 1;
|
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.right, 'auto'); // eslint-disable-line no-undef
|
||||||
assert.equal(domids.CMDispTooltipWarningParent.style.margin, '4px'); // 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
|
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 { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||||
import ToggleUpgradeBarAndColor from '../../../src/Config/Toggles/ToggleUpgradeBarAndColour';
|
import ToggleUpgradeBarAndColor from '../../../src/Config/Toggles/ToggleUpgradeBarAndColour';
|
||||||
|
|
||||||
describe('ToggleUpgradeBarAndColor', function () {
|
describe('ToggleUpgradeBarAndColor', () => {
|
||||||
global.l = l;
|
global.l = l;
|
||||||
global.Game = Game;
|
global.Game = Game;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
ToggleUpgradeBarAndColor();
|
ToggleUpgradeBarAndColor();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('UpBarColor = 0', function () {
|
describe('UpBarColor = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.UpBarColor = 0;
|
CMOptions.UpBarColor = 0;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('UpBarColor = 1', function () {
|
describe('UpBarColor = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.UpBarColor = 1;
|
CMOptions.UpBarColor = 1;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMUpgradeBar.style.display, ''); // eslint-disable-line no-undef
|
assert.equal(domids.CMUpgradeBar.style.display, ''); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('UpBarColor = 2', function () {
|
describe('UpBarColor = 2', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.UpBarColor = 2;
|
CMOptions.UpBarColor = 2;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMUpgradeBar.style.display, 'none'); // eslint-disable-line no-undef
|
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 { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||||
import ToggleUpgradeBarFixedPos from '../../../src/Config/Toggles/ToggleUpgradeBarFixedPos';
|
import ToggleUpgradeBarFixedPos from '../../../src/Config/Toggles/ToggleUpgradeBarFixedPos';
|
||||||
|
|
||||||
describe('ToggleUpgradeBarFixedPos', function () {
|
describe('ToggleUpgradeBarFixedPos', () => {
|
||||||
global.l = l;
|
global.l = l;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
ToggleUpgradeBarFixedPos();
|
ToggleUpgradeBarFixedPos();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('UpgradeBarFixedPos = 0', function () {
|
describe('UpgradeBarFixedPos = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.UpgradeBarFixedPos = 0;
|
CMOptions.UpgradeBarFixedPos = 0;
|
||||||
});
|
});
|
||||||
it('Toggle style correctly', function () {
|
it('Toggle style correctly', () => {
|
||||||
assert.equal(domids.CMUpgradeBar.style.position, ''); // eslint-disable-line no-undef
|
assert.equal(domids.CMUpgradeBar.style.position, ''); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('UpgradeBarFixedPos = 1', function () {
|
describe('UpgradeBarFixedPos = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.UpgradeBarFixedPos = 1;
|
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.position, 'sticky'); // eslint-disable-line no-undef
|
||||||
assert.equal(domids.CMUpgradeBar.style.top, '0px'); // 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 { CMOptions } from '../../../src/Config/VariablesAndData';
|
||||||
import ToggleWrinklerButtons from '../../../src/Config/Toggles/ToggleWrinklerButtons';
|
import ToggleWrinklerButtons from '../../../src/Config/Toggles/ToggleWrinklerButtons';
|
||||||
|
|
||||||
describe('ToggleWrinklerButtons', function () {
|
describe('ToggleWrinklerButtons', () => {
|
||||||
global.l = l;
|
global.l = l;
|
||||||
global.Game = Game;
|
global.Game = Game;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(() => {
|
||||||
global.domids = {};
|
global.domids = {};
|
||||||
ToggleWrinklerButtons();
|
ToggleWrinklerButtons();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('WrinklerButtons = 0', function () {
|
describe('WrinklerButtons = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.WrinklerButtons = 0;
|
CMOptions.WrinklerButtons = 0;
|
||||||
});
|
});
|
||||||
describe('Game.elderWrath = 0', function () {
|
describe('Game.elderWrath = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
Game.elderWrath = 0;
|
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.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||||
assert.equal(domids.PopFattestWrinklerButton.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 () {
|
describe('Game.elderWrath = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
Game.elderWrath = 1;
|
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.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||||
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
assert.equal(domids.PopFattestWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('WrinklerButtons = 1', function () {
|
describe('WrinklerButtons = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.WrinklerButtons = 1;
|
CMOptions.WrinklerButtons = 1;
|
||||||
});
|
});
|
||||||
describe('Game.elderWrath = 0', function () {
|
describe('Game.elderWrath = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
Game.elderWrath = 0;
|
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.PopAllNormalWrinklerButton.style.display, 'none'); // eslint-disable-line no-undef
|
||||||
assert.equal(domids.PopFattestWrinklerButton.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 () {
|
describe('Game.elderWrath = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
Game.elderWrath = 1;
|
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.PopAllNormalWrinklerButton.style.display, ''); // eslint-disable-line no-undef
|
||||||
assert.equal(domids.PopFattestWrinklerButton.style.display, ''); // eslint-disable-line no-undef
|
assert.equal(domids.PopFattestWrinklerButton.style.display, ''); // eslint-disable-line no-undef
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,102 +4,102 @@ import { assert } from 'chai';
|
|||||||
import FormatTime from '../../src/Disp/BeautifyAndFormatting/FormatTime';
|
import FormatTime from '../../src/Disp/BeautifyAndFormatting/FormatTime';
|
||||||
import { CMOptions } from '../../src/Config/VariablesAndData';
|
import { CMOptions } from '../../src/Config/VariablesAndData';
|
||||||
|
|
||||||
describe('FormatTime', function () {
|
describe('FormatTime', () => {
|
||||||
it('Format when time is Infinity', function () {
|
it('Format when time is Infinity', () => {
|
||||||
assert.equal(FormatTime(Infinity, 0), 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');
|
assert.equal(FormatTime(-1, 0), 'Negative time period');
|
||||||
});
|
});
|
||||||
describe('TimeFormat = 0', function () {
|
describe('TimeFormat = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.TimeFormat = 0;
|
CMOptions.TimeFormat = 0;
|
||||||
});
|
});
|
||||||
describe('Longformat = 0', function () {
|
describe('Longformat = 0', () => {
|
||||||
it('Format when time is 0', function () {
|
it('Format when time is 0', () => {
|
||||||
assert.equal(FormatTime(0, 0), '0s');
|
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');
|
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');
|
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');
|
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');
|
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');
|
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');
|
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');
|
assert.equal(FormatTime(3155760001, 0), '>9000d');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('Longformat = 1', function () {
|
describe('Longformat = 1', () => {
|
||||||
it('Format when time is 0', function () {
|
it('Format when time is 0', () => {
|
||||||
assert.equal(FormatTime(0, 1), '0 seconds');
|
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');
|
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');
|
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');
|
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(
|
assert.equal(
|
||||||
FormatTime(86401, 1),
|
FormatTime(86401, 1),
|
||||||
'1 day, 0 hours, 0 minutes, 1 second',
|
'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(
|
assert.equal(
|
||||||
FormatTime(31536001, 1),
|
FormatTime(31536001, 1),
|
||||||
'1 year, 0 days, 0 hours, 0 minutes, 1 second',
|
'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!');
|
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!');
|
assert.equal(FormatTime(3155760001, 1), 'Over 9000 days!');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('TimeFormat = 1', function () {
|
describe('TimeFormat = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.TimeFormat = 1;
|
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');
|
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');
|
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');
|
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');
|
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');
|
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');
|
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');
|
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');
|
assert.equal(FormatTime(3155760001, 0), 'XX:XX:XX:XX:XX');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,41 +4,41 @@ import { expect } from 'chai';
|
|||||||
import GetTimeColour from '../../src/Disp/BeautifyAndFormatting/GetTimeColour';
|
import GetTimeColour from '../../src/Disp/BeautifyAndFormatting/GetTimeColour';
|
||||||
import { CMOptions } from '../../src/Config/VariablesAndData';
|
import { CMOptions } from '../../src/Config/VariablesAndData';
|
||||||
|
|
||||||
describe('GetTimeColour', function () {
|
describe('GetTimeColour', () => {
|
||||||
it('Format when time is less than 60', function () {
|
it('Format when time is less than 60', () => {
|
||||||
expect(GetTimeColour(59).color).to.deep.equal('Yellow');
|
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');
|
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');
|
expect(GetTimeColour(301).color).to.deep.equal('Red');
|
||||||
});
|
});
|
||||||
describe('TimeFormat = 0', function () {
|
describe('TimeFormat = 0', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.TimeFormat = 0;
|
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' });
|
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({
|
expect(GetTimeColour(-1)).to.deep.equal({
|
||||||
text: 'Done!',
|
text: 'Done!',
|
||||||
color: 'Green',
|
color: 'Green',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('TimeFormat = 1', function () {
|
describe('TimeFormat = 1', () => {
|
||||||
before(function () {
|
before(() => {
|
||||||
CMOptions.TimeFormat = 1;
|
CMOptions.TimeFormat = 1;
|
||||||
});
|
});
|
||||||
it('Format when time is 0', function () {
|
it('Format when time is 0', () => {
|
||||||
expect(GetTimeColour(0)).to.deep.equal({
|
expect(GetTimeColour(0)).to.deep.equal({
|
||||||
text: '00:00:00:00:00',
|
text: '00:00:00:00:00',
|
||||||
color: 'Green',
|
color: 'Green',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('Format when time is negative', function () {
|
it('Format when time is negative', () => {
|
||||||
expect(GetTimeColour(-1)).to.deep.equal({
|
expect(GetTimeColour(-1)).to.deep.equal({
|
||||||
text: '00:00:00:00:00',
|
text: '00:00:00:00:00',
|
||||||
color: 'Green',
|
color: 'Green',
|
||||||
|
|||||||
Reference in new issue
Block a user