PluginProbe
Booking Calendar / 10.10
Booking Calendar v10.10
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
booking / includes / _tour / _src / wpbc_tour.js

wpbc_tour.js in Booking Calendar 10.10, at includes/_tour/_src/wpbc_tour.js

124 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function ($) {
2
3 $(function() {
4
5 // if Shepherd is undefined, exit.
6 if (!window.Shepherd) return;
7
8 var button_classes = 'button button-primary';
9 var plugins_page_tour = window.wpbc_plugins_page_tour = new Shepherd.Tour();
10 var main_tour = window.wpbc_main_tour = new Shepherd.Tour();
11
12 // Set up the defaults for each step
13 main_tour.options.defaults = plugins_page_tour.options.defaults = {
14 classes: 'wpbc_tour_theme202408 wpbc_tour_main',
15 showCancelLink: true,
16 scrollTo: false,
17 tetherOptions: {
18 constraints: [
19 {
20 to: 'scrollParent',
21 attachment: 'together',
22 pin: false
23 }
24 ]
25 }
26 };
27
28 /*
29 Plugins page
30 */
31
32 main_tour.addStep( 'intro', {
33 title: wpbc_tour_i18n.plugins_page.title,
34 text: wpbc_tour_i18n.plugins_page.text,
35 attachTo: '.wpbc_plugins_links__start_tour top',
36 buttons: [
37 {
38 classes: button_classes,
39 text: wpbc_tour_i18n.plugins_page.button.text,
40 action: function() {
41 window.location = wpbc_tour_i18n.plugins_page.button.url;
42 }
43 }
44 ],
45 tetherOptions: {
46 constraints: [
47 {
48 to: 'scrollParent',
49 attachment: 'together',
50 pin: false
51 }
52 ],
53 offset: '20px 0'
54 },
55 when: {
56 show: function() {
57 $('body').addClass('plugins_page_highlight_wpbc');
58 var popup = $(this.el);
59 var target = $(this.tether.target);
60 $('body, html').animate({
61 scrollTop: popup.offset().top - 50
62 }, 500, function() {
63 window.scrollTo(0, popup.offset().top - 50);
64 });
65 },
66 hide: function() {
67 $('body').removeClass('plugins_page_highlight_wpbc');
68 }
69 }
70 });
71
72
73 /*
74 Main Tour steps
75 */
76
77 // 1. Your first backup
78 main_tour.addStep( 'main_tour_start', {
79 title: wpbc_tour_i18n.setup_page.title,
80 text: wpbc_tour_i18n.setup_page.text,
81 //attachTo: '.wpbc_page_top__wizard_button_content bottom',
82 attachTo: { element: jQuery( '#toplevel_page_wpbc ul li:nth-last-child(2)').get(0), on: 'right'},
83 buttons: [
84 {
85 classes: 'wpbc_tour_end',
86 text: wpbc_tour_i18n.button_end_tour.text,
87 action: main_tour.cancel
88 },
89 {
90 classes: button_classes,
91 text: wpbc_tour_i18n.button_next.text,
92 action: function() {
93 //jQuery('.wpbc_page_top__wizard_button_content .button').trigger('click');
94 jQuery( '#toplevel_page_wpbc ul li:nth-last-child(2) a').get(0).click();
95 }
96 }
97 ],
98 tetherOptions: {
99 constraints: [
100 {
101 to: 'window',
102 attachment: 'together'
103 }
104 ],
105 offset: '0 0'
106 }
107 });
108
109 });
110
111 })(jQuery);
112
113 jQuery(document).ready(function(){
114
115 setTimeout(function(){
116 if (jQuery('.wpbc_plugins_links__start_tour').length){
117 wpbc_main_tour.start();
118 }
119 if (jQuery('.wpbc_page_top__wizard_button_content').length){
120 wpbc_main_tour.show('main_tour_start');
121 }
122 },1000)
123 });
124