-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix browserify issue and move demo to its own folder.
- Loading branch information
Mario Rodriguez
committed
Feb 14, 2019
1 parent
edd7fef
commit 04e1f82
Showing
8 changed files
with
345 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
/node_modules | ||
index.html | ||
index.js | ||
index-min.js | ||
*.svg | ||
.DS_Store | ||
.eslintrc.json | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/src/ | ||
/assets/ | ||
/demo/ | ||
/gulpfile.js | ||
/index.html |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Proceed only if the DOM is loaded and ready. | ||
* @param {Function} fn The function to be executed when DOM is ready. | ||
*/ | ||
function domReady(fn) { | ||
document.addEventListener('DOMContentLoaded', fn); | ||
|
||
// Is the DOM ready now? If so, execute the given function. | ||
if (document.readyState === 'interactive' || document.readyState === 'complete') { | ||
fn(); | ||
} | ||
} | ||
|
||
/** | ||
* Run when DOM is ready. | ||
*/ | ||
domReady(function() { | ||
const Vue = require('../node_modules/vue/dist/vue.min.js'); | ||
// const MailtoUI = require('../src/js/mailtoui.js'); | ||
const MailtoUI = require('../dist/mailtoui-min.js'); | ||
|
||
var app = new Vue({ | ||
el: '#app', | ||
data: { | ||
emailSyntax: '{{ email }}', | ||
email: '[email protected]', | ||
emailDisplay: 'With cc' | ||
}, | ||
computed: { | ||
mailtoHref: function() { | ||
return 'mailto:' + this.email + '[email protected]'; | ||
} | ||
}, | ||
mounted() { | ||
MailtoUI.run({ | ||
buttonTextCopy: 'Copia', | ||
buttonIconCopy: '/demo/bear.svg', | ||
buttonTextCopyAction: 'Copiado!', | ||
autoClose: false | ||
}); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!doctype html> | ||
<html lang="en" class="smooth-scroll"> | ||
<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>Quick Demo</title> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css"> | ||
<style type="text/css"> | ||
.smooth-scroll { | ||
scroll-behavior: smooth; | ||
} | ||
|
||
/* .mailtoui-modal { | ||
background-color: rgba(250,250,250,0.5); | ||
color: #fff; | ||
} | ||
.mailtoui-modal-head { | ||
background-color: #21262C; | ||
} | ||
.mailtoui-modal-title { | ||
color: #fff; | ||
} | ||
.mailtoui-modal-close:focus, | ||
.mailtoui-modal-close:hover { | ||
color: #fff; | ||
} | ||
.mailtoui-modal-body { | ||
background-color: #373b41; | ||
} | ||
.mailtoui-button:focus .mailtoui-button-content { | ||
background-color: #D8DCDF; | ||
color: #333; | ||
} | ||
.mailtoui-button-content, | ||
.mailtoui-button-copy { | ||
background-color: #63676b; | ||
color: #fff; | ||
} | ||
.mailtoui-button-content:hover, | ||
.mailtoui-button-content:focus, | ||
.mailtoui-button-copy:hover, | ||
.mailtoui-button-copy:focus { | ||
background-color: #D8DCDF; | ||
color: #333; | ||
} | ||
.mailtoui-button-copy-clicked, | ||
.mailtoui-button-copy-clicked:hover, | ||
.mailtoui-button-copy-clicked:focus { | ||
background-color: #1F9D55; | ||
color: #fff; | ||
} | ||
.mailtoui-email-address { | ||
background-color: #909295; | ||
color: #21262c; | ||
} */ | ||
</style> | ||
</head> | ||
<body> | ||
<div id="app" class="max-w-sm mx-auto py-32"> | ||
<h1 class="mb-12">MailtoUI Quick Demo</h1> | ||
|
||
<p class="mb-8"><a class="mailtoui" href="mailto:[email protected],[email protected]?subject=Hello!">With subject</a></p> | ||
|
||
<p class="mb-8"><a class="mailtoui" href="mailto:[email protected]?body=Hello World!">With body</a></p> | ||
|
||
<p> | ||
<a class="mailtoui text-blue" :href="mailtoHref">{{ emailDisplay }}</a> | ||
<span class="text-grey-dark"> - Link created with Vue.js</span> | ||
</p> | ||
</div> | ||
|
||
<!-- <script src="../src/js/mailtoui.js" data-options='{ "buttonTextCopy": "Copia", "buttonTextCopyAction": "Copiado!", "autoClose": true }'></script> --> | ||
<script src="./demo-min.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.