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