apostrophecms-plugin-all-in-one-accessibility 1.0.7 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +173 -168
  2. package/app/config.js +134 -0
  3. package/app/helpers.js +62 -0
  4. package/app/skynet-widget.js +509 -0
  5. package/assets/css/banners.css +77 -0
  6. package/assets/css/base.css +50 -0
  7. package/assets/css/components.css +91 -0
  8. package/assets/css/paid.css +53 -0
  9. package/assets/css/responsive.css +70 -0
  10. package/assets/css/score.css +42 -0
  11. package/assets/css/settings.css +154 -0
  12. package/assets/css/tabs.css +52 -0
  13. package/assets/css/tokens.css +53 -0
  14. package/assets/images/icons/aioa-icon-type-1.svg +1 -0
  15. package/assets/images/icons/aioa-icon-type-10.svg +1 -0
  16. package/assets/images/icons/aioa-icon-type-11.svg +1 -0
  17. package/assets/images/icons/aioa-icon-type-12.svg +1 -0
  18. package/assets/images/icons/aioa-icon-type-13.svg +1 -0
  19. package/assets/images/icons/aioa-icon-type-14.svg +29 -0
  20. package/assets/images/icons/aioa-icon-type-15.svg +26 -0
  21. package/assets/images/icons/aioa-icon-type-16.svg +17 -0
  22. package/assets/images/icons/aioa-icon-type-17.svg +24 -0
  23. package/assets/images/icons/aioa-icon-type-18.svg +20 -0
  24. package/assets/images/icons/aioa-icon-type-19.svg +25 -0
  25. package/assets/images/icons/aioa-icon-type-2.svg +1 -0
  26. package/assets/images/icons/aioa-icon-type-20.svg +24 -0
  27. package/assets/images/icons/aioa-icon-type-21.svg +28 -0
  28. package/assets/images/icons/aioa-icon-type-22.svg +21 -0
  29. package/assets/images/icons/aioa-icon-type-23.svg +21 -0
  30. package/assets/images/icons/aioa-icon-type-24.svg +21 -0
  31. package/assets/images/icons/aioa-icon-type-25.svg +15 -0
  32. package/assets/images/icons/aioa-icon-type-26.svg +23 -0
  33. package/assets/images/icons/aioa-icon-type-27.svg +21 -0
  34. package/assets/images/icons/aioa-icon-type-28.svg +27 -0
  35. package/assets/images/icons/aioa-icon-type-29.svg +25 -0
  36. package/assets/images/icons/aioa-icon-type-3.svg +1 -0
  37. package/assets/images/icons/aioa-icon-type-4.svg +16 -0
  38. package/assets/images/icons/aioa-icon-type-5.svg +1 -0
  39. package/assets/images/icons/aioa-icon-type-6.svg +1 -0
  40. package/assets/images/icons/aioa-icon-type-7.svg +1 -0
  41. package/assets/images/icons/aioa-icon-type-8.svg +1 -0
  42. package/assets/images/icons/aioa-icon-type-9.svg +1 -0
  43. package/assets/js/app.js +152 -0
  44. package/assets/js/core.js +249 -0
  45. package/assets/js/dashboard.js +97 -0
  46. package/assets/js/paid-features.js +237 -0
  47. package/assets/js/plan.js +65 -0
  48. package/assets/js/save.js +35 -0
  49. package/assets/js/score.js +130 -0
  50. package/assets/js/settings-form.js +371 -0
  51. package/assets/js/tabs.js +108 -0
  52. package/assets/js/ui.js +90 -0
  53. package/index.js +301 -15
  54. package/package.json +19 -9
  55. package/ui/apos/components/AllInOneAccessibilitySettings.vue +126 -679
  56. package/views/layout.ejs +97 -0
  57. package/views/partials/accessibility-score.ejs +37 -0
  58. package/views/partials/header.ejs +13 -0
  59. package/views/partials/lock.ejs +20 -0
  60. package/views/partials/paid/links.ejs +33 -0
  61. package/views/partials/paid/mobile-position.ejs +80 -0
  62. package/views/partials/paid/toggles.ejs +20 -0
  63. package/views/partials/paid-banner.ejs +19 -0
  64. package/views/partials/paid-features.ejs +14 -0
  65. package/views/partials/score/card.ejs +61 -0
  66. package/views/partials/settings/color.ejs +37 -0
  67. package/views/partials/settings/icon-size.ejs +43 -0
  68. package/views/partials/settings/icon-type.ejs +24 -0
  69. package/views/partials/settings/position.ejs +70 -0
  70. package/views/partials/settings/save-bar.ejs +9 -0
  71. package/views/partials/settings/widget-size.ejs +38 -0
  72. package/views/partials/settings-form.ejs +39 -0
  73. package/views/partials/site-strip.ejs +5 -0
  74. package/views/partials/status.ejs +16 -0
  75. package/views/partials/tabs.ejs +32 -0
  76. package/views/partials/upgrade-banner.ejs +34 -0
  77. package/views/scriptTag.html +7 -1
  78. package/ui/apos/apps/AllInOneAccessibilitySettings.js +0 -8
