diff options
author | Indrajith K L | 2017-12-18 17:02:00 +0530 |
---|---|---|
committer | Indrajith K L | 2017-12-18 17:02:00 +0530 |
commit | 22e4705a9cde1ec45fac032721af6d47ef60566b (patch) | |
tree | b2da1d0f49c725e3032ed1ad14b2118d2c3ca482 | |
download | vanilla-yo-notification-22e4705a9cde1ec45fac032721af6d47ef60566b.tar.gz vanilla-yo-notification-22e4705a9cde1ec45fac032721af6d47ef60566b.tar.bz2 vanilla-yo-notification-22e4705a9cde1ec45fac032721af6d47ef60566b.zip |
initial commit
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | .npmignore | 10 | ||||
-rw-r--r-- | dist/vanilla-yo-notification.js | 2 | ||||
-rw-r--r-- | dist/vanilla-yo-notification.js.map | 1 | ||||
-rw-r--r-- | karma.conf.js | 61 | ||||
-rw-r--r-- | package.json | 52 | ||||
-rw-r--r-- | src/config.interface.ts | 6 | ||||
-rw-r--r-- | src/index.html | 22 | ||||
-rw-r--r-- | src/index.spec.ts | 5 | ||||
-rw-r--r-- | src/index.ts | 3 | ||||
-rw-r--r-- | src/styles/style.css | 38 | ||||
-rw-r--r-- | src/vanilla.yo.notification.ts | 76 | ||||
-rw-r--r-- | src/vendor.ts | 4 | ||||
-rw-r--r-- | tests/unit/spec-bundle.js | 9 | ||||
-rw-r--r-- | tsconfig.json | 19 | ||||
-rw-r--r-- | tslint.json | 30 | ||||
-rw-r--r-- | typings.json | 7 | ||||
-rw-r--r-- | webpack.config.js | 66 |
18 files changed, 415 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..49c90de --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# dependencies +/node_modules + +package-lock.json
\ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..57220e4 --- /dev/null +++ b/.npmignore @@ -0,0 +1,10 @@ +# Build results +dist/ +typings/**/* + +# Others +~$* +*~ +node_modules/ +src/build/ +coverage/ diff --git a/dist/vanilla-yo-notification.js b/dist/vanilla-yo-notification.js new file mode 100644 index 0000000..c238021 --- /dev/null +++ b/dist/vanilla-yo-notification.js @@ -0,0 +1,2 @@ +!function(t){function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}var e={};n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=0)}([function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(1);window.VanillaYoNotification=o.default},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),e(2);var o=function(){function t(){this.defaultConfig={content:"",footer:"",timeout:3e3,title:""},this.init()}return t.prototype.init=function(){this.buildContainers()},t.prototype.buildContainers=function(){var t=document.createElement("div");t.className="notif-mainContainer topRight",this.notifInner=document.createElement("div"),this.notifInner.className="notif-inner",t.appendChild(this.notifInner),document.body.appendChild(t)},t.prototype.show=function(t){var n=this,e=document.createElement("div");e.className="vanilla-yo-notification",this.notificationTemplate='\n <div class="notification_container">\n <div class="notification_header">\n '+(t.title?t.title:this.defaultConfig.title)+'\n </div>\n <div class="notification_body">\n '+(t.content?t.content:this.defaultConfig.content)+'\n </div>\n <div class="notification_footer">\n '+(t.footer?t.footer:this.defaultConfig.footer)+"\n </div>\n </div>\n ",e.innerHTML=this.notificationTemplate,this.notifInner.appendChild(e),setTimeout(function(){n.destroyNotification(e)},t.timeout?t.timeout:this.defaultConfig.timeout)},t.prototype.destroyNotification=function(t){this.notifInner.removeChild(t)},t}();n.default=o},function(t,n,e){var o=e(3);"string"==typeof o&&(o=[[t.i,o,""]]);var i={};i.transform=void 0;e(5)(o,i);o.locals&&(t.exports=o.locals)},function(t,n,e){n=t.exports=e(4)(void 0),n.push([t.i,'\n\n.notif-mainContainer {\n z-index: 999;\n position: fixed;\n width: 350px;\n max-width: 98%;\n font-family: "Segoe UI","Tahoma","Calibri","Verdana",sans-serif;\n color: #999;\n box-sizing: border-box;\n}\n\n.notif-mainContainer.topRight{\n top: 8px;\n right: 8px;\n}\n\n.notif-inner {\n display: flex;\n flex-direction: column;\n}\n\n.vanilla-yo-notification{\n width: 250px;\n background: #58a758;\n color: white;\n position: relative;\n cursor: pointer;\n padding: 8px;\n margin-bottom: 12px;\n display: flex;\n}\n\n\n.notification_header{\n\tfont-size: 15px;\n font-weight: bold\n}',""])},function(t,n){function e(t,n){var e=t[1]||"",i=t[3];if(!i)return e;if(n&&"function"==typeof btoa){var r=o(i);return[e].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([r]).join("\n")}return[e].join("\n")}function o(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var n=[];return n.toString=function(){return this.map(function(n){var o=e(n,t);return n[2]?"@media "+n[2]+"{"+o+"}":o}).join("")},n.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},i=0;i<this.length;i++){var r=this[i][0];"number"==typeof r&&(o[r]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&o[a[0]]||(e&&!a[2]?a[2]=e:e&&(a[2]="("+a[2]+") and ("+e+")"),n.push(a))}},n}},function(t,n,e){function o(t,n){for(var e=0;e<t.length;e++){var o=t[e],i=h[o.id];if(i){i.refs++;for(var r=0;r<i.parts.length;r++)i.parts[r](o.parts[r]);for(;r<o.parts.length;r++)i.parts.push(u(o.parts[r],n))}else{for(var a=[],r=0;r<o.parts.length;r++)a.push(u(o.parts[r],n));h[o.id]={id:o.id,refs:1,parts:a}}}}function i(t,n){for(var e=[],o={},i=0;i<t.length;i++){var r=t[i],a=n.base?r[0]+n.base:r[0],s=r[1],f=r[2],c=r[3],u={css:s,media:f,sourceMap:c};o[a]?o[a].parts.push(u):e.push(o[a]={id:a,parts:[u]})}return e}function r(t,n){var e=m(t.insertInto);if(!e)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=g[g.length-1];if("top"===t.insertAt)o?o.nextSibling?e.insertBefore(n,o.nextSibling):e.appendChild(n):e.insertBefore(n,e.firstChild),g.push(n);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");e.appendChild(n)}}function a(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var n=g.indexOf(t);n>=0&&g.splice(n,1)}function s(t){var n=document.createElement("style");return t.attrs.type="text/css",c(n,t.attrs),r(t,n),n}function f(t){var n=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",c(n,t.attrs),r(t,n),n}function c(t,n){Object.keys(n).forEach(function(e){t.setAttribute(e,n[e])})}function u(t,n){var e,o,i,r;if(n.transform&&t.css){if(!(r=n.transform(t.css)))return function(){};t.css=r}if(n.singleton){var c=y++;e=b||(b=s(n)),o=l.bind(null,e,c,!1),i=l.bind(null,e,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(e=f(n),o=p.bind(null,e,n),i=function(){a(e),e.href&&URL.revokeObjectURL(e.href)}):(e=s(n),o=d.bind(null,e),i=function(){a(e)});return o(t),function(n){if(n){if(n.css===t.css&&n.media===t.media&&n.sourceMap===t.sourceMap)return;o(t=n)}else i()}}function l(t,n,e,o){var i=e?"":o.css;if(t.styleSheet)t.styleSheet.cssText=w(n,i);else{var r=document.createTextNode(i),a=t.childNodes;a[n]&&t.removeChild(a[n]),a.length?t.insertBefore(r,a[n]):t.appendChild(r)}}function d(t,n){var e=n.css,o=n.media;if(o&&t.setAttribute("media",o),t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}function p(t,n,e){var o=e.css,i=e.sourceMap,r=void 0===n.convertToAbsoluteUrls&&i;(n.convertToAbsoluteUrls||r)&&(o=x(o)),i&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([o],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var h={},v=function(t){var n;return function(){return void 0===n&&(n=t.apply(this,arguments)),n}}(function(){return window&&document&&document.all&&!window.atob}),m=function(t){var n={};return function(e){return void 0===n[e]&&(n[e]=t.call(this,e)),n[e]}}(function(t){return document.querySelector(t)}),b=null,y=0,g=[],x=e(6);t.exports=function(t,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");n=n||{},n.attrs="object"==typeof n.attrs?n.attrs:{},n.singleton||(n.singleton=v()),n.insertInto||(n.insertInto="head"),n.insertAt||(n.insertAt="bottom");var e=i(t,n);return o(e,n),function(t){for(var r=[],a=0;a<e.length;a++){var s=e[a],f=h[s.id];f.refs--,r.push(f)}if(t){o(i(t,n),n)}for(var a=0;a<r.length;a++){var f=r[a];if(0===f.refs){for(var c=0;c<f.parts.length;c++)f.parts[c]();delete h[f.id]}}}};var w=function(){var t=[];return function(n,e){return t[n]=e,t.filter(Boolean).join("\n")}}()},function(t,n){t.exports=function(t){var n="undefined"!=typeof window&&window.location;if(!n)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var e=n.protocol+"//"+n.host,o=e+n.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(t,n){var i=n.trim().replace(/^"(.*)"$/,function(t,n){return n}).replace(/^'(.*)'$/,function(t,n){return n});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i))return t;var r;return r=0===i.indexOf("//")?i:0===i.indexOf("/")?e+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(r)+")"})}}]); +//# sourceMappingURL=vanilla-yo-notification.js.map
\ No newline at end of file diff --git a/dist/vanilla-yo-notification.js.map b/dist/vanilla-yo-notification.js.map new file mode 100644 index 0000000..094b8ce --- /dev/null +++ b/dist/vanilla-yo-notification.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["file:///vanilla-yo-notification.js","file:///webpack/bootstrap a986a3597f839f5318b6","file:///C:\\Users\\InApp\\Desktop\\custom-notification\\src\\index.ts","file:///C:\\Users\\InApp\\Desktop\\custom-notification\\src\\vanilla.yo.notification.ts","webpack:///./styles/style.css?42e5","file:///C:\\Users\\InApp\\Desktop\\custom-notification\\src\\styles\\style.css","file:///C:\\Users\\InApp\\Desktop\\custom-notification\\node_modules\\css-loader\\lib\\css-base.js","file:///C:\\Users\\InApp\\Desktop\\custom-notification\\node_modules\\style-loader\\lib\\addStyles.js","file:///C:\\Users\\InApp\\Desktop\\custom-notification\\node_modules\\style-loader\\lib\\urls.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","vanilla_yo_notification_1","window","VanillaYoNotification","default","this","defaultConfig","content","footer","timeout","title","init","buildContainers","container","document","createElement","className","notifInner","appendChild","body","show","config","_this","notifContainer","notificationTemplate","innerHTML","setTimeout","destroyNotification","removeChild","options","transform","locals","undefined","push","cssWithMappingToString","item","useSourceMap","cssMapping","btoa","sourceMapping","toComment","concat","sources","map","source","sourceRoot","join","sourceMap","unescape","encodeURIComponent","JSON","stringify","list","toString","mediaQuery","alreadyImportedModules","length","id","addStylesToDom","styles","domStyle","stylesInDom","refs","j","parts","addStyle","listToStyles","newStyles","base","css","media","part","insertStyleElement","style","target","getElement","insertInto","Error","lastStyleElementInsertedAtTop","stylesInsertedAtTop","insertAt","nextSibling","insertBefore","firstChild","removeStyleElement","parentNode","idx","indexOf","splice","createStyleElement","attrs","type","addAttrs","createLinkElement","link","rel","el","keys","forEach","key","setAttribute","obj","update","remove","result","singleton","styleIndex","singletonCounter","applyToSingletonTag","bind","URL","createObjectURL","revokeObjectURL","Blob","updateLink","href","applyToTag","newObj","index","styleSheet","cssText","replaceText","cssNode","createTextNode","childNodes","autoFixUrls","convertToAbsoluteUrls","fixUrls","blob","oldSrc","isOldIE","fn","memo","apply","arguments","all","atob","selector","querySelector","DEBUG","newList","mayRemove","textStore","replacement","filter","Boolean","location","baseUrl","protocol","host","currentDir","pathname","replace","fullMatch","origUrl","unquotedOrigUrl","trim","$1","test","newUrl"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMM,SAAUtB,EAAQD,EAASH,GAEjC,YAEAc,QAAOC,eAAeZ,EAAS,cAAgBwB,OAAO,GEv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G,KAAA2B,GAGA,GAAAgF,EAAA,CAEAlF,EADAQ,EAAA0E,EAAA/G,GACAA,GAGA,OAAAnD,GAAA,EAAiBA,EAAAmK,EAAArF,OAAsB9E,IAAA,CACvC,GAAAkF,GAAAiF,EAAAnK,EAEA,QAAAkF,EAAAE,KAAA,CACA,OAAAC,GAAA,EAAmBA,EAAAH,EAAAI,MAAAR,OAA2BO,IAAAH,EAAAI,MAAAD,WAE9CF,GAAAD,EAAAH,OA0LA,IAAAgE,GAAA,WACA,GAAAqB,KAEA,iBAAAxB,EAAAyB,GAGA,MAFAD,GAAAxB,GAAAyB,EAEAD,EAAAE,OAAAC,SAAAnG,KAAA,WP2UM,SAAUrE,EAAQD,GQvlBxBC,EAAAD,QAAA,SAAA6F,GAEA,GAAA6E,GAAA,mBAAAhJ,gBAAAgJ,QAEA,KAAAA,EACA,SAAArE,OAAA,mCAIA,KAAAR,GAAA,gBAAAA,GACA,MAAAA,EAGA,IAAA8E,GAAAD,EAAAE,SAAA,KAAAF,EAAAG,KACAC,EAAAH,EAAAD,EAAAK,SAAAC,QAAA,gBA2DA,OA/BAnF,GAAAmF,QAAA,+DAAAC,EAAAC,GAEA,GAAAC,GAAAD,EACAE,OACAJ,QAAA,oBAAAtK,EAAA2K,GAAwC,MAAAA,KACxCL,QAAA,oBAAAtK,EAAA2K,GAAwC,MAAAA,IAGxC,mDAAAC,KAAAH,GACA,MAAAF,EAIA,IAAAM,EAcA,OAVAA,GAFA,IAAAJ,EAAApE,QAAA,MAEAoE,EACG,IAAAA,EAAApE,QAAA,KAEH4D,EAAAQ,EAGAL,EAAAK,EAAAH,QAAA,YAIA,OAAAtG,KAAAC,UAAA4G,GAAA","file":"vanilla-yo-notification.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar vanilla_yo_notification_1 = __webpack_require__(1);\r\nwindow.VanillaYoNotification = vanilla_yo_notification_1.default;\r\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n// Import stylesheets\r\n__webpack_require__(2);\r\nvar VanillaYoNotification = /** @class */ (function () {\r\n function VanillaYoNotification() {\r\n this.defaultConfig = {\r\n content: '',\r\n footer: '',\r\n timeout: 3000,\r\n title: ''\r\n };\r\n this.init();\r\n }\r\n VanillaYoNotification.prototype.init = function () {\r\n this.buildContainers();\r\n };\r\n VanillaYoNotification.prototype.buildContainers = function () {\r\n var container = document.createElement('div');\r\n container.className = \"notif-mainContainer topRight\";\r\n this.notifInner = document.createElement('div');\r\n this.notifInner.className = \"notif-inner\";\r\n container.appendChild(this.notifInner);\r\n document.body.appendChild(container);\r\n };\r\n VanillaYoNotification.prototype.show = function (config) {\r\n var _this = this;\r\n var notifContainer = document.createElement('div');\r\n notifContainer.className = \"vanilla-yo-notification\";\r\n this.notificationTemplate = \"\\n <div class=\\\"notification_container\\\">\\n <div class=\\\"notification_header\\\">\\n \" + (config.title ? config.title : this.defaultConfig.title) + \"\\n </div>\\n <div class=\\\"notification_body\\\">\\n \" + (config.content ? config.content : this.defaultConfig.content) + \"\\n </div>\\n <div class=\\\"notification_footer\\\">\\n \" + (config.footer ? config.footer : this.defaultConfig.footer) + \"\\n </div>\\n </div>\\n \";\r\n notifContainer.innerHTML = (this.notificationTemplate);\r\n this.notifInner.appendChild(notifContainer);\r\n setTimeout(function () {\r\n _this.destroyNotification(notifContainer);\r\n }, (config.timeout ? config.timeout : this.defaultConfig.timeout));\r\n };\r\n VanillaYoNotification.prototype.destroyNotification = function (container) {\r\n this.notifInner.removeChild(container);\r\n };\r\n return VanillaYoNotification;\r\n}());\r\nexports.default = VanillaYoNotification;\r\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = __webpack_require__(3);\nif(typeof content === 'string') content = [[module.i, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = __webpack_require__(5)(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(false) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../node_modules/css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../node_modules/css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(4)(undefined);\n// imports\n\n\n// module\nexports.push([module.i, \"\\n\\n.notif-mainContainer {\\n z-index: 999;\\n position: fixed;\\n width: 350px;\\n max-width: 98%;\\n font-family: \\\"Segoe UI\\\",\\\"Tahoma\\\",\\\"Calibri\\\",\\\"Verdana\\\",sans-serif;\\n color: #999;\\n box-sizing: border-box;\\n}\\n\\n.notif-mainContainer.topRight{\\n top: 8px;\\n right: 8px;\\n}\\n\\n.notif-inner {\\n display: flex;\\n flex-direction: column;\\n}\\n\\n.vanilla-yo-notification{\\n width: 250px;\\n background: #58a758;\\n color: white;\\n position: relative;\\n cursor: pointer;\\n padding: 8px;\\n margin-bottom: 12px;\\n display: flex;\\n}\\n\\n\\n.notification_header{\\n\\tfont-size: 15px;\\n font-weight: bold\\n}\", \"\"]);\n\n// exports\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = __webpack_require__(6);\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// vanilla-yo-notification.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap a986a3597f839f5318b6","import VanillaYoNotification from \"./vanilla.yo.notification\";\n\n(window as any).VanillaYoNotification = VanillaYoNotification;\n\n\n// WEBPACK FOOTER //\n// ../node_modules/source-map-loader!./index.ts","// Import stylesheets\r\nimport './styles/style.css';\r\nimport { Config } from './config.interface';\r\n\r\nexport default class VanillaYoNotification {\r\n\r\n private notificationTemplate: string;\r\n private defaultConfig: Config;\r\n private notifInner: any;\r\n\r\n constructor() {\r\n this.defaultConfig = {\r\n content: '',\r\n footer: '',\r\n timeout: 3000,\r\n title: ''\r\n }\r\n this.init();\r\n }\r\n\r\n private init() {\r\n\r\n this.buildContainers();\r\n \r\n \r\n }\r\n\r\n buildContainers(){\r\n let container = document.createElement('div');\r\n container.className = \"notif-mainContainer topRight\";\r\n\r\n this.notifInner = document.createElement('div');\r\n this.notifInner.className = \"notif-inner\";\r\n\r\n container.appendChild(this.notifInner);\r\n document.body.appendChild(container); \r\n }\r\n\r\n\r\n show(config: Config) {\r\n\r\n let notifContainer = document.createElement('div');\r\n notifContainer.className = \"vanilla-yo-notification\";\r\n\r\n\r\n this.notificationTemplate = `\r\n <div class=\"notification_container\">\r\n <div class=\"notification_header\">\r\n ${config.title ? config.title : this.defaultConfig.title}\r\n </div>\r\n <div class=\"notification_body\">\r\n ${config.content ? config.content : this.defaultConfig.content}\r\n </div>\r\n <div class=\"notification_footer\">\r\n ${config.footer ? config.footer : this.defaultConfig.footer}\r\n </div>\r\n </div>\r\n `;\r\n\r\n notifContainer.innerHTML = (this.notificationTemplate);\r\n\r\n this.notifInner.appendChild(notifContainer);\r\n\r\n\r\n setTimeout(() => {\r\n this.destroyNotification(notifContainer);\r\n }, (config.timeout ? config.timeout : this.defaultConfig.timeout));\r\n\r\n \r\n }\r\n\r\n private destroyNotification(container: Node) {\r\n this.notifInner.removeChild(container);\r\n }\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ../node_modules/source-map-loader!./vanilla.yo.notification.ts","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../node_modules/css-loader/index.js!./style.css\");\nif(typeof content === 'string') content = [[module.id, content, '']];\n// Prepare cssTransformation\nvar transform;\n\nvar options = {}\noptions.transform = transform\n// add the styles to the DOM\nvar update = require(\"!../../node_modules/style-loader/lib/addStyles.js\")(content, options);\nif(content.locals) module.exports = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update the <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept(\"!!../../node_modules/css-loader/index.js!./style.css\", function() {\n\t\t\tvar newContent = require(\"!!../../node_modules/css-loader/index.js!./style.css\");\n\t\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> tags\n\tmodule.hot.dispose(function() { update(); });\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./styles/style.css\n// module id = 2\n// module chunks = 0","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \"\\n\\n.notif-mainContainer {\\n z-index: 999;\\n position: fixed;\\n width: 350px;\\n max-width: 98%;\\n font-family: \\\"Segoe UI\\\",\\\"Tahoma\\\",\\\"Calibri\\\",\\\"Verdana\\\",sans-serif;\\n color: #999;\\n box-sizing: border-box;\\n}\\n\\n.notif-mainContainer.topRight{\\n top: 8px;\\n right: 8px;\\n}\\n\\n.notif-inner {\\n display: flex;\\n flex-direction: column;\\n}\\n\\n.vanilla-yo-notification{\\n width: 250px;\\n background: #58a758;\\n color: white;\\n position: relative;\\n cursor: pointer;\\n padding: 8px;\\n margin-bottom: 12px;\\n display: flex;\\n}\\n\\n\\n.notification_header{\\n\\tfont-size: 15px;\\n font-weight: bold\\n}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader!./styles/style.css\n// module id = 3\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/css-loader/lib/css-base.js\n// module id = 4\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n\nvar stylesInDom = {};\n\nvar\tmemoize = function (fn) {\n\tvar memo;\n\n\treturn function () {\n\t\tif (typeof memo === \"undefined\") memo = fn.apply(this, arguments);\n\t\treturn memo;\n\t};\n};\n\nvar isOldIE = memoize(function () {\n\t// Test for IE <= 9 as proposed by Browserhacks\n\t// @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n\t// Tests for existence of standard globals is to allow style-loader\n\t// to operate correctly into non-standard environments\n\t// @see https://github.com/webpack-contrib/style-loader/issues/177\n\treturn window && document && document.all && !window.atob;\n});\n\nvar getElement = (function (fn) {\n\tvar memo = {};\n\n\treturn function(selector) {\n\t\tif (typeof memo[selector] === \"undefined\") {\n\t\t\tmemo[selector] = fn.call(this, selector);\n\t\t}\n\n\t\treturn memo[selector]\n\t};\n})(function (target) {\n\treturn document.querySelector(target)\n});\n\nvar singleton = null;\nvar\tsingletonCounter = 0;\nvar\tstylesInsertedAtTop = [];\n\nvar\tfixUrls = require(\"./urls\");\n\nmodule.exports = function(list, options) {\n\tif (typeof DEBUG !== \"undefined\" && DEBUG) {\n\t\tif (typeof document !== \"object\") throw new Error(\"The style-loader cannot be used in a non-browser environment\");\n\t}\n\n\toptions = options || {};\n\n\toptions.attrs = typeof options.attrs === \"object\" ? options.attrs : {};\n\n\t// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n\t// tags it will allow on a page\n\tif (!options.singleton) options.singleton = isOldIE();\n\n\t// By default, add <style> tags to the <head> element\n\tif (!options.insertInto) options.insertInto = \"head\";\n\n\t// By default, add <style> tags to the bottom of the target\n\tif (!options.insertAt) options.insertAt = \"bottom\";\n\n\tvar styles = listToStyles(list, options);\n\n\taddStylesToDom(styles, options);\n\n\treturn function update (newList) {\n\t\tvar mayRemove = [];\n\n\t\tfor (var i = 0; i < styles.length; i++) {\n\t\t\tvar item = styles[i];\n\t\t\tvar domStyle = stylesInDom[item.id];\n\n\t\t\tdomStyle.refs--;\n\t\t\tmayRemove.push(domStyle);\n\t\t}\n\n\t\tif(newList) {\n\t\t\tvar newStyles = listToStyles(newList, options);\n\t\t\taddStylesToDom(newStyles, options);\n\t\t}\n\n\t\tfor (var i = 0; i < mayRemove.length; i++) {\n\t\t\tvar domStyle = mayRemove[i];\n\n\t\t\tif(domStyle.refs === 0) {\n\t\t\t\tfor (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();\n\n\t\t\t\tdelete stylesInDom[domStyle.id];\n\t\t\t}\n\t\t}\n\t};\n};\n\nfunction addStylesToDom (styles, options) {\n\tfor (var i = 0; i < styles.length; i++) {\n\t\tvar item = styles[i];\n\t\tvar domStyle = stylesInDom[item.id];\n\n\t\tif(domStyle) {\n\t\t\tdomStyle.refs++;\n\n\t\t\tfor(var j = 0; j < domStyle.parts.length; j++) {\n\t\t\t\tdomStyle.parts[j](item.parts[j]);\n\t\t\t}\n\n\t\t\tfor(; j < item.parts.length; j++) {\n\t\t\t\tdomStyle.parts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\t\t} else {\n\t\t\tvar parts = [];\n\n\t\t\tfor(var j = 0; j < item.parts.length; j++) {\n\t\t\t\tparts.push(addStyle(item.parts[j], options));\n\t\t\t}\n\n\t\t\tstylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};\n\t\t}\n\t}\n}\n\nfunction listToStyles (list, options) {\n\tvar styles = [];\n\tvar newStyles = {};\n\n\tfor (var i = 0; i < list.length; i++) {\n\t\tvar item = list[i];\n\t\tvar id = options.base ? item[0] + options.base : item[0];\n\t\tvar css = item[1];\n\t\tvar media = item[2];\n\t\tvar sourceMap = item[3];\n\t\tvar part = {css: css, media: media, sourceMap: sourceMap};\n\n\t\tif(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});\n\t\telse newStyles[id].parts.push(part);\n\t}\n\n\treturn styles;\n}\n\nfunction insertStyleElement (options, style) {\n\tvar target = getElement(options.insertInto)\n\n\tif (!target) {\n\t\tthrow new Error(\"Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.\");\n\t}\n\n\tvar lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];\n\n\tif (options.insertAt === \"top\") {\n\t\tif (!lastStyleElementInsertedAtTop) {\n\t\t\ttarget.insertBefore(style, target.firstChild);\n\t\t} else if (lastStyleElementInsertedAtTop.nextSibling) {\n\t\t\ttarget.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);\n\t\t} else {\n\t\t\ttarget.appendChild(style);\n\t\t}\n\t\tstylesInsertedAtTop.push(style);\n\t} else if (options.insertAt === \"bottom\") {\n\t\ttarget.appendChild(style);\n\t} else {\n\t\tthrow new Error(\"Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.\");\n\t}\n}\n\nfunction removeStyleElement (style) {\n\tif (style.parentNode === null) return false;\n\tstyle.parentNode.removeChild(style);\n\n\tvar idx = stylesInsertedAtTop.indexOf(style);\n\tif(idx >= 0) {\n\t\tstylesInsertedAtTop.splice(idx, 1);\n\t}\n}\n\nfunction createStyleElement (options) {\n\tvar style = document.createElement(\"style\");\n\n\toptions.attrs.type = \"text/css\";\n\n\taddAttrs(style, options.attrs);\n\tinsertStyleElement(options, style);\n\n\treturn style;\n}\n\nfunction createLinkElement (options) {\n\tvar link = document.createElement(\"link\");\n\n\toptions.attrs.type = \"text/css\";\n\toptions.attrs.rel = \"stylesheet\";\n\n\taddAttrs(link, options.attrs);\n\tinsertStyleElement(options, link);\n\n\treturn link;\n}\n\nfunction addAttrs (el, attrs) {\n\tObject.keys(attrs).forEach(function (key) {\n\t\tel.setAttribute(key, attrs[key]);\n\t});\n}\n\nfunction addStyle (obj, options) {\n\tvar style, update, remove, result;\n\n\t// If a transform function was defined, run it on the css\n\tif (options.transform && obj.css) {\n\t result = options.transform(obj.css);\n\n\t if (result) {\n\t \t// If transform returns a value, use that instead of the original css.\n\t \t// This allows running runtime transformations on the css.\n\t \tobj.css = result;\n\t } else {\n\t \t// If the transform function returns a falsy value, don't add this css.\n\t \t// This allows conditional loading of css\n\t \treturn function() {\n\t \t\t// noop\n\t \t};\n\t }\n\t}\n\n\tif (options.singleton) {\n\t\tvar styleIndex = singletonCounter++;\n\n\t\tstyle = singleton || (singleton = createStyleElement(options));\n\n\t\tupdate = applyToSingletonTag.bind(null, style, styleIndex, false);\n\t\tremove = applyToSingletonTag.bind(null, style, styleIndex, true);\n\n\t} else if (\n\t\tobj.sourceMap &&\n\t\ttypeof URL === \"function\" &&\n\t\ttypeof URL.createObjectURL === \"function\" &&\n\t\ttypeof URL.revokeObjectURL === \"function\" &&\n\t\ttypeof Blob === \"function\" &&\n\t\ttypeof btoa === \"function\"\n\t) {\n\t\tstyle = createLinkElement(options);\n\t\tupdate = updateLink.bind(null, style, options);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\n\t\t\tif(style.href) URL.revokeObjectURL(style.href);\n\t\t};\n\t} else {\n\t\tstyle = createStyleElement(options);\n\t\tupdate = applyToTag.bind(null, style);\n\t\tremove = function () {\n\t\t\tremoveStyleElement(style);\n\t\t};\n\t}\n\n\tupdate(obj);\n\n\treturn function updateStyle (newObj) {\n\t\tif (newObj) {\n\t\t\tif (\n\t\t\t\tnewObj.css === obj.css &&\n\t\t\t\tnewObj.media === obj.media &&\n\t\t\t\tnewObj.sourceMap === obj.sourceMap\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdate(obj = newObj);\n\t\t} else {\n\t\t\tremove();\n\t\t}\n\t};\n}\n\nvar replaceText = (function () {\n\tvar textStore = [];\n\n\treturn function (index, replacement) {\n\t\ttextStore[index] = replacement;\n\n\t\treturn textStore.filter(Boolean).join('\\n');\n\t};\n})();\n\nfunction applyToSingletonTag (style, index, remove, obj) {\n\tvar css = remove ? \"\" : obj.css;\n\n\tif (style.styleSheet) {\n\t\tstyle.styleSheet.cssText = replaceText(index, css);\n\t} else {\n\t\tvar cssNode = document.createTextNode(css);\n\t\tvar childNodes = style.childNodes;\n\n\t\tif (childNodes[index]) style.removeChild(childNodes[index]);\n\n\t\tif (childNodes.length) {\n\t\t\tstyle.insertBefore(cssNode, childNodes[index]);\n\t\t} else {\n\t\t\tstyle.appendChild(cssNode);\n\t\t}\n\t}\n}\n\nfunction applyToTag (style, obj) {\n\tvar css = obj.css;\n\tvar media = obj.media;\n\n\tif(media) {\n\t\tstyle.setAttribute(\"media\", media)\n\t}\n\n\tif(style.styleSheet) {\n\t\tstyle.styleSheet.cssText = css;\n\t} else {\n\t\twhile(style.firstChild) {\n\t\t\tstyle.removeChild(style.firstChild);\n\t\t}\n\n\t\tstyle.appendChild(document.createTextNode(css));\n\t}\n}\n\nfunction updateLink (link, options, obj) {\n\tvar css = obj.css;\n\tvar sourceMap = obj.sourceMap;\n\n\t/*\n\t\tIf convertToAbsoluteUrls isn't defined, but sourcemaps are enabled\n\t\tand there is no publicPath defined then lets turn convertToAbsoluteUrls\n\t\ton by default. Otherwise default to the convertToAbsoluteUrls option\n\t\tdirectly\n\t*/\n\tvar autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;\n\n\tif (options.convertToAbsoluteUrls || autoFixUrls) {\n\t\tcss = fixUrls(css);\n\t}\n\n\tif (sourceMap) {\n\t\t// http://stackoverflow.com/a/26603875\n\t\tcss += \"\\n/*# sourceMappingURL=data:application/json;base64,\" + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + \" */\";\n\t}\n\n\tvar blob = new Blob([css], { type: \"text/css\" });\n\n\tvar oldSrc = link.href;\n\n\tlink.href = URL.createObjectURL(blob);\n\n\tif(oldSrc) URL.revokeObjectURL(oldSrc);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/addStyles.js\n// module id = 5\n// module chunks = 0","\n/**\n * When source maps are enabled, `style-loader` uses a link element with a data-uri to\n * embed the css on the page. This breaks all relative urls because now they are relative to a\n * bundle instead of the current page.\n *\n * One solution is to only use full urls, but that may be impossible.\n *\n * Instead, this function \"fixes\" the relative urls to be absolute according to the current page location.\n *\n * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.\n *\n */\n\nmodule.exports = function (css) {\n // get current location\n var location = typeof window !== \"undefined\" && window.location;\n\n if (!location) {\n throw new Error(\"fixUrls requires window.location\");\n }\n\n\t// blank or null?\n\tif (!css || typeof css !== \"string\") {\n\t return css;\n }\n\n var baseUrl = location.protocol + \"//\" + location.host;\n var currentDir = baseUrl + location.pathname.replace(/\\/[^\\/]*$/, \"/\");\n\n\t// convert each url(...)\n\t/*\n\tThis regular expression is just a way to recursively match brackets within\n\ta string.\n\n\t /url\\s*\\( = Match on the word \"url\" with any whitespace after it and then a parens\n\t ( = Start a capturing group\n\t (?: = Start a non-capturing group\n\t [^)(] = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t (?: = Start another non-capturing groups\n\t [^)(]+ = Match anything that isn't a parentheses\n\t | = OR\n\t \\( = Match a start parentheses\n\t [^)(]* = Match anything that isn't a parentheses\n\t \\) = Match a end parentheses\n\t ) = End Group\n *\\) = Match anything and then a close parens\n ) = Close non-capturing group\n * = Match anything\n ) = Close capturing group\n\t \\) = Match a close parens\n\n\t /gi = Get all matches, not the first. Be case insensitive.\n\t */\n\tvar fixedCss = css.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi, function(fullMatch, origUrl) {\n\t\t// strip quotes (if they exist)\n\t\tvar unquotedOrigUrl = origUrl\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, function(o, $1){ return $1; })\n\t\t\t.replace(/^'(.*)'$/, function(o, $1){ return $1; });\n\n\t\t// already a full url? no change\n\t\tif (/^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/)/i.test(unquotedOrigUrl)) {\n\t\t return fullMatch;\n\t\t}\n\n\t\t// convert the url to a full url\n\t\tvar newUrl;\n\n\t\tif (unquotedOrigUrl.indexOf(\"//\") === 0) {\n\t\t \t//TODO: should we add protocol?\n\t\t\tnewUrl = unquotedOrigUrl;\n\t\t} else if (unquotedOrigUrl.indexOf(\"/\") === 0) {\n\t\t\t// path should be relative to the base url\n\t\t\tnewUrl = baseUrl + unquotedOrigUrl; // already starts with '/'\n\t\t} else {\n\t\t\t// path should be relative to current directory\n\t\t\tnewUrl = currentDir + unquotedOrigUrl.replace(/^\\.\\//, \"\"); // Strip leading './'\n\t\t}\n\n\t\t// send back the fixed url(...)\n\t\treturn \"url(\" + JSON.stringify(newUrl) + \")\";\n\t});\n\n\t// send back the fixed css\n\treturn fixedCss;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../node_modules/style-loader/lib/urls.js\n// module id = 6\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000..5ebe9d0 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,61 @@ +var webpackConf = require('./webpack.config.js'); +module.exports = function (config) { + config.set({ + basePath:'', + frameworks: ['jasmine'], + files: [{ pattern: './tests/unit/spec-bundle.js', watched: false }], + preprocessors: { './tests/unit/spec-bundle.js': ['coverage', 'webpack', 'sourcemap'] }, + webpack: { + module: webpackConf.module, + resolve: webpackConf.resolve + }, + webpackMiddleware: { + noInfo: true, + stats: 'errors-only' + }, + reporters: ['kjhtml', 'spec', 'coverage'], + // optionally, configure the reporter + coverageReporter: { + // specify a common output directory + dir: './tests/build/reports/coverage', + reporters: [ + // reporters not supporting the `file` property + { type: 'html', subdir: 'report-html' }, + { type: 'lcov', subdir: 'report-lcov' }, + // reporters supporting the `file` property, use `subdir` to directly + // output them in the `dir` directory + { type: 'cobertura', subdir: '.', file: 'cobertura.txt' }, + { type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' }, + { type: 'teamcity', subdir: '.', file: 'teamcity.txt' }, + { type: 'text', subdir: '.', file: 'text.txt' }, + { type: 'text-summary', subdir: '.', file: 'text-summary.txt' }, + ] + }, + specReporter: { + maxLogLines: 5, // limit number of lines logged per test + suppressErrorSummary: true, // do not print error summary + suppressFailed: false, // do not print information about failed tests + suppressPassed: false, // do not print information about passed tests + suppressSkipped: true, // do not print information about skipped tests + showSpecTiming: false // print the time elapsed for each spec + }, + customLaunchers: { + Chrome_travis_ci: { + base: 'Chrome', + flags: ['--no-sandbox'] + } + }, + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: true, + concurrency: Infinity + }); + + + if (process.env.TRAVIS) { + config.browsers = ['Chrome_travis_ci']; + } +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..661e867 --- /dev/null +++ b/package.json @@ -0,0 +1,52 @@ +{ + "name": "vanilla-yo-notification", + "version": "0.0.1", + "main": "src/index.ts", + "scripts": { + "start": "npm run server:dev", + "server": "npm run server:dev", + "server:dev": "webpack-dashboard -- webpack-dev-server --config ./webpack.config.js --hot --inline --progress --watch --open", + "server:prod": "cross-env NODE_ENV=production webpack-dashboard -- webpack-dev-server --config ./webpack.config.js --port 3000 --host 0.0.0.0 --hot --inline --progress --profile --watch --open --content-base dist/", + "build": "npm run build:dev", + "build:dev": "webpack --config ./webpack.config.js --progress --profile --color --display-error-details --display-cached", + "build:prod": "cross-env NODE_ENV=production webpack --config ./webpack.config.js --progress --profile --color --display-error-details --display-cached --bail", + "clean": "npm cache clear && rimraf -- dist", + "test": "karma start" + }, + "license": "MIT", + "devDependencies": { + "@types/jasmine": "^2.5.53", + "@types/lodash": "^4.14.70", + "awesome-typescript-loader": "^3.2.1", + "cross-env": "^5.0.1", + "css-loader": "^0.28.4", + "ejs-loader": "^0.3.0", + "eslint": "^4.2.0", + "expose-loader": "^0.7.3", + "jasmine": "^2.6.0", + "jasmine-core": "^2.6.4", + "karma": "^1.7.0", + "karma-babel-preprocessor": "^6.0.1", + "karma-chrome-launcher": "^2.2.0", + "karma-coverage": "^1.1.1", + "karma-firefox-launcher": "^1.0.1", + "karma-jasmine": "^1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "karma-phantomjs-launcher": "^1.0.4", + "karma-sourcemap-loader": "^0.3.7", + "karma-spec-reporter": "0.0.31", + "karma-webpack": "^2.0.4", + "rimraf": "^2.6.1", + "source-map-loader": "^0.2.1", + "style-loader": "^0.18.2", + "tslint": "^5.5.0", + "tslint-loader": "^3.5.3", + "typescript": "^2.4.1", + "webpack": "^3.3.0", + "webpack-dashboard": "^0.4.0", + "webpack-dev-server": "2.5.1" + }, + "dependencies": { + "lodash": "^4.17.4" + } +} diff --git a/src/config.interface.ts b/src/config.interface.ts new file mode 100644 index 0000000..178a309 --- /dev/null +++ b/src/config.interface.ts @@ -0,0 +1,6 @@ +export interface Config { + content: string; + timeout?: number; + title: string; + footer?: string; +}
\ No newline at end of file diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..15eaf96 --- /dev/null +++ b/src/index.html @@ -0,0 +1,22 @@ +<!DOCTYPE html> +<html lang=""> + +<head> + <meta charset="utf-8"> + <meta http-equiv="x-ua-compatible" content="ie=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <title> + <%= htmlWebpackPlugin.options.title %> + </title> + + <meta name="description" content="<%= htmlWebpackPlugin.options.title %>"> + +</head> + +<body> + <div> You have successfully started your Typescript application using Webpack. Open your console to see your printed message from the index.ts file </div> + <p>By <a href="https://twitter.com/renaudin_yann">@renaudin_yann</a> </p> +</body> + +</html>
\ No newline at end of file diff --git a/src/index.spec.ts b/src/index.spec.ts new file mode 100644 index 0000000..64b3e49 --- /dev/null +++ b/src/index.spec.ts @@ -0,0 +1,5 @@ +describe('TypeScript WebPack Starter Tests', () => { + it('A good way to start building an awesome lib is by doing Unit Tests 👌🏽', () => { + expect(true).toBe(true); + }); +})
\ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..bb3d67c --- /dev/null +++ b/src/index.ts @@ -0,0 +1,3 @@ +import VanillaYoNotification from "./vanilla.yo.notification"; + +(window as any).VanillaYoNotification = VanillaYoNotification;
\ No newline at end of file diff --git a/src/styles/style.css b/src/styles/style.css new file mode 100644 index 0000000..b941e56 --- /dev/null +++ b/src/styles/style.css @@ -0,0 +1,38 @@ + + +.notif-mainContainer { + z-index: 999; + position: fixed; + width: 350px; + max-width: 98%; + font-family: "Segoe UI","Tahoma","Calibri","Verdana",sans-serif; + color: #999; + box-sizing: border-box; +} + +.notif-mainContainer.topRight{ + top: 8px; + right: 8px; +} + +.notif-inner { + display: flex; + flex-direction: column; +} + +.vanilla-yo-notification{ + width: 250px; + background: #58a758; + color: white; + position: relative; + cursor: pointer; + padding: 8px; + margin-bottom: 12px; + display: flex; +} + + +.notification_header{ + font-size: 15px; + font-weight: bold +}
\ No newline at end of file diff --git a/src/vanilla.yo.notification.ts b/src/vanilla.yo.notification.ts new file mode 100644 index 0000000..7b50804 --- /dev/null +++ b/src/vanilla.yo.notification.ts @@ -0,0 +1,76 @@ +// Import stylesheets +import './styles/style.css'; +import { Config } from './config.interface'; + +export default class VanillaYoNotification { + + private notificationTemplate: string; + private defaultConfig: Config; + private notifInner: any; + + constructor() { + this.defaultConfig = { + content: '', + footer: '', + timeout: 3000, + title: '' + } + this.init(); + } + + private init() { + + this.buildContainers(); + + + } + + buildContainers(){ + let container = document.createElement('div'); + container.className = "notif-mainContainer topRight"; + + this.notifInner = document.createElement('div'); + this.notifInner.className = "notif-inner"; + + container.appendChild(this.notifInner); + document.body.appendChild(container); + } + + + show(config: Config) { + + let notifContainer = document.createElement('div'); + notifContainer.className = "vanilla-yo-notification"; + + + this.notificationTemplate = ` + <div class="notification_container"> + <div class="notification_header"> + ${config.title ? config.title : this.defaultConfig.title} + </div> + <div class="notification_body"> + ${config.content ? config.content : this.defaultConfig.content} + </div> + <div class="notification_footer"> + ${config.footer ? config.footer : this.defaultConfig.footer} + </div> + </div> + `; + + notifContainer.innerHTML = (this.notificationTemplate); + + this.notifInner.appendChild(notifContainer); + + + setTimeout(() => { + this.destroyNotification(notifContainer); + }, (config.timeout ? config.timeout : this.defaultConfig.timeout)); + + + } + + private destroyNotification(container: Node) { + this.notifInner.removeChild(container); + } +} + diff --git a/src/vendor.ts b/src/vendor.ts new file mode 100644 index 0000000..27f2cc1 --- /dev/null +++ b/src/vendor.ts @@ -0,0 +1,4 @@ +// Application Dependencies + +import 'lodash'; + diff --git a/tests/unit/spec-bundle.js b/tests/unit/spec-bundle.js new file mode 100644 index 0000000..964cf50 --- /dev/null +++ b/tests/unit/spec-bundle.js @@ -0,0 +1,9 @@ +Error.stackTraceLimit = Infinity; + +var testContext = require.context('./../../src', true, /\.spec\.ts/); + +function requireAll(requireContext) { + return requireContext.keys().map(requireContext); +} + +var modules = requireAll(testContext);
\ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e4239f8 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "sourceMap": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": [ + "es2015", + "dom" + ], + "noImplicitAny": true, + "suppressImplicitAnyIndexErrors": true + }, + "exclude": [ + "node_modules", + "dist" + ] +}
\ No newline at end of file diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..d6fcfd2 --- /dev/null +++ b/tslint.json @@ -0,0 +1,30 @@ +{ + "rules": { + "class-name": true, + "comment-format": [true, "check-space"], + "indent": [true, "spaces"], + "no-duplicate-variable": true, + "no-eval": true, + "no-internal-module": true, + "no-trailing-whitespace": true, + "no-var-keyword": true, + "one-line": [true, "check-open-brace", "check-whitespace"], + "semicolon": false, + "triple-equals": [true, "allow-null-check"], + "typedef-whitespace": [true, { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }], + "variable-name": [true, "ban-keywords"], + "whitespace": [true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } +} diff --git a/typings.json b/typings.json new file mode 100644 index 0000000..63eac50 --- /dev/null +++ b/typings.json @@ -0,0 +1,7 @@ +{ + "globalDependencies": { + }, + "dependencies": { + "lodash": "registry:npm/lodash#4.0.0+20160723033700" + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..e88631d --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,66 @@ +const webpack = require("webpack"); +const path = require("path"); +const HtmlWebpackPlugin = require("html-webpack-plugin"); +const DashboardPlugin = require("webpack-dashboard/plugin"); +const nodeEnv = process.env.NODE_ENV || "development"; +const isProd = nodeEnv === "production"; + +var config = { + devtool: isProd ? "hidden-source-map" : "source-map", + context: path.resolve("./src"), + entry: { + app: "./index.ts" + }, + output: { + path: path.resolve("./dist"), + filename: "vanilla-yo-notification.js", + sourceMapFilename: "vanilla-yo-notification.js.map", + devtoolModuleFilenameTemplate: function (info) { + return "file:///" + info.absoluteResourcePath; + } + }, + module: { + rules: [ + { + enforce: "pre", + test: /\.ts?$/, + exclude: ["node_modules"], + use: ["awesome-typescript-loader", "source-map-loader"] + }, + { test: /\.css$/, loaders: ["style-loader", "css-loader"] } + ] + }, + resolve: { + extensions: [".ts", ".js"] + }, + plugins: [ + new webpack.DefinePlugin({ + "process.env": { + // eslint-disable-line quote-props + NODE_ENV: JSON.stringify(nodeEnv) + } + }), + new webpack.optimize.UglifyJsPlugin({ + compress: { warnings: false }, + output: { comments: false }, + sourceMap: true + }), + new DashboardPlugin(), + new webpack.LoaderOptionsPlugin({ + options: { + tslint: { + emitErrors: true, + failOnHint: true + } + } + }) + ], + devServer: { + contentBase: path.join(__dirname, "dist/"), + compress: true, + port: 3000, + hot: true + } +}; + +module.exports = config; |