From 55ff11fb15e7f9a80eb1b9ca7afc15421e7ac537 Mon Sep 17 00:00:00 2001 From: Michael Xander Date: Mon, 26 Aug 2019 15:28:53 +0200 Subject: [PATCH] Stopped set item events from bubbling up --- LICENSE | 21 +++++++++++++++++++++ LICENSE.txt | 7 ------- dist/assets/main.js | 2 +- package.json | 2 +- src/js/components/handlers.js | 9 +++++++++ src/js/components/helpers.js | 7 ++++++- 6 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 LICENSE delete mode 100644 LICENSE.txt diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f85a901 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Michael Xander + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 5b0e36a..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2019 Michael Xander - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/dist/assets/main.js b/dist/assets/main.js index 31c1ba2..e45493a 100644 --- a/dist/assets/main.js +++ b/dist/assets/main.js @@ -1 +1 @@ -!function(t){function e(e){for(var n,o,i=e[0],a=e[1],c=0,u=[];c\n \n \n \n ')}function i(t){var e=document.createElement("li");e.setAttribute("id",t),e.setAttribute("class","plugins__item"),r.appendChild(e)}function a(t){try{var e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==storage.length}}},function(t,e,n){t.exports=n(4)},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)})}}n.d(e,"a",function(){return o})},function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=j(a,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=u(t,e,n);if("normal"===s.type){if(r=n.done?h:f,s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l="suspendedStart",f="suspendedYield",d="executing",h="completed",p={};function m(){}function v(){}function y(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(S([])));w&&w!==n&&r.call(w,i)&&(g=w);var E=y.prototype=m.prototype=Object.create(g);function x(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(n,o){function i(){return new Promise(function(e,i){!function e(n,o,i,a){var c=u(t[n],t,o);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){s.value=t,i(s)},function(t){return e("throw",t,i,a)})}a(c.arg)}(n,o,e,i)})}return e=e?e.then(i,i):i()}}function j(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,j(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=u(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:S(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){var r={"./age.js":[11,1],"./weather.js":[12,2]};function o(t){if(!n.o(r,t))return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e});var e=r[t],o=e[0];return n.e(e[1]).then(function(){return n(o)})}o.keys=function(){return Object.keys(r)},o.id=5,t.exports=o},function(t,e,n){var r=n(7);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(8)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){},function(t,e,n){var r,o,i={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),c=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var r=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),s=null,u=0,l=[],f=n(9);function d(t,e){for(var n=0;n=0&&l.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return y(e,t.attrs),p(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var a=u++;n=s||(s=v(e)),r=E.bind(null,n,a,!1),o=E.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),p(t,e),e}(e),r=function(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),c=t.href;t.href=URL.createObjectURL(a),c&&URL.revokeObjectURL(c)}.bind(null,n,e),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return d(n,e),function(t){for(var r=[],o=0;o0&&Number(e.key)<=9&&Number(e.key)<=t.sets.length&&t.openSet(Number(e.key-1)))}),a.addEventListener("keydown",function(t){t.stopPropagation(),"Escape"===t.key&&a.blur()}))},l=n(1),f=document.getElementById("js-welcome-modal"),d=document.getElementById("js-welcome-dismiss"),h=function(){Object(l.c)("localStorage")&&!localStorage.getItem("launchbot__welcome")&&(f.style.display="block"),d.addEventListener("click",function(){f.style.display="none",localStorage.setItem("launchbot__welcome",!1)})},p=n(2),m=n.n(p),v=n(3);function y(){return(y=Object(v.a)(m.a.mark(function t(e){return m.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n(5)("./"+e.name+".js");case 3:t.sent.init(),t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(0),t.t0;case 10:case"end":return t.stop()}},t,null,[[0,7]])}))).apply(this,arguments)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function b(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n \n \n \n ')}),x.innerHTML=T;var A="";Object.entries(r.a.options).forEach(function(t){var e=g(t,2),n=e[0],r=e[1],o="",i="input input--settings",a="text";"darkMode"!==n&&"keyboardShortcuts"!==n||(a="checkbox",i="",!0===r&&(o="checked")),A+='
  • \n \n \n
  • ")}),w.innerHTML=A,r.a.plugins.forEach(function(t){var e=document.createElement("ul");e.setAttribute("class","settings-form-list settings-form-list--plugin"),Object.entries(t).forEach(function(t){var n=g(t,2),r=n[0],o=n[1],i="",a="input input--settings",c="text";"enabled"===r&&(c="checkbox",a="",!0===o&&(i="checked")),"name"===r&&(i="disabled"),e.innerHTML+='
  • \n \n \n
  • ")}),E.appendChild(e)}),L.innerHTML="export default ".concat(JSON.stringify(r.a,null,2),";"),O.addEventListener("click",function(){j.style.position="relative",k.classList.add("is-active")}),S.addEventListener("click",function(t){t.preventDefault(),k.classList.remove("is-active"),j.style.position="fixed"}),N.addEventListener("click",function(t){var e;t.preventDefault(),e=function(){var t=[];x.childNodes.forEach(function(e){t.push({name:e.children[0].value,items:b(e.children[1].value.split("\n"))})});var e={};w.childNodes.forEach(function(t){var n=t.children[1],r=n.name,o=n.type,i=n.checked,a=t.children[1].value;"checkbox"===o&&(a=i),e[r]=a});var n=[];return E.childNodes.forEach(function(t){var e={};t.childNodes.forEach(function(t){var n=t.children[1],r=n.name,o=n.type,i=n.checked,a=t.children[1].value;"checkbox"===o&&(a=i),e[r]=a}),n.push(e)}),{sets:t,options:e,plugins:n}}(),localStorage.setItem("config",JSON.stringify(e)),window.location.reload(!0)}),I.addEventListener("click",function(t){t.preventDefault(),localStorage.removeItem("config"),window.location.reload(!0)});var B=function(t){var e=t.target;x.removeChild(e.parentNode)};function M(){x.childNodes.forEach(function(t){t.children[2].addEventListener("click",B)})}M(),_.addEventListener("click",function(){var t=document.createElement("li");t.setAttribute("class","settings-form-list__item"),t.innerHTML='\n \n \n \n ',x.appendChild(t),M()}),function(t){!1===t.options.darkMode&&document.documentElement.classList.add("theme-light");var e="";t.sets.forEach(function(t,n){var o=t.name,i=t.items,a="";i.forEach(function(t){a+=Object(l.b)(t,r.a)}),e+='
  • \n
    \n

    '.concat(o,'

    \n ').concat(n+1,"\n
      ").concat(a,"
    \n
    \n
  • ")}),document.getElementById("js-sets").innerHTML=e,t.options.searchEngine&&(document.getElementById("js-search-form").action=t.options.searchEngine),h(),u(t)}(new i(r.a));n(6)}]); \ No newline at end of file +!function(t){function e(e){for(var n,o,i=e[0],a=e[1],c=0,u=[];c\n \n \n \n ')}function i(t){var e=document.createElement("li");e.setAttribute("id",t),e.setAttribute("class","plugins__item"),r.appendChild(e)}function a(t){try{var e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(t){return t instanceof DOMException&&(22===t.code||1014===t.code||"QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&0!==storage.length}}},function(t,e,n){t.exports=n(4)},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,s,"next",t)}function s(t){r(a,o,i,c,s,"throw",t)}c(void 0)})}}n.d(e,"a",function(){return o})},function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,n,r){var o=e&&e.prototype instanceof m?e:m,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=j(a,n);if(c){if(c===p)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var s=u(t,e,n);if("normal"===s.type){if(r=n.done?h:f,s.arg===p)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=h,n.method="throw",n.arg=s.arg)}}}(t,n,a),i}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var l="suspendedStart",f="suspendedYield",d="executing",h="completed",p={};function m(){}function v(){}function y(){}var g={};g[i]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(S([])));w&&w!==n&&r.call(w,i)&&(g=w);var E=y.prototype=m.prototype=Object.create(g);function x(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(n,o){function i(){return new Promise(function(e,i){!function e(n,o,i,a){var c=u(t[n],t,o);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){s.value=t,i(s)},function(t){return e("throw",t,i,a)})}a(c.arg)}(n,o,e,i)})}return e=e?e.then(i,i):i()}}function j(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,j(t,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var o=u(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,p;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,p):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:S(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),p}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){var r={"./age.js":[11,1],"./weather.js":[12,2]};function o(t){if(!n.o(r,t))return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e});var e=r[t],o=e[0];return n.e(e[1]).then(function(){return n(o)})}o.keys=function(){return Object.keys(r)},o.id=5,t.exports=o},function(t,e,n){var r=n(7);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(8)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){},function(t,e,n){var r,o,i={},a=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),c=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var r=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}}(),s=null,u=0,l=[],f=n(9);function d(t,e){for(var n=0;n=0&&l.splice(e,1)}function v(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var r=function(){0;return n.nc}();r&&(t.attrs.nonce=r)}return y(e,t.attrs),p(t,e),e}function y(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function g(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=i}if(e.singleton){var a=u++;n=s||(s=v(e)),r=E.bind(null,n,a,!1),o=E.bind(null,n,a,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",y(e,t.attrs),p(t,e),e}(e),r=function(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),c=t.href;t.href=URL.createObjectURL(a),c&&URL.revokeObjectURL(c)}.bind(null,n,e),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=function(t,e){var n=e.css,r=e.media;r&&t.setAttribute("media",r);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=a()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return d(n,e),function(t){for(var r=[],o=0;o0&&Number(e.key)<=9&&Number(e.key)<=t.sets.length&&t.openSet(Number(e.key-1)))}),a.addEventListener("keydown",function(t){t.stopPropagation(),"Escape"===t.key&&a.blur()})),Array.from(c).forEach(function(t){t.addEventListener("click",function(t){t.stopPropagation()})})},f=n(1),d=document.getElementById("js-welcome-modal"),h=document.getElementById("js-welcome-dismiss"),p=function(){Object(f.c)("localStorage")&&!localStorage.getItem("launchbot__welcome")&&(d.style.display="block"),h.addEventListener("click",function(){d.style.display="none",localStorage.setItem("launchbot__welcome",!1)})},m=n(2),v=n.n(m),y=n(3);function g(){return(g=Object(y.a)(v.a.mark(function t(e){return v.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,n(5)("./"+e.name+".js");case 3:t.sent.init(),t.next=10;break;case 7:throw t.prev=7,t.t0=t.catch(0),t.t0;case 10:case"end":return t.stop()}},t,null,[[0,7]])}))).apply(this,arguments)}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function w(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n \n \n \n ')}),L.innerHTML=T;var B="";Object.entries(r.a.options).forEach(function(t){var e=b(t,2),n=e[0],r=e[1],o="",i="input input--settings",a="text";"darkMode"!==n&&"keyboardShortcuts"!==n||(a="checkbox",i="",!0===r&&(o="checked")),B+='
  • \n \n \n
  • ")}),E.innerHTML=B,r.a.plugins.forEach(function(t){var e=document.createElement("ul");e.setAttribute("class","settings-form-list settings-form-list--plugin"),Object.entries(t).forEach(function(t){var n=b(t,2),r=n[0],o=n[1],i="",a="input input--settings",c="text";"enabled"===r&&(c="checkbox",a="",!0===o&&(i="checked")),"name"===r&&(i="disabled"),e.innerHTML+='
  • \n \n \n
  • ")}),x.appendChild(e)}),j.innerHTML="export default ".concat(JSON.stringify(r.a,null,2),";"),S.addEventListener("click",function(){k.style.position="relative",_.classList.add("is-active")}),I.addEventListener("click",function(t){t.preventDefault(),_.classList.remove("is-active"),k.style.position="fixed"}),A.addEventListener("click",function(t){var e;t.preventDefault(),e=function(){var t=[];L.childNodes.forEach(function(e){t.push({name:e.children[0].value,items:w(e.children[1].value.split("\n"))})});var e={};E.childNodes.forEach(function(t){var n=t.children[1],r=n.name,o=n.type,i=n.checked,a=t.children[1].value;"checkbox"===o&&(a=i),e[r]=a});var n=[];return x.childNodes.forEach(function(t){var e={};t.childNodes.forEach(function(t){var n=t.children[1],r=n.name,o=n.type,i=n.checked,a=t.children[1].value;"checkbox"===o&&(a=i),e[r]=a}),n.push(e)}),{sets:t,options:e,plugins:n}}(),localStorage.setItem("config",JSON.stringify(e)),window.location.reload(!0)}),N.addEventListener("click",function(t){t.preventDefault(),localStorage.removeItem("config"),window.location.reload(!0)});var C=function(t){var e=t.target;L.removeChild(e.parentNode)};function M(){L.childNodes.forEach(function(t){t.children[2].addEventListener("click",C)})}M(),O.addEventListener("click",function(){var t=document.createElement("li");t.setAttribute("class","settings-form-list__item"),t.innerHTML='\n \n \n \n ',L.appendChild(t),M()}),function(t){!1===t.options.darkMode&&document.documentElement.classList.add("theme-light");var e="";t.sets.forEach(function(t,n){var o=t.name,i=t.items,a="";i.forEach(function(t){a+=Object(f.b)(t,r.a)}),e+='
  • \n
    \n

    '.concat(o,'

    \n ').concat(n+1,"\n
      ").concat(a,"
    \n
    \n
  • ")}),document.getElementById("js-sets").innerHTML=e,t.options.searchEngine&&(document.getElementById("js-search-form").action=t.options.searchEngine),p(),l(t)}(new i(r.a));n(6)}]); \ No newline at end of file diff --git a/package.json b/package.json index eb1165e..ac7c5b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Launchbot", - "version": "3.0.2", + "version": "3.0.3", "description": "Self-hosted open source startpage. Open collections of websites with one click. It’s like restoring tabs, but anywhere.", "author": "Michael Xander", "bugs": "https://github.com/michaelx/Launchbot/issues", diff --git a/src/js/components/handlers.js b/src/js/components/handlers.js index 910dfbb..02c4c46 100644 --- a/src/js/components/handlers.js +++ b/src/js/components/handlers.js @@ -1,4 +1,5 @@ const searchDOM = document.getElementById('js-search-text'); +const setItemsDOM = document.getElementsByClassName('js-set-item-link'); const setsDOM = document.getElementsByClassName('set'); const settingsDOM = document.getElementById('js-settings'); @@ -45,4 +46,12 @@ export default function (launchbot) { if (event.key === 'Escape') searchDOM.blur(); }); } + + + // Stop set item events from bubbling up + Array.from(setItemsDOM).forEach((item) => { + item.addEventListener('click', (event) => { + event.stopPropagation(); + }); + }); } diff --git a/src/js/components/helpers.js b/src/js/components/helpers.js index 060389a..b346867 100644 --- a/src/js/components/helpers.js +++ b/src/js/components/helpers.js @@ -4,7 +4,12 @@ const pluginsDefaultDOM = document.getElementById('js-plugins-default'); // Link style with favicon export function formatItemBar(item, config) { return `
  • - +