PluginProbe
Accessibility by AllAccessible / 1.2
Accessibility by AllAccessible v1.2
2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1.0 2.0.6 trunk 1.0 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 All 43 releases
allaccessible / inc / AllAccessibleSettings.php

AllAccessibleSettings.php in Accessibility by AllAccessible 1.2, at inc/AllAccessibleSettings.php

321 lines 34.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div class="aacb-main">
2 <div class="aacb-container">
3 <div class="aacb-row">
4 <?php
5 $user_id = get_current_user_id();
6 $user_info = get_userdata($user_id);
7 if (!empty($message)) : ?>
8 <div class="message notice <?php echo esc_attr($class); ?>">
9 <p><?php echo esc_attr($message); ?></p>
10 </div>
11 <?php endif; ?>
12 <div class="aacb_settings" style="width:100%;" id="siteDetails" data-siteid="<?php echo esc_attr(get_option('aacb_siteID')); ?>">
13 <div class="page-header">
14 <object style="max-width:250px;height:auto;margin:0 auto;" data="<?php echo AACB_IMG;?>logo.svg" type="image/svg+xml">
15 <img style="max-width:250px;height:auto;;margin:0 auto;" src="<?php echo AACB_IMG;?>logo.png" />
16 </object>
17 <h1><?php echo AACB_NAME; ?> <small>Plugin Configuration</small></h1>
18 <p class="lead">Let's make this WordPress website AllAccessible</p>
19 </div>
20
21 <div class="aacb-col-12">
22 <div class="aacb_row">
23 <?php if(!get_option('aacb_accountID')){ ?>
24 <p class="lead">Connect you AllAccessible account with your email in the form below. If you do not have an existing account, we will create a free 7 day trial for <?php echo get_bloginfo( 'name' ); ?>.</p>
25 <form class="aacb-form" id="AACB_trialForm">
26 <!-- <p>Create a free 7 day trial for --><?php //echo get_bloginfo( 'name' ); ?><!--. All you need to do is verify your email below and hit submit. If you don't have an account, we'll automatically create one for you and email you a confirmation. If you already have an account, we'll add this site to your dashboard. We'll create a 7-day trial for your site.</p>-->
27 <div class="form-group">
28 <label for="aacb_email">Your Email (Used to manage your AllAccessible account)</label>
29 <input type="text" class="form-control" id="aacb_email" name="aacb_email" value="<?php echo esc_attr($user_info->user_email); ?>">
30 <input type="hidden" name="aacb_url" id="aacb_url" value="<?php echo get_bloginfo('wpurl'); ?>">
31 </div>
32 <input class="btn btn-primary" type="submit" id="aacb-trial-btn" value="Connect">
33 </form>
34 <?php } else { ?>
35 <p><?php echo get_bloginfo('wpurl'); ?> is connected to AllAccessible under account <?php echo esc_attr(get_option('aacb_accountID')); ?></p>
36 <?php if($GLOBALS['aacb_siteOptions']){ ?>
37 <div class="aacb-col-6">
38 <div class="">
39 <div class="aacb_preview-window">
40 <div class="aacb_preview-window__button"></div>
41 <div class="aacb_preview-window__toolbar"></div>
42 </div>
43 </div>
44 </div>
45 <div class="aacb-col-6">
46 <form class="aacb-form" id="AACB_optionsForm">
47 <div class="aacb_row form-group">
48 <div class="aacb-col-6">
49 <label for="colorPicker" class="aacb_form-label">
50 Choose Widget Color <?php if(isset($GLOBALS['aacb_siteOptions']->triggerBtnBg)){ echo $GLOBALS['aacb_siteOptions']->triggerBtnBg; } else { echo "#2b446d"; } ?>
51 </label>
52 <input type="text" id="colorPicker" class="aacb_form-control aacb_h-60px" name="triggerBtnBg" value="<?php if(isset($GLOBALS['aacb_siteOptions']->triggerBtnBg)){ echo $GLOBALS['aacb_siteOptions']->triggerBtnBg; } else { echo "#2b446d"; } ?>" placeholder=""/>
53 </div>
54
55 <div class="aacb-col-6">
56 <label for="kt_docs_select2_icon" class="mb-2">Choose Icon</label>
57 <select class="form-select form-select-transparent aacb_h-60px" name="triggerSVG" id="kt_docs_select2_icon" >
58 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Default'){?>selected<?php } ?> value="Default" data-kt-select2-icon="Default"></option>
59 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Alt'){?>selected<?php } ?> value="Alt" data-kt-select2-icon="Alt"></option>
60 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Adjust'){?>selected<?php } ?> value="Adjust" data-kt-select2-icon="Adjust"></option>
61 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Chair2'){?>selected<?php } ?> value="Chair2" data-kt-select2-icon="Chair2"></option>
62 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Chair3'){?>selected<?php } ?> value="Chair3" data-kt-select2-icon="Chair3"></option>
63 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Heart'){?>selected<?php } ?> value="Heart" data-kt-select2-icon="Heart"></option>
64 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Braille'){?>selected<?php } ?> value="Braille" data-kt-select2-icon="Braille"></option>
65 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Blind'){?>selected<?php } ?> value="Blind" data-kt-select2-icon="Blind"></option>
66 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Eye'){?>selected<?php } ?> value="Eye" data-kt-select2-icon="Eye"></option>
67 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Globe'){?>selected<?php } ?> value="Globe" data-kt-select2-icon="Globe"></option>
68 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Access'){?>selected<?php } ?> value="Access" data-kt-select2-icon="Access"></option>
69 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Alt2'){?>selected<?php } ?> value="Alt2" data-kt-select2-icon="Alt2"></option>
70 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Cogs'){?>selected<?php } ?> value="Cogs" data-kt-select2-icon="Cogs"></option>
71 <option <?php if($GLOBALS['aacb_siteOptions']->triggerSVG == 'Cane'){?>selected<?php } ?> value="Cane" data-kt-select2-icon="Cane"></option>
72 </select>
73 </div>
74 </div>
75
76 <div class="aacb_row form-group">
77 <div class="aacb-col-6">
78 <label class="mb-2" >Choose Widget Size</label>
79 <select class="form-select" id="sizeSelect" data-control="select2" name="triggerBtnSize" data-hide-search="true" data-placeholder="Choose Widget Size">
80 <option <?php if($GLOBALS['aacb_siteOptions']->triggerBtnSize == '40'){?>selected<?php } ?> value="40">Small</option>
81 <option <?php if($GLOBALS['aacb_siteOptions']->triggerBtnSize == '55'){?>selected<?php } elseif (!isset($GLOBALS['aacb_siteOptions']->triggerBtnSize)) { ?>selected<?php } ?> value="55" >Medium (Default)</option>
82 <option <?php if($GLOBALS['aacb_siteOptions']->triggerBtnSize == '80'){?>selected<?php } ?> value="80">Large</option>
83 </select>
84 </div>
85 <div class="aacb-col-6">
86 <label for="buttonPosition">Choose Widget Position</label>
87 <select id="buttonPosition" name="buttonPosition">
88 <option value="bottom-right" <?php if($GLOBALS['aacb_siteOptions']->buttonPosition == 'bottom-right'){?>selected<?php } ?>>Bottom Right</option>
89 <option value="right-center" <?php if($GLOBALS['aacb_siteOptions']->buttonPosition == 'right-center'){?>selected<?php } ?>>Middle Right</option>
90 <option value="top-right" <?php if($GLOBALS['aacb_siteOptions']->buttonPosition == 'top-right'){?>selected<?php } ?>>Top Right</option>
91 <option value="bottom-center" <?php if($GLOBALS['aacb_siteOptions']->buttonPosition == 'bottom-center'){?>selected<?php } ?>>Bottom Center</option>
92 <option value="bottom-left" <?php if($GLOBALS['aacb_siteOptions']->buttonPosition == 'bottom-left'){?>selected<?php } ?>>Bottom Left</option>
93 <option value="left-center" <?php if($GLOBALS['aacb_siteOptions']->buttonPosition == 'left-center'){?>selected<?php } ?>>Middle Left</option>
94 <option value="top-left" <?php if($GLOBALS['aacb_siteOptions']->buttonPosition == 'top-left'){?>selected<?php } ?>>Top Left</option>
95 </select><br />
96 </div>
97 </div>
98 <input class="btn btn-primary" id="aacb-save-opt-btn" type="submit" value="Save Settings">
99 </form>
100 <div class="aacb_message" id="aacb_message"></div>
101 </div>
102 <?php } else { ?>
103 <p>You may need to reload this page if your widget options are not visible</p>
104 <?php } ?>
105
106 <?php } ?>
107 </div>
108 <div class="aacb_row">
109 <p style="padding-top:40px;"><strong><?php echo AACB_NAME; ?></strong> <i>Version <?php echo AACB_VERSION; ?></i><br />
110 Need Help? <a href="<?php echo AACB_SUPPORT; ?>" target="_blank">Contact Us</a></p>
111 </div>
112 </div>
113 <script>
114 jQuery(document).ready(function ($) {
115 const svgIcons = {
116 Default: '<svg version="1.1" x="0px" y="0px" viewBox="0 0 79.583 79.638" style="padding:10px;" xmlns="http://www.w3.org/2000/svg"> <title>Open Accessibility Panel</title> <g transform="matrix(1, 0, 0, 1, -10.250157, -10.143444)"> <path d="M55.6,73.2c0.5,1.1,1.5,1.7,2.6,1.7c0.4,0,0.8-0.1,1.2-0.3c1.5-0.7,2.1-2.4,1.4-3.9c0,0-5.5-12.6-6.5-17.2 c-0.4-1.6-0.6-5.9-0.7-7.9c0-0.7,0.4-1.3,1-1.5l12.3-3.7c1.5-0.4,2.4-2.1,2-3.6c-0.4-1.5-2.1-2.4-3.6-2c0,0-11.4,3.7-15.5,3.7 c-4,0-15.3-3.6-15.3-3.6c-1.5-0.4-3.2,0.3-3.7,1.8c-0.5,1.6,0.4,3.3,2,3.7l12.3,3.7c0.6,0.2,1.1,0.8,1,1.5c-0.1,2-0.3,6.3-0.7,7.9 c-1,4.6-6.5,17.2-6.5,17.2c-0.7,1.5,0,3.2,1.4,3.9c0.4,0.2,0.8,0.3,1.2,0.3c1.1,0,2.2-0.6,2.6-1.7L50,61.2L55.6,73.2z"/> <circle cx="50" cy="30" r="5.6"/> <path d="M89.5,50c0-21.8-17.7-39.5-39.5-39.5c-21.8,0-39.5,17.7-39.5,39.5S28.2,89.5,50,89.5C71.8,89.5,89.5,71.8,89.5,50z M17.1,50c0-18.2,14.8-32.9,32.9-32.9S82.9,31.8,82.9,50S68.2,82.9,50,82.9S17.1,68.2,17.1,50z"/> </g> </svg>',
117 Alt: '<svg version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 182.608 214.637" style="padding:10px;" xmlns="http://www.w3.org/2000/svg"> <g transform="matrix(1, 0, 0, 1, -15.892562, 0.061192)"> <path d="M127.75,183.153c-10.629,10.63-24.76,16.483-39.793,16.483c-31.024,0-56.265-25.241-56.265-56.268 c0-15.034,5.852-29.168,16.479-39.796c2.929-2.929,2.928-7.678-0.001-10.607c-2.929-2.93-7.678-2.929-10.607,0.001 c-13.459,13.461-20.871,31.36-20.871,50.401c0,39.297,31.969,71.268,71.265,71.268c19.039,0,36.938-7.414,50.4-20.878 c2.929-2.929,2.928-7.678-0.001-10.606C135.427,180.225,130.678,180.224,127.75,183.153z"/> <path d="M190.444,166.706h-21.335L155.9,130.057c-1.072-2.975-3.894-4.957-7.056-4.957H93.232V91.424h51.648 c4.142,0,7.5-3.357,7.5-7.5c0-4.143-3.358-7.5-7.5-7.5H93.232V53.279c0-4.143-3.358-7.5-7.5-7.5c-4.142,0-7.5,3.357-7.5,7.5v79.32 c0,4.143,3.358,7.5,7.5,7.5h57.842l13.209,36.649c1.072,2.975,3.894,4.957,7.056,4.957h26.604c4.142,0,7.5-3.357,7.5-7.5 S194.587,166.706,190.444,166.706z"/> <path d="M86.015,36.438c10.063,0,18.221-8.154,18.221-18.224C104.235,8.161,96.078,0,86.015,0C75.952,0,67.796,8.161,67.796,18.215 C67.796,28.284,75.952,36.438,86.015,36.438z"/> </g> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> <g/> </svg>',
118 Alt2: '<svg x="0px" y="0px" viewBox="0.634 0.344 56.406 60.613" enable-background="new 0 0 100 100" style="padding:10px;" xmlns="http://www.w3.org/2000/svg"> <g transform="matrix(1, 0, 0, 1, -21.093462, -19.272371)"> <path d="M50.1,41.3c-4.9,0-8.8,3.9-8.8,8.8s3.9,8.8,8.8,8.8s8.8-3.9,8.8-8.8S55,41.3,50.1,41.3z M76.4,58l-4.6-3.9 c0.3-1.4,0.4-2.9,0.4-4.3c0-1.4-0.1-2.9-0.4-4.3l4.6-3.9c1.5-1.3,2-3.5,1-5.3l-2-3.5c-0.8-1.3-2.1-2-3.6-2c-0.5,0-1,0.1-1.4,0.3 l-5.8,2.1c-2.3-2-4.8-3.4-7.4-4.3l-1-5.9c-0.4-2-2.1-3.1-4.1-3.1h-4c-2,0-3.8,1.1-4.1,3.1l-1,5.8c-2.8,0.9-5.3,2.4-7.5,4.3L29.6,31 c-0.5-0.1-0.9-0.3-1.4-0.3c-1.5,0-2.9,0.8-3.6,2l-2,3.5c-1,1.8-0.6,4,1,5.3l4.6,3.9c-0.3,1.4-0.4,2.9-0.4,4.3 c0,1.5,0.1,2.9,0.4,4.3l-4.6,3.9c-1.5,1.3-2,3.5-1,5.3l2,3.5c0.8,1.3,2.1,2,3.6,2c0.5,0,1-0.1,1.4-0.3l5.8-2.1 c2.3,2,4.8,3.4,7.4,4.3l1,6c0.4,2,2,3.4,4.1,3.4h4c2,0,3.8-1.5,4.1-3.5l1-6c2.9-1,5.5-2.5,7.8-4.6l5.4,2.1c0.5,0.1,1,0.3,1.5,0.3 c1.5,0,2.9-0.8,3.6-2l1.9-3.3C78.4,61.5,77.9,59.3,76.4,58z M50.1,63.9c-7.7,0-13.8-6.2-13.8-13.8s6.2-13.8,13.8-13.8 s13.8,6.2,13.8,13.8S57.7,63.9,50.1,63.9z"/> </g> </svg>',
119 Adjust: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="padding:10px;"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="#ffffff" d="M8 256c0 136.966 111.033 248 248 248s248-111.034 248-248S392.966 8 256 8 8 119.033 8 256zm248 184V72c101.705 0 184 82.311 184 184 0 101.705-82.311 184-184 184z"></path></svg>',
120 Braille: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" style="padding:10px;"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="#ffffff" d="M128 256c0 35.346-28.654 64-64 64S0 291.346 0 256s28.654-64 64-64 64 28.654 64 64zM64 384c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zm0-352C28.654 32 0 60.654 0 96s28.654 64 64 64 64-28.654 64-64-28.654-64-64-64zm160 192c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zm0 160c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zm0-352c-35.346 0-64 28.654-64 64s28.654 64 64 64 64-28.654 64-64-28.654-64-64-64zm224 192c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zm0 160c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zm0-352c-35.346 0-64 28.654-64 64s28.654 64 64 64 64-28.654 64-64-28.654-64-64-64zm160 192c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zm0 160c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32zm0-320c-17.673 0-32 14.327-32 32s14.327 32 32 32 32-14.327 32-32-14.327-32-32-32z"></path></svg>',
121 Blind: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" enable-background="new 0 0 100 100" style="padding:10px;"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path fill="#ffffff" d="M380.15 510.837a8 8 0 0 1-10.989-2.687l-125.33-206.427a31.923 31.923 0 0 0 12.958-9.485l126.048 207.608a8 8 0 0 1-2.687 10.991zM142.803 314.338l-32.54 89.485 36.12 88.285c6.693 16.36 25.377 24.192 41.733 17.501 16.357-6.692 24.193-25.376 17.501-41.734l-62.814-153.537zM96 88c24.301 0 44-19.699 44-44S120.301 0 96 0 52 19.699 52 44s19.699 44 44 44zm154.837 169.128l-120-152c-4.733-5.995-11.75-9.108-18.837-9.112V96H80v.026c-7.146.003-14.217 3.161-18.944 9.24L0 183.766v95.694c0 13.455 11.011 24.791 24.464 24.536C37.505 303.748 48 293.1 48 280v-79.766l16-20.571v140.698L9.927 469.055c-6.04 16.609 2.528 34.969 19.138 41.009 16.602 6.039 34.968-2.524 41.009-19.138L136 309.638V202.441l-31.406-39.816a4 4 0 1 1 6.269-4.971l102.3 129.217c9.145 11.584 24.368 11.339 33.708 3.965 10.41-8.216 12.159-23.334 3.966-33.708z"></path></svg>',
122 Eye: '<svg style="padding:10px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c5.2-11.8 8-24.8 8-38.5c0-53-43-96-96-96c-2.8 0-5.6 .1-8.4 .4c5.3 9.3 8.4 20.1 8.4 31.6c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zm223.1 298L83.1 161.5c-11 14.4-20.5 28.7-28.4 42.2l339 265.7c18.7-5.5 36.2-13 52.6-21.8zM34.5 268.3c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c3.1 0 6.1-.1 9.2-.2L33.1 247.8c-1.8 6.8-1.3 14 1.4 20.5z"/></svg>',
123 Cogs: '<svg style="padding:10px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M224 256c-70.7 0-128-57.3-128-128S153.3 0 224 0s128 57.3 128 128s-57.3 128-128 128zm-45.7 48h91.4c11.8 0 23.4 1.2 34.5 3.3c-2.1 18.5 7.4 35.6 21.8 44.8c-16.6 10.6-26.7 31.6-20 53.3c4 12.9 9.4 25.5 16.4 37.6s15.2 23.1 24.4 33c15.7 16.9 39.6 18.4 57.2 8.7v.9c0 9.2 2.7 18.5 7.9 26.3H29.7C13.3 512 0 498.7 0 482.3C0 383.8 79.8 304 178.3 304zM436 218.2c0-7 4.5-13.3 11.3-14.8c10.5-2.4 21.5-3.7 32.7-3.7s22.2 1.3 32.7 3.7c6.8 1.5 11.3 7.8 11.3 14.8v30.6c7.9 3.4 15.4 7.7 22.3 12.8l24.9-14.3c6.1-3.5 13.7-2.7 18.5 2.4c7.6 8.1 14.3 17.2 20.1 27.2s10.3 20.4 13.5 31c2.1 6.7-1.1 13.7-7.2 17.2l-25 14.4c.4 4 .7 8.1 .7 12.3s-.2 8.2-.7 12.3l25 14.4c6.1 3.5 9.2 10.5 7.2 17.2c-3.3 10.6-7.8 21-13.5 31s-12.5 19.1-20.1 27.2c-4.8 5.1-12.5 5.9-18.5 2.4l-24.9-14.3c-6.9 5.1-14.3 9.4-22.3 12.8l0 30.6c0 7-4.5 13.3-11.3 14.8c-10.5 2.4-21.5 3.7-32.7 3.7s-22.2-1.3-32.7-3.7c-6.8-1.5-11.3-7.8-11.3-14.8V454.8c-8-3.4-15.6-7.7-22.5-12.9l-24.7 14.3c-6.1 3.5-13.7 2.7-18.5-2.4c-7.6-8.1-14.3-17.2-20.1-27.2s-10.3-20.4-13.5-31c-2.1-6.7 1.1-13.7 7.2-17.2l24.8-14.3c-.4-4.1-.7-8.2-.7-12.4s.2-8.3 .7-12.4L343.8 325c-6.1-3.5-9.2-10.5-7.2-17.2c3.3-10.6 7.7-21 13.5-31s12.5-19.1 20.1-27.2c4.8-5.1 12.4-5.9 18.5-2.4l24.8 14.3c6.9-5.1 14.5-9.4 22.5-12.9V218.2zm92.1 133.5c0-26.5-21.5-48-48.1-48s-48.1 21.5-48.1 48s21.5 48 48.1 48s48.1-21.5 48.1-48z"/></svg>',
124 Globe: '<svg style="padding:10px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M352 256c0 22.2-1.2 43.6-3.3 64H163.3c-2.2-20.4-3.3-41.8-3.3-64s1.2-43.6 3.3-64H348.7c2.2 20.4 3.3 41.8 3.3 64zm28.8-64H503.9c5.3 20.5 8.1 41.9 8.1 64s-2.8 43.5-8.1 64H380.8c2.1-20.6 3.2-42 3.2-64s-1.1-43.4-3.2-64zm112.6-32H376.7c-10-63.9-29.8-117.4-55.3-151.6c78.3 20.7 142 77.5 171.9 151.6zm-149.1 0H167.7c6.1-36.4 15.5-68.6 27-94.7c10.5-23.6 22.2-40.7 33.5-51.5C239.4 3.2 248.7 0 256 0s16.6 3.2 27.8 13.8c11.3 10.8 23 27.9 33.5 51.5c11.6 26 21 58.2 27 94.7zm-209 0H18.6C48.6 85.9 112.2 29.1 190.6 8.4C165.1 42.6 145.3 96.1 135.3 160zM8.1 192H131.2c-2.1 20.6-3.2 42-3.2 64s1.1 43.4 3.2 64H8.1C2.8 299.5 0 278.1 0 256s2.8-43.5 8.1-64zM194.7 446.6c-11.6-26-20.9-58.2-27-94.6H344.3c-6.1 36.4-15.5 68.6-27 94.6c-10.5 23.6-22.2 40.7-33.5 51.5C272.6 508.8 263.3 512 256 512s-16.6-3.2-27.8-13.8c-11.3-10.8-23-27.9-33.5-51.5zM135.3 352c10 63.9 29.8 117.4 55.3 151.6C112.2 482.9 48.6 426.1 18.6 352H135.3zm358.1 0c-30 74.1-93.6 130.9-171.9 151.6c25.5-34.2 45.2-87.7 55.3-151.6H493.4z"/></svg>',
125 Heart: '<svg x="0px" y="0px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="padding:10px;"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M244 84L255.1 96L267.1 84.02C300.6 51.37 347 36.51 392.6 44.1C461.5 55.58 512 115.2 512 185.1V190.9C512 232.4 494.8 272.1 464.4 300.4L283.7 469.1C276.2 476.1 266.3 480 256 480C245.7 480 235.8 476.1 228.3 469.1L47.59 300.4C17.23 272.1 0 232.4 0 190.9V185.1C0 115.2 50.52 55.58 119.4 44.1C164.1 36.51 211.4 51.37 244 84C243.1 84 244 84.01 244 84L244 84zM255.1 163.9L210.1 117.1C188.4 96.28 157.6 86.4 127.3 91.44C81.55 99.07 48 138.7 48 185.1V190.9C48 219.1 59.71 246.1 80.34 265.3L256 429.3L431.7 265.3C452.3 246.1 464 219.1 464 190.9V185.1C464 138.7 430.4 99.07 384.7 91.44C354.4 86.4 323.6 96.28 301.9 117.1L255.1 163.9z"/></svg></xml>',
126 Chair2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" style="padding:10px;"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M416 48c0 26.5-21.5 48-48 48s-48-21.5-48-48s21.5-48 48-48s48 21.5 48 48zM204.5 121.3c-5.4-2.5-11.7-1.9-16.4 1.7l-40.9 30.7c-14.1 10.6-34.2 7.7-44.8-6.4s-7.7-34.2 6.4-44.8l40.9-30.7c23.7-17.8 55.3-21 82.1-8.4l90.4 42.5c29.1 13.7 36.8 51.6 15.2 75.5L299.1 224h97.4c30.3 0 53 27.7 47.1 57.4L415.4 422.3c-3.5 17.3-20.3 28.6-37.7 25.1s-28.6-20.3-25.1-37.7L377 288H306.7c8.6 19.6 13.3 41.2 13.3 64c0 88.4-71.6 160-160 160S0 440.4 0 352s71.6-160 160-160c11.1 0 22 1.1 32.4 3.3l54.2-54.2-42.1-19.8zM160 448c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96s43 96 96 96z"/></svg>',
127 Chair3: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" style="padding:10px;"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M224 96c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zM152.5 247.2c12.4-4.7 18.7-18.5 14-30.9s-18.5-18.7-30.9-14C75.1 225.1 32 283.5 32 352c0 88.4 71.6 160 160 160c61.2 0 114.3-34.3 141.2-84.7c6.2-11.7 1.8-26.2-9.9-32.5s-26.2-1.8-32.5 9.9C272 440 234.8 464 192 464c-61.9 0-112-50.1-112-112c0-47.9 30.1-88.8 72.5-104.8zM291.8 176l-1.9-9.7c-4.5-22.3-24-38.3-46.8-38.3c-30.1 0-52.7 27.5-46.8 57l23.1 115.5c6 29.9 32.2 51.4 62.8 51.4h5.1c.4 0 .8 0 1.3 0h94.1c6.7 0 12.6 4.1 15 10.4L434 459.2c6 16.1 23.8 24.6 40.1 19.1l48-16c16.8-5.6 25.8-23.7 20.2-40.5s-23.7-25.8-40.5-20.2l-18.7 6.2-25.5-68c-11.7-31.2-41.6-51.9-74.9-51.9H314.2l-9.6-48H368c17.7 0 32-14.3 32-32s-14.3-32-32-32H291.8z"/></svg>',
128 Access: '<svg style="padding:10px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M512 256c0 141.4-114.6 256-256 256S0 397.4 0 256S114.6 0 256 0S512 114.6 512 256zM161.5 169.9c-12.2-5.2-26.3 .4-31.5 12.6s.4 26.3 12.6 31.5l11.9 5.1c17.3 7.4 35.2 12.9 53.6 16.3v50.1c0 4.3-.7 8.6-2.1 12.6l-28.7 86.1c-4.2 12.6 2.6 26.2 15.2 30.4s26.2-2.6 30.4-15.2l24.4-73.2c1.3-3.8 4.8-6.4 8.8-6.4s7.6 2.6 8.8 6.4l24.4 73.2c4.2 12.6 17.8 19.4 30.4 15.2s19.4-17.8 15.2-30.4l-28.7-86.1c-1.4-4.1-2.1-8.3-2.1-12.6V235.5c18.4-3.5 36.3-8.9 53.6-16.3l11.9-5.1c12.2-5.2 17.8-19.3 12.6-31.5s-19.3-17.8-31.5-12.6L338.7 175c-26.1 11.2-54.2 17-82.7 17s-56.5-5.8-82.7-17l-11.9-5.1zM256 160c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40s17.9 40 40 40z"/></svg>',
129 Cane: '<svg style="padding:10px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M176 96c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm-8.4 32c-36.4 0-69.6 20.5-85.9 53.1L35.4 273.7c-7.9 15.8-1.5 35 14.3 42.9s35 1.5 42.9-14.3L128 231.6v43.2c0 17 6.7 33.3 18.7 45.3L224 397.3V480c0 17.7 14.3 32 32 32s32-14.3 32-32V390.6c0-12.7-5.1-24.9-14.1-33.9L224 306.7V213.3l70.4 93.9c10.6 14.1 30.7 17 44.8 6.4s17-30.7 6.4-44.8L268.8 166.4C250.7 142.2 222.2 128 192 128H167.6zM128.3 346.8L97 472.2c-4.3 17.1 6.1 34.5 23.3 38.8s34.5-6.1 38.8-23.3l22-88.2-52.8-52.8zM450.8 505.1c5 7.3 15 9.1 22.3 4s9.1-15 4-22.3L358.9 316.1c-2.8 3.8-6.1 7.3-10.1 10.3c-5 3.8-10.5 6.4-16.2 7.9L450.8 505.1z"/></svg>',
130 }
131 //
132 //
133 //// {% if subdomain.options and subdomain.options.triggerBtnRadius is defined %}
134 ////
135 //// {% if subdomain.options.triggerBtnRadius == "50" %}
136 let selectedType = 1;
137 //// {% else %}
138 //// let selectedType = 2;
139 //// {% endif %}
140 ////
141 //// {% else %}
142 //// let selectedType = 1;
143 //// {% endif %}
144 //
145 let selectedIcon = $('#kt_docs_select2_icon').val();
146 let selectedColor = $('#colorPicker').val();
147 let selectedSize = $('#sizeSelect').val();
148 let selectedPosition = $('#buttonPosition').val();
149 let isWhitelabel = $('#isWhitelabel').val();
150 //
151 $('.aacb_btn-type').find('i').addClass('hide');
152 $('.aacb_btn-type[data-type="' + selectedType + '"]').find('i').removeClass('hide')
153
154 $("#colorPicker").spectrum({
155 color: selectedColor,
156 preferredFormat: "rgb",
157 change: function (color) {
158 selectedColor = color.toRgbString();
159 runPreview();
160 }
161 });
162
163 var iconSelect = function (item) {
164 if (!item) {
165 return;
166 }
167
168 if (!item.id) {
169 return item.text;
170 }
171
172 var span = document.createElement('span');
173 var iconName = item.element.getAttribute('data-kt-select2-icon');
174 var template = '';
175
176 selectedIcon = iconName;
177
178 selectedIcon = svgIcons[`${iconName}`];
179 template += '<i class="aacb_triggerSVGSelect" >' + svgIcons[`${iconName}`] + '</i>';
180 //template += '<span class="mx-1">' + iconName + '</span>';
181
182 span.innerHTML = template;
183 return $(span);
184 }
185
186 $('#kt_docs_select2_icon').select2({
187 templateSelection: iconSelect,
188 minimumResultsForSearch: -1,
189 templateResult: iconSelect
190 });
191
192 $('#kt_docs_select2_icon, #sizeSelect, #buttonPosition, #isWhitelabel').change(function () {
193 selectedIcon = $('#kt_docs_select2_icon').val();
194
195 selectedSize = $('#sizeSelect').val()
196 selectedPosition = $('#buttonPosition').val()
197 isWhitelabel = $('#isWhitelabel').val()
198 runPreview();
199 })
200
201 $('.aacb_btn-type').click(function () {
202 selectedType = $(this).data('type');
203 $('.aacb_btn-type').find('i').addClass('hide')
204 $(this).find('i').removeClass('hide')
205 runPreview();
206 })
207
208 function runPreview() {
209 $('.aacb_preview-window__button').html('');
210 $('.aacb_preview-window__button').append(svgIcons[`${$('#kt_docs_select2_icon').val()}`])
211
212 const btn = $('.aacb_preview-window__button');
213 btn.find('i, svg').removeClass('h-30px')
214
215 btn.attr('style', '')
216 switch (selectedPosition) {
217 case "bottom-right":
218 btn.css({
219 right: "10px",
220 bottom: "15px",
221 })
222 break;
223 case "right-center":
224 btn.css({
225 right: "10px",
226 top: "50%",
227 transform: "translate(0%, -50%)",
228 })
229 break;
230 case "top-right":
231 btn.css({
232 right: "10px",
233 top: "35px",
234 })
235 break;
236 case "bottom-center":
237 btn.css({
238 bottom: "15px",
239 left: "50%",
240 transform: "translate(-50%, 0%)",
241 })
242 break;
243 case "bottom-left":
244 btn.css({
245 left: "10px",
246 bottom: "15px",
247 })
248 break;
249 case "left-center":
250 btn.css({
251 left: "10px",
252 top: "50%",
253 transform: "translate(0%, -50%)",
254 })
255 break;
256 case "top-left":
257 btn.css({
258 left: "10px",
259 top: "35px",
260 })
261 break;
262 default:
263 break
264 }
265
266 btn.find('svg').css({
267 height: selectedSize + 'px',
268 width: selectedSize + 'px',
269 fill: '#fff',
270 color: '#fff'
271 })
272
273 btn.css({
274 height: selectedSize + 'px',
275 width: selectedSize + 'px',
276 borderColor: selectedColor,
277 background: selectedColor,
278 borderRadius: selectedType === 1 ? "50px" : "0",
279 })
280
281 }
282
283 $('#saveOptions').click(function () {
284 const $this = $(this)
285 $this.attr('data-kt-indicator', 'on');
286 $this.attr('disabled', true);
287
288 $.ajax({
289 url: "{{ path('save_site_options', {id: subdomain.id }) }}",
290 method: 'POST',
291 headers: {'Content-Type': 'application/json'},
292 data: JSON.stringify({
293 DEBUG: false,
294 triggerBtnBg: selectedColor,
295 triggerBtnRadius: selectedType === 1 ? "50" : "0",
296 triggerBtnSize: selectedSize,
297 buttonPosition: selectedPosition,
298 triggerSVG: $('#kt_docs_select2_icon').val(),
299 isWhitelabel: (isWhitelabel === 'true')
300 }),
301 success: function (response) {
302 $this.removeAttr('data-kt-indicator');
303 $this.attr('disabled', false);
304 // let successToast = document.getElementById('successToast');
305 // let toast = new bootstrap.Toast(successToast);
306 // toast.show();
307 },
308 error: function (XMLHttpRequest, textStatus, errorThrown) {
309 console.log(arguments);
310 },
311 });
312
313 })
314
315 runPreview();
316 });
317 </script>
318 </div>
319 </div>
320 </div>
321 </div>