Skip to content

Commit 6e83a39

Browse files
committed
add all the js to get vue working in the wizard
1 parent adcf78f commit 6e83a39

File tree

2 files changed

+45
-5
lines changed

2 files changed

+45
-5
lines changed

inc/admin-pages/class-setup-wizard-admin-page.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,42 @@ public function register_scripts(): void {
900900

901901
wp_register_script('wu-functions', wu_get_asset('functions.js', 'js'), ['jquery'], \WP_Ultimo::VERSION, true);
902902

903+
/*
904+
* Localize selectizer
905+
*/
906+
wp_localize_script(
907+
'wu-functions',
908+
'wu_selectizer',
909+
[
910+
'ajaxurl' => wu_ajax_url('init'),
911+
]
912+
);
913+
914+
wp_localize_script(
915+
'wu-functions',
916+
'wu_settings',
917+
[
918+
'currency' => wu_get_setting('currency_symbol', 'USD'),
919+
'currency_symbol' => wu_get_currency_symbol(),
920+
'currency_position' => wu_get_setting('currency_position', '%s %v'),
921+
'decimal_separator' => wu_get_setting('decimal_separator', '.'),
922+
'thousand_separator' => wu_get_setting('thousand_separator', ','),
923+
'precision' => wu_get_setting('precision', 2),
924+
'use_container' => get_user_setting('wu_use_container', false),
925+
'disable_image_zoom' => wu_get_setting('disable_image_zoom', false),
926+
]
927+
);
928+
929+
wp_localize_script(
930+
'wu-functions',
931+
'wu_ticker',
932+
[
933+
'server_clock_offset' => (wu_get_current_time('timestamp') - time()) / 60 / 60, // phpcs:ignore
934+
'moment_clock_timezone_name' => wp_date('e'),
935+
'moment_clock_timezone_offset' => wp_date('Z'),
936+
]
937+
);
938+
903939
wp_register_script('wubox', wu_get_asset('wubox.js', 'js'), ['wu-functions'], \WP_Ultimo::VERSION, true);
904940

905941
wp_localize_script(
@@ -917,6 +953,13 @@ public function register_scripts(): void {
917953
);
918954

919955
wp_add_inline_script('wu-setup-wizard-extra', 'document.addEventListener("DOMContentLoaded", () => wu_initialize_imagepicker());', 'after');
956+
957+
// All these just so the toggle of footer credits shows the other options.
958+
wp_register_script('wu-vue', wu_get_asset('lib/vue.js', 'js'), [], wu_get_version(), true);
959+
wp_register_script('wu-money-mask', wu_get_asset('lib/v-money.js', 'js'), ['wu-vue'], wu_get_version(), true);
960+
wp_register_script('wu-input-mask', wu_get_asset('lib/vue-the-mask.js', 'js'), ['wu-vue'], wu_get_version(), true);
961+
wp_register_script('wu-vue-apps', wu_get_asset('vue-apps.js', 'js'), ['wu-functions', 'wu-vue', 'wu-money-mask', 'wu-input-mask', 'wp-hooks'], wu_get_version(), true);
962+
wp_enqueue_script('wu-vue-apps');
920963
}
921964

922965
wp_enqueue_script('wu-setup-wizard-extra', wu_get_asset('setup-wizard-extra.js', 'js'), ['jquery', 'wu-fields', 'wu-functions', 'wubox'], wu_get_version(), true);

inc/class-wp-ultimo.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ public function init(): void {
153153
*/
154154
$this->settings = WP_Ultimo\Settings::get_instance();
155155

156+
// These must be loaded here so the settings are in the setup wizard.
156157
WP_Ultimo\Newsletter::get_instance();
158+
\WP_Ultimo\Credits::get_instance();
157159

158160
/*
159161
* Check if the Ultimate Multisite requirements are present.
@@ -610,11 +612,6 @@ function () {
610612
*/
611613
\WP_Ultimo\Whitelabel::get_instance();
612614

613-
/*
614-
* Optional Footer Credits (opt-in, defaults OFF)
615-
*/
616-
\WP_Ultimo\Credits::get_instance();
617-
618615
/*
619616
* Adds support to multiple accounts.
620617
*

0 commit comments

Comments
 (0)