PluginProbe
Extendify / 3.1.5
Extendify v3.1.5
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 / Agent / tours / welcome.js

welcome.js in Extendify 3.1.5, at src/Agent/tours/welcome.js

373 lines 9.0 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: 'welcome-tour',
5 title: __('Getting started with WordPress', 'extendify-local'),
6 message: __('Take the welcome tour', 'extendify-local'),
7 settings: {
8 allowOverflow: true,
9 startFrom: [
10 `${window.extSharedData.adminUrl}index.php`,
11 `${window.extSharedData.adminUrl}admin.php?page=extendify-assist#dashboard`,
12 ],
13 minBoxWidth: '360px',
14 },
15 onStart: () => {
16 // if the menu is collapsed, remove the class to expand it
17 if (document.body.classList.contains('folded')) {
18 document.body.classList.remove('folded');
19 document.body.classList.add('temp-open');
20 }
21 },
22 onFinish: () => {
23 // only fold the menu if it was folded before
24 if (document.body.classList.contains('temp-open')) {
25 document.body.classList.remove('temp-open');
26 document.body.classList.add('folded');
27 }
28 },
29 steps: [
30 {
31 title: __('View Site', 'extendify-local'),
32 text: __(
33 "At any time, you can view your site (from a visitor's perspective) from the top admin bar under your site's name.",
34 'extendify-local',
35 ),
36 image: 'https://images.extendify-cdn.com/tours/welcome/view-site.gif',
37 attachTo: {
38 element: '#wp-admin-bar-view-site',
39 offset: {
40 marginTop: 0,
41 marginLeft: isRTL() ? -10 : 10,
42 },
43 position: {
44 x: isRTL() ? 'left' : 'right',
45 y: 'top',
46 },
47 hook: isRTL() ? 'top right' : 'top left',
48 },
49 events: {
50 beforeAttach: () => {
51 const menu = document.querySelector(
52 '#wp-admin-bar-site-name .ab-sub-wrapper',
53 );
54 menu.style.position = 'relative';
55 menu.style.display = 'block';
56 },
57 onAttach: () => {
58 const menu = document.querySelector(
59 '#wp-admin-bar-site-name .ab-sub-wrapper',
60 );
61 menu.style.position = 'relative';
62 menu.style.display = 'block';
63 },
64 onDetach: () => {
65 const menu = document.querySelector(
66 '#wp-admin-bar-site-name .ab-sub-wrapper',
67 );
68 menu.style.position = 'absolute';
69 menu.style.display = '';
70 },
71 },
72 },
73 {
74 title: __('Site Assistant', 'extendify-local'),
75 text: __('Access the Site Assistant at any time.', 'extendify-local'),
76 attachTo: {
77 element: '#toplevel_page_extendify-assist',
78 offset: {
79 marginTop: 0,
80 marginLeft: isRTL() ? -15 : 15,
81 },
82 position: {
83 x: isRTL() ? 'left' : 'right',
84 y: 'top',
85 },
86 hook: isRTL() ? 'top right' : 'top left',
87 },
88 events: {},
89 },
90 {
91 title: document
92 .getElementById('toplevel_page_wpSq')
93 ?.textContent?.replace(/[^\w\s²]/g, '')
94 .trim(),
95 text: __(
96 'Click here to go to your website management dashboard. From there you will be able to create more websites, and manage your account settings.',
97 'extendify-local',
98 ),
99 showOnlyIf: () => document.getElementById('toplevel_page_wpSq'),
100 attachTo: {
101 element: '#toplevel_page_wpSq',
102 offset: {
103 marginTop: 0,
104 marginLeft: isRTL() ? -15 : 15,
105 },
106 position: {
107 x: isRTL() ? 'left' : 'right',
108 y: 'top',
109 },
110 hook: isRTL() ? 'top right' : 'top left',
111 },
112 events: {},
113 },
114 {
115 title: __('Dashboard', 'extendify-local'),
116 text: __(
117 'The default WordPress dashboard will have some overall site metrics and modules added from certain plugins.',
118 'extendify-local',
119 ),
120 attachTo: {
121 element: '#menu-dashboard',
122 offset: {
123 marginTop: 0,
124 marginLeft: isRTL() ? -15 : 15,
125 },
126 position: {
127 x: isRTL() ? 'left' : 'right',
128 y: 'top',
129 },
130 hook: isRTL() ? 'top right' : 'top left',
131 },
132 events: {},
133 },
134 {
135 title: __('Posts', 'extendify-local'),
136 text: __('Manage and create blog posts.', 'extendify-local'),
137 attachTo: {
138 element: '#menu-posts',
139 offset: {
140 marginTop: 0,
141 marginLeft: isRTL() ? -15 : 15,
142 },
143 position: {
144 x: isRTL() ? 'left' : 'right',
145 y: 'top',
146 },
147 hook: isRTL() ? 'top right' : 'top left',
148 },
149 events: {},
150 },
151 {
152 title: __('Media', 'extendify-local'),
153 text: __(
154 'Add, edit, or remove images and other media from your library. When you upload an image to be used on your site, it will be added to the library.',
155 'extendify-local',
156 ),
157 attachTo: {
158 element: '#menu-media',
159 offset: {
160 marginTop: 0,
161 marginLeft: isRTL() ? -15 : 15,
162 },
163 position: {
164 x: isRTL() ? 'left' : 'right',
165 y: 'top',
166 },
167 hook: isRTL() ? 'top right' : 'top left',
168 },
169 events: {},
170 },
171 {
172 title: __('Pages', 'extendify-local'),
173 text: __(
174 'Use the pages menu to add, delete, or edit the pages on your site.',
175 'extendify-local',
176 ),
177 image: 'https://images.extendify-cdn.com/tours/welcome/add-pages.gif',
178 attachTo: {
179 element: '#menu-pages',
180 offset: {
181 marginTop: 0,
182 marginLeft: isRTL() ? -15 : 15,
183 },
184 position: {
185 x: isRTL() ? 'left' : 'right',
186 y: 'top',
187 },
188 hook: isRTL() ? 'top right' : 'top left',
189 },
190 events: {},
191 },
192 {
193 title: __('Comments', 'extendify-local'),
194 text: __(
195 'If you have commenting enabled on your posts, you can manage those comments here.',
196 'extendify-local',
197 ),
198 attachTo: {
199 element: '#menu-comments',
200 offset: {
201 marginTop: 0,
202 marginLeft: isRTL() ? -15 : 15,
203 },
204 position: {
205 x: isRTL() ? 'left' : 'right',
206 y: 'top',
207 },
208 hook: isRTL() ? 'top right' : 'top left',
209 },
210 events: {},
211 },
212 {
213 title: __('Appearance', 'extendify-local'),
214 text: __(
215 'Manage your theme and access the Site Editor from the Appearance menu. The Site Editor is where you can make global changes to your site (such as the menu, header/footer, and styles).',
216 'extendify-local',
217 ),
218 attachTo: {
219 element: '#menu-appearance',
220 offset: {
221 marginTop: 0,
222 marginLeft: isRTL() ? -15 : 15,
223 },
224 position: {
225 x: isRTL() ? 'left' : 'right',
226 y: 'top',
227 },
228 hook: isRTL() ? 'top right' : 'top left',
229 },
230 events: {},
231 },
232 {
233 title: __('Plugins', 'extendify-local'),
234 text: __('Add or manage the plugins on your site.', 'extendify-local'),
235 attachTo: {
236 element: '#menu-plugins',
237 offset: {
238 marginTop: 0,
239 marginLeft: isRTL() ? -15 : 15,
240 },
241 position: {
242 x: isRTL() ? 'left' : 'right',
243 y: 'top',
244 },
245 hook: isRTL() ? 'top right' : 'top left',
246 },
247 events: {},
248 },
249 {
250 title: __('Users', 'extendify-local'),
251 text: __(
252 'Add or manage users on your site, both admin users and others.',
253 'extendify-local',
254 ),
255 attachTo: {
256 element: '#menu-users',
257 offset: {
258 marginTop: 0,
259 marginLeft: isRTL() ? -15 : 15,
260 },
261 position: {
262 x: isRTL() ? 'left' : 'right',
263 y: 'top',
264 },
265 hook: isRTL() ? 'top right' : 'top left',
266 },
267 events: {},
268 },
269 {
270 title: __('Tools', 'extendify-local'),
271 text: __(
272 'Import/export post data, check site health, and edit theme or plugin files directly in the WordPress admin.',
273 'extendify-local',
274 ),
275 attachTo: {
276 element: '#menu-tools',
277 offset: {
278 marginTop: 0,
279 marginLeft: isRTL() ? -15 : 15,
280 },
281 position: {
282 x: isRTL() ? 'left' : 'right',
283 y: 'top',
284 },
285 hook: isRTL() ? 'top right' : 'top left',
286 },
287 events: {},
288 },
289 {
290 title: __('Settings', 'extendify-local'),
291 text: __(
292 'Advanced settings for your site and for certain plugins.',
293 'extendify-local',
294 ),
295 attachTo: {
296 element: '#menu-settings',
297 offset: {
298 marginTop: 0,
299 marginLeft: isRTL() ? -15 : 15,
300 },
301 position: {
302 x: isRTL() ? 'left' : 'right',
303 y: 'top',
304 },
305 hook: isRTL() ? 'top right' : 'top left',
306 },
307 events: {},
308 },
309 {
310 title: __('Collapse menu', 'extendify-local'),
311 text: __(
312 'Use this toggle to collapse or expand the sidebar menu.',
313 'extendify-local',
314 ),
315 attachTo: {
316 element: '#collapse-menu',
317 offset: {
318 marginTop: 0,
319 marginLeft: isRTL() ? -15 : 15,
320 },
321 position: {
322 x: isRTL() ? 'left' : 'right',
323 y: 'top',
324 },
325 hook: isRTL() ? 'top right' : 'top left',
326 },
327 events: {},
328 },
329 {
330 title: __('User', 'extendify-local'),
331 text: __(
332 'Manage your profile or log out of your account here.',
333 'extendify-local',
334 ),
335 attachTo: {
336 element: '#wp-admin-bar-user-actions',
337 offset: {
338 marginTop: 5,
339 marginLeft: isRTL() ? 15 : -15,
340 },
341 position: {
342 x: isRTL() ? 'right' : 'left',
343 y: 'top',
344 },
345 hook: isRTL() ? 'top left' : 'top right',
346 },
347 events: {
348 beforeAttach: () => {
349 const menu = document.querySelector(
350 '#wp-admin-bar-my-account .ab-sub-wrapper',
351 );
352 menu.style.position = 'relative';
353 menu.style.display = 'block';
354 },
355 onAttach: () => {
356 const menu = document.querySelector(
357 '#wp-admin-bar-my-account .ab-sub-wrapper',
358 );
359 menu.style.position = 'relative';
360 menu.style.display = 'block';
361 },
362 onDetach: () => {
363 const menu = document.querySelector(
364 '#wp-admin-bar-my-account .ab-sub-wrapper',
365 );
366 menu.style.position = 'absolute';
367 menu.style.display = '';
368 },
369 },
370 },
371 ],
372 };
373