PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / admin / views / editconfigapp / tmpl / default_customizer_toolbar.php
vikappointments / admin / views / editconfigapp / tmpl Last commit date
default.php 3 days ago default_api.php 3 days ago default_api_basic.php 3 days ago default_api_users.php 3 days ago default_backup.php 3 days ago default_backup_basic.php 3 days ago default_customizer.php 3 days ago default_customizer_addcss.php 3 days ago default_customizer_form.php 3 days ago default_customizer_preview.php 3 days ago default_customizer_toolbar.php 3 days ago default_webhooks.php 3 days ago default_webhooks_basic.php 3 days ago index.html 3 days ago
default_customizer_toolbar.php
71 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 JHtml::fetch('formbehavior.chosen');
15
16 ?>
17
18 <style>
19 div#customizer-toolbar {
20 flex-basis: 100%;
21 }
22 </style>
23
24 <div id="customizer-toolbar" class="hidden-phone">
25
26 <div class="btn-toolbar">
27
28 <div class="btn-group pull-left">
29 <select id="customizer-action-page">
30 <?php echo JHtml::fetch('select.options', $this->menuItems, 'value', 'text', $this->filters['preview_page']); ?>
31 </select>
32 </div>
33
34 <div class="btn-group pull-right">
35 <button type="button" class="btn" id="customizer-action-toggle"><?php echo JText::translate('VAP_CUSTOMIZER_TOGGLE_PREVIEW'); ?></button>
36 </div>
37
38 </div>
39
40 </div>
41
42 <script>
43 (function($) {
44 'use strict';
45
46 $(function() {
47 VikRenderer.chosen('#customizer-toolbar');
48
49 const expDate = new Date();
50 expDate.setMonth(expDate.getMonth() + 1);
51
52 $('#customizer-action-toggle').on('click', () => {
53 const status = toggleCustomizerPreview();
54
55 // register status in a cookie
56 document.cookie = 'vikappointments.customizer.preview.status=' + status + '; expires=' + expDate.toUTCString() + '; path=/; SameSite=Lax';
57 });
58
59 $('#customizer-action-page').on('change', function() {
60 // get selected URL
61 const url = $(this).val();
62
63 // switch preview URL
64 changeCustomizerPreviewPage(url);
65
66 // register URL in a cookie
67 document.cookie = 'vikappointments.customizer.preview.page=' + url + '; expires=' + expDate.toUTCString() + '; path=/; SameSite=Lax';
68 });
69 });
70 })(jQuery);
71 </script>