@@ -1,692 +1,139 @@
1
1
  <template>
2
- <AposModal :modal="modal" modal-title="All in One Accessibility" @esc="cancel" @no-modal="$emit('safe-close')"
3
- @show-modal="modal.showModal = true" @inactive="modal.active = false" @ready="ready">
4
- <template #secondaryControls>
5
- <AposButton ref="cancelButton" type="default" label="apostrophe:cancel" @click="cancel" />
2
+ <!--
3
+ All in One Accessibility® settings, opened from the admin bar.
4
+ The settings page is its own HTML document (index.js -> views/layout.ejs),
5
+ shown here in an iframe so the admin UI and the page never share CSS or scripts.
6
+ -->
7
+ <AposModal
8
+ class="aioa-settings-modal"
9
+ :modal="modal"
10
+ modal-title="All in One Accessibility"
11
+ @esc="close"
12
+ @no-modal="$emit('safe-close')"
13
+ @inactive="modal.active = false"
14
+ @show-modal="modal.showModal = true"
15
+ >
16
+ <template #secondaryControls>
17
+ <AposButton
18
+ type="default"
19
+ label="apostrophe:close"
20
+ @click="close"
21
+ />
22
+ </template>
23
+ <template #primaryControls>
24
+ <AposButton
25
+ type="primary"
26
+ label="Open in new tab"
27
+ icon="link-external-icon"
28
+ :disabled="!settingsUrl"
29
+ @click="openInNewTab"
30
+ />
31
+ </template>
32
+ <template #main>
33
+ <AposModalBody>
34
+ <template #bodyMain>
35
+ <div class="aioa-settings-modal__body">
36
+ <iframe
37
+ v-if="settingsUrl"
38
+ class="aioa-settings-modal__frame"
39
+ :src="settingsUrl"
40
+ title="All in One Accessibility settings"
41
+ />
42
+ <p
43
+ v-else
44
+ class="aioa-settings-modal__message"
45
+ >
46
+ Only admins can change the All in One Accessibility settings.
47
+ </p>
48
+ </div>
6
49
  </template>
