PluginProbe
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress / 8.5.4
WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress v8.5.4
9.1.2 9.1.1 9.1.0 9.0.3 9.0.2 9.0.1 9.0.0 8.5.79 8.5.78 8.5.77 8.5.76 8.5.75 8.5.74 8.5.73 8.5.72 8.5.71 8.5.70 8.5.69 8.5.68 8.5.35 8.5.36 8.5.37 8.5.38 8.5.39 8.5.4 All 221 releases
wpvr / admin / js / wpvr-global.js

wpvr-global.js in WPVR – 360 Panorama viewer and Virtual Tour Builder for WordPress 8.5.4, at admin/js/wpvr-global.js

171 lines 4.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function( $ ) {
2 'use strict';
3 /**
4 * All of the code for your admin-facing JavaScript source
5 * should reside in this file.
6 *
7 * Note: It has been assumed you will write jQuery code here, so the
8 * $ function reference has been prepared for usage within the scope
9 * of this function.
10 *
11 * This enables you to define handlers, for when the DOM is ready:
12 *
13 * $(function() {
14 *
15 * });
16 *
17 * When the window is loaded:
18 *
19 * $( window ).load(function() {
20 *
21 * });
22 *
23 * ...and/or other possibilities.
24 *
25 * Ideally, it is not considered best practise to attach more than a
26 * single DOM-ready or window-load handler for a particular page.
27 * Although scripts in the WordPress core, Plugins and Themes may be
28 * practising this, we should strive to set a better example in our own work.
29 */
30
31 $(document).ready(function(){
32
33 $( '#wpvr-gopro-submenu' ).parent().attr( 'target', '_blank' );
34
35 $('.setup-wizard-carousel').owlCarousel({
36 loop:false,
37 items:1,
38 dots: false,
39 mouseDrag: false,
40 touchDrag: false,
41 navText: ['Previous','Next'],
42 });
43
44 $(".choose-tour input[type='radio']").on('click', function(){
45 var val = $(this).val();
46 $('#'+val).show();
47 $('#'+val).siblings().hide();
48 });
49
50 function wpvr_bf_notice_dismiss(event) {
51 event.preventDefault();
52 var ajaxurl = wpvr_global_obj.ajaxurl;
53 var that = $(this);
54 $.ajax({
55 type : "post",
56 dataType : "json",
57 url : ajaxurl,
58 data : { action: "wpvr_black_friday_offer_notice_dismiss", nonce : wpvr_global_obj.ajax_nonce },
59 success: function(response) {
60 if(response.success) {
61 that.fadeOut('slow');
62 }
63 }
64 })
65 }
66 $(document).on('click', '.wpvr-black-friday-offer notice-dismiss', wpvr_bf_notice_dismiss);
67
68
69 function wpvr_halloween_notice_dismiss(event) {
70 event.preventDefault();
71 $('#rex_wpvr_deal_notification').css('display','none');
72 var ajaxurl = wpvr_global_obj.ajaxurl;
73 var that = $(this);
74 $.ajax({
75 type : "post",
76 dataType : "json",
77 url : ajaxurl,
78 data : { action: "wpvr_halloween_offer_notice_dismiss", nonce : wpvr_global_obj.ajax_nonce },
79 success: function(response) {
80 if(response.success) {
81 that.fadeOut('slow');
82 }
83 }
84 })
85 }
86 $(document).on('click', '.close-promotional-banner', wpvr_halloween_notice_dismiss);
87
88 });
89
90 $(document).on("click","#wpvr-dismissible",function(e) {
91
92 e.preventDefault();
93 var ajaxurl = wpvr_global_obj.ajaxurl;
94 jQuery.ajax({
95 type: "POST",
96 url: ajaxurl,
97 data: {
98 action: "wpvr_notice",
99 nonce : wpvr_global_obj.ajax_nonce
100 },
101 success: function( response ){
102 $('#wpvr-warning').hide();
103 }
104 });
105 });
106
107
108 /**
109 * Dismiss black friday notice
110 *
111 * @param e
112 */
113 function wpvr_dismiss_black_friday_notice(e) {
114 e.preventDefault();
115 jQuery.ajax({
116 type: "POST",
117 url: ajaxurl,
118 data: {
119 action: "wpvr_dismiss_black_friday_notice",
120 nonce : wpvr_global_obj.ajax_nonce
121 },
122 success: function(response) {
123 $('.wpvr-black-friday-banner').hide();
124 }
125 });
126 }
127 $(document).on('click', '#wpvr-black-friday-close-button, #wpvr-black-friday-close-button svg', wpvr_dismiss_black_friday_notice);
128
129
130 // video setup wizard__video
131 $( document ).on( 'click', '.box-video', function() {
132 $('iframe',this)[0].src += "?autoplay=1";
133 $(this).addClass('open');
134 });
135
136 $(document).on('click','.wpvr-halloween-notice .notice-dismiss',function (){
137 var ajaxurl = wpvr_global_obj.ajaxurl;
138 jQuery.ajax({
139 type: "POST",
140 url: ajaxurl,
141 data: {
142 action: "wpvr_notice",
143 nonce : wpvr_global_obj.ajax_nonce
144 },
145 });
146 })
147
148 $(document).on('click','#wpvr-copy-shortcode-listing',function() {
149 var shortcode = $(this).parent().find('code').text(); // Get the shortcode text
150 copyToClipboard(shortcode,$(this)); // Copy the shortcode to clipboard
151 });
152
153 function copyToClipboard(text,current) {
154
155 var tempInput = $("<input>");
156 $("body").append(tempInput);
157 tempInput.val(text).select();
158 document.execCommand("copy");
159 tempInput.remove();
160 current.find('.copy-shortcode-text').show();
161
162 setTimeout(function(){
163 current.find(".copy-shortcode-text").hide();
164 }, 2000 );
165
166 }
167
168
169
170 })( jQuery );
171