mode development

This commit is contained in:
Matteo Manzinello 2020-07-07 12:35:08 +02:00
parent bd0706afbd
commit 0d232a35bd
3 changed files with 85 additions and 51 deletions

View File

@ -91,44 +91,45 @@ return /******/ (function(modules) { // webpackBootstrap
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 4);
/******/ return __webpack_require__(__webpack_require__.s = "./mailgo.lib.ts");
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/******/ ({
/***/ "../i18n/i18n.json":
/*!*************************!*\
!*** ../i18n/i18n.json ***!
\*************************/
/*! exports provided: languages, translations, default */
/***/ (function(module) {
module.exports = JSON.parse("{\"a\":[\"en\",\"it\"],\"b\":{\"en\":{\"open_in\":\"open in \",\"cc_\":\"cc \",\"bcc_\":\"bcc \",\"subject_\":\"subject \",\"body_\":\"body \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"call\",\"open\":\"open\",\"_default\":\" default\",\"_as_default\":\" as default\",\"copy\":\"copy\"},\"it\":{\"open_in\":\"apri con \",\"cc_\":\"cc \",\"bcc_\":\"ccn \",\"subject_\":\"oggetto \",\"body_\":\"testo \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"chiama\",\"open\":\"apri\",\"_default\":\" \",\"_as_default\":\" \",\"copy\":\"copia\"}}}");
module.exports = JSON.parse("{\"languages\":[\"en\",\"it\"],\"translations\":{\"en\":{\"open_in\":\"open in \",\"cc_\":\"cc \",\"bcc_\":\"bcc \",\"subject_\":\"subject \",\"body_\":\"body \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"call\",\"open\":\"open\",\"_default\":\" default\",\"_as_default\":\" as default\",\"copy\":\"copy\"},\"it\":{\"open_in\":\"apri con \",\"cc_\":\"cc \",\"bcc_\":\"ccn \",\"subject_\":\"oggetto \",\"body_\":\"testo \",\"gmail\":\"Gmail\",\"outlook\":\"Outlook\",\"telegram\":\"Telegram\",\"whatsapp\":\"WhatsApp\",\"skype\":\"Skype\",\"call\":\"chiama\",\"open\":\"apri\",\"_default\":\" \",\"_as_default\":\" \",\"copy\":\"copia\"}}}");
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
var result = __webpack_require__(2);
if (typeof result === "string") {
module.exports = result;
} else {
module.exports = result.toString();
}
/***/ }),
/* 2 */
/***/ "../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!../src/mailgo.scss":
/*!*********************************************************************************************************!*\
!*** ../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!../src/mailgo.scss ***!
\*********************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(3);
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "../node_modules/css-loader/dist/runtime/api.js");
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, ".m-modal{position:fixed;top:0;right:0;bottom:0;left:0;justify-content:center;align-items:center;flex-direction:column;overflow:hidden;font-size:15px;z-index:10000}.m-modal p,.m-modal span,.m-modal strong,.m-modal a{margin:0;padding:0;font-size:100%;line-height:1;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\";text-rendering:optimizeLegibility}.m-modal strong{font-weight:700}.m-modal .m-modal-back{position:absolute;z-index:10001;top:0;right:0;bottom:0;left:0;background-color:#20232a;opacity:0.8}.m-modal .m-modal-content{position:relative;z-index:10002;box-sizing:content-box;text-align:center;min-width:200px;max-width:240px;background-color:#fff;opacity:0.95;border-radius:20px;box-shadow:0 3px 20px rgba(32,35,42,0.5);color:#4a4a4a;display:flex;flex-direction:column;overflow:auto;padding:24px;transition:0.5s box-shadow}.m-modal .m-modal-content:hover{opacity:1}.m-modal .m-modal-content .m-title{margin-bottom:8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.m-modal .m-modal-content .m-details{margin-bottom:10px}.m-modal .m-modal-content .m-details p{font-size:12px;margin-top:3px;margin-bottom:3px}.m-modal .m-modal-content a{padding:10px;color:#4a4a4a;border-radius:20px;text-decoration:none}.m-modal .m-modal-content a.m-gmail{color:#d44638}.m-modal .m-modal-content a.m-gmail:hover{background-color:rgba(212,70,56,0.08);color:#d44638}.m-modal .m-modal-content a.m-outlook{color:#0072c6}.m-modal .m-modal-content a.m-outlook:hover{background-color:rgba(0,114,198,0.08);color:#0072c6}.m-modal .m-modal-content a.m-tg{color:#08c}.m-modal .m-modal-content a.m-tg:hover{background-color:rgba(0,136,204,0.08);color:#08c}.m-modal .m-modal-content a.m-wa{color:#00bfa5}.m-modal .m-modal-content a.m-wa:hover{background-color:rgba(0,191,165,0.08);color:#00bfa5}.m-modal .m-modal-content a.m-skype{color:#00aff0}.m-modal .m-modal-content a.m-skype:hover{background-color:rgba(0,175,240,0.08);color:#00aff0}.m-modal .m-modal-content a.m-copy{padding:16px 10px;font-size:16px}.m-modal .m-modal-content a.m-default:hover,.m-modal .m-modal-content a.m-copy:hover{background-color:rgba(0,0,0,0.08);color:#4a4a4a}.m-modal .m-modal-content a.m-by{font-size:8px;margin-top:0.8rem;padding:5px;color:#4a4a4a;opacity:0.55}.m-modal .m-modal-content a.m-by:hover{opacity:1}.m-modal .m-modal-content .w-500{font-weight:500}.m-modal.m-dark .m-modal-content{color:#fff;background-color:#20232a}.m-modal.m-dark .m-modal-content a{color:#bbb}.m-modal.m-dark .m-modal-content a:hover{color:#fff}.m-modal.m-dark .m-modal-content a.m-gmail:hover{color:#faeceb}.m-modal.m-dark .m-modal-content a.m-outlook:hover{color:#e5f0f9}.m-modal.m-dark .m-modal-content a.m-tg:hover{color:#e5f3f9}.m-modal.m-dark .m-modal-content a.m-wa:hover{color:#e5f8f6}.m-modal.m-dark .m-modal-content a.m-skype:hover{color:#e5f7fd}\n", ""]);
exports.push([module.i, ".m-modal {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n overflow: hidden;\n font-size: 15px;\n z-index: 10000; }\n .m-modal p,\n .m-modal span,\n .m-modal strong,\n .m-modal a {\n margin: 0;\n padding: 0;\n font-size: 100%;\n line-height: 1;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n text-rendering: optimizeLegibility; }\n .m-modal strong {\n font-weight: 700; }\n .m-modal .m-modal-back {\n position: absolute;\n z-index: 10001;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: #20232a;\n opacity: 0.8; }\n .m-modal .m-modal-content {\n position: relative;\n z-index: 10002;\n box-sizing: content-box;\n text-align: center;\n min-width: 200px;\n max-width: 240px;\n background-color: #fff;\n opacity: 0.95;\n border-radius: 20px;\n box-shadow: 0 3px 20px rgba(32, 35, 42, 0.5);\n color: #4a4a4a;\n display: flex;\n flex-direction: column;\n overflow: auto;\n padding: 24px;\n transition: 0.5s box-shadow; }\n .m-modal .m-modal-content:hover {\n opacity: 1; }\n .m-modal .m-modal-content .m-title {\n margin-bottom: 8px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis; }\n .m-modal .m-modal-content .m-details {\n margin-bottom: 10px; }\n .m-modal .m-modal-content .m-details p {\n font-size: 12px;\n margin-top: 3px;\n margin-bottom: 3px; }\n .m-modal .m-modal-content a {\n padding: 10px;\n color: #4a4a4a;\n border-radius: 20px;\n text-decoration: none; }\n .m-modal .m-modal-content a.m-gmail {\n color: #d44638; }\n .m-modal .m-modal-content a.m-gmail:hover {\n background-color: rgba(212, 70, 56, 0.08);\n color: #d44638; }\n .m-modal .m-modal-content a.m-outlook {\n color: #0072c6; }\n .m-modal .m-modal-content a.m-outlook:hover {\n background-color: rgba(0, 114, 198, 0.08);\n color: #0072c6; }\n .m-modal .m-modal-content a.m-tg {\n color: #0088cc; }\n .m-modal .m-modal-content a.m-tg:hover {\n background-color: rgba(0, 136, 204, 0.08);\n color: #0088cc; }\n .m-modal .m-modal-content a.m-wa {\n color: #00bfa5; }\n .m-modal .m-modal-content a.m-wa:hover {\n background-color: rgba(0, 191, 165, 0.08);\n color: #00bfa5; }\n .m-modal .m-modal-content a.m-skype {\n color: #00aff0; }\n .m-modal .m-modal-content a.m-skype:hover {\n background-color: rgba(0, 175, 240, 0.08);\n color: #00aff0; }\n .m-modal .m-modal-content a.m-copy {\n padding: 16px 10px;\n font-size: 16px; }\n .m-modal .m-modal-content a.m-default:hover, .m-modal .m-modal-content a.m-copy:hover {\n background-color: rgba(0, 0, 0, 0.08);\n color: #4a4a4a; }\n .m-modal .m-modal-content a.m-by {\n font-size: 8px;\n margin-top: 0.8rem;\n padding: 5px;\n color: #4a4a4a;\n opacity: 0.55; }\n .m-modal .m-modal-content a.m-by:hover {\n opacity: 1; }\n .m-modal .m-modal-content .w-500 {\n font-weight: 500; }\n .m-modal.m-dark .m-modal-content {\n color: #fff;\n background-color: #20232a; }\n .m-modal.m-dark .m-modal-content a {\n color: #bbbbbb; }\n .m-modal.m-dark .m-modal-content a:hover {\n color: #fff; }\n .m-modal.m-dark .m-modal-content a.m-gmail:hover {\n color: #faeceb; }\n .m-modal.m-dark .m-modal-content a.m-outlook:hover {\n color: #e5f0f9; }\n .m-modal.m-dark .m-modal-content a.m-tg:hover {\n color: #e5f3f9; }\n .m-modal.m-dark .m-modal-content a.m-wa:hover {\n color: #e5f8f6; }\n .m-modal.m-dark .m-modal-content a.m-skype:hover {\n color: #e5f7fd; }\n", ""]);
// Exports
module.exports = exports;
/***/ }),
/* 3 */
/***/ "../node_modules/css-loader/dist/runtime/api.js":
/*!******************************************************!*\
!*** ../node_modules/css-loader/dist/runtime/api.js ***!
\******************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
@ -228,21 +229,41 @@ function toComment(sourceMap) {
}
/***/ }),
/* 4 */
/***/ "../src/mailgo.scss":
/*!**************************!*\
!*** ../src/mailgo.scss ***!
\**************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
var result = __webpack_require__(/*! !../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!./mailgo.scss */ "../node_modules/css-loader/dist/cjs.js!../node_modules/sass-loader/dist/cjs.js!../src/mailgo.scss");
if (typeof result === "string") {
module.exports = result;
} else {
module.exports = result.toString();
}
/***/ }),
/***/ "../src/mailgo.ts":
/*!************************!*\
!*** ../src/mailgo.ts ***!
\************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ../i18n/i18n.json
var i18n = __webpack_require__(0);
// CONCATENATED MODULE: ../src/mailgo.ts
/* harmony import */ var _i18n_i18n_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../i18n/i18n.json */ "../i18n/i18n.json");
var _i18n_i18n_json__WEBPACK_IMPORTED_MODULE_0___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../i18n/i18n.json */ "../i18n/i18n.json", 1);
// i18n for mailgo
// mailgo scss
var mailgoCSS = __webpack_require__(1).toString(); // default lang
var mailgoCSS = __webpack_require__(/*! ./mailgo.scss */ "../src/mailgo.scss").toString(); // default lang
var DEFAULT_LANG = "en"; // links
@ -273,19 +294,19 @@ var tel = "",
var title, titleTel, detailCc, detailBcc, detailSubject, detailBody, ccValue, bccValue, subjectValue, bodyValue; // mailgo buttons (actions)
var gmail, outlook, mailgo_open, telegram, wa, skype, call, copyMail, copyTel;
var gmail, outlook, open, telegram, wa, skype, call, copyMail, copyTel;
/**
* mailgoInit
* the function that creates the mailgo elements in DOM
*/
var mailgo_mailgoInit = function mailgoInit(mailgoConfig) {
var mailgoInit = function mailgoInit(mailgoConfig) {
// default language
var lang = DEFAULT_LANG; // translations
var translations = i18n["b" /* translations */]; // if a default language is defined use it
var translations = _i18n_i18n_json__WEBPACK_IMPORTED_MODULE_0__["translations"]; // if a default language is defined use it
if ((mailgoConfig === null || mailgoConfig === void 0 ? void 0 : mailgoConfig.lang) && i18n["a" /* languages */].includes(mailgoConfig.lang)) {
if ((mailgoConfig === null || mailgoConfig === void 0 ? void 0 : mailgoConfig.lang) && _i18n_i18n_json__WEBPACK_IMPORTED_MODULE_0__["languages"].includes(mailgoConfig.lang)) {
lang = mailgoConfig.lang;
} // if is defined <html lang=""> use it!
@ -294,7 +315,7 @@ var mailgo_mailgoInit = function mailgoInit(mailgoConfig) {
// keep the lang from html
var htmlLang = document.documentElement.lang; // if there are translations...
if (i18n["a" /* languages */].includes(htmlLang)) {
if (_i18n_i18n_json__WEBPACK_IMPORTED_MODULE_0__["languages"].includes(htmlLang)) {
lang = document.documentElement.lang;
}
} // strings
@ -397,17 +418,17 @@ var mailgo_mailgoInit = function mailgoInit(mailgoConfig) {
outlook.appendChild(outlookSpan);
modalContent.appendChild(outlook); // open default
mailgo_open = createElement("a");
mailgo_open.id = "m-open";
mailgo_open.href = DEFAULT_BTN_HREF;
mailgo_open.classList.add("m-open");
mailgo_open.classList.add("m-default");
open = createElement("a");
open.id = "m-open";
open.href = DEFAULT_BTN_HREF;
open.classList.add("m-open");
open.classList.add("m-default");
var openSpan = createElement(span);
openSpan.className = "w-500";
openSpan.appendChild(createTextNode(strings.open || defaultStrings.open));
mailgo_open.appendChild(openSpan);
mailgo_open.appendChild(createTextNode(strings._default || defaultStrings._default));
modalContent.appendChild(mailgo_open); // copy
open.appendChild(openSpan);
open.appendChild(createTextNode(strings._default || defaultStrings._default));
modalContent.appendChild(open); // copy
copyMail = createElement("a");
copyMail.id = "m-copy";
@ -589,7 +610,7 @@ var mailgoRender = function mailgoRender() {
gmail.addEventListener("click", openGmail);
outlook.addEventListener("click", openOutlook);
encEmail = encodeEmail(mail);
mailgo_open.addEventListener("click", openDefault);
open.addEventListener("click", openDefault);
copyMail.addEventListener("click", function () {
return copy(mail);
});
@ -1018,24 +1039,37 @@ function mailgo(mailgoConfig) {
if (mailgoConfig === null || mailgoConfig === void 0 ? void 0 : mailgoConfig.initEvent) {
document.addEventListener(mailgoConfig.initEvent, function () {
mailgo_mailgoInit(mailgoConfig);
mailgoInit(mailgoConfig);
});
} else {
mailgo_mailgoInit(mailgoConfig);
mailgoInit(mailgoConfig);
}
}
}
/* harmony default export */ var src_mailgo = (mailgo);
// CONCATENATED MODULE: ./mailgo.lib.ts
/* harmony default export */ __webpack_exports__["default"] = (mailgo);
/***/ }),
/***/ "./mailgo.lib.ts":
/*!***********************!*\
!*** ./mailgo.lib.ts ***!
\***********************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _src_mailgo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/mailgo */ "../src/mailgo.ts");
// webpack > lib/mailgo.js
/* harmony default export */ var mailgo_lib = __webpack_exports__["default"] = (src_mailgo);
/* harmony default export */ __webpack_exports__["default"] = (_src_mailgo__WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ })
/******/ ])["default"];
/******/ })["default"];
});
//# sourceMappingURL=mailgo.js.map

File diff suppressed because one or more lines are too long

View File

@ -53,7 +53,7 @@ module.exports = [
},
},
{
mode: "production",
mode: "development",
target: "node",
devtool: "source-map",
entry: "./mailgo.lib.ts",