| 1 |
import { __, isRTL } from '@wordpress/i18n'; |
| 2 |
|
| 3 |
export default { |
| 4 |
id: 'plugin-install-tour', |
| 5 |
title: __('Installing a plugin', 'extendify-local'), |
| 6 |
settings: { |
| 7 |
allowOverflow: false, |
| 8 |
startFrom: [`${window.extSharedData.adminUrl}plugin-install.php`], |
| 9 |
}, |
| 10 |
onStart: () => { |
| 11 |
if (document.body.classList.contains('folded')) { |
| 12 |
document.querySelector('#menu-plugins').classList.add('opensub'); |
| 13 |
} |
| 14 |
}, |
| 15 |
steps: [ |
| 16 |
{ |
| 17 |
title: __('Add New plugin menu', 'extendify-local'), |
| 18 |
text: __('Click here to access the Add Plugins page.', 'extendify-local'), |
| 19 |
attachTo: { |
| 20 |
element: '#menu-plugins .wp-submenu a[href="plugin-install.php"]', |
| 21 |
offset: { |
| 22 |
marginTop: 0, |
| 23 |
marginLeft: isRTL() ? -15 : 15, |
| 24 |
}, |
| 25 |
position: { |
| 26 |
x: isRTL() ? 'left' : 'right', |
| 27 |
y: 'top', |
| 28 |
}, |
| 29 |
hook: isRTL() ? 'top right' : 'top left', |
| 30 |
}, |
| 31 |
events: { |
| 32 |
onDetach: () => { |
| 33 |
if (document.body.classList.contains('folded')) { |
| 34 |
document.querySelector('#menu-plugins').classList.remove('opensub'); |
| 35 |
} |
| 36 |
}, |
| 37 |
}, |
| 38 |
}, |
| 39 |
{ |
| 40 |
title: __('Search', 'extendify-local'), |
| 41 |
text: __( |
| 42 |
'Search for a plugin by name or functionality.', |
| 43 |
'extendify-local', |
| 44 |
), |
| 45 |
attachTo: { |
| 46 |
element: '.search-form.search-plugins', |
| 47 |
offset: { |
| 48 |
marginTop: 5, |
| 49 |
marginLeft: isRTL() ? 350 : -350, |
| 50 |
}, |
| 51 |
boxPadding: { |
| 52 |
top: -5, |
| 53 |
bottom: 3, |
| 54 |
left: 5, |
| 55 |
right: 5, |
| 56 |
}, |
| 57 |
position: { |
| 58 |
x: isRTL() ? 'right' : 'left', |
| 59 |
y: 'top', |
| 60 |
}, |
| 61 |
hook: isRTL() ? 'top right' : 'top left', |
| 62 |
}, |
| 63 |
events: {}, |
| 64 |
}, |
| 65 |
{ |
| 66 |
title: __('Plugin details', 'extendify-local'), |
| 67 |
text: __( |
| 68 |
'See important information about each plugin.', |
| 69 |
'extendify-local', |
| 70 |
), |
| 71 |
attachTo: { |
| 72 |
element: '#the-list .plugin-card:first-child .plugin-card-bottom', |
| 73 |
offset: { |
| 74 |
marginTop: 0, |
| 75 |
marginLeft: isRTL() ? -15 : 15, |
| 76 |
}, |
| 77 |
position: { |
| 78 |
x: isRTL() ? 'left' : 'right', |
| 79 |
y: 'bottom', |
| 80 |
}, |
| 81 |
hook: isRTL() ? 'bottom right' : 'bottom left', |
| 82 |
}, |
| 83 |
events: {}, |
| 84 |
}, |
| 85 |
{ |
| 86 |
title: __('Install now', 'extendify-local'), |
| 87 |
text: __( |
| 88 |
'Install the plugin. Then, press this button again to activate the plugin.', |
| 89 |
'extendify-local', |
| 90 |
), |
| 91 |
attachTo: { |
| 92 |
element: '#the-list .plugin-card:first-child .install-now', |
| 93 |
offset: { |
| 94 |
marginTop: -5, |
| 95 |
marginLeft: isRTL() ? -15 : 15, |
| 96 |
}, |
| 97 |
boxPadding: { |
| 98 |
top: 5, |
| 99 |
bottom: 5, |
| 100 |
left: 5, |
| 101 |
right: 5, |
| 102 |
}, |
| 103 |
position: { |
| 104 |
x: isRTL() ? 'left' : 'right', |
| 105 |
y: 'top', |
| 106 |
}, |
| 107 |
hook: isRTL() ? 'top right' : 'top left', |
| 108 |
}, |
| 109 |
events: {}, |
| 110 |
}, |
| 111 |
{ |
| 112 |
title: __('Upload Plugin', 'extendify-local'), |
| 113 |
text: __( |
| 114 |
'If you have a plugin from an external source, you can upload it directly here.', |
| 115 |
'extendify-local', |
| 116 |
), |
| 117 |
attachTo: { |
| 118 |
element: '.upload-view-toggle', |
| 119 |
offset: { |
| 120 |
marginTop: -5, |
| 121 |
marginLeft: isRTL() ? -15 : 15, |
| 122 |
}, |
| 123 |
boxPadding: { |
| 124 |
top: 5, |
| 125 |
bottom: 5, |
| 126 |
left: 5, |
| 127 |
right: 5, |
| 128 |
}, |
| 129 |
position: { |
| 130 |
x: isRTL() ? 'left' : 'right', |
| 131 |
y: 'top', |
| 132 |
}, |
| 133 |
hook: isRTL() ? 'top right' : 'top left', |
| 134 |
}, |
| 135 |
events: {}, |
| 136 |
}, |
| 137 |
], |
| 138 |
}; |
| 139 |
|