7
- <template #main>
8
- <AposModalBody>
9
- <template #bodyMain>
10
- <div :style="elementStyle">
11
- <div class="all-in-one-accessibility-strapi-container">
12
- <div class="container">
13
- <div class="set-width">
14
- <div class="all-in-one-accessibility-wrap">
15
- <div class="accessibility-settings">
16
- <h1><b></b> </h1>
17
- <img :src="allinoneaccessibilitylogo"
18
- alt="All in One Accessibility - Skynet Technologies"
19
- :style="logoStyle" />
20
- <h1><b></b></h1>
21
- <div class="all-one-accessibility-form">
22
- <form @submit.prevent="onSaveChanges">
23
- <div v-if="!isValid" class="mb-30 row">
24
- <label class="col-sm-12 col-form-label">
25
- <div class="form-text col-sm-12 col-form-label">
26
- Please
27
- <a href="https://ada.skynettechnologies.us/trial-subscription"
28
- target="_blank" rel="noopener noreferrer">
29
- &nbsp;Upgrade&nbsp;
30
- </a>
31
- to the full version of All in One Accessibility Pro.
32
- </div>
33
- </label>
34
- </div>
35
- <div class="mb-30 row">
36
- <label for="colorcode" class="col-sm-3 col-form-label">Hex
37
- color code:</label>
38
- <div class="col-sm-9">
39
- <input v-model="parameters.hexaColor" class="form-control"
40
- id="colorcode" name="colorcode" />
41
- </div>
42
- <div class="col-sm-3"></div>
43
- <div class="form-text col-sm-9">
44
- You can customize the ADA Widget color. For example:
45
- FF5733
46
- </div>
47
- </div>
48
- <div class="mb-30 row">
49
- <label class="col-sm-12 col-form-label">Select Widget
50
- Size:</label>
51
- <div class="col-sm-12 three-col">
52
- <div class="form-item">
53
- <input type="radio" id="edit-widget-size-regularsize"
54
- value="0" v-model="parameters.widget_size"
55
- class="form-radio" />
56
- <label for="edit-widget-size-regularsize"
57
- class="edit-position">Regular Size</label>
58
- </div>
59
- <div class="form-item">
60
- <input type="radio" id="edit-widget-size-oversize"
61
- value="1" v-model="parameters.widget_size"
62
- class="form-radio" />
63
- <label for="edit-widget-size-oversize"
64
- class="edit-position">Over Size</label>
65
- </div>
66
- </div>
67
- </div>
68
- <div class="icon-custom-size-wrapper mb-3">
69
- <div class="row align-items-center mb-30">
70
- <div class="col">
71
- <label class="col-sm-12 col-form-label">Enable
72
- precise accessibility widget icon
73
- position:</label>
74
- </div>
75
- <div class="col-auto">
76
- <!-- <input type="checkbox" id="custom-size-switcher" v-model="isSizeSwitcherEnabled"
77
- class="custom-switcher" /> -->
78
- <label class="custom-switch">
79
- <input type="checkbox" id="custom-size-switcher"
80
- v-model="isSwitcherEnabled"
81
- class="custom-switcher" />
82
- <span class="slider"></span>
83
- </label>
84
- </div>
85
- </div>
86
- </div>
87
- <div class="mb-30 row">
88
- <div class="icon-custom-position-wrapper mb-3">
89
- <div class="mb-2">
90
- <div v-if="!isSwitcherEnabled">
91
- <label class="col-sm-12 col-form-label">
92
- Where would you like to place the
93
- accessibility icon on your site?:
94
- </label>
95
- <div class="col-sm-12 three-col">
96
- <div class="form-item">
97
- <input type="radio"
98
- id="edit-position-top-left"
99
- value="top_left"
100
- v-model="parameters.position"
101
- class="form-radio" />
102
- <label for="edit-position-top-left"
103
- class="edit-position">Top
104
- left</label>
105
- </div>
106
- <div class="form-item">
107
- <input type="radio"
108
- id="edit-position-top-center"
109
- value="top_center"
110
- v-model="parameters.position"
111
- class="form-radio" />
112
- <label for="edit-position-top-center"
113
- class="edit-position">Top
114
- Center</label>
115
- </div>
116
- <div class="form-item">
117
- <input type="radio"
118
- id="edit-position-top-right"
119
- value="top_right"
120
- v-model="parameters.position"
121
- class="form-radio" />
122
- <label for="edit-position-top-right"
123
- class="edit-position">Top
124
- Right</label>
125
- </div>
126
- <div class="form-item">
127
- <input type="radio"
128
- id="edit-position-middle-left"
129
- value="middle_left"
130
- v-model="parameters.position"
131
- class="form-radio" />
132
- <label for="edit-position-middle-left"
133
- class="edit-position"> Middle
134
- left</label>
135
- </div>
136
- <div class="form-item">
137
- <input type="radio"
138
- id="edit-position-middle-right"
139
- value="middle_right"
140
- v-model="parameters.position"
141
- class="form-radio" />
142
- <label for="edit-position-middle-right"
143
- class="edit-position">Middle
144
- Right</label>
145
- </div>
146
- <div class="form-item">
147
- <input type="radio"
148
- id="edit-position-bottom-left"
149
- value="bottom_left"
150
- v-model="parameters.position"
151
- class="form-radio" />
152
- <label for="edit-position-bottom-left"
153
- class="edit-position">Bottom
154
- left</label>
155
- </div>
156
- <div class="form-item">
157
- <input type="radio"
158
- id="edit-position-bottom-center"
159
- value="bottom_center"
160
- v-model="parameters.position"
161
- class="form-radio" />
162
- <label for="edit-position-bottom-center"
163
- class="edit-position">Bottom
164
- Center</label>
165
- </div>
166
- <div class="form-item">
167
- <input type="radio"
168
- id="edit-position-bottom-right"
169
- value="bottom_right"
170
- v-model="parameters.position"
171
- class="form-radio" />
172
- <label for="edit-position-bottom-right"
173
- class="edit-position">Bottom
174
- Right</label>
175
- </div>
176
- </div>
177
- </div>
178
- <div v-if="isSwitcherEnabled"
179
- class="custom-position-controls">
180
- <div class="row mb-3 d-flex align-items-center">
181
- <div class="col-auto">
182
- <input type="number" min="0" max="250"
183
- id="custom_position_x_value"
184
- v-model="widgetSettings.custom_position_x_value"
185
- class="form-control"
186
- @input="handleInput" />
187
- </div>
188
- <div
189
- class="col-auto d-flex justify-content-center align-items-center">
190
- <span>PX</span>
191
- </div>
192
- <div class="col-auto">
193
- <select id="custom_position_left_right"
194
- v-model="widgetSettings.custom_position_left_right"
195
- class="form-select">
196
- <option value="cust-pos-to-the-right">To
197
- the right</option>
198
- <option value="cust-pos-to-the-left">To
199
- the left</option>
200
- </select>
201
- </div>
202
- </div>
203
- <div class="row mb-3 d-flex align-items-center">
204
- <div class="col-auto">
205
- <input type="number" min="0" max="250"
206
- id="custom_position_y_value"
207
- v-model="widgetSettings.custom_position_y_value"
208
- class="form-control"
209
- @input="handleInput2" />
210
- </div>
211
- <div
212
- class="col-auto d-flex justify-content-center align-items-center">
213
- <span>PX</span>
214
- </div>
215
- <div class="col-auto">
216
- <select id="custom_position_top_bottom"
217
- v-model="widgetSettings.custom_position_top_bottom"
218
- class="form-select">
219
- <option value="cust-pos-to-the-lower">To
220
- the bottom</option>
221
- <option value="cust-pos-to-the-upper">To
222
- the top</option>
223
- </select>
224
- </div>
225
- </div>
226
- <div class="description">0 - 250px are permitted
227
- values</div>
228
- </div>
229
- </div>
230
- </div>
231
- </div>
232
- <div class="icon-type-wrapper row" :class="{ 'd-none': !isValid }">
233
- <label class="col-sm-12 col-form-label">Select icon
234
- type:</label>
235
- <div class="col-sm-12">
236
- <div class="row">
237
- <div class="col-auto mb-30"
238
- v-for="(icon, index) in iconTypes" :key="index">
239
- <div
240
- class="form-item js-form-item form-item js-form-type-radio form-type-radio js-form-item-position form-item-position">
241
- <input type="radio"
242
- :id="'edit-type-' + (index + 1)"
243
- :value="icon.value"
244
- v-model="parameters.icontype"
245
- class="form-radio" />
246
- <label :for="'edit-type-' + (index + 1)">
247
- <img :src=icon.src alt="" width="65"
248
- height="65" />
249
- </label>
250
- </div>
251
- </div>
252
- </div>
253
- </div>
254
- </div>
255
- <div class="mb-30 row">
256
- <div class="icon-custom-size-wrapper mb-3">
257
- <!-- <div class="row align-items-center mb-30"> -->
258
- <div class="col">
259
- <label class="col-sm-12 col-form-label">Enable icon
260
- custom size:</label>
261
- </div>
262
- <div class="col-auto">
263
- <!-- <input type="checkbox" id="custom-size-switcher" v-model="isSizeSwitcherEnabled"
264
- class="custom-switcher" /> -->
265
- <label class="custom-switch">
266
- <input type="checkbox" id="custom-size-switcher"
267
- v-model="isSizeSwitcherEnabled"
268
- class="custom-switcher" />
269
- <span class="slider"></span>
270
- </label>
271
- </div>
272
- </div>
273
- <div v-if="!isSizeSwitcherEnabled">
274
- <label class="col-sm-12 col-form-label">Select icon
275
- size:</label>
276
- <div class="col-sm-12">
277
- <div class="row">
278
- <div class="col-auto mb-30"
279
- v-for="(size, index) in iconSizes" :key="index">
280
- <div
281
- class="form-item js-form-item form-item js-form-type-radio form-type-radio js-form-item-position form-item-position">
282
- <input type="radio"
283
- :id="'edit-size-' + size.value"
284
- :value="size.value"
285
- v-model="parameters.iconsize"
286
- class="form-radio" />
287
- <label :for="'edit-size-' + size.value">
288
- <img :src="'https://sanity.skynettechnologies.us/assets/images/' + parameters.icontype + '.svg'"
289
- alt="" :width="size.width"
290
- :height="size.height" />
291
- </label>
292
- </div>
293
- </div>
294
- </div>
295
- </div>
296
- </div>
297
- <div v-if="isSizeSwitcherEnabled"
298
- class="custom-size-controls mt-3">
299
- <div class="row">
300
- <div class="col-xs-auto">
301
- <label for="widget_icon_size_custom"
302
- class="col-sm-12 col-form-label">
303
- Select exact icon size:
304
- </label>
305
- <input type="number" id="widget_icon_size_custom"
306
- v-model="widgetSettings.widget_icon_size_custom"
307
- min="20" max="150" class="form-control"
308
- @input="handleInput1" />
309
- <span>PX</span>
310
- <div class="description">20 - 150px are
311
- permitted values</div>
312
- </div>
313
- </div>
314
- </div>
315
- <!-- </div> -->
316
- </div>
317
- <div class="save-changes-btn">
318
- <button type="submit" class="btn btn-primary">Save
319
- Changes</button>
320
- <div class="mt-30 row">
321
- <div v-if="showSuccessMessage" class="success-message">
322
- Settings successfully saved!
323
- </div>
324
- </div>
325
- </div>
326
- </form>
327
- </div>
328
- </div>
329
- </div>
330
- </div>
331
- </div>
332
- </div>
333
- </div>
334
- </template>
335
- </AposModalBody>
336
- </template>
337
- </AposModal>
50
+ </AposModalBody>
51
+ </template>
52
+ </AposModal>
338
53
  </template>
