diff --git a/ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineashoras.php b/ci4/app/Controllers/Tarifas/Tarifaencuadernacionlineashoras.php old mode 100755 new mode 100644 diff --git a/ci4/app/Entities/Tarifas/TarifaEncuadernacionLineaHoras.php b/ci4/app/Entities/Tarifas/TarifaEncuadernacionLineaHoras.php old mode 100755 new mode 100644 diff --git a/ci4/app/Models/Tarifas/TarifaEncuadernacionLineaHorasModel.php b/ci4/app/Models/Tarifas/TarifaEncuadernacionLineaHorasModel.php old mode 100755 new mode 100644 diff --git a/ci4/app/Views/themes/backend/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php b/ci4/app/Views/themes/backend/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php index 12d225b4..6ceaa662 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php +++ b/ci4/app/Views/themes/backend/vuexy/form/tarifas/encuadernacion/viewTarifaEncuadernacionForm.php @@ -221,8 +221,7 @@ method: 'POST', headers: {'X-Requested-With': 'XMLHttpRequest'}, success:function(response){ - - token=JSON.parse(response).= csrf_token() ?>; + token = response.= csrf_token() ?>; yeniden(token); theTable3.clearPipeline(); @@ -249,7 +248,7 @@ headers: {'X-Requested-With': 'XMLHttpRequest'}, success:function(response){ - token=JSON.parse(response).= csrf_token() ?>; + token=response.= csrf_token() ?>; yeniden(token); theTable3.clearPipeline(); diff --git a/httpdocs/themes/vuexy/img/illustrations/add-new-roles.png b/httpdocs/themes/vuexy/img/illustrations/add-new-roles.png new file mode 100755 index 00000000..27a2b922 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/add-new-roles.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-forgot-password-illustration-dark.png b/httpdocs/themes/vuexy/img/illustrations/auth-forgot-password-illustration-dark.png new file mode 100755 index 00000000..a2575d4e Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-forgot-password-illustration-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-forgot-password-illustration-light.png b/httpdocs/themes/vuexy/img/illustrations/auth-forgot-password-illustration-light.png new file mode 100755 index 00000000..eec75940 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-forgot-password-illustration-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-login-illustration-dark.png b/httpdocs/themes/vuexy/img/illustrations/auth-login-illustration-dark.png new file mode 100755 index 00000000..edde615d Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-login-illustration-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-login-illustration-light.png b/httpdocs/themes/vuexy/img/illustrations/auth-login-illustration-light.png new file mode 100755 index 00000000..3a071d9f Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-login-illustration-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-register-illustration-dark.png b/httpdocs/themes/vuexy/img/illustrations/auth-register-illustration-dark.png new file mode 100755 index 00000000..50c6584f Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-register-illustration-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-register-illustration-light.png b/httpdocs/themes/vuexy/img/illustrations/auth-register-illustration-light.png new file mode 100755 index 00000000..7582ed25 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-register-illustration-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-register-multisteps-illustration.png b/httpdocs/themes/vuexy/img/illustrations/auth-register-multisteps-illustration.png new file mode 100755 index 00000000..4865d1db Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-register-multisteps-illustration.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-reset-password-illustration-dark.png b/httpdocs/themes/vuexy/img/illustrations/auth-reset-password-illustration-dark.png new file mode 100755 index 00000000..5032f94e Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-reset-password-illustration-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-reset-password-illustration-light.png b/httpdocs/themes/vuexy/img/illustrations/auth-reset-password-illustration-light.png new file mode 100755 index 00000000..56528fff Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-reset-password-illustration-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-two-step-illustration-dark.png b/httpdocs/themes/vuexy/img/illustrations/auth-two-step-illustration-dark.png new file mode 100755 index 00000000..59bc7457 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-two-step-illustration-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-two-step-illustration-light.png b/httpdocs/themes/vuexy/img/illustrations/auth-two-step-illustration-light.png new file mode 100755 index 00000000..10e4a57c Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-two-step-illustration-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-verify-email-illustration-dark.png b/httpdocs/themes/vuexy/img/illustrations/auth-verify-email-illustration-dark.png new file mode 100755 index 00000000..8e93590b Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-verify-email-illustration-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/auth-verify-email-illustration-light.png b/httpdocs/themes/vuexy/img/illustrations/auth-verify-email-illustration-light.png new file mode 100755 index 00000000..e428b984 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/auth-verify-email-illustration-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/bg-shape-image-dark.png b/httpdocs/themes/vuexy/img/illustrations/bg-shape-image-dark.png new file mode 100755 index 00000000..ad3a0500 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/bg-shape-image-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/bg-shape-image-light.png b/httpdocs/themes/vuexy/img/illustrations/bg-shape-image-light.png new file mode 100755 index 00000000..c18d34e7 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/bg-shape-image-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/boy-verify-email-dark.png b/httpdocs/themes/vuexy/img/illustrations/boy-verify-email-dark.png new file mode 100755 index 00000000..a468bcda Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/boy-verify-email-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/boy-verify-email-light.png b/httpdocs/themes/vuexy/img/illustrations/boy-verify-email-light.png new file mode 100755 index 00000000..6090dee9 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/boy-verify-email-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/boy-with-laptop-dark.png b/httpdocs/themes/vuexy/img/illustrations/boy-with-laptop-dark.png new file mode 100755 index 00000000..799bb36c Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/boy-with-laptop-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/boy-with-laptop-light.png b/httpdocs/themes/vuexy/img/illustrations/boy-with-laptop-light.png new file mode 100755 index 00000000..df99e9ea Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/boy-with-laptop-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/boy-with-rocket-dark.png b/httpdocs/themes/vuexy/img/illustrations/boy-with-rocket-dark.png new file mode 100755 index 00000000..2d22fe36 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/boy-with-rocket-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/boy-with-rocket-light.png b/httpdocs/themes/vuexy/img/illustrations/boy-with-rocket-light.png new file mode 100755 index 00000000..734b424e Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/boy-with-rocket-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/card-advance-sale.png b/httpdocs/themes/vuexy/img/illustrations/card-advance-sale.png new file mode 100755 index 00000000..be81dc69 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/card-advance-sale.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-1.png b/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-1.png new file mode 100755 index 00000000..778f20bf Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-1.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-2.png b/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-2.png new file mode 100755 index 00000000..0e3be496 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-2.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-3.png b/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-3.png new file mode 100755 index 00000000..ec8d98a4 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/card-website-analytics-3.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-doing-yoga-dark.png b/httpdocs/themes/vuexy/img/illustrations/girl-doing-yoga-dark.png new file mode 100755 index 00000000..3ba779ca Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-doing-yoga-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-doing-yoga-light.png b/httpdocs/themes/vuexy/img/illustrations/girl-doing-yoga-light.png new file mode 100755 index 00000000..32efea28 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-doing-yoga-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-sitting-with-laptop.png b/httpdocs/themes/vuexy/img/illustrations/girl-sitting-with-laptop.png new file mode 100755 index 00000000..5123417e Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-sitting-with-laptop.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-unlock-password-dark.png b/httpdocs/themes/vuexy/img/illustrations/girl-unlock-password-dark.png new file mode 100755 index 00000000..24bd7143 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-unlock-password-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-unlock-password-light.png b/httpdocs/themes/vuexy/img/illustrations/girl-unlock-password-light.png new file mode 100755 index 00000000..18f4b274 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-unlock-password-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-verify-password-dark.png b/httpdocs/themes/vuexy/img/illustrations/girl-verify-password-dark.png new file mode 100755 index 00000000..467410c2 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-verify-password-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-verify-password-light.png b/httpdocs/themes/vuexy/img/illustrations/girl-verify-password-light.png new file mode 100755 index 00000000..001d1496 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-verify-password-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop-dark.png b/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop-dark.png new file mode 100755 index 00000000..b29682e2 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop-light.png b/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop-light.png new file mode 100755 index 00000000..836bd4b4 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop-light.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop.png b/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop.png new file mode 100755 index 00000000..bd339778 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/girl-with-laptop.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/page-misc-error.png b/httpdocs/themes/vuexy/img/illustrations/page-misc-error.png new file mode 100755 index 00000000..a8d2c4fd Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/page-misc-error.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/page-misc-launching-soon.png b/httpdocs/themes/vuexy/img/illustrations/page-misc-launching-soon.png new file mode 100755 index 00000000..29da9eb5 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/page-misc-launching-soon.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/page-misc-under-maintenance.png b/httpdocs/themes/vuexy/img/illustrations/page-misc-under-maintenance.png new file mode 100755 index 00000000..02547d82 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/page-misc-under-maintenance.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/page-misc-you-are-not-authorized.png b/httpdocs/themes/vuexy/img/illustrations/page-misc-you-are-not-authorized.png new file mode 100755 index 00000000..d1ea59d2 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/page-misc-you-are-not-authorized.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/page-pricing-basic.png b/httpdocs/themes/vuexy/img/illustrations/page-pricing-basic.png new file mode 100755 index 00000000..6e83817f Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/page-pricing-basic.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/page-pricing-enterprise.png b/httpdocs/themes/vuexy/img/illustrations/page-pricing-enterprise.png new file mode 100755 index 00000000..7295012e Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/page-pricing-enterprise.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/page-pricing-standard.png b/httpdocs/themes/vuexy/img/illustrations/page-pricing-standard.png new file mode 100755 index 00000000..9e8c0ac9 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/page-pricing-standard.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-confirm.png b/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-confirm.png new file mode 100755 index 00000000..8d7100fd Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-confirm.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-girl-with-laptop-dark.png b/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-girl-with-laptop-dark.png new file mode 100755 index 00000000..79fa2664 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-girl-with-laptop-dark.png differ diff --git a/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-girl-with-laptop-light.png b/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-girl-with-laptop-light.png new file mode 100755 index 00000000..79fa2664 Binary files /dev/null and b/httpdocs/themes/vuexy/img/illustrations/wizard-create-deal-girl-with-laptop-light.png differ diff --git a/httpdocs/themes/vuexy/js/app-access-permission.js b/httpdocs/themes/vuexy/js/app-access-permission.js new file mode 100755 index 00000000..f1735e15 --- /dev/null +++ b/httpdocs/themes/vuexy/js/app-access-permission.js @@ -0,0 +1,195 @@ +/** + * App user list (jquery) + */ + +'use strict'; + +$(function () { + var dataTablePermissions = $('.datatables-permissions'), + dt_permission, + userList = 'app-user-list.html'; + + // Users List datatable + if (dataTablePermissions.length) { + dt_permission = dataTablePermissions.DataTable({ + ajax: assetsPath + 'json/permissions-list.json', // JSON file to add data + columns: [ + // columns according to JSON + { data: '' }, + { data: 'id' }, + { data: 'name' }, + { data: 'assigned_to' }, + { data: 'created_date' }, + { data: '' } + ], + columnDefs: [ + { + // For Responsive + className: 'control', + orderable: false, + searchable: false, + responsivePriority: 2, + targets: 0, + render: function (data, type, full, meta) { + return ''; + } + }, + { + targets: 1, + searchable: false, + visible: false + }, + { + // Name + targets: 2, + render: function (data, type, full, meta) { + var $name = full['name']; + return '' + $name + ''; + } + }, + { + // User Role + targets: 3, + orderable: false, + render: function (data, type, full, meta) { + var $assignedTo = full['assigned_to'], + $output = ''; + var roleBadgeObj = { + Admin: 'Administrator', + Manager: 'Manager', + Users: 'Users', + Support: 'Support', + Restricted: + 'Restricted User' + }; + for (var i = 0; i < $assignedTo.length; i++) { + var val = $assignedTo[i]; + $output += roleBadgeObj[val]; + } + return '' + $output + ''; + } + }, + { + // remove ordering from Name + targets: 4, + orderable: false, + render: function (data, type, full, meta) { + var $date = full['created_date']; + return '' + $date + ''; + } + }, + { + // Actions + targets: -1, + searchable: false, + title: 'Actions', + orderable: false, + render: function (data, type, full, meta) { + return ( + '' + + '' + ); + } + } + ], + order: [[1, 'asc']], + dom: + '<"row mx-1"' + + '<"col-sm-12 col-md-3" l>' + + '<"col-sm-12 col-md-9"<"dt-action-buttons text-xl-end text-lg-start text-md-end text-start d-flex align-items-center justify-content-md-end justify-content-center flex-wrap me-1"<"me-3"f>B>>' + + '>t' + + '<"row mx-2"' + + '<"col-sm-12 col-md-6"i>' + + '<"col-sm-12 col-md-6"p>' + + '>', + language: { + sLengthMenu: 'Show _MENU_', + search: 'Search', + searchPlaceholder: 'Search..' + }, + // Buttons with Dropdown + buttons: [ + { + text: 'Add Permission', + className: 'add-new btn btn-primary mb-3 mb-md-0', + attr: { + 'data-bs-toggle': 'modal', + 'data-bs-target': '#addPermissionModal' + }, + init: function (api, node, config) { + $(node).removeClass('btn-secondary'); + } + } + ], + // For responsive popup + responsive: { + details: { + display: $.fn.dataTable.Responsive.display.modal({ + header: function (row) { + var data = row.data(); + return 'Details of ' + data['name']; + } + }), + type: 'column', + renderer: function (api, rowIdx, columns) { + var data = $.map(columns, function (col, i) { + return col.title !== '' // ? Do not show row in modal popup if title is blank (for check box) + ? '
' + messageInput.value + '
'; + document.querySelector('li:last-child .chat-message-wrapper').appendChild(renderMsg); + messageInput.value = ''; + scrollToBottom(); + } + }); + + // on click of chatHistoryHeaderMenu, Remove data-overlay attribute from chatSidebarLeftClose to resolve overlay overlapping issue for two sidebar + let chatHistoryHeaderMenu = document.querySelector(".chat-history-header [data-target='#app-chat-contacts']"), + chatSidebarLeftClose = document.querySelector('.app-chat-sidebar-left .close-sidebar'); + chatHistoryHeaderMenu.addEventListener('click', e => { + chatSidebarLeftClose.removeAttribute('data-overlay'); + }); + // } + + // Speech To Text + if (speechToText.length) { + var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition; + if (SpeechRecognition !== undefined && SpeechRecognition !== null) { + var recognition = new SpeechRecognition(), + listening = false; + speechToText.on('click', function () { + const $this = $(this); + recognition.onspeechstart = function () { + listening = true; + }; + if (listening === false) { + recognition.start(); + } + recognition.onerror = function (event) { + listening = false; + }; + recognition.onresult = function (event) { + $this.closest('.form-send-message').find('.message-input').val(event.results[0][0].transcript); + }; + recognition.onspeechend = function (event) { + listening = false; + recognition.stop(); + }; + }); + } + } + })(); +}); diff --git a/httpdocs/themes/vuexy/js/app-email.js b/httpdocs/themes/vuexy/js/app-email.js new file mode 100755 index 00000000..e040439e --- /dev/null +++ b/httpdocs/themes/vuexy/js/app-email.js @@ -0,0 +1,380 @@ +/** + * App Email + */ + +'use strict'; + +document.addEventListener('DOMContentLoaded', function () { + (function () { + const emailList = document.querySelector('.email-list'), + emailListItems = [].slice.call(document.querySelectorAll('.email-list-item')), + emailListItemInputs = [].slice.call(document.querySelectorAll('.email-list-item-input')), + emailView = document.querySelector('.app-email-view-content'), + emailFilters = document.querySelector('.email-filters'), + emailFilterByFolders = [].slice.call(document.querySelectorAll('.email-filter-folders li')), + emailEditor = document.querySelector('.email-editor'), + appEmailSidebar = document.querySelector('.app-email-sidebar'), + appOverlay = document.querySelector('.app-overlay'), + emailReplyEditor = document.querySelector('.email-reply-editor'), + bookmarkEmail = [].slice.call(document.querySelectorAll('.email-list-item-bookmark')), + selectAllEmails = document.getElementById('email-select-all'), + emailSearch = document.querySelector('.email-search-input'), + toggleCC = document.querySelector('.email-compose-toggle-cc'), + toggleBCC = document.querySelector('.email-compose-toggle-bcc'), + emailCompose = document.querySelector('.app-email-compose'), + emailListDelete = document.querySelector('.email-list-delete'), + emailListRead = document.querySelector('.email-list-read'), + refreshEmails = document.querySelector('.email-refresh'), + emailViewContainer = document.getElementById('app-email-view'), + emailFilterFolderLists = [].slice.call(document.querySelectorAll('.email-filter-folders li')), + emailListItemActions = [].slice.call(document.querySelectorAll('.email-list-item-actions li')); + + // Initialize PerfectScrollbar + // ------------------------------ + // Email list scrollbar + if (emailList) { + let emailListInstance = new PerfectScrollbar(emailList, { + wheelPropagation: false, + suppressScrollX: true + }); + } + + // Sidebar tags scrollbar + if (emailFilters) { + new PerfectScrollbar(emailFilters, { + wheelPropagation: false, + suppressScrollX: true + }); + } + + // Email view scrollbar + if (emailView) { + new PerfectScrollbar(emailView, { + wheelPropagation: false, + suppressScrollX: true + }); + } + + // Initialize Quill Editor + // ------------------------------ + if (emailEditor) { + new Quill('.email-editor', { + modules: { + toolbar: '.email-editor-toolbar' + }, + placeholder: 'Write your message... ', + theme: 'snow' + }); + } + + if (emailReplyEditor) { + new Quill('.email-reply-editor', { + modules: { + toolbar: '.email-reply-toolbar' + }, + placeholder: 'Write your message... ', + theme: 'snow' + }); + } + + // Bookmark email + if (bookmarkEmail) { + bookmarkEmail.forEach(emailItem => { + emailItem.addEventListener('click', e => { + let emailItem = e.currentTarget.parentNode.parentNode; + let starredAttr = emailItem.getAttribute('data-starred'); + e.stopPropagation(); + if (!starredAttr) { + emailItem.setAttribute('data-starred', 'true'); + } else { + emailItem.removeAttribute('data-starred'); + } + }); + }); + } + + // Select all + if (selectAllEmails) { + selectAllEmails.addEventListener('click', e => { + if (e.currentTarget.checked) { + emailListItemInputs.forEach(c => (c.checked = 1)); + } else { + emailListItemInputs.forEach(c => (c.checked = 0)); + } + }); + } + + // Select single email + if (emailListItemInputs) { + emailListItemInputs.forEach(emailListItemInput => { + emailListItemInput.addEventListener('click', e => { + e.stopPropagation(); + // Check input count to reset the indeterminate state + let emailListItemInputCount = 0; + emailListItemInputs.forEach(emailListItemInput => { + if (emailListItemInput.checked) { + emailListItemInputCount++; + } + }); + + if (emailListItemInputCount < emailListItemInputs.length) { + if (emailListItemInputCount == 0) { + selectAllEmails.indeterminate = false; + } else { + selectAllEmails.indeterminate = true; + } + } else { + if (emailListItemInputCount == emailListItemInputs.length) { + selectAllEmails.indeterminate = false; + selectAllEmails.checked = true; + } else { + selectAllEmails.indeterminate = false; + } + } + }); + }); + } + + // Search email based on searched text + if (emailSearch) { + emailSearch.addEventListener('keyup', e => { + let searchValue = e.currentTarget.value.toLowerCase(), + searchEmailListItems = {}, + selectedFolderFilter = document.querySelector('.email-filter-folders .active').getAttribute('data-target'); + + // Filter emails based on selected folders + if (selectedFolderFilter != 'inbox') { + searchEmailListItems = [].slice.call( + document.querySelectorAll('.email-list-item[data-' + selectedFolderFilter + '="true"]') + ); + } else { + searchEmailListItems = [].slice.call(document.querySelectorAll('.email-list-item')); + } + + // console.log(searchValue); + searchEmailListItems.forEach(searchEmailListItem => { + let searchEmailListItemText = searchEmailListItem.textContent.toLowerCase(); + if (searchValue) { + if (-1 < searchEmailListItemText.indexOf(searchValue)) { + searchEmailListItem.classList.add('d-block'); + } else { + searchEmailListItem.classList.add('d-none'); + } + } else { + searchEmailListItem.classList.remove('d-none'); + } + }); + }); + } + + // Filter based on folder type (Inbox, Sent, Draft etc...) + emailFilterByFolders.forEach(emailFilterByFolder => { + emailFilterByFolder.addEventListener('click', e => { + let currentTarget = e.currentTarget, + currentTargetData = currentTarget.getAttribute('data-target'); + + appEmailSidebar.classList.remove('show'); + appOverlay.classList.remove('show'); + + // Remove active class from each folder filters + Helpers._removeClass('active', emailFilterByFolders); + // Add active class to selected folder filters + currentTarget.classList.add('active'); + emailListItems.forEach(emailListItem => { + // If folder filter is Inbox + if (currentTargetData == 'inbox') { + emailListItem.classList.add('d-block'); + emailListItem.classList.remove('d-none'); + } else if (emailListItem.hasAttribute('data-' + currentTargetData)) { + emailListItem.classList.add('d-block'); + emailListItem.classList.remove('d-none'); + } else { + emailListItem.classList.add('d-none'); + emailListItem.classList.remove('d-block'); + } + }); + }); + }); + + // Toggle CC/BCC input + if (toggleBCC) { + toggleBCC.addEventListener('click', e => { + Helpers._toggleClass(document.querySelector('.email-compose-bcc'), 'd-block', 'd-none'); + }); + } + + if (toggleCC) { + toggleCC.addEventListener('click', e => { + Helpers._toggleClass(document.querySelector('.email-compose-cc'), 'd-block', 'd-none'); + }); + } + + // Empty compose email message inputs when modal is hidden + emailCompose.addEventListener('hidden.bs.modal', event => { + document.querySelector('.email-editor .ql-editor').innerHTML = ''; + $('#emailContacts').val(''); + initSelect2(); + }); + + // Delete multiple email + if (emailListDelete) { + emailListDelete.addEventListener('click', e => { + emailListItemInputs.forEach(emailListItemInput => { + if (emailListItemInput.checked) { + emailListItemInput.parentNode.closest('li.email-list-item').remove(); + } + }); + selectAllEmails.indeterminate = false; + selectAllEmails.checked = false; + }); + } + + // Mark as read + if (emailListRead) { + emailListRead.addEventListener('click', e => { + emailListItemInputs.forEach(emailListItemInput => { + if (emailListItemInput.checked) { + emailListItemInput.checked = false; + emailListItemInput.parentNode.closest('li.email-list-item').classList.add('email-marked-read'); + let emailItemEnvelop = emailListItemInput.parentNode + .closest('li.email-list-item') + .querySelector('.email-list-item-actions li'); + + if (Helpers._hasClass('email-read', emailItemEnvelop)) { + emailItemEnvelop.classList.remove('email-read'); + emailItemEnvelop.classList.add('email-unread'); + emailItemEnvelop.querySelector('i').classList.remove('ti-mail-opened'); + emailItemEnvelop.querySelector('i').classList.add('ti-mail'); + } + } + }); + selectAllEmails.indeterminate = false; + selectAllEmails.checked = false; + }); + } + + // Refresh Mails + + if (refreshEmails && emailList) { + let emailListJq = $('.email-list'), + emailListInstance = new PerfectScrollbar(emailList, { + wheelPropagation: false, + suppressScrollX: true + }); + // ? Using jquery vars due to BlockUI jQuery dependency + refreshEmails.addEventListener('click', e => { + emailListJq.block({ + message: '', + timeout: 1000, + css: { + backgroundColor: 'transparent', + border: '0' + }, + overlayCSS: { + backgroundColor: '#000', + opacity: 0.1 + }, + onBlock: function () { + emailListInstance.settings.suppressScrollY = true; + }, + onUnblock: function () { + emailListInstance.settings.suppressScrollY = false; + } + }); + }); + } + + // Earlier msgs + // ? Using jquery vars due to jQuery animation (slideToggle) dependency + let earlierMsg = $('.email-earlier-msgs'); + if (earlierMsg.length) { + earlierMsg.on('click', function () { + let $this = $(this); + $this.parents().find('.email-card-last').addClass('hide-pseudo'); + $this.next('.email-card-prev').slideToggle(); + $this.remove(); + }); + } + + // Email contacts (select2) + // ? Using jquery vars due to select2 jQuery dependency + let emailContacts = $('#emailContacts'); + function initSelect2() { + if (emailContacts.length) { + function renderContactsAvatar(option) { + if (!option.id) { + return option.text; + } + let $avatar = + "