PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / HelpCenter / tours / site-assistant.js

site-assistant.js in Extendify 3.2.1, at src/HelpCenter/tours/site-assistant.js

160 lines 3.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __, isRTL } from '@wordpress/i18n';
2
3 export default {
4 id: 'site-assistant-tour',
5 title: __('Site Assistant', 'extendify-local'),
6 settings: {
7 allowOverflow: false,
8 startFrom: [
9 `${window.extSharedData.adminUrl}admin.php?page=extendify-assist#dashboard`,
10 ],
11 },
12 steps: [
13 {
14 title: __('Tasks', 'extendify-local'),
15 text: __(
16 "Now that you've created your starter site, make it your own with these follow up tasks.",
17 'extendify-local',
18 ),
19 showOnlyIf: () => document.getElementById('assist-tasks-module'),
20 attachTo: {
21 element: '#assist-tasks-module',
22 offset: {
23 marginTop: window.innerWidth <= 1151 ? -15 : 2,
24 marginLeft: window.innerWidth <= 1151 ? -25 : 15,
25 },
26 position: {
27 x: isRTL() ? 'left' : 'right',
28 y: 'top',
29 },
30 hook: isRTL() ? 'top right' : 'top left',
31 },
32 events: {},
33 },
34 {
35 title: __('Quick Links', 'extendify-local'),
36 text: __(
37 'Easily access some of the most common items in WordPress with these quick links.',
38 'extendify-local',
39 ),
40 attachTo: {
41 element: '#assist-quick-links-module',
42 offset: {
43 marginTop: window.innerWidth <= 1151 ? -15 : 2,
44 marginLeft: window.innerWidth <= 1151 ? -25 : 15,
45 },
46 position: {
47 x: isRTL() ? 'left' : 'right',
48 y: 'top',
49 },
50 hook: isRTL() ? 'top right' : 'top left',
51 },
52 events: {
53 onAttach: () => {},
54 },
55 },
56 {
57 title: __('Website Tools & Plugins', 'extendify-local'),
58 text: __(
59 'See our personalized recommendations for you that will help you accomplish your goals.',
60 'extendify-local',
61 ),
62 showOnlyIf: () =>
63 document.querySelector('#assist-recommendations-module'),
64 attachTo: {
65 element: '#assist-recommendations-module',
66 offset: {
67 marginTop: window.innerWidth <= 1151 ? -15 : 2,
68 marginLeft: window.innerWidth <= 1151 ? -25 : 15,
69 },
70 position: {
71 x: isRTL() ? 'left' : 'right',
72 y: 'top',
73 },
74 hook: isRTL() ? 'top right' : 'top left',
75 },
76 events: {},
77 },
78 {
79 title: __('Help Center', 'extendify-local'),
80 text: __(
81 'You can always access the help center by clicking this button.',
82 'extendify-local',
83 ),
84 showOnlyIf: () => document.querySelector('#wp-admin-bar-help-center-btn'),
85 attachTo: {
86 element: '#wp-admin-bar-help-center-btn',
87 offset: {
88 marginTop: 45,
89 marginLeft: isRTL() ? 5 : -5,
90 },
91 position: {
92 x: isRTL() ? 'left' : 'right',
93 y: 'top',
94 },
95 hook: isRTL() ? 'top right' : 'top left',
96 },
97 events: {},
98 },
99 {
100 title: __('Visit your site', 'extendify-local'),
101 text: __(
102 'You can always visit your site by clicking this button.',
103 'extendify-local',
104 ),
105 attachTo: {
106 element: '#assist-menu-bar',
107 offset: {
108 marginTop: 20,
109 marginLeft: isRTL() ? 5 : -5,
110 },
111 position: {
112 x: isRTL() ? 'right' : 'left',
113 y: 'bottom',
114 },
115 hook: isRTL() ? 'top right' : 'top left',
116 boxPadding: {
117 top: 5,
118 bottom: 5,
119 left: 5,
120 right: 5,
121 },
122 },
123 events: {},
124 },
125 {
126 title: __('Site Assistant', 'extendify-local'),
127 text: __(
128 'Come back to the Site Assistant any time by clicking the menu item.',
129 'extendify-local',
130 ),
131 attachTo: {
132 element: '#toplevel_page_extendify-assist',
133 offset: {
134 marginTop: 0,
135 marginLeft: isRTL() ? -15 : 15,
136 },
137 position: {
138 x: isRTL() ? 'left' : 'right',
139 y: 'top',
140 },
141 hook: isRTL() ? 'top right' : 'top left',
142 },
143 events: {
144 onAttach: () => {
145 if (document.body.classList.contains('folded')) {
146 document.body.classList.remove('folded');
147 document.body.classList.add('temp-open');
148 }
149 },
150 onDetach: () => {
151 if (document.body.classList.contains('temp-open')) {
152 document.body.classList.remove('temp-open');
153 document.body.classList.add('folded');
154 }
155 },
156 },
157 },
158 ],
159 };
160