Merge pull request #674 from DanielNoord/fix/hotfix
Create tooltip for wrinkler buttons #628
This commit is contained in:
7 files changed
+104
-49
No files matched your search
+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/CookieMonster.js"],"names":["__webpack_modules__","877","module","global","factory","exports","document","win","Error","window","this","BoxShadow","funcName","elm","jsc","jscolor","initialized","instances","readyQueue","register","addEventListener","pub","init","installBySelector","selector","rootNode","node","elms","querySelectorAll","matchClass","RegExp","lookupClass","i","length","dataOpts","m","undefined","type","toLowerCase","isColorAttrSupported","getDataAttr","className","match","targetElm","optsStr","console","warn","docsRef","opts","trim","parseOptionsStr","e","str","JSON","parse","eParse","looseJSON","Function","eEval","getInstances","inst","targetElement","push","createEl","tagName","el","createElement","setData","nodeOrSelector","sel","querySelector","isNode","val","Node","nodeType","nodeName","removeChildren","firstChild","removeChild","isTextInput","isButton","n","indexOf","isButtonEmpty","value","textContent","isPassiveEventSupported","supported","Object","defineProperty","get","removeEventListener","setAttribute","dataProp","obj","arguments","data","hasOwnProperty","prop","map","removeData","getData","setDefault","name","attrName","getAttribute","setDataAttr","_attachedGroupEvents","attachGroupEvent","groupName","evnt","func","detachGroupEvents","evt","preventDefault","returnValue","captureTarget","target","setCapture","_capturedTarget","releaseTarget","releaseCapture","triggerEvent","eventName","bubbles","cancelable","ev","Event","createEvent","initEvent","dispatchEvent","triggerInputEvent","eventKey","keys","9","13","27","code","keyCode","strList","replace","split","hasClass","classList","contains","addClass","classNames","add","removeClass","repl","remove","getCompStyle","getComputedStyle","currentStyle","setStyle","styles","important","reversible","priority","origStyle","setVal","style","setProperty","hexColor","r","g","b","Math","round","toString","substr","toUpperCase","hexaColor","a","rgbColor","rgbaColor","linearGradient","stdName","prefixes","helper","tryFunc","tryVal","background","getFuncName","Array","prototype","join","call","setBorderRadius","border-radius","setBoxShadow","box-shadow","getElementPos","relativeToViewport","x","y","rect","getBoundingClientRect","left","top","viewPos","getViewPos","getElementSize","offsetWidth","offsetHeight","getAbsPointerPos","changedTouches","clientX","clientY","getRelPointerPos","targetRect","srcElement","doc","documentElement","pageXOffset","scrollLeft","clientLeft","pageYOffset","scrollTop","clientTop","getViewSize","innerWidth","clientWidth","innerHeight","clientHeight","RGB_HSV","min","v","max","h","HSV_RGB","s","u","floor","parseColorString","ret","rgba","format","parseInt","charAt","mR","mG","mB","mA","par","re","parseFloat","parsePaletteValue","mixed","vals","isArray","colors","color","containsTranparentColor","isAlphaFormat","scaleCanvasForHighDPR","canvas","dpr","devicePixelRatio","width","height","getContext","scale","genColorPreviewCanvas","separatorPos","specWidth","scaleForHighDPR","sepW","previewSeparator","sqSize","chessboardSize","sqColor1","chessboardColor1","sqColor2","chessboardColor2","cWidth","cHeight","ctx","fillStyle","fillRect","start","clearRect","lineWidth","beginPath","strokeStyle","moveTo","lineTo","stroke","genColorPreviewGradient","position","params","right","apply","redrawPosition","picker","owner","tp","vp","thisObj","fixed","c","ts","vs","pd","getPickerDims","ps","borderW","borderH","l","smartPosition","pp","positionValue","contractShadow","_drawPosition","vShadow","shadowBlur","wrap","boxS","shadow","shadowColor","w","controlBorderWidth","sliderSpace","getControlPadding","sliderSize","getSliderChannel","hasAlphaChannel","pal","getPaletteDims","padding","closeButton","buttonHeight","pW","pH","contentW","contentH","paddedW","paddedH","borderWidth","palette","cols","rows","cellW","cellH","sampleCount","_palette","paletteCols","ceil","paletteSpacing","paletteHeight","pointerBorderWidth","pointerThickness","getPadYChannel","mode","triggerCallback","callback","error","triggerGlobal","eventNames","trigger","_pointerMoveEvent","mouse","touch","_pointerEndEvent","_pointerOrigin","onDocumentKeyUp","tryHide","onWindowResize","onWindowScroll","onParentScroll","onDocumentMouseDown","showOnClick","disabled","show","onControlPointerStart","onPickerTouchStart","controlName","pointerType","registerDragEvents","offset","onDocumentPointerMove","onDocumentPointerEnd","parent","frameElement","ofs","abs","rel","channels","fromHSVA","setPad","setSld","setASld","onPaletteSampleClick","currentTarget","_setFormat","getFormat","paletteSetsAlpha","_paletteHasTransparency","fromRGBA","hideOnPaletteClick","hide","ofsX","ofsY","pointerAbs","xVal","yVal","fmt","createPadCanvas","draw","hGrad","createLinearGradient","addColorStop","vGrad","createSliderGradient","color1","color2","grad","createASliderGradient","hShadow","blur","spread","inset","flags","leaveValue","leaveAlpha","leavePreviewLine truncated
|
{"version":3,"sources":["webpack://cookiemonster-mod/CookieMonster.js"],"names":["__webpack_modules__","877","module","global","factory","exports","document","win","Error","window","this","BoxShadow","funcName","elm","jsc","jscolor","initialized","instances","readyQueue","register","addEventListener","pub","init","installBySelector","selector","rootNode","node","elms","querySelectorAll","matchClass","RegExp","lookupClass","i","length","dataOpts","m","undefined","type","toLowerCase","isColorAttrSupported","getDataAttr","className","match","targetElm","optsStr","console","warn","docsRef","opts","trim","parseOptionsStr","e","str","JSON","parse","eParse","looseJSON","Function","eEval","getInstances","inst","targetElement","push","createEl","tagName","el","createElement","setData","nodeOrSelector","sel","querySelector","isNode","val","Node","nodeType","nodeName","removeChildren","firstChild","removeChild","isTextInput","isButton","n","indexOf","isButtonEmpty","value","textContent","isPassiveEventSupported","supported","Object","defineProperty","get","removeEventListener","setAttribute","dataProp","obj","arguments","data","hasOwnProperty","prop","map","removeData","getData","setDefault","name","attrName","getAttribute","setDataAttr","_attachedGroupEvents","attachGroupEvent","groupName","evnt","func","detachGroupEvents","evt","preventDefault","returnValue","captureTarget","target","setCapture","_capturedTarget","releaseTarget","releaseCapture","triggerEvent","eventName","bubbles","cancelable","ev","Event","createEvent","initEvent","dispatchEvent","triggerInputEvent","eventKey","keys","9","13","27","code","keyCode","strList","replace","split","hasClass","classList","contains","addClass","classNames","add","removeClass","repl","remove","getCompStyle","getComputedStyle","currentStyle","setStyle","styles","important","reversible","priority","origStyle","setVal","style","setProperty","hexColor","r","g","b","Math","round","toString","substr","toUpperCase","hexaColor","a","rgbColor","rgbaColor","linearGradient","stdName","prefixes","helper","tryFunc","tryVal","background","getFuncName","Array","prototype","join","call","setBorderRadius","border-radius","setBoxShadow","box-shadow","getElementPos","relativeToViewport","x","y","rect","getBoundingClientRect","left","top","viewPos","getViewPos","getElementSize","offsetWidth","offsetHeight","getAbsPointerPos","changedTouches","clientX","clientY","getRelPointerPos","targetRect","srcElement","doc","documentElement","pageXOffset","scrollLeft","clientLeft","pageYOffset","scrollTop","clientTop","getViewSize","innerWidth","clientWidth","innerHeight","clientHeight","RGB_HSV","min","v","max","h","HSV_RGB","s","u","floor","parseColorString","ret","rgba","format","parseInt","charAt","mR","mG","mB","mA","par","re","parseFloat","parsePaletteValue","mixed","vals","isArray","colors","color","containsTranparentColor","isAlphaFormat","scaleCanvasForHighDPR","canvas","dpr","devicePixelRatio","width","height","getContext","scale","genColorPreviewCanvas","separatorPos","specWidth","scaleForHighDPR","sepW","previewSeparator","sqSize","chessboardSize","sqColor1","chessboardColor1","sqColor2","chessboardColor2","cWidth","cHeight","ctx","fillStyle","fillRect","start","clearRect","lineWidth","beginPath","strokeStyle","moveTo","lineTo","stroke","genColorPreviewGradient","position","params","right","apply","redrawPosition","picker","owner","tp","vp","thisObj","fixed","c","ts","vs","pd","getPickerDims","ps","borderW","borderH","l","smartPosition","pp","positionValue","contractShadow","_drawPosition","vShadow","shadowBlur","wrap","boxS","shadow","shadowColor","w","controlBorderWidth","sliderSpace","getControlPadding","sliderSize","getSliderChannel","hasAlphaChannel","pal","getPaletteDims","padding","closeButton","buttonHeight","pW","pH","contentW","contentH","paddedW","paddedH","borderWidth","palette","cols","rows","cellW","cellH","sampleCount","_palette","paletteCols","ceil","paletteSpacing","paletteHeight","pointerBorderWidth","pointerThickness","getPadYChannel","mode","triggerCallback","callback","error","triggerGlobal","eventNames","trigger","_pointerMoveEvent","mouse","touch","_pointerEndEvent","_pointerOrigin","onDocumentKeyUp","tryHide","onWindowResize","onWindowScroll","onParentScroll","onDocumentMouseDown","showOnClick","disabled","show","onControlPointerStart","onPickerTouchStart","controlName","pointerType","registerDragEvents","offset","onDocumentPointerMove","onDocumentPointerEnd","parent","frameElement","ofs","abs","rel","channels","fromHSVA","setPad","setSld","setASld","onPaletteSampleClick","currentTarget","_setFormat","getFormat","paletteSetsAlpha","_paletteHasTransparency","fromRGBA","hideOnPaletteClick","hide","ofsX","ofsY","pointerAbs","xVal","yVal","fmt","createPadCanvas","draw","hGrad","createLinearGradient","addColorStop","vGrad","createSliderGradient","color1","color2","grad","createASliderGradient","hShadow","blur","spread","inset","flags","leaveValue","leaveAlpha","leavePreviewLine truncated
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import UpdateUpgrades from './BuildingsUpgrades/Upgrades';
|
|||||||
import { UpdateBotBar } from './InfoBars/BottomBar';
|
import { UpdateBotBar } from './InfoBars/BottomBar';
|
||||||
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
import { UpdateTimerBar } from './InfoBars/TimerBar';
|
||||||
import RefreshMenu from './MenuSections/Refreshmenu';
|
import RefreshMenu from './MenuSections/Refreshmenu';
|
||||||
import { UpdateTooltips } from './Tooltips/Tooltip';
|
import UpdateTooltips from './Tooltips/UpdateTooltips';
|
||||||
import {
|
import {
|
||||||
CheckWrinklerTooltip,
|
CheckWrinklerTooltip,
|
||||||
UpdateWrinklerTooltip,
|
UpdateWrinklerTooltip,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
|
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
|
||||||
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
|
||||||
|
import { CreateTooltip } from '../Tooltips/Tooltip';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
|
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
|
||||||
@@ -12,6 +13,20 @@ export default function CreateWrinklerButtons() {
|
|||||||
popAllA.onclick = function () {
|
popAllA.onclick = function () {
|
||||||
PopAllNormalWrinklers();
|
PopAllNormalWrinklers();
|
||||||
};
|
};
|
||||||
|
popAllA.onmouseout = function () {
|
||||||
|
Game.tooltip.shouldHide = 1;
|
||||||
|
};
|
||||||
|
popAllA.onmouseover = function () {
|
||||||
|
Game.tooltip.dynamic = 1;
|
||||||
|
Game.tooltip.draw(
|
||||||
|
this,
|
||||||
|
function () {
|
||||||
|
return CreateTooltip('wb', 'PopAll');
|
||||||
|
},
|
||||||
|
'this',
|
||||||
|
);
|
||||||
|
Game.tooltip.wobble();
|
||||||
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popAllA);
|
l('sectionLeftExtra').children[0].append(popAllA);
|
||||||
const popFattestA = document.createElement('a');
|
const popFattestA = document.createElement('a');
|
||||||
popFattestA.id = 'PopFattestWrinklerButton';
|
popFattestA.id = 'PopFattestWrinklerButton';
|
||||||
@@ -21,5 +36,19 @@ export default function CreateWrinklerButtons() {
|
|||||||
if (CacheWrinklersFattest[1] !== null)
|
if (CacheWrinklersFattest[1] !== null)
|
||||||
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
|
||||||
};
|
};
|
||||||
|
popFattestA.onmouseout = function () {
|
||||||
|
Game.tooltip.shouldHide = 1;
|
||||||
|
};
|
||||||
|
popFattestA.onmouseover = function () {
|
||||||
|
Game.tooltip.dynamic = 1;
|
||||||
|
Game.tooltip.draw(
|
||||||
|
this,
|
||||||
|
function () {
|
||||||
|
return CreateTooltip('wb', 'PopFattest');
|
||||||
|
},
|
||||||
|
'this',
|
||||||
|
);
|
||||||
|
Game.tooltip.wobble();
|
||||||
|
};
|
||||||
l('sectionLeftExtra').children[0].append(popFattestA);
|
l('sectionLeftExtra').children[0].append(popFattestA);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable no-unused-vars */
|
/* eslint-disable no-unused-vars */
|
||||||
import * as UpdateTooltip from './UpdateTooltips';
|
import UpdateTooltips, * as UpdateTooltip from './UpdateTooltips';
|
||||||
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
import { TooltipCreateTooltipBox } from './CreateTooltip';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
@@ -32,38 +32,6 @@ export function CreateSimpleTooltip(placeholder, text, minWidth) {
|
|||||||
Tooltip.appendChild(desc);
|
Tooltip.appendChild(desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This function updates the sections of the tooltips created by CookieMonster
|
|
||||||
*/
|
|
||||||
export function UpdateTooltips() {
|
|
||||||
CopyData();
|
|
||||||
if (l('tooltipAnchor').style.display !== 'none' && l('CMTooltipArea')) {
|
|
||||||
l('CMTooltipArea').innerHTML = '';
|
|
||||||
const tooltipBox = TooltipCreateTooltipBox();
|
|
||||||
l('CMTooltipArea').appendChild(tooltipBox);
|
|
||||||
|
|
||||||
if (TooltipType === 'b') {
|
|
||||||
UpdateTooltip.Building();
|
|
||||||
} else if (TooltipType === 'u') {
|
|
||||||
UpdateTooltip.Upgrade();
|
|
||||||
} else if (TooltipType === 's') {
|
|
||||||
UpdateTooltip.SugarLump();
|
|
||||||
} else if (TooltipType === 'g') {
|
|
||||||
UpdateTooltip.Grimoire();
|
|
||||||
} else if (TooltipType === 'p') {
|
|
||||||
UpdateTooltip.GardenPlots();
|
|
||||||
} else if (TooltipType === 'ha') {
|
|
||||||
UpdateTooltip.HarvestAll();
|
|
||||||
}
|
|
||||||
UpdateTooltip.Warnings();
|
|
||||||
} else if (l('CMTooltipArea') === null) {
|
|
||||||
// Remove warnings if its a basic tooltip
|
|
||||||
if (l('CMDispTooltipWarningParent') !== null) {
|
|
||||||
l('CMDispTooltipWarningParent').remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function enhance the standard tooltips by creating and changing l('tooltip')
|
* This function enhance the standard tooltips by creating and changing l('tooltip')
|
||||||
* The function is called by .onmouseover events that have replaced original code to use CM.Disp.Tooltip()
|
* The function is called by .onmouseover events that have replaced original code to use CM.Disp.Tooltip()
|
||||||
@@ -141,9 +109,10 @@ export function CreateTooltip(type, name) {
|
|||||||
name[0],
|
name[0],
|
||||||
name[1],
|
name[1],
|
||||||
)();
|
)();
|
||||||
// Garden plots
|
// Harvest all button in garden
|
||||||
else if (type === 'ha')
|
else if (type === 'ha')
|
||||||
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)(); // Harvest all button in garden
|
l('tooltip').innerHTML = Game.ObjectsById[2].minigame.toolTooltip(1)();
|
||||||
|
else if (type === 'wb') l('tooltip').innerHTML = '';
|
||||||
|
|
||||||
// Adds area for extra tooltip-sections
|
// Adds area for extra tooltip-sections
|
||||||
if (
|
if (
|
||||||
@@ -152,7 +121,8 @@ export function CreateTooltip(type, name) {
|
|||||||
type === 's' ||
|
type === 's' ||
|
||||||
type === 'g' ||
|
type === 'g' ||
|
||||||
(type === 'p' && !Game.keys[16]) ||
|
(type === 'p' && !Game.keys[16]) ||
|
||||||
type === 'ha'
|
type === 'ha' ||
|
||||||
|
type === 'wb'
|
||||||
) {
|
) {
|
||||||
const area = document.createElement('div');
|
const area = document.createElement('div');
|
||||||
area.id = 'CMTooltipArea';
|
area.id = 'CMTooltipArea';
|
||||||
|
|||||||
@@ -8,9 +8,12 @@ import {
|
|||||||
CacheObjects10,
|
CacheObjects10,
|
||||||
CacheObjects100,
|
CacheObjects100,
|
||||||
CacheUpgrades,
|
CacheUpgrades,
|
||||||
|
CacheWrinklersFattest,
|
||||||
|
CacheWrinklersTotal,
|
||||||
} from '../../Cache/VariablesAndData';
|
} from '../../Cache/VariablesAndData';
|
||||||
import ToggleToolWarnPos from '../../Config/Toggles/ToggleToolWarnPos';
|
import ToggleToolWarnPos from '../../Config/Toggles/ToggleToolWarnPos';
|
||||||
import { CMOptions } from '../../Config/VariablesAndData';
|
import { CMOptions } from '../../Config/VariablesAndData';
|
||||||
|
import CopyData from '../../Sim/SimulationData/CopyData';
|
||||||
import { SimObjects } from '../../Sim/VariablesAndData';
|
import { SimObjects } from '../../Sim/VariablesAndData';
|
||||||
import {
|
import {
|
||||||
Beautify,
|
Beautify,
|
||||||
@@ -37,7 +40,7 @@ import * as Create from './CreateTooltip';
|
|||||||
/**
|
/**
|
||||||
* This function adds extra info to the Building tooltips
|
* This function adds extra info to the Building tooltips
|
||||||
*/
|
*/
|
||||||
export function Building() {
|
function Building() {
|
||||||
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
if (CMOptions.TooltipBuildUpgrade === 1 && Game.buyMode === 1) {
|
||||||
const tooltipBox = l('CMTooltipBorder');
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||||
@@ -111,7 +114,7 @@ export function Building() {
|
|||||||
/**
|
/**
|
||||||
* This function adds extra info to the Upgrade tooltips
|
* This function adds extra info to the Upgrade tooltips
|
||||||
*/
|
*/
|
||||||
export function Upgrade() {
|
function Upgrade() {
|
||||||
const tooltipBox = l('CMTooltipBorder');
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
Create.TooltipCreateCalculationSection(tooltipBox);
|
Create.TooltipCreateCalculationSection(tooltipBox);
|
||||||
|
|
||||||
@@ -200,7 +203,7 @@ export function Upgrade() {
|
|||||||
* This function adds extra info to the Sugar Lump tooltip
|
* This function adds extra info to the Sugar Lump tooltip
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
*/
|
*/
|
||||||
export function SugarLump() {
|
function SugarLump() {
|
||||||
if (CMOptions.TooltipLump === 1) {
|
if (CMOptions.TooltipLump === 1) {
|
||||||
const tooltipBox = l('CMTooltipBorder');
|
const tooltipBox = l('CMTooltipBorder');
|
||||||
|
|
||||||
@@ -219,7 +222,7 @@ export function SugarLump() {
|
|||||||
* This function adds extra info to the Grimoire tooltips
|
* This function adds extra info to the Grimoire tooltips
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
*/
|
*/
|
||||||
export function Grimoire() {
|
function Grimoire() {
|
||||||
const minigame = Game.Objects['Wizard tower'].minigame;
|
const minigame = Game.Objects['Wizard tower'].minigame;
|
||||||
const spellCost = minigame.getSpellCost(minigame.spellsById[TooltipName]);
|
const spellCost = minigame.getSpellCost(minigame.spellsById[TooltipName]);
|
||||||
|
|
||||||
@@ -289,7 +292,7 @@ export function Grimoire() {
|
|||||||
* This function adds extra info to the Garden plots tooltips
|
* This function adds extra info to the Garden plots tooltips
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
*/
|
*/
|
||||||
export function GardenPlots() {
|
function GardenPlots() {
|
||||||
const minigame = Game.Objects.Farm.minigame;
|
const minigame = Game.Objects.Farm.minigame;
|
||||||
if (
|
if (
|
||||||
CMOptions.TooltipPlots &&
|
CMOptions.TooltipPlots &&
|
||||||
@@ -341,7 +344,7 @@ export function GardenPlots() {
|
|||||||
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
* It is called when the Harvest All tooltip is created or refreshed by CM.Disp.UpdateTooltip()
|
||||||
* It adds to the additional information to l('CMTooltipArea')
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
*/
|
*/
|
||||||
export function HarvestAll() {
|
function HarvestAll() {
|
||||||
const minigame = Game.Objects.Farm.minigame;
|
const minigame = Game.Objects.Farm.minigame;
|
||||||
if (CMOptions.TooltipLump) {
|
if (CMOptions.TooltipLump) {
|
||||||
l('CMTooltipBorder').appendChild(
|
l('CMTooltipBorder').appendChild(
|
||||||
@@ -391,10 +394,28 @@ export function HarvestAll() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function updates the warnings section of the building and upgrade tooltips
|
* This function adds extra info to the wrinkler button tooltip
|
||||||
* It is called by CM.Disp.UpdateTooltip()
|
* It adds to the additional information to l('CMTooltipArea')
|
||||||
*/
|
*/
|
||||||
export function Warnings() {
|
function WrinklerButton() {
|
||||||
|
l('tooltip').innerHTML = '';
|
||||||
|
l('tooltip').appendChild(Create.TooltipCreateHeader('Reward:'));
|
||||||
|
|
||||||
|
const WrinklerReward = document.createElement('div');
|
||||||
|
WrinklerReward.id = 'CMWrinklerReward';
|
||||||
|
if (TooltipName === 'PopAll') {
|
||||||
|
WrinklerReward.textContent = CacheWrinklersTotal;
|
||||||
|
} else if (TooltipName === 'PopFattest') {
|
||||||
|
WrinklerReward.textContent = CacheWrinklersFattest[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
l('tooltip').appendChild(WrinklerReward);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function updates the warnings section of the building and upgrade tooltips
|
||||||
|
*/
|
||||||
|
function Warnings() {
|
||||||
if (TooltipType === 'b' || TooltipType === 'u') {
|
if (TooltipType === 'b' || TooltipType === 'u') {
|
||||||
if (document.getElementById('CMDispTooltipWarningParent') === null) {
|
if (document.getElementById('CMDispTooltipWarningParent') === null) {
|
||||||
l('tooltipAnchor').appendChild(Create.TooltipCreateWarningSection());
|
l('tooltipAnchor').appendChild(Create.TooltipCreateWarningSection());
|
||||||
@@ -517,3 +538,38 @@ export function Warnings() {
|
|||||||
l('CMDispTooltipWarningParent').remove();
|
l('CMDispTooltipWarningParent').remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function updates the sections of the tooltips created by CookieMonster
|
||||||
|
*/
|
||||||
|
export default function UpdateTooltips() {
|
||||||
|
CopyData();
|
||||||
|
if (l('tooltipAnchor').style.display !== 'none' && l('CMTooltipArea')) {
|
||||||
|
l('CMTooltipArea').innerHTML = '';
|
||||||
|
const tooltipBox = Create.TooltipCreateTooltipBox();
|
||||||
|
l('CMTooltipArea').appendChild(tooltipBox);
|
||||||
|
|
||||||
|
if (TooltipType === 'b') {
|
||||||
|
Building();
|
||||||
|
} else if (TooltipType === 'u') {
|
||||||
|
Upgrade();
|
||||||
|
} else if (TooltipType === 's') {
|
||||||
|
SugarLump();
|
||||||
|
} else if (TooltipType === 'g') {
|
||||||
|
Grimoire();
|
||||||
|
} else if (TooltipType === 'p') {
|
||||||
|
GardenPlots();
|
||||||
|
} else if (TooltipType === 'ha') {
|
||||||
|
HarvestAll();
|
||||||
|
} else if (TooltipType === 'wb') {
|
||||||
|
l('CMTooltipArea').innerHTML = '';
|
||||||
|
WrinklerButton();
|
||||||
|
}
|
||||||
|
Warnings();
|
||||||
|
} else if (l('CMTooltipArea') === null) {
|
||||||
|
// Remove warnings if its a basic tooltip
|
||||||
|
if (l('CMDispTooltipWarningParent') !== null) {
|
||||||
|
l('CMDispTooltipWarningParent').remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user