From 19528778a9b717d927b61abdc25363793f23c994 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sat, 29 Aug 2020 18:42:14 +0200 Subject: [PATCH] proper naming conventions --- README.md | 12 ++++++------ dist/mailymaily-min.js | 1 - dist/mailymaily.min.js | 1 + gulpfile.js | 22 +++++++++++----------- index.html | 2 +- src/{html => }/component.html | 0 src/{js => }/mailymaily.js | 0 7 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 dist/mailymaily-min.js create mode 100644 dist/mailymaily.min.js rename src/{html => }/component.html (100%) rename src/{js => }/mailymaily.js (100%) diff --git a/README.md b/README.md index ff11f0c..9ec782d 100644 --- a/README.md +++ b/README.md @@ -10,21 +10,21 @@ yarn && yarn build [Example](index.html) -Basic: Link the dist file "mailymaily-min.js" at the bottom of your footer. +Basic: Link the dist file `mailymaily.min.js` at the bottom of your footer. ```html - + ``` Alternatively: Add defer or async=false when linking in the header ```html - + - + ``` ### VueJS & NuxtJs -Place the dist file "mailymaily-min.js" in the static folder. +Place the dist file "mailymaily.min.js" in the static folder. Link the dist file at the bottom of your layout, for example: ```html ``` \ No newline at end of file diff --git a/dist/mailymaily-min.js b/dist/mailymaily-min.js deleted file mode 100644 index acb0a0f..0000000 --- a/dist/mailymaily-min.js +++ /dev/null @@ -1 +0,0 @@ -var mailymailyApp=mailymailyApp||{};!function(t){var e=document.getElementsByTagName("html")[0],i=document.getElementsByTagName("body")[0],o=null,n=null,a=' ',l='',r=new Object;r.linkClass="mailymaily",r.autoClose=!0,r.disableOnMobile=!0,r.title="Neue E-Mail schreiben mit",r.buttonText1="Gmail",r.buttonText2="Outlook Web",r.buttonText4="Standardanwendung",r.buttonIcon1='',r.buttonIcon2='',r.buttonIcon3=a,r.buttonIcon4='',r.buttonIconCopy=l,r.buttonTextCopy="Kopieren",r.buttonTextCopyAction="Kopiert!";var c=0,s="auto";t.buildStyleTag=function(){var e=document.createElement("style"),i=".mailymaily-modal{background-color:#000;background-color:rgba(0,0,0,.4);bottom:0;color:#303131;display:none;height:100%;left:0;margin:0;padding:0;position:fixed;right:0;top:0;width:100%;z-index:1000}.mailymaily-modal-content{-webkit-animation:mailymaily-appear .4s;animation:mailymaily-appear .4s;background-color:#f1f5f8;border-radius:8px;bottom:auto;box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);left:50%;max-height:calc(100% - 100px);overflow:auto;padding:0;position:fixed;right:-45%;top:50%;transform:translate(-50%,-50%)}.mailymaily-modal-content:focus,.mailymaily-modal-content:hover{overflow-y:auto}@media only screen and (min-width:768px){.mailymaily-modal-content{right:auto}}.mailymaily-modal-head{align-items:center;background-color:#fff;clear:both;display:flex;min-width:0;padding:10px 20px}.mailymaily-modal-title{color:#303131;flex:1;font-family:sans-serif;font-size:120%;font-weight:700;margin:0;overflow:hidden;padding:0;text-overflow:ellipsis;white-space:nowrap}.mailymaily-modal-close{color:#aaa;flex:initial;font-size:38px;margin-left:20px;position:relative;text-align:right;text-decoration:none;top:-4px}.mailymaily-modal-close:focus,.mailymaily-modal-close:hover{color:#000;cursor:pointer;font-weight:700;outline:0}.mailymaily-modal-body{height:100%;padding:20px}.mailymaily-button{color:#333;text-decoration:none}.mailymaily-button:focus{outline:0}.mailymaily-button:focus .mailymaily-button-content{background-color:#555;color:#fff}.mailymaily-button-content{background-color:#fff;border:none;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.18);margin-bottom:20px;overflow:hidden;padding:15px 20px;text-overflow:ellipsis;white-space:nowrap}.mailymaily-button-content:hover{background-color:#555;color:#fff}.mailymaily-button:last-child .mailymaily-button-content{margin-bottom:0}.mailymaily-button-icon{display:inline-block;font-weight:700;position:relative;top:0}.mailymaily-button-icon svg{height:24px;width:24px}.mailymaily-button-text{display:inline-block;margin-left:0;position:relative;top:-2px;vertical-align:sub}.mailymaily-copy{border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.18);height:59px;margin-top:20px;position:relative}.mailymaily-button-copy{background-color:#fff;border:none;border-bottom-left-radius:8px;border-top-left-radius:8px;bottom:21px;color:#333;font-size:100%;height:100%;left:0;overflow:false;padding:15px 20px;position:absolute;text-overflow:ellipsis;top:0;white-space:nowrap;width:130px}.mailymaily-button-copy:focus,.mailymaily-button-copy:hover{background-color:#555;color:#fff;cursor:pointer;outline:0}.mailymaily-button-copy-clicked,.mailymaily-button-copy-clicked:focus,.mailymaily-button-copy-clicked:hover{background-color:#1f9d55;color:#fff}.mailymaily-button-copy-clicked .mailymaily-button-icon,.mailymaily-button-copy-clicked:focus .mailymaily-button-icon,.mailymaily-button-copy-clicked:hover .mailymaily-button-icon{display:none;visibility:hidden}.mailymaily-button-copy-clicked .mailymaily-button-text,.mailymaily-button-copy-clicked:focus .mailymaily-button-text,.mailymaily-button-copy-clicked:hover .mailymaily-button-text{color:#fff;top:2px}.mailymaily-email-address{background-color:#d8dcdf;border:none;border-radius:8px;box-shadow:unset;box-sizing:border-box;color:#48494a;font-size:100%;height:100%;overflow:hidden;padding:20px 20px 20px 140px;text-overflow:ellipsis;white-space:nowrap;width:100%}.mailymaily-brand{color:#888;font-size:80%;margin-top:20px;text-align:center}.mailymaily-brand a{color:#888}.mailymaily-brand a:focus,.mailymaily-brand a:hover{font-weight:700;outline:0}.mailymaily-no-scroll{overflow:hidden;position:fixed;width:100%}.mailymaily-is-hidden{display:none;visibility:hidden}@-webkit-keyframes mailymaily-appear{0%{opacity:0;transform:translate(-50%,-50%) scale(0,0)}100%{opacity:1;transform:translate(-50%,-50%) scale(1,1)}}@keyframes mailymaily-appear{0%{opacity:0;transform:translate(-50%,-50%) scale(0,0)}100%{opacity:1;transform:translate(-50%,-50%) scale(1,1)}}";return i=i.replace(/mailymaily/g,t.prefix()),e.setAttribute("id",t.prefix("-styles")),e.styleSheet?e.styleSheet.cssText=i:e.appendChild(document.createTextNode(i)),e},t.embedStyleTag=function(){if(!t.styleTagExists()){var e=document.head.firstChild;document.head.insertBefore(t.buildStyleTag(),e)}},t.styleTagExists=function(){return!!document.getElementById(t.prefix("-styles"))},t.buildModal=function(){var e=document.createElement("div"),i=`
${r.title}
×
`;return i=i.replace(/mailymaily/g,t.prefix()),e.setAttribute("id",t.prefix("-modal")),e.setAttribute("class",t.prefix("-modal")),e.setAttribute("style","display: none;"),e.setAttribute("aria-hidden",!0),e.innerHTML=i,e},t.embedModal=function(){if(!t.modalExists()){var e=t.buildModal(),i=document.body.firstChild;document.body.insertBefore(e,i)}},t.modalExists=function(){return!!document.getElementById(t.prefix("-modal"))},t.getModal=function(e){return t.hydrateModal(e),document.getElementById(t.prefix("-modal"))},t.hydrateModal=function(e){var i=t.getEmail(e),o=t.getLinkField(e,"subject"),n=t.getLinkField(e,"cc"),a=t.getLinkField(e,"bcc"),l=t.getLinkField(e,"body");document.getElementById(t.prefix("-button-1")).href=`https://mail.google.com/mail/?view=cm&fs=1&to=${i}&su=${o}&cc=${n}&bcc=${a}&body=${l}`,document.getElementById(t.prefix("-button-2")).href=`https://outlook.office.com/owa/?path=/mail/action/compose&to=${i}&subject=${o}&body=${l}`,document.getElementById(t.prefix("-button-4")).href=`mailto:${i}?subject=${o}&cc=${n}&bcc=${a}&body=${l}`,document.getElementById(t.prefix("-email-address")).innerHTML=i,document.getElementById(t.prefix("-button-icon-1")).innerHTML=r.buttonIcon1,document.getElementById(t.prefix("-button-icon-2")).innerHTML=r.buttonIcon2,document.getElementById(t.prefix("-button-icon-4")).innerHTML=r.buttonIcon4,document.getElementById(t.prefix("-button-icon-copy")).innerHTML=r.buttonIconCopy,t.toggleHideCopyUi(i)},t.savePageScrollPosition=function(){c=window.pageYOffset,i.style.top=-c+"px"},t.restorePageScrollPosition=function(){window.scrollTo(0,c),i.style.top=0},t.saveScrollBehavior=function(){s=e.style.scrollBehavior,e.style.scrollBehavior="auto"},t.restoreScrollBehavior=function(){e.style.scrollBehavior=s},t.saveLastDocElementFocused=function(){n=document.activeElement},t.openModal=function(e){r.disableOnMobile&&t.isMobileDevice()||(e.preventDefault(),t.saveLastDocElementFocused(),t.savePageScrollPosition(),t.saveScrollBehavior(),t.displayModal(e),t.hideModalFromScreenReader(!1),t.enablePageScrolling(!1),t.modalFocus(),t.triggerEvent(o,"open"))},t.displayModal=function(e){var i=t.getParentElement(e.target,"a");(o=t.getModal(i)).style.display="block"},t.modalFocus=function(){o.focusableChildren=Array.from(o.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])')),o.focusableChildren[1].focus()},t.closeModal=function(e){e.preventDefault(),t.hideModal(),t.enablePageScrolling(!0),t.restorePageScrollPosition(),t.restoreScrollBehavior(),t.docRefocus(),t.triggerEvent(o,"close")},t.hideModal=function(){t.hideModalFromScreenReader(!0),t.isDefined(o)&&(o.style.display="none")},t.hideModalFromScreenReader=function(e){t.isDefined(o)&&o.setAttribute("aria-hidden",e)},t.enablePageScrolling=function(o){o?(i.classList.remove(t.prefix("-no-scroll")),e.classList.remove(t.prefix("-no-scroll"))):(i.classList.add(t.prefix("-no-scroll")),e.classList.add(t.prefix("-no-scroll")))},t.docRefocus=function(){n.focus()},t.openClient=function(e,i){var o="_blank";t.isDefaultEmailAppButton(e)&&(o="_self"),window.open(e.href,o),t.triggerEvent(e,"compose"),r.autoClose&&t.closeModal(i)},t.isDefaultEmailAppButton=function(e){return e.id==t.prefix("-button-4")},t.getParentElement=function(t,e){for(;null!==t;){if(t.tagName.toUpperCase()==e.toUpperCase())return t;t=t.parentNode}return null},t.triggerEvent=function(t,e){var i=new Event(e);t.dispatchEvent(i)},t.isMobileDevice=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e},t.listenForEvents=function(){t.listenForClickOnLink(),t.listenForClickOnClient(),t.listenForClickOnCopy(),t.listenForClickOnClose(),t.listenForClickOnWindow(),t.listenForKeys()},t.listenForClickOnLink=function(){for(var e=document.getElementsByClassName(t.prefix()),i=0;i0&&(i[1]=e.replace(i[0]+"?","").trim()),i},t.getLinkField=function(e,i){var o=t.splitLink(e),n="",a=[],l=[];null!==o&&o.length>0&&(n=o[1]),null!==n&&n.length>0&&(a=(n=n.replace("%20&%20","%20%26%20")).split("&"));for(var r=0;r0&&(o=i[0]),decodeURIComponent(o)},t.getClassHideCopyUi=function(){return t.prefix("-is-hidden")},t.toggleHideCopyUi=function(e){var i=document.getElementById(t.prefix("-copy"));0==e.length?i.classList.add(t.getClassHideCopyUi()):i.classList.remove(t.getClassHideCopyUi())},t.toggleCopyButton=function(){button=document.getElementById(t.prefix("-button-copy")),buttonText=document.getElementById(t.prefix("-button-text-copy")),buttonText.innerHTML=r.buttonTextCopyAction,button.classList.add(t.prefix("-button-copy-clicked")),setTimeout(function(){buttonText.innerHTML=r.buttonTextCopy,button.classList.remove(t.prefix("-button-copy-clicked"))},600)},t.copy=function(e){e.preventDefault();var i=t.getParentElement(e.target,"button").getAttribute("data-copytargetid"),o=document.getElementById(i),n=document.createRange();n.selectNodeContents(o);var a=window.getSelection();a.removeAllRanges(),a.addRange(n),document.execCommand("copy"),t.triggerEvent(o,"copy"),t.toggleCopyButton()},t.isiOSDevice=function(){return navigator.userAgent.match(/ipad|iphone/i)},t.setOptions=function(e){if(e)var i=JSON.stringify(e);else i=t.getOptionsFromScriptTag();if(i&&i.trim().length>0)for(var o in i=JSON.parse(i),r)i.hasOwnProperty(o)&&(r[o]=t.sanitizeUserOption(o,i[o]))},t.sanitizeUserOption=function(e,i){return t.stringContains(e,"icon")?t.validateSvg(e,i):t.isString(i)?t.stripHtml(i):i},t.validateSvg=function(e,i){t.getSvg(e,i).then(function(o){if(!t.stringIsSvg(o.responseText))throw new Error(e+": "+i+" is not an SVG file.");if(t.stringHasScript(o.responseText))throw new Error(e+": "+i+" is an invalid SVG file.");r[e]=o.responseText}).catch(function(t){r[e]="buttonIconCopy"==e?l:a,console.log(t)})},t.loadSvg=function(t,e){return new Promise((t,i)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.onload=function(e){200==o.status?t(o):i(o)},o.send()})},t.getSvg=async function(e,i){return await t.loadSvg(e,i)},t.isString=function(t){return"string"==typeof t},t.stripHtml=function(t){return t.replace(/(<([^>]+)>)/g,"")},t.stringContains=function(t,e){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},t.stringIsSvg=function(t){return t.startsWith(" ',l='',r=new Object;r.linkClass="mailymaily",r.autoClose=!0,r.disableOnMobile=!0,r.title="Neue E-Mail schreiben mit",r.buttonText1="Gmail",r.buttonText2="Outlook Web",r.buttonText4="Standardanwendung",r.buttonIcon1='',r.buttonIcon2='',r.buttonIcon3=a,r.buttonIcon4='',r.buttonIconCopy=l,r.buttonTextCopy="Kopieren",r.buttonTextCopyAction="Kopiert!";var c=0,s="auto";t.buildStyleTag=function(){var e=document.createElement("style"),i=".mailymaily-modal{background-color:#000;background-color:rgba(0,0,0,.4);bottom:0;color:#303131;display:none;height:100%;left:0;margin:0;padding:0;position:fixed;right:0;top:0;width:100%;z-index:1000}.mailymaily-modal-content{-webkit-animation:mailymaily-appear .4s;animation:mailymaily-appear .4s;background-color:#f1f5f8;border-radius:8px;bottom:auto;box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);left:50%;max-height:calc(100% - 100px);overflow:auto;padding:0;position:fixed;right:-45%;top:50%;transform:translate(-50%,-50%)}.mailymaily-modal-content:focus,.mailymaily-modal-content:hover{overflow-y:auto}@media only screen and (min-width:768px){.mailymaily-modal-content{right:auto}}.mailymaily-modal-head{align-items:center;background-color:#fff;clear:both;display:flex;min-width:0;padding:10px 20px}.mailymaily-modal-title{color:#303131;flex:1;font-family:sans-serif;font-size:120%;font-weight:700;margin:0;overflow:hidden;padding:0;text-overflow:ellipsis;white-space:nowrap}.mailymaily-modal-close{color:#aaa;flex:initial;font-size:38px;margin-left:20px;position:relative;text-align:right;text-decoration:none;top:-4px}.mailymaily-modal-close:focus,.mailymaily-modal-close:hover{color:#000;cursor:pointer;font-weight:700;outline:0}.mailymaily-modal-body{height:100%;padding:20px}.mailymaily-button{color:#333;text-decoration:none}.mailymaily-button:focus{outline:0}.mailymaily-button:focus .mailymaily-button-content{background-color:#555;color:#fff}.mailymaily-button-content{background-color:#fff;border:none;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.18);margin-bottom:20px;overflow:hidden;padding:15px 20px;text-overflow:ellipsis;white-space:nowrap}.mailymaily-button-content:hover{background-color:#555;color:#fff}.mailymaily-button:last-child .mailymaily-button-content{margin-bottom:0}.mailymaily-button-icon{display:inline-block;font-weight:700;position:relative;top:0}.mailymaily-button-icon svg{height:24px;width:24px}.mailymaily-button-text{display:inline-block;margin-left:0;position:relative;top:-2px;vertical-align:sub}.mailymaily-copy{border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.18);height:59px;margin-top:20px;position:relative}.mailymaily-button-copy{background-color:#fff;border:none;border-bottom-left-radius:8px;border-top-left-radius:8px;bottom:21px;color:#333;font-size:100%;height:100%;left:0;overflow:false;padding:15px 20px;position:absolute;text-overflow:ellipsis;top:0;white-space:nowrap;width:130px}.mailymaily-button-copy:focus,.mailymaily-button-copy:hover{background-color:#555;color:#fff;cursor:pointer;outline:0}.mailymaily-button-copy-clicked,.mailymaily-button-copy-clicked:focus,.mailymaily-button-copy-clicked:hover{background-color:#1f9d55;color:#fff}.mailymaily-button-copy-clicked .mailymaily-button-icon,.mailymaily-button-copy-clicked:focus .mailymaily-button-icon,.mailymaily-button-copy-clicked:hover .mailymaily-button-icon{display:none;visibility:hidden}.mailymaily-button-copy-clicked .mailymaily-button-text,.mailymaily-button-copy-clicked:focus .mailymaily-button-text,.mailymaily-button-copy-clicked:hover .mailymaily-button-text{color:#fff;top:2px}.mailymaily-email-address{background-color:#d8dcdf;border:none;border-radius:8px;box-shadow:unset;box-sizing:border-box;color:#48494a;font-size:100%;height:100%;overflow:hidden;padding:20px 20px 20px 140px;text-overflow:ellipsis;white-space:nowrap;width:100%}.mailymaily-brand{color:#888;font-size:80%;margin-top:20px;text-align:center}.mailymaily-brand a{color:#888}.mailymaily-brand a:focus,.mailymaily-brand a:hover{font-weight:700;outline:0}.mailymaily-no-scroll{height:100%;overflow:hidden}.mailymaily-is-hidden{display:none;visibility:hidden}@-webkit-keyframes mailymaily-appear{0%{opacity:0;transform:translate(-50%,-50%) scale(0,0)}100%{opacity:1;transform:translate(-50%,-50%) scale(1,1)}}@keyframes mailymaily-appear{0%{opacity:0;transform:translate(-50%,-50%) scale(0,0)}100%{opacity:1;transform:translate(-50%,-50%) scale(1,1)}}";return i=i.replace(/mailymaily/g,t.prefix()),e.setAttribute("id",t.prefix("-styles")),e.styleSheet?e.styleSheet.cssText=i:e.appendChild(document.createTextNode(i)),e},t.embedStyleTag=function(){if(!t.styleTagExists()){var e=document.head.firstChild;document.head.insertBefore(t.buildStyleTag(),e)}},t.styleTagExists=function(){return!!document.getElementById(t.prefix("-styles"))},t.buildModal=function(){var e=document.createElement("div"),i=``;return i=i.replace(/mailymaily/g,t.prefix()),e.setAttribute("id",t.prefix("-modal")),e.setAttribute("class",t.prefix("-modal")),e.setAttribute("style","display: none;"),e.setAttribute("aria-hidden",!0),e.innerHTML=i,e},t.embedModal=function(){if(!t.modalExists()){var e=t.buildModal(),i=document.body.firstChild;document.body.insertBefore(e,i)}},t.modalExists=function(){return!!document.getElementById(t.prefix("-modal"))},t.getModal=function(e){return t.hydrateModal(e),document.getElementById(t.prefix("-modal"))},t.hydrateModal=function(e){var i=t.getEmail(e),o=t.getLinkField(e,"subject"),n=t.getLinkField(e,"cc"),a=t.getLinkField(e,"bcc"),l=t.getLinkField(e,"body");document.getElementById(t.prefix("-button-1")).href=`https://mail.google.com/mail/?view=cm&fs=1&to=${i}&su=${o}&cc=${n}&bcc=${a}&body=${l}`,document.getElementById(t.prefix("-button-2")).href=`https://outlook.office.com/owa/?path=/mail/action/compose&to=${i}&subject=${o}&body=${l}`,document.getElementById(t.prefix("-button-4")).href=`mailto:${i}?subject=${o}&cc=${n}&bcc=${a}&body=${l}`,document.getElementById(t.prefix("-email-address")).innerHTML=i,document.getElementById(t.prefix("-button-icon-1")).innerHTML=r.buttonIcon1,document.getElementById(t.prefix("-button-icon-2")).innerHTML=r.buttonIcon2,document.getElementById(t.prefix("-button-icon-4")).innerHTML=r.buttonIcon4,document.getElementById(t.prefix("-button-icon-copy")).innerHTML=r.buttonIconCopy,t.toggleHideCopyUi(i)},t.savePageScrollPosition=function(){c=window.pageYOffset,i.style.top=-c+"px"},t.restorePageScrollPosition=function(){window.scrollTo(0,c),i.style.top=0},t.saveScrollBehavior=function(){s=e.style.scrollBehavior,e.style.scrollBehavior="auto"},t.restoreScrollBehavior=function(){e.style.scrollBehavior=s},t.saveLastDocElementFocused=function(){n=document.activeElement},t.openModal=function(e){r.disableOnMobile&&t.isMobileDevice()||(e.preventDefault(),t.saveLastDocElementFocused(),t.savePageScrollPosition(),t.saveScrollBehavior(),t.displayModal(e),t.hideModalFromScreenReader(!1),t.enablePageScrolling(!1),t.modalFocus(),t.triggerEvent(o,"open"))},t.displayModal=function(e){var i=t.getParentElement(e.target,"a");(o=t.getModal(i)).style.display="block"},t.modalFocus=function(){o.focusableChildren=Array.from(o.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])')),o.focusableChildren[1].focus()},t.closeModal=function(e){e.preventDefault(),t.hideModal(),t.enablePageScrolling(!0),t.restorePageScrollPosition(),t.restoreScrollBehavior(),t.docRefocus(),t.triggerEvent(o,"close")},t.hideModal=function(){t.hideModalFromScreenReader(!0),t.isDefined(o)&&(o.style.display="none")},t.hideModalFromScreenReader=function(e){t.isDefined(o)&&o.setAttribute("aria-hidden",e)},t.enablePageScrolling=function(o){o?(i.classList.remove(t.prefix("-no-scroll")),e.classList.remove(t.prefix("-no-scroll"))):(i.classList.add(t.prefix("-no-scroll")),e.classList.add(t.prefix("-no-scroll")))},t.docRefocus=function(){n.focus()},t.openClient=function(e,i){var o="_blank";t.isDefaultEmailAppButton(e)&&(o="_self"),window.open(e.href,o),t.triggerEvent(e,"compose"),r.autoClose&&t.closeModal(i)},t.isDefaultEmailAppButton=function(e){return e.id==t.prefix("-button-4")},t.getParentElement=function(t,e){for(;null!==t;){if(t.tagName.toUpperCase()==e.toUpperCase())return t;t=t.parentNode}return null},t.triggerEvent=function(t,e){var i=new Event(e);t.dispatchEvent(i)},t.isMobileDevice=function(){var t,e=!1;return t=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e},t.listenForEvents=function(){t.listenForClickOnLink(),t.listenForClickOnClient(),t.listenForClickOnCopy(),t.listenForClickOnClose(),t.listenForClickOnWindow(),t.listenForKeys()},t.listenForClickOnLink=function(){for(var e=document.getElementsByClassName(t.prefix()),i=0;i0&&(i[1]=e.replace(i[0]+"?","").trim()),i},t.getLinkField=function(e,i){var o=t.splitLink(e),n="",a=[],l=[];null!==o&&o.length>0&&(n=o[1]),null!==n&&n.length>0&&(a=(n=n.replace("%20&%20","%20%26%20")).split("&"));for(var r=0;r0&&(o=i[0]),decodeURIComponent(o)},t.getClassHideCopyUi=function(){return t.prefix("-is-hidden")},t.toggleHideCopyUi=function(e){var i=document.getElementById(t.prefix("-copy"));0==e.length?i.classList.add(t.getClassHideCopyUi()):i.classList.remove(t.getClassHideCopyUi())},t.toggleCopyButton=function(){button=document.getElementById(t.prefix("-button-copy")),buttonText=document.getElementById(t.prefix("-button-text-copy")),buttonText.innerHTML=r.buttonTextCopyAction,button.classList.add(t.prefix("-button-copy-clicked")),setTimeout(function(){buttonText.innerHTML=r.buttonTextCopy,button.classList.remove(t.prefix("-button-copy-clicked"))},600)},t.copy=function(e){e.preventDefault();var i=t.getParentElement(e.target,"button").getAttribute("data-copytargetid"),o=document.getElementById(i),n=document.createRange();n.selectNodeContents(o);var a=window.getSelection();a.removeAllRanges(),a.addRange(n),document.execCommand("copy"),t.triggerEvent(o,"copy"),t.toggleCopyButton()},t.isiOSDevice=function(){return navigator.userAgent.match(/ipad|iphone/i)},t.setOptions=function(e){if(e)var i=JSON.stringify(e);else i=t.getOptionsFromScriptTag();if(i&&i.trim().length>0)for(var o in i=JSON.parse(i),r)i.hasOwnProperty(o)&&(r[o]=t.sanitizeUserOption(o,i[o]))},t.sanitizeUserOption=function(e,i){return t.stringContains(e,"icon")?t.validateSvg(e,i):t.isString(i)?t.stripHtml(i):i},t.validateSvg=function(e,i){t.getSvg(e,i).then(function(o){if(!t.stringIsSvg(o.responseText))throw new Error(e+": "+i+" is not an SVG file.");if(t.stringHasScript(o.responseText))throw new Error(e+": "+i+" is an invalid SVG file.");r[e]=o.responseText}).catch(function(t){r[e]="buttonIconCopy"==e?l:a,console.log(t)})},t.loadSvg=function(t,e){return new Promise((t,i)=>{var o=new XMLHttpRequest;o.open("GET",e,!0),o.onload=function(e){200==o.status?t(o):i(o)},o.send()})},t.getSvg=async function(e,i){return await t.loadSvg(e,i)},t.isString=function(t){return"string"==typeof t},t.stripHtml=function(t){return t.replace(/(<([^>]+)>)/g,"")},t.stringContains=function(t,e){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},t.stringIsSvg=function(t){return t.startsWith(" del([ './src/component.min.html', './src/css/' ]); +const prebuild = () => del([ './dist/' ]); +exports.default = series(prebuild, html, css, js, clean); diff --git a/index.html b/index.html index 545ab08..b695cf0 100644 --- a/index.html +++ b/index.html @@ -10,6 +10,6 @@

mailymaily-sample

info@odit.services - + \ No newline at end of file diff --git a/src/html/component.html b/src/component.html similarity index 100% rename from src/html/component.html rename to src/component.html diff --git a/src/js/mailymaily.js b/src/mailymaily.js similarity index 100% rename from src/js/mailymaily.js rename to src/mailymaily.js