339
54
 
340
55
  <script>
341
56
  export default {
342
- props: {
343
- moduleName: String
344
- },
345
- emits: ['safe-close'],
346
- data() {
347
- return {
348
- modal: { active: false, showModal: false, type: 'overlay' },
349
- user: {
350
- name: '',
351
- email: ''
352
- },
353
- allinoneaccessibilitylogo: 'https://sanity.skynettechnologies.us/assets/images/all-in-one-accessibility-logo.svg',
354
- parameters: {
355
- hexaColor: '420083',
356
- widget_size: '0',
357
- position: 'bottom_right',
358
- icontype: 'aioa-icon-type-1',
359
- iconsize: 'aioa-default-icon',
360
- },
361
- widgetSettings: {
362
- widget_icon_size_custom: '',
363
- custom_position_x_value: '',
364
- custom_position_y_value: '',
365
- custom_position_left_right: 'To the right',
366
- custom_position_top_bottom: 'To the bottom',
367
- },
368
- isSwitcherEnabled: false,
369
- isSizeSwitcherEnabled: false,
370
- showSuccessMessage: false,
371
- isValid: false,
372
- elementStyle: {
373
- marginTop: '0px',
374
- display: 'flex',
375
- justifyContent: 'center',
376
- alignItems: 'center',
377
- flexDirection: 'column',
378
- },
379
- logoStyle: {
380
- display: 'block',
381
- justifyContent: 'center',
382
- alignItems: 'center',
383
- textAlign: 'center',
384
- marginLeft: 'auto',
385
- marginRight: 'auto',
386
- width: '50%',
387
- },
388
- iconTypes: [
389
- { value: 'aioa-icon-type-1', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-1.svg' },
390
- { value: 'aioa-icon-type-2', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-2.svg' },
391
- { value: 'aioa-icon-type-3', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-3.svg' },
392
- { value: 'aioa-icon-type-4', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-4.svg' },
393
- { value: 'aioa-icon-type-5', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-5.svg' },
394
- { value: 'aioa-icon-type-6', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-6.svg' },
395
- { value: 'aioa-icon-type-7', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-7.svg' },
396
- { value: 'aioa-icon-type-8', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-8.svg' },
397
- { value: 'aioa-icon-type-9', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-9.svg' },
398
- { value: 'aioa-icon-type-10', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-10.svg' },
399
- { value: 'aioa-icon-type-11', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-11.svg' },
400
- { value: 'aioa-icon-type-12', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-12.svg' },
401
- { value: 'aioa-icon-type-13', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-13.svg' },
402
- { value: 'aioa-icon-type-14', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-14.svg' },
403
- { value: 'aioa-icon-type-15', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-15.svg' },
404
- { value: 'aioa-icon-type-16', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-16.svg' },
405
- { value: 'aioa-icon-type-17', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-17.svg' },
406
- { value: 'aioa-icon-type-18', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-18.svg' },
407
- { value: 'aioa-icon-type-19', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-19.svg' },
408
- { value: 'aioa-icon-type-20', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-20.svg' },
409
- { value: 'aioa-icon-type-21', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-21.svg' },
410
- { value: 'aioa-icon-type-22', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-22.svg' },
411
- { value: 'aioa-icon-type-23', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-23.svg' },
412
- { value: 'aioa-icon-type-24', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-24.svg' },
413
- { value: 'aioa-icon-type-25', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-25.svg' },
414
- { value: 'aioa-icon-type-26', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-26.svg' },
415
- { value: 'aioa-icon-type-27', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-27.svg' },
416
- { value: 'aioa-icon-type-28', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-28.svg' },
417
- { value: 'aioa-icon-type-29', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-29.svg' },
418
-
419
- // Add other icon types here...
420
- ],
421
- iconSizes: [
422
- { value: 'aioa-big-icon', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-1.svg', width: 75, height: 75 },
423
- { value: 'aioa-medium-icon', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-1.svg', width: 65, height: 65 },
424
- { value: 'aioa-default-icon', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-1.svg', width: 55, height: 55 },
425
- { value: 'aioa-small-icon', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-1.svg', width: 45, height: 45 },
426
- { value: 'aioa-extra-small-icon', src: 'https://sanity.skynettechnologies.us/assets/images/aioa-icon-type-1.svg', width: 35, height: 35 },
427
- ],
428
-
429
- };
430
- },
431
- async mounted() {
432
- this.modal.active = true;
433
- // Create link element for Bootstrap CSS
434
- const bootstrapLink = document.createElement('link');
435
- bootstrapLink.rel = 'stylesheet';
436
- bootstrapLink.href = 'https://sanity.skynettechnologies.us/assets/css/bootstrap.min.css';
437
- document.head.appendChild(bootstrapLink);
438
-
439
- // Create link element for your custom CSS
440
- const customLink = document.createElement('link');
441
- customLink.rel = 'stylesheet';
442
- customLink.href = 'https://sanity.skynettechnologies.us/assets/css/style.css';
443
- document.head.appendChild(customLink);
444
- this.getAPIData();
445
-
446
- },
447
- computed: {
448
- },
449
- methods: {
450
- onSaveChanges() {
451
- const formdata = new FormData();
452
- const widget_icon_size_custom = this.widgetSettings.widget_icon_size_custom || '';
453
- const custom_position_x_value = this.widgetSettings.custom_position_x_value || '';
454
- const custom_position_y_value = this.widgetSettings.custom_position_y_value || '';
455
- const custom_position_left_right = this.widgetSettings.custom_position_left_right || '';
456
- const custom_position_top_bottom = this.widgetSettings.custom_position_top_bottom || '';
457
-
458
- let widget_position_right = '',
459
- widget_position_left = '',
460
- widget_position_top = '',
461
- widget_position_bottom = '';
462
-
463
- if (custom_position_left_right == 'cust-pos-to-the-right') {
464
- widget_position_right = custom_position_x_value;
465
- } else {
466
- widget_position_left = custom_position_x_value;
467
- }
468
-
469
- if (custom_position_left_right == 'cust-pos-to-the-lower') {
470
- widget_position_bottom = custom_position_y_value;
471
- } else {
472
- widget_position_top = custom_position_y_value;
473
- }
474
-
475
- formdata.append('u', window.location.hostname);
476
- formdata.append('widget_position', this.parameters.position);
477
- formdata.append('widget_color_code', this.parameters.hexaColor);
478
- formdata.append('widget_icon_type', this.parameters.icontype);
479
- formdata.append('widget_icon_size', this.parameters.iconsize);
480
- formdata.append('widget_size', this.parameters.widget_size);
481
- formdata.append('is_widget_custom_position', this.isSwitcherEnabled ? '1' : '0');
482
- formdata.append('is_widget_custom_size', this.isSizeSwitcherEnabled ? '1' : '0');
483
- formdata.append('widget_icon_size_custom', widget_icon_size_custom);
484
- formdata.append('widget_position_right', widget_position_right);
485
- formdata.append('widget_position_left', widget_position_left);
486
- formdata.append('widget_position_top', widget_position_top);
487
- formdata.append('widget_position_bottom', widget_position_bottom);
488
-
489
- console.log("this.isSizeSwitcherEnabled : ", this.isSizeSwitcherEnabled);
490
-
491
- console.log('u', window.location.hostname);
492
- console.log('widget_position', this.parameters.position);
493
- console.log('widget_color_code', this.parameters.hexaColor);
494
- console.log('widget_icon_type', this.parameters.icontype);
495
- console.log('widget_icon_size', this.parameters.iconsize);
496
- console.log('widget_size', this.parameters.widget_size);
497
- console.log('is_widget_custom_position', this.isSwitcherEnabled ? '1' : '0');
498
- console.log('is_widget_custom_size', this.isSizeSwitcherEnabled ? '1' : '0');
499
- console.log('widget_icon_size_custom', widget_icon_size_custom);
500
- console.log('widget_position_right', widget_position_right);
501
- console.log('widget_position_left', widget_position_left);
502
- console.log('widget_position_top', widget_position_top);
503
- console.log('widget_position_bottom', widget_position_bottom);
504
-
505
- fetch('https://ada.skynettechnologies.us/api/widget-setting-update-platform', {
506
- method: 'POST',
507
- body: formdata,
508
- })
509
- .then((response) => response.json())
510
- .then((response) => {
511
- console.log('response Save Data', response);
512
- this.showSuccessMessage = true;
513
-
514
- setTimeout(() => {
515
- this.showSuccessMessage = false;
516
- }, 3000); // Reset message after 3 seconds
517
- })
518
- .catch((error) => console.log('error', error));
519
- },
520
- getAPIData() {
521
- const formdata = new FormData();
522
- formdata.append('website_url', window.location.hostname);
523
-
524
- fetch('https://ada.skynettechnologies.us/api/widget-settings', {
525
- method: 'POST',
526
- body: formdata,
527
- })
528
- .then((response) => response.json())
529
- .then((response) => {
530
- if (Object.keys(response.Data).length !== 0) {
531
- this.isValid = true;
532
- this.parameters = {
533
- hexaColor: response.Data.widget_color_code,
534
- position: response.Data.widget_position,
535
- icontype: response.Data.widget_icon_type,
536
- iconsize: response.Data.widget_icon_size,
537
- widget_size: response.Data.widget_size,
538
- };
539
- this.isSizeSwitcherEnabled = response.Data.is_widget_custom_size == '0' ? false : true;
540
- this.isSwitcherEnabled = response.Data.is_widget_custom_position == '0' ? false : true;
541
-
542
- this.widgetSettings = {
543
- widget_icon_size_custom: response.Data.widget_icon_size_custom || '',
544
- custom_position_x_value: parseInt(response.Data.widget_position_left) > 0
545
- ? response.Data.widget_position_left
546
- : response.Data.widget_position_right,
547
- custom_position_y_value: parseInt(response.Data.widget_position_bottom) > 0
548
- ? response.Data.widget_position_bottom
549
- : response.Data.widget_position_top,
550
- custom_position_left_right: parseInt(response.Data.widget_position_left) > 0 ? 'cust-pos-to-the-left' : 'cust-pos-to-the-right',
551
- custom_position_top_bottom: parseInt(response.Data.widget_position_bottom) > 0 ? 'cust-pos-to-the-lower' : 'cust-pos-to-the-upper',
552
- };
553
-
554
- } else {
555
- this.isValid = false;
556
- }
557
- })
558
- .catch((error) => console.log('error', error));
559
- },
560
- handleInput(e) {
561
- e.target.value = Math.min(Math.max(Number(e.target.value), 0), 250).toString();
562
- },
563
- handleInput2(e) {
564
- e.target.value = Math.min(Math.max(Number(e.target.value), 0), 250).toString();
565
- },
566
- handleInput1(e) {
567
- e.target.value = Math.min(Math.max(Number(e.target.value), 0), 150).toString();
568
- },
569
- onIconChange(e) {
570
- this.parameters.icontype = e.target.value;
571
- },
572
- setIconSize(e) {
573
- this.parameters.iconsize = e.target.value;
574
- },
575
- ready() {
576
- this.$refs.cancelButton.$el.querySelector('button').focus();
577
- },
578
- cancel() {
579
- this.modal.showModal = false;
580
- }
57
+ name: 'AllInOneAccessibilitySettings',
58
+ props: {
59
+ moduleName: {
60
+ type: String,
61
+ required: true
62
+ }
63
+ },
64
+ emits: [ 'safe-close' ],
65
+ data() {
66
+ return {
67
+ modal: {
68
+ active: false,
69
+ showModal: false,
70
+ type: 'overlay'
71
+ }
72
+ };
73
+ },
74
+ computed: {
75
+ // From getBrowserData() in index.js (admins only)
76
+ settingsUrl() {
77
+ const data = window.apos.modules[this.moduleName];
78
+ return (data && data.settingsUrl) || '';
79
+ }
80
+ },
81
+ mounted() {
82
+ this.modal.active = true;
83
+ // The website's own widget button sits above every modal: hide it while the settings are open
84
+ document.documentElement.classList.add('aioa-settings-open');
85
+ },
86
+ unmounted() {
87
+ document.documentElement.classList.remove('aioa-settings-open');
88
+ },
89
+ methods: {
90
+ openInNewTab() {
91
+ window.open(this.settingsUrl, '_blank', 'noopener');
581
92
  },
582
- beforeDestroy() {
583
- if (this.pollInterval) {
584
- clearInterval(this.pollInterval);
585
- }
93
+ close() {
94
+ this.modal.showModal = false;
586
95
  }
96
+ }
587
97
  };
588
98
  </script>
589
99
 
590
- <style scoped>
591
- .btn [class*=" icon-"],
592
- .btn [class^=icon-],
593
- .s-btn [class*=" icon-"],
594
- .s-btn [class^=icon-],
595
- [class*=" icon-"],
596
- [class^=icon-],
597
- i.icon,
598
- span.icon {
599
- display: contents;
600
- }
601
-
602
- img {
603
- position: relative;
604
- top: 50%;
605
- transform: translateY(-50%);
606
- margin: 0 auto;
607
- }
608
-
609
- .all-in-one-accessibility-wrap .accessibility-settings .all-one-accessibility-form [type=radio]:checked+label:not(.edit-position),
610
- .all-in-one-accessibility-wrap .accessibility-settings .all-one-accessibility-form [type=radio]:not(:checked)+label:not(.edit-position) {
611
- width: 130px;
612
- height: 130px;
613
- padding: 10px !important;
614
- text-align: center;
615
- background-color: #3c007f !important;
616
- outline: 4px solid #fff;
617
- outline-offset: -4px;
618
- border-radius: 10px;
619
- }
620
-
621
- .all-in-one-accessibility-wrap .accessibility-settings .all-one-accessibility-form {
622
- margin: 0 auto 40px;
623
- border-radius: 19px;
624
- background: #e9efff;
625
- }
626
-
627
- .success-message {
628
- color: green;
629
- }
630
-
631
- .custom-switch {
632
- position: relative;
633
- display: inline-block;
634
- width: 60px;
635
- /* Adjust width as needed */
636
- height: 34px;
637
- /* Adjust height as needed */
638
- }
639
-
640
- .custom-switch input {
641
- opacity: 0;
642
- /* Hide the default checkbox */
643
- width: 0;
644
- height: 0;
645
- }
646
-
647
- .slider {
648
- position: absolute;
649
- cursor: pointer;
650
- top: 0;
651
- left: 0;
652
- right: 0;
653
- bottom: 0;
654
- background-color: #ccc;
655
- /* Background color when off */
656
- transition: .4s;
657
- /* Transition effect */
658
- border-radius: 34px;
659
- /* Rounded corners */
660
- }
661
-
662
- .slider:before {
663
- position: absolute;
664
- content: "";
665
- height: 26px;
666
- /* Height of the slider knob */
667
- width: 26px;
668
- /* Width of the slider knob */
669
- left: 4px;
670
- /* Position of the knob */
671
- bottom: 4px;
672
- /* Position of the knob */
673
- background-color: white;
674
- /* Color of the knob */
675
- border-radius: 50%;
676
- /* Round knob */
677
- transition: .4s;
678
- /* Transition effect */
679
- }
680
-
681
- /* Change background color when checked */
682
- input:checked+.slider {
683
- background-color: #420083;
684
- /* Background color when on */
685
- }
100
+ <style lang="scss">
101
+ // Doubled class: wins over the padding rules of AposModalBody
102
+ .aioa-settings-modal.aioa-settings-modal {
103
+ .apos-modal__main .apos-modal__body {
104
+ overflow: hidden;
105
+ padding: 0;
106
+ }
686
107
 
687
- /* Move the knob when checked */
688
- input:checked+.slider:before {
689
- transform: translateX(26px);
690
- /* Move knob to the right */
691
- }
108
+ .apos-modal__body-inner,
109
+ .apos-modal__body-main {
110
+ height: 100%;
111
+ max-width: none;
112
+ margin: 0;
113
+ padding: 0;
114
+ }
115
+ }
116
+
117
+ .aioa-settings-modal__body {
118
+ display: flex;
119
+ height: 100%;
120
+ min-height: 70vh;
121
+ }
122
+
123
+ .aioa-settings-modal__frame {
124
+ flex: 1;
125
+ width: 100%;
126
+ border: 0;
127
+ }
128
+
129
+ // The widget on the website behind the modal (added by views/scriptTag.html)
130
+ .aioa-settings-open .aioa-widget-wrapper,
131
+ .aioa-settings-open #accessibility_tooltip {
132
+ visibility: hidden !important;
133
+ }
134
+
135
+ .aioa-settings-modal__message {
136
+ margin: 40px auto;
137
+ color: var(--a-text-primary);
138
+ }
692
139
  </style>