diff --git a/css/style.css b/css/style.css index 5838bea..97c119e 100644 --- a/css/style.css +++ b/css/style.css @@ -280,4 +280,77 @@ label { font-size: 1.5em; font-weight: bold; color: #666; +} + +/** +Modal + */ + +.modal-mask { + position: fixed; + z-index: 9998; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, .5); + display: table; + transition: opacity .3s ease; +} + +.modal-wrapper { + display: table-cell; + vertical-align: middle; +} + +.modal-container { + width: 300px; + margin: 0px auto; + padding: 20px 30px; + background-color: #fff; + border-radius: 2px; + box-shadow: 0 2px 8px rgba(0, 0, 0, .33); + transition: all .3s ease; + font-family: Helvetica, Arial, sans-serif; +} + +.modal-header h3 { + margin-top: 0; + color: #42b983; +} + +.modal-body { + margin: 20px 0; +} + +.modal-default-button { + float: right; +} + +.modal-crit-button { + background: #822C19; + color: white; +} + +/* + * The following styles are auto-applied to elements with + * transition="modal" when their visibility is toggled + * by Vue.js. + * + * You can easily play with the modal transition by editing + * these styles. + */ + +.modal-enter { + opacity: 0; +} + +.modal-leave-active { + opacity: 0; +} + +.modal-enter .modal-container, +.modal-leave-active .modal-container { + -webkit-transform: scale(1.1); + transform: scale(1.1); } \ No newline at end of file diff --git a/js/devel/app.js b/js/devel/app.js index a81a81a..313f61c 100644 --- a/js/devel/app.js +++ b/js/devel/app.js @@ -73,8 +73,6 @@ var ContactRenderer = { } }; -Vue.filter('firstCharacter', ContactRenderer.generateFirstCharacter); - $.urlParam = function (name) { var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); if (results == null) { @@ -85,6 +83,32 @@ $.urlParam = function (name) { } }; +Vue.filter('firstCharacter', ContactRenderer.generateFirstCharacter); +const Dialog = Vue.extend({ + template: '#modal-template' +}); + +Vue.directive('confirm', { + bind(el, binding, vnode) { + const yesMethod = binding.value[1]; + const bodyMessage = binding.value[0]; + console.log(bodyMessage); + el.handleClick = (e) => { + const data = { + doYes: function () { yesMethod(); data.show = false; }, + show: true, + bodyMessage: bodyMessage + }; + let dialog = new Dialog({ data: data }).$mount(); + document.getElementById('app').appendChild(dialog.$el); + } + el.addEventListener('click', el.handleClick); + }, + unbind(el) { + el.removeEventListener('click', el.handleClick); + } +}); + (function ($, OC) { // reset count and title window.onfocus = function () { diff --git a/templates/main.php b/templates/main.php index 999d3cb..6feac41 100644 --- a/templates/main.php +++ b/templates/main.php @@ -15,6 +15,31 @@ use \OCA\OcSms\Lib\CountryCodes; \OCP\Util::addStyle('ocsms', 'style'); ?> + +
@@ -72,8 +97,9 @@ use \OCA\OcSms\Lib\CountryCodes;
-
- + +
+