morphext
2 years ago
detectmobilebrowser.js
2 years ago
iris-script.js
2 years ago
jquery.email-autocomplete.js
1 year ago
jquery.star-rating-svg.min.js
3 years ago
mailcheck.js
1 year ago
mystickymenu-admin.js
1 year ago
mystickymenu.js
1 year ago
mystickymenu.min.js
5 years ago
select2.min.js
2 years ago
slick.min.js
2 years ago
welcomebar-front.js
1 year ago
mystickymenu-admin.js
1221 lines
| 1 | (function( $ ) { |
| 2 | "use strict"; |
| 3 | |
| 4 | jQuery(document).ready(function($){ |
| 5 | var handle = $( "#custom-handle" ); |
| 6 | $( "#slider" ).slider({ |
| 7 | create: function() { |
| 8 | handle.text( $( this ).slider( "value" ) ); |
| 9 | handle.text( $('#myfixed_opacity').val() ); |
| 10 | handle.css('left', $('#myfixed_opacity').val() + '%') |
| 11 | }, |
| 12 | slide: function( event, ui ) { |
| 13 | $('#myfixed_opacity').val(ui.value); |
| 14 | handle.text( ui.value ); |
| 15 | } |
| 16 | }); |
| 17 | jQuery( |
| 18 | '<div class="pt_number"><div class="pt_numberbutton pt_numberup">+</div><div class="pt_numberbutton pt_numberdown">-</div></div>' |
| 19 | ).insertAfter("input.mysticky-number1"); |
| 20 | |
| 21 | jQuery(".mystickynumber1").each(function() { |
| 22 | |
| 23 | var spinner = jQuery(this), |
| 24 | input = spinner.find('input[type="number"]'), |
| 25 | btnUp = spinner.find(".pt_numberup"), |
| 26 | btnDown = spinner.find(".pt_numberdown"), |
| 27 | min = input.attr("min"), |
| 28 | max = input.attr("max"), |
| 29 | valOfAmout = input.val(), |
| 30 | newVal = 0; |
| 31 | |
| 32 | btnUp.on("click", function() { |
| 33 | |
| 34 | var oldValue = parseFloat(input.val()); |
| 35 | |
| 36 | if (oldValue >= max) { |
| 37 | var newVal = oldValue; |
| 38 | } else { |
| 39 | var newVal = oldValue + 1; |
| 40 | } |
| 41 | spinner.find("input").val(newVal); |
| 42 | spinner.find("input").trigger("change"); |
| 43 | }); |
| 44 | btnDown.on("click", function() { |
| 45 | var oldValue = parseFloat(input.val()); |
| 46 | if (oldValue <= min) { |
| 47 | var newVal = oldValue; |
| 48 | } else { |
| 49 | var newVal = oldValue - 1; |
| 50 | } |
| 51 | spinner.find("input").val(newVal); |
| 52 | spinner.find("input").trigger("change"); |
| 53 | }); |
| 54 | }); |
| 55 | |
| 56 | |
| 57 | $(".confirm").on( 'click', function() { |
| 58 | return window.confirm("Reset to default settings?"); |
| 59 | }); |
| 60 | |
| 61 | var flag = 0; |
| 62 | $( "#mystickymenu-select option" ).each(function( i ) { |
| 63 | |
| 64 | if ($('select#mystickymenu-select option:selected').val() !== '' ) { |
| 65 | flag = 1; |
| 66 | } |
| 67 | if( $('select#mystickymenu-select option:selected').val() == $(this).val() ){ |
| 68 | $('#mysticky_class_selector').show(); |
| 69 | }else { |
| 70 | $('#mysticky_class_selector').hide(); |
| 71 | } |
| 72 | }); |
| 73 | if ( flag === 0 ) { |
| 74 | $('#mysticky_class_selector').show(); |
| 75 | $("select#mystickymenu-select option[value=custom]").attr('selected', 'selected'); |
| 76 | } |
| 77 | |
| 78 | $("#mystickymenu-select").on( 'change', function() { |
| 79 | if ($(this).val() == 'custom' ) { |
| 80 | $('#mysticky_class_selector').show(); |
| 81 | }else { |
| 82 | $('#mysticky_class_selector').hide(); |
| 83 | } |
| 84 | |
| 85 | }); |
| 86 | /*02-08-2019 welcom bar js*/ |
| 87 | |
| 88 | var bar_action_previous; |
| 89 | $( '.mysticky-welcomebar-action' ).on('focus', function () { |
| 90 | // Store the current value on focus and on change |
| 91 | bar_action_previous = this.value; |
| 92 | }).change(function() { |
| 93 | var mysticky_welcomebar_action = $( this ).val(); |
| 94 | |
| 95 | if ( mysticky_welcomebar_action == 'redirect_to_url' ) { |
| 96 | $( '.mysticky-welcomebar-redirect' ).show(); |
| 97 | $( '.mysticky-welcomebar-redirect-container' ).show(); |
| 98 | } else { |
| 99 | $( '.mysticky-welcomebar-redirect' ).hide(); |
| 100 | $( '.mysticky-welcomebar-redirect-container' ).hide(); |
| 101 | } |
| 102 | if ( mysticky_welcomebar_action == 'poptin_popup' ) { |
| 103 | $( '.mysticky-welcomebar-poptin-popup' ).show(); |
| 104 | } else { |
| 105 | $( '.mysticky-welcomebar-poptin-popup' ).hide(); |
| 106 | } |
| 107 | if ( $('.mysticky-welcomebar-action option:selected').attr('data-href') !== '' && mysticky_welcomebar_action == 'thankyou_screen' ) { |
| 108 | window.open( $( '.mysticky-welcomebar-action option:selected' ).attr('data-href') , '_blank'); |
| 109 | $('.mysticky-welcomebar-action').val( bar_action_previous ).change(); |
| 110 | console.log(bar_action_previous); |
| 111 | } |
| 112 | bar_action_previous = this.value; |
| 113 | |
| 114 | }); |
| 115 | |
| 116 | var page_option_content = ""; |
| 117 | page_option_content = $( '.mysticky-welcomebar-page-options-html' ).html(); |
| 118 | $( '.mysticky-welcomebar-page-options-html' ).remove(); |
| 119 | |
| 120 | $( '#create-rule' ).on( 'click', function(){ |
| 121 | var append_html = page_option_content.replace(/__count__/g, '1', page_option_content); |
| 122 | $( '.mysticky-welcomebar-page-options' ).append( append_html ); |
| 123 | $( '.mysticky-welcomebar-page-options' ).show(); |
| 124 | $( this ).parent().remove(); |
| 125 | }); |
| 126 | $( document ).on( 'click', '#add-date-schedule-option' ,function(){ |
| 127 | $( '#mysticky-welcomebar-date-schedule-options').show(); |
| 128 | }); |
| 129 | |
| 130 | /*Mysticky page target*/ |
| 131 | var mysticky_total_page_option = 0; |
| 132 | var mysticky_page_option_content = ""; |
| 133 | mysticky_total_page_option = $( '.mysticky-page-option' ).length; |
| 134 | mysticky_page_option_content = $( '.mysticky-page-options-html' ).html(); |
| 135 | $( '.mysticky-page-options-html' ).remove(); |
| 136 | |
| 137 | $( '#mysticky_create-rule' ).on( 'click', function(){ |
| 138 | |
| 139 | var append_html = mysticky_page_option_content.replace(/__count__/g, mysticky_total_page_option, mysticky_page_option_content); |
| 140 | mysticky_total_page_option++; |
| 141 | $( '.mysticky-page-options' ).append( append_html ); |
| 142 | $( '.mysticky-page-options .mysticky-page-option' ).removeClass( 'last' ); |
| 143 | $( '.mysticky-page-options .mysticky-page-option:last' ).addClass( 'last' ); |
| 144 | |
| 145 | if( $( '.mysticky-page-option .myStickymenu-upgrade' ).length > 0 ) { |
| 146 | $( this ).remove(); |
| 147 | } |
| 148 | }); |
| 149 | $( document ).on( 'click', '.mysticky-remove-rule', function() { |
| 150 | $( this ).closest( '.mysticky-page-option' ).remove(); |
| 151 | $( '.mysticky-page-options .mysticky-page-option' ).removeClass( 'last' ); |
| 152 | $( '.mysticky-page-options .mysticky-page-option:last' ).addClass( 'last' ); |
| 153 | }); |
| 154 | $( document ).on( 'change', '.mysticky-url-options', function() { |
| 155 | var current_val = jQuery( this ).val(); |
| 156 | var mysticky_welcomebar_siteURL = jQuery( '#mysticky_welcomebar_site_url' ).val(); |
| 157 | var mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL; |
| 158 | if( current_val == 'page_has_url' ) { |
| 159 | mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL; |
| 160 | } else if( current_val == 'page_contains' ) { |
| 161 | mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL + '%s%'; |
| 162 | } else if( current_val == 'page_start_with' ) { |
| 163 | mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL + 's%'; |
| 164 | } else if( current_val == 'page_end_with' ) { |
| 165 | mysticky_welcomebar_newURL = mysticky_welcomebar_siteURL + '%s'; |
| 166 | } |
| 167 | $( this ).closest( '.url-content' ).find( '.mysticky-welcomebar-url' ).text( mysticky_welcomebar_newURL ); |
| 168 | }); |
| 169 | /* welcome bar live preview */ |
| 170 | |
| 171 | /* Apply Wp Color Picker */ |
| 172 | var myOptions = { |
| 173 | clear: function (event) { |
| 174 | var color_id = $(event.target).parents('.wp-picker-input-wrap').find('.wp-color-picker').attr('id'); |
| 175 | var color_code = 'unset'; |
| 176 | if ( color_id === 'mysticky_welcomebar_bgcolor'){ |
| 177 | $('.mysticky-welcomebar-fixed').css('background-color', color_code ); |
| 178 | } |
| 179 | if ( color_id === 'mysticky_welcomebar_bgtxtcolor'){ |
| 180 | $('.mysticky-welcomebar-fixed .mysticky-welcomebar-content p').css('color', color_code ); |
| 181 | } |
| 182 | if ( color_id === 'mysticky_welcomebar_btncolor'){ |
| 183 | $('.mysticky-welcomebar-btn a').css('background-color', color_code ); |
| 184 | } |
| 185 | if ( color_id === 'mysticky_welcomebar_btntxtcolor'){ |
| 186 | $('.mysticky-welcomebar-btn a').css('color', color_code ); |
| 187 | } |
| 188 | if( color_id === 'mysticky_welcomebar_xcolor' ){ |
| 189 | $(".mysticky-welcomebar-close").css('color',color_code); |
| 190 | } |
| 191 | if (color_id === 'mysticky_welcomebar_btnhovertxtcolor') { |
| 192 | if(selectedValue !="none"){ |
| 193 | $('.mysticky-welcomebar-preview-screen').find('style[data-text-color]').remove(); |
| 194 | $('.mysticky-welcomebar-preview-screen').append('<style data-text-color>.mysticky-welcomebar-btn a:hover {color:' + color_code + ' !important} </style>'); |
| 195 | } |
| 196 | } |
| 197 | if ( color_id === 'mysticky_welcomebar_btnhovercolor'){ |
| 198 | var selectElement = document.querySelector('select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_effect]"]'); |
| 199 | var selectedValue = selectElement.value; |
| 200 | if(selectedValue =="fill_effect_button"){ |
| 201 | $('.mysticky-welcomebar-preview-screen').find('style[data-background-color]').remove(); |
| 202 | $('.mysticky-welcomebar-preview-screen').append('<style data-background-color>.mysticky-welcomebar-btn a:after {background:' + color_code + ' !important} </style>'); |
| 203 | } |
| 204 | if(selectedValue =="border_effect_button"){ |
| 205 | $('.mysticky-welcomebar-preview-screen').find('style[data-background-color]').remove(); |
| 206 | $('.mysticky-welcomebar-preview-screen').append('<style data-background-color>.mysticky-welcomebar-fixed .mysticky-welcomebar-btn a:hover {background:' + color_code + ' !important} </style>'); |
| 207 | } |
| 208 | } |
| 209 | if ( color_id === 'mysticky_welcomebar_btnhoverbordercolor'){ |
| 210 | $('.mysticky-welcomebar-preview-screen').find('style[data-border-color]').remove(); |
| 211 | $('.mysticky-welcomebar-preview-screen').append('<style data-border-color>.mysticky-welcomebar-btn:before, .mysticky-welcomebar-btn:after {background-color:' + color_code + ' !important} .mysticky-welcomebar-btn a:before, .mysticky-welcomebar-btn a:after {background-color:' + color_code + ' !important} </style>'); |
| 212 | } |
| 213 | }, |
| 214 | change: function(event, ui){ |
| 215 | var color_id = $(this).attr('id'); |
| 216 | var slug = $(this).data('slug'); |
| 217 | |
| 218 | var color_code = ui.color.toString(); |
| 219 | if ( color_id === 'mysticky_welcomebar_bgcolor'){ |
| 220 | $('.mysticky-welcomebar-fixed').css('background-color', color_code ); |
| 221 | } |
| 222 | if ( color_id === 'mysticky_welcomebar_bgtxtcolor'){ |
| 223 | $('.mysticky-welcomebar-fixed .mysticky-welcomebar-content p').css('color', color_code ); |
| 224 | } |
| 225 | if ( color_id === 'mysticky_welcomebar_btncolor'){ |
| 226 | $('.mysticky-welcomebar-btn a').css('background-color', color_code ); |
| 227 | } |
| 228 | if ( color_id === 'mysticky_welcomebar_btntxtcolor'){ |
| 229 | $('.mysticky-welcomebar-btn a').css('color', color_code ); |
| 230 | } |
| 231 | if( color_id === 'mysticky_welcomebar_xcolor' ){ |
| 232 | $(".mysticky-welcomebar-close").css('color',color_code); |
| 233 | } |
| 234 | if (color_id === 'mysticky_welcomebar_btnhovertxtcolor') { |
| 235 | if(selectedValue !="none"){ |
| 236 | $('.mysticky-welcomebar-preview-screen').find('style[data-text-color]').remove(); |
| 237 | $('.mysticky-welcomebar-preview-screen').append('<style data-text-color>.mysticky-welcomebar-btn a:hover {color:' + color_code + ' !important} </style>'); |
| 238 | } |
| 239 | } |
| 240 | if ( color_id === 'mysticky_welcomebar_btnhovercolor'){ |
| 241 | var selectElement = document.querySelector('select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_effect]"]'); |
| 242 | var selectedValue = selectElement.value; |
| 243 | if(selectedValue =="fill_effect_button"){ |
| 244 | $('.mysticky-welcomebar-preview-screen').find('style[data-background-color]').remove(); |
| 245 | $('.mysticky-welcomebar-preview-screen').append('<style data-background-color>.mysticky-welcomebar-btn a:after {background:' + color_code + ' !important} </style>'); |
| 246 | } |
| 247 | if(selectedValue =="border_effect_button"){ |
| 248 | $('.mysticky-welcomebar-preview-screen').find('style[data-background-color]').remove(); |
| 249 | $('.mysticky-welcomebar-preview-screen').append('<style data-background-color>.mysticky-welcomebar-fixed .mysticky-welcomebar-btn a:hover {background:' + color_code + ' !important} </style>'); |
| 250 | } |
| 251 | } |
| 252 | if ( color_id === 'mysticky_welcomebar_btnhoverbordercolor'){ |
| 253 | $('.mysticky-welcomebar-preview-screen').find('style[data-border-color]').remove(); |
| 254 | $('.mysticky-welcomebar-preview-screen').append('<style data-border-color>.mysticky-welcomebar-btn:before, .mysticky-welcomebar-btn:after {background-color:' + color_code + ' !important} .mysticky-welcomebar-btn a:before, .mysticky-welcomebar-btn a:after {background-color:' + color_code + ' !important} </style>'); |
| 255 | } |
| 256 | } |
| 257 | }; |
| 258 | $('.mysticky-welcomebar-setting-wrap .my-color-field,.sticky-header-content .my-color-field').wpColorPicker(myOptions); |
| 259 | |
| 260 | $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_x_desktop]"]' ).on( 'change', function(){ |
| 261 | if( $( this ).prop( "checked" ) == true ) { |
| 262 | $( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-showx-desktop' ); |
| 263 | } else { |
| 264 | $( '.mysticky-welcomebar-fixed' ).removeClass( 'mysticky-welcomebar-showx-desktop' ); |
| 265 | } |
| 266 | } ); |
| 267 | $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_x_mobile]"]' ).on( 'change', function(){ |
| 268 | if( $( this ).prop( "checked" ) == true ) { |
| 269 | $( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-showx-mobile' ); |
| 270 | } else { |
| 271 | $( '.mysticky-welcomebar-fixed' ).removeClass( 'mysticky-welcomebar-showx-mobile' ); |
| 272 | } |
| 273 | } ); |
| 274 | |
| 275 | $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_btn_desktop]"]' ).on( 'change', function(){ |
| 276 | if( $( this ).prop( "checked" ) == true ) { |
| 277 | $( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-btn-desktop' ); |
| 278 | } else { |
| 279 | $( '.mysticky-welcomebar-fixed' ).removeClass( 'mysticky-welcomebar-btn-desktop' ); |
| 280 | } |
| 281 | |
| 282 | if( $( this ).prop( "checked" ) == false && $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_btn_mobile]"]' ).prop( "checked" ) == false ) { |
| 283 | $( ".mysticky_welcomebar_disable, .mysticky_welcomebar_btn_color button.wp-color-result" ).css({ |
| 284 | 'pointer-events': 'none', |
| 285 | 'opacity': '0.5' |
| 286 | }); |
| 287 | } else { |
| 288 | $( ".mysticky_welcomebar_disable, .mysticky_welcomebar_btn_color button.wp-color-result" ).css({ |
| 289 | 'pointer-events': '', |
| 290 | 'opacity': '' |
| 291 | }); |
| 292 | } |
| 293 | } ); |
| 294 | |
| 295 | $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_btn_mobile]"]' ).on( 'change', function(){ |
| 296 | if( $( this ).prop( "checked" ) == true ) { |
| 297 | $( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-btn-mobile' ); |
| 298 | } else { |
| 299 | $( '.mysticky-welcomebar-fixed' ).removeClass( 'mysticky-welcomebar-btn-mobile' ); |
| 300 | } |
| 301 | |
| 302 | if( $( this ).prop( "checked" ) == false && $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_btn_desktop]"]' ).prop( "checked" ) == false ) { |
| 303 | $( ".mysticky_welcomebar_disable, .mysticky_welcomebar_btn_color button.wp-color-result" ).css({ |
| 304 | 'pointer-events': 'none', |
| 305 | 'opacity': '0.5' |
| 306 | }); |
| 307 | } else { |
| 308 | $( ".mysticky_welcomebar_disable, .mysticky_welcomebar_btn_color button.wp-color-result" ).css({ |
| 309 | 'pointer-events': '', |
| 310 | 'opacity': '' |
| 311 | }); |
| 312 | } |
| 313 | } ); |
| 314 | if( $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_btn_desktop]"]' ).prop( "checked" ) == false && $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_btn_mobile]"]' ).prop( "checked" ) == false ) { |
| 315 | $( ".mysticky_welcomebar_disable, .mysticky_welcomebar_btn_color button.wp-color-result" ).css({ |
| 316 | 'pointer-events': 'none', |
| 317 | 'opacity': '0.5' |
| 318 | }); |
| 319 | } else { |
| 320 | $( ".mysticky_welcomebar_disable, .mysticky_welcomebar_btn_color button.wp-color-result" ).css({ |
| 321 | 'pointer-events': '', |
| 322 | 'opacity': '' |
| 323 | }); |
| 324 | } |
| 325 | |
| 326 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_font]"]' ).on( 'change', function(){ |
| 327 | var myfixed_font_val = $( this ).val(); |
| 328 | if( myfixed_font_val == 'System Stack'){ |
| 329 | myfixed_font_val = '-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'; |
| 330 | } |
| 331 | $( 'head' ).append( '<link href="https://fonts.googleapis.com/css?family='+ myfixed_font_val +':400,600,700" rel="stylesheet" type="text/css" class="sfba-google-font">' ); |
| 332 | $( '.mysticky-welcomebar-fixed' ).css( 'font-family', myfixed_font_val ); |
| 333 | } ); |
| 334 | |
| 335 | $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_fontsize]"]' ).on( 'keyup click', function(){ |
| 336 | var mysticky_welcomebar_fontsize_val = $( this ).val(); |
| 337 | $( '.mysticky-welcomebar-fixed p' ).css( 'font-size', mysticky_welcomebar_fontsize_val + 'px' ); |
| 338 | $( '.mysticky-welcomebar-btn a' ).css( 'font-size', mysticky_welcomebar_fontsize_val + 'px' ); |
| 339 | } ); |
| 340 | |
| 341 | $( '#wp-mysticky_bar_text-wrap .wp-editor-tabs button' ).on( 'click', function(){ |
| 342 | if ( $("#wp-mysticky_bar_text-wrap").hasClass("tmce-active") ){ |
| 343 | |
| 344 | } |
| 345 | } ); |
| 346 | |
| 347 | $( document ).on( 'click', '#qt_mysticky_bar_text_toolbar .ed_button', function(){ |
| 348 | $( 'textarea[name="mysticky_option_welcomebar[mysticky_welcomebar_bar_text]"]' ).trigger( 'change keyup click' ); |
| 349 | } ); |
| 350 | |
| 351 | /* Static Text */ |
| 352 | var mysticky_bar_text_val = $( 'textarea[name="mysticky_option_welcomebar[mysticky_welcomebar_bar_text]"]' ).val().replace(/(?:\r\n|\r|\n)/g, '<br />'); |
| 353 | mysticky_bar_text_val = mysticky_bar_text_val.replace(/(?:onchange|onclick|onmouseover|onmouseout|onkeydown|onload\onerror|alert)/g, ''); |
| 354 | $( '.mysticky-welcomebar-content p.mysticky-welcomebar-static_text' ).html( mysticky_bar_text_val ); |
| 355 | $( 'textarea[name="mysticky_option_welcomebar[mysticky_welcomebar_bar_text]"]' ).on( 'change keyup click', function(){ |
| 356 | |
| 357 | var mysticky_bar_text_val = $( this ).val().replace(/(?:\r\n|\r|\n)/g, '<br />'); |
| 358 | mysticky_bar_text_val = mysticky_bar_text_val.replace(/(?:onchange|onclick|onmouseover|onmouseout|onkeydown|onload\onerror|alert)/g, ''); |
| 359 | $( '.mysticky-welcomebar-content p.mysticky-welcomebar-static_text' ).html( mysticky_bar_text_val ); |
| 360 | $('.mysticky-welcomebar-fixed .mysticky-welcomebar-content p.mysticky-welcomebar-static_text').css('color', $('#mysticky_welcomebar_bgtxtcolor').val() ); |
| 361 | $( '.mysticky-welcomebar-fixed p.mysticky-welcomebar-static_text' ).css( 'font-size', $('#mysticky_welcomebar_fontsize').val() + 'px' ); |
| 362 | |
| 363 | } ); |
| 364 | /* Sliding Text */ |
| 365 | $( document ).on( 'change keyup click', 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_slider_text][]"]' , function(){ |
| 366 | var sliding_text = ''; |
| 367 | $('input[name="mysticky_option_welcomebar[mysticky_welcomebar_slider_text][]"]').each(function(index) { |
| 368 | sliding_text += '"' + $(this).val() + '",'; |
| 369 | }); |
| 370 | var slider_transition = $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_slider_transition]"]' ).val(); |
| 371 | $('.mysticky-welcomebar-animation-transition').html('<span class="mysticky-welcomebar-animation-text" data-morphext-options=\'{"animation": "'+ slider_transition +'", "phrases": [' + sliding_text.slice(0, -1) + '], "speed":"3500"}\'></span>') |
| 372 | jQuery(".mysticky-welcomebar-animation-transition .mysticky-welcomebar-animation-text").morphext(); |
| 373 | }); |
| 374 | |
| 375 | $( document ).on( 'change', 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_slider_transition]"]' , function(){ |
| 376 | var sliding_text = ''; |
| 377 | $('input[name="mysticky_option_welcomebar[mysticky_welcomebar_slider_text][]"]').each(function(index) { |
| 378 | sliding_text += '"' + $(this).val() + '",'; |
| 379 | }); |
| 380 | var slider_transition = $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_slider_transition]"]' ).val(); |
| 381 | $('.mysticky-welcomebar-animation-transition').html('<span class="mysticky-welcomebar-animation-text" data-morphext-options=\'{"animation": "'+ slider_transition +'", "phrases": [' + sliding_text.slice(0, -1) + '], "speed":"3500"}\'></span>') |
| 382 | jQuery(".mysticky-welcomebar-animation-transition .mysticky-welcomebar-animation-text").morphext(); |
| 383 | }); |
| 384 | |
| 385 | $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_btn_text]"]' ).on( 'keyup', function(){ |
| 386 | var mysticky_btn_text_val = $( this ).val(); |
| 387 | $( '.mysticky-welcomebar-btn a' ).text( mysticky_btn_text_val ); |
| 388 | } ); |
| 389 | |
| 390 | /* DATE: 11-12-2019 start */ |
| 391 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_attentionselect]"]' ).on( 'change', function(){ |
| 392 | $(".mysticky-welcomebar-fixed").removeClass (function (index, className) { |
| 393 | return (className.match (/(^|\s)mysticky-welcomebar-attention-\S+/g) || []).join(' '); |
| 394 | }); |
| 395 | $( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-attention-' + $(this).val() ); |
| 396 | |
| 397 | } ); |
| 398 | /* DATE: 11-12-2019 End */ |
| 399 | /* DATE: 15-02-2024 */ |
| 400 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_fill_effect]"]' ).on( 'change', function(){ |
| 401 | $(".mysticky-welcomebar-btn").removeClass (function (index, className) { |
| 402 | return (className.match (/(^|\s)mysticky-welcomebar-hover-effect-\S+/g) || []).join(' '); |
| 403 | }); |
| 404 | $( '.mysticky-welcomebar-btn' ).addClass( 'mysticky-welcomebar-hover-effect-' + $(this).val() ); |
| 405 | |
| 406 | } ); |
| 407 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_border_effect]"]' ).on( 'change', function(){ |
| 408 | $(".mysticky-welcomebar-btn").removeClass (function (index, className) { |
| 409 | return (className.match (/(^|\s)mysticky-welcomebar-hover-effect-\S+/g) || []).join(' '); |
| 410 | }); |
| 411 | $( '.mysticky-welcomebar-btn' ).addClass( 'mysticky-welcomebar-hover-effect-' + $(this).val() ); |
| 412 | |
| 413 | } ); |
| 414 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_effect]"]' ).on( 'change', function(){ |
| 415 | var hovervalue = $(this).val(); |
| 416 | if (hovervalue == "fill_effect_button") { |
| 417 | $(".welcomebar-hover-fill-effect").css("display", "flex"); |
| 418 | $(".welcomebar-hover-border-effect").css("display", "none"); |
| 419 | } |
| 420 | if (hovervalue == "border_effect_button") { |
| 421 | $(".welcomebar-hover-fill-effect").css("display", "none"); |
| 422 | $(".welcomebar-hover-border-effect").css("display", "flex"); |
| 423 | } |
| 424 | if (hovervalue == "none") { |
| 425 | $(".welcomebar-hover-fill-effect").css("display", "none"); |
| 426 | $(".welcomebar-hover-border-effect").css("display", "none"); |
| 427 | } |
| 428 | |
| 429 | }); |
| 430 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_effect]"]' ).on( 'change', function(){ |
| 431 | var hovervalue = $(this).val(); |
| 432 | if (hovervalue == "fill_effect_button") { |
| 433 | $(".mysticky-welcomebar-hover-txt-color").css("display", "flex"); |
| 434 | $(".mysticky-welcomebar-hover-color").css("display", "flex"); |
| 435 | $(".mysticky-welcomebar-hover-border-color").css("display", "none"); |
| 436 | } |
| 437 | if (hovervalue == "border_effect_button") { |
| 438 | $(".mysticky-welcomebar-hover-txt-color").css("display", "flex"); |
| 439 | $(".mysticky-welcomebar-hover-color").css("display", "flex"); |
| 440 | $(".mysticky-welcomebar-hover-border-color").css("display", "flex"); |
| 441 | } |
| 442 | if (hovervalue == "none") { |
| 443 | $(".mysticky-welcomebar-hover-txt-color").css("display", "none"); |
| 444 | $(".mysticky-welcomebar-hover-color").css("display", "none"); |
| 445 | $(".mysticky-welcomebar-hover-border-color").css("display", "none"); |
| 446 | } |
| 447 | |
| 448 | }); |
| 449 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_effect]"]' ).on( 'change', function(){ |
| 450 | var hovereffectvalue = $(this).val(); |
| 451 | var filleffect = $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_fill_effect]"]' ).val(); |
| 452 | var bordereffect = $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_border_effect]"]' ).val(); |
| 453 | if(hovereffectvalue == "fill_effect_button"){ |
| 454 | $(".mysticky-welcomebar-btn").removeClass (function (index, className) { |
| 455 | return (className.match (/(^|\s)mysticky-welcomebar-hover-effect-\S+/g) || []).join(' '); |
| 456 | }); |
| 457 | $( '.mysticky-welcomebar-btn' ).addClass( 'mysticky-welcomebar-hover-effect-' + filleffect ); |
| 458 | } |
| 459 | if(hovereffectvalue == "border_effect_button"){ |
| 460 | $(".mysticky-welcomebar-btn").removeClass (function (index, className) { |
| 461 | return (className.match (/(^|\s)mysticky-welcomebar-hover-effect-\S+/g) || []).join(' '); |
| 462 | }); |
| 463 | $( '.mysticky-welcomebar-btn' ).addClass( 'mysticky-welcomebar-hover-effect-' + bordereffect ); |
| 464 | } |
| 465 | }); |
| 466 | $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_effect]"]' ).on( 'change', function(){ |
| 467 | var hovereffectvalue = $(this).val(); |
| 468 | var filleffect = $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_fill_effect]"]' ).val(); |
| 469 | var bordereffect = $( 'select[name="mysticky_option_welcomebar[mysticky_welcomebar_hover_border_effect]"]' ).val(); |
| 470 | if(hovereffectvalue == "fill_effect_button"){ |
| 471 | $(".mysticky-welcomebar-btn").removeClass (function (index, className) { |
| 472 | return (className.match (/(^|\s)mysticky-welcomebar-hover-effect-\S+/g) || []).join(' '); |
| 473 | }); |
| 474 | $( '.mysticky-welcomebar-btn' ).addClass( 'mysticky-welcomebar-hover-effect-' + filleffect ); |
| 475 | |
| 476 | var btnhovertxtcolor = $( '#mysticky_welcomebar_btnhovertxtcolor' ).val(); |
| 477 | var btnhovercolor = $( '#mysticky_welcomebar_btnhovercolor' ).val(); |
| 478 | $('.mysticky-welcomebar-preview-screen').find('style[data-hover-color]').remove(); |
| 479 | $('.mysticky-welcomebar-preview-screen').append('<style data-hover-color>.mysticky-welcomebar-fixed .mysticky-welcomebar-btn a:hover {color:' + btnhovertxtcolor + ';}.mysticky-welcomebar-btn a:after{background:' + btnhovercolor + '!important;z-index: -1 !important}.mysticky-welcomebar-btn a:before,.mysticky-welcomebar-btn a:after{background:' + btnhovercolor + '!important;z-index: -1 !important;}</style>'); |
| 480 | $('#button-hover-color').remove(); |
| 481 | } |
| 482 | if(hovereffectvalue == "border_effect_button"){ |
| 483 | $(".mysticky-welcomebar-btn").removeClass (function (index, className) { |
| 484 | return (className.match (/(^|\s)mysticky-welcomebar-hover-effect-\S+/g) || []).join(' '); |
| 485 | }); |
| 486 | $( '.mysticky-welcomebar-btn' ).addClass( 'mysticky-welcomebar-hover-effect-' + bordereffect ); |
| 487 | |
| 488 | var btnhovertxtcolor = $( '#mysticky_welcomebar_btnhovertxtcolor' ).val(); |
| 489 | var btnhovercolor = $( '#mysticky_welcomebar_btnhovercolor' ).val(); |
| 490 | var btnhoverbordercolor = $( '#mysticky_welcomebar_btnhoverbordercolor' ).val(); |
| 491 | $('.mysticky-welcomebar-preview-screen').find('style[data-hover-color]').remove(); |
| 492 | $('.mysticky-welcomebar-preview-screen').find('style[data-hover-color]').remove(); |
| 493 | $('.mysticky-welcomebar-preview-screen').append('<style data-hover-color>.mysticky-welcomebar-fixed .mysticky-welcomebar-btn a:hover {color:' + btnhovertxtcolor + ';background:' + btnhovercolor + '!important;}.mysticky-welcomebar-btn:before,.mysticky-welcomebar-btn:after {background:' + btnhoverbordercolor + '!important;z-index: 1 !important}.mysticky-welcomebar-btn a:before,.mysticky-welcomebar-btn a:after {background:' + btnhoverbordercolor + '!important;z-index: 1 !important;}</style>'); |
| 494 | $('#button-hover-color').remove(); |
| 495 | } |
| 496 | if(hovereffectvalue == "none"){ |
| 497 | $('.mysticky-welcomebar-preview-screen').find('style[data-hover-color]').remove(); |
| 498 | $('.mysticky-welcomebar-preview-screen').find('style[data-background-color]').remove(); |
| 499 | $('.mysticky-welcomebar-preview-screen').find('style[data-border-color]').remove(); |
| 500 | $('#button-hover-color').remove(); |
| 501 | } |
| 502 | }); |
| 503 | /* DATE: 15-02-2024 End */ |
| 504 | $("#myStickymenu-entry-effect").on( 'change', function() { |
| 505 | $(".mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed").removeClass('entry-effect'); |
| 506 | $(".mysticky-welcomebar-fixed").removeClass (function (index, className) { |
| 507 | return (className.match (/(^|\s)mysticky-welcomebar-entry-effect-\S+/g) || []).join(' '); |
| 508 | }); |
| 509 | $( '.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-entry-effect-' + $(this).val() ); |
| 510 | setTimeout( function(){ |
| 511 | $(".mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed").addClass('entry-effect'); |
| 512 | }, 1000 ); |
| 513 | |
| 514 | }); |
| 515 | $( '.mysticky-welcomebar-fixed' ).addClass( 'entry-effect' ); |
| 516 | |
| 517 | jQuery(".mysticky-welcomebar-animation-transition .mysticky-welcomebar-animation-text").morphext(); |
| 518 | |
| 519 | }); |
| 520 | $( window ).on('load', function(){ |
| 521 | $( '.mysticky-welcomebar-url-options' ).each( function(){ |
| 522 | $( this ).trigger( 'change' ); |
| 523 | }); |
| 524 | }); |
| 525 | |
| 526 | jQuery(document).on("click",".mystickymenu-delete-widget",function(e){ |
| 527 | e.preventDefault(); |
| 528 | |
| 529 | var widget_id = jQuery(this).data("widget-id"); |
| 530 | jQuery("#widget-delete-dialog-"+widget_id).show(); |
| 531 | jQuery("#mystickymenu-delete-popup-overlay-"+widget_id).show(); |
| 532 | }); |
| 533 | |
| 534 | /* Mystickymenu: Dashbaord table delete button click action */ |
| 535 | |
| 536 | jQuery(document).on("click",".btn-delete",function(e){ |
| 537 | e.preventDefault(); |
| 538 | var delWidId = jQuery(this).data("id"); |
| 539 | jQuery.ajax({ |
| 540 | url: ajaxurl, |
| 541 | type:'post', |
| 542 | data: 'action=stickymenu_widget_delete&widget_id=' + delWidId + '&widget_delete=1&wpnonce=' + mystickymenu.ajax_nonce, |
| 543 | success: function( data ){ |
| 544 | $( '#stickymenu-widget-' + delWidId ).remove(); |
| 545 | setTimeout('location.reload()', 500); |
| 546 | }, |
| 547 | }); |
| 548 | }); |
| 549 | |
| 550 | |
| 551 | jQuery(document).on("click",".btn-delete-cancel",function(e){ |
| 552 | e.preventDefault(); |
| 553 | var id = jQuery(this).data("id"); |
| 554 | jQuery("#widget-delete-dialog-"+id).hide(); |
| 555 | jQuery("#mystickymenu-delete-popup-overlay-"+id).hide(); |
| 556 | }); |
| 557 | |
| 558 | /* Mystickymenu: Dashbaord table welcombar widget status change action */ |
| 559 | |
| 560 | jQuery(document).on("click",".mystickymenu-widget-enabled",function(){ |
| 561 | var widget_id = $(this).data('id'); |
| 562 | if(jQuery(this).prop("checked") != true){ |
| 563 | jQuery('#widget-status-dialog-' + widget_id).show(); |
| 564 | jQuery('#mystickymenu-status-popup-overlay-' + widget_id).show(); |
| 565 | }else{ |
| 566 | var widget_status = 1; |
| 567 | set_widget_status( widget_id, widget_status ); |
| 568 | } |
| 569 | }); |
| 570 | |
| 571 | jQuery(document).on("click",".btn-turnoff-status",function(e){ |
| 572 | e.preventDefault(); |
| 573 | var widget_id = $(this).data('id'); |
| 574 | |
| 575 | if ( typeof widget_id !== "undefined") { |
| 576 | var widget_status = 0; |
| 577 | set_widget_status( widget_id, widget_status ); |
| 578 | } |
| 579 | |
| 580 | }); |
| 581 | |
| 582 | |
| 583 | jQuery(document).on("click",".btn-nevermind-status",function(e){ |
| 584 | e.preventDefault(); |
| 585 | var widget_id = $(this).data('id'); |
| 586 | if ( typeof widget_id !== "undefined") { |
| 587 | var widget_status = 1; |
| 588 | set_widget_status( widget_id, widget_status ); |
| 589 | jQuery("#mystickymenu-widget-enabled-"+widget_id).prop('checked', true) |
| 590 | } |
| 591 | |
| 592 | }); |
| 593 | |
| 594 | jQuery(document).on("click",".mystickymenupopup-overlay",function(e){ |
| 595 | e.preventDefault(); |
| 596 | |
| 597 | if(jQuery(this).data("fromoverlay") == 'welcombar_delete'){ |
| 598 | jQuery(this).hide(); |
| 599 | var delId = jQuery(this).data('id'); |
| 600 | jQuery('#widget-delete-dialog-'+delId).hide(); |
| 601 | } |
| 602 | }); |
| 603 | |
| 604 | jQuery(document).on("click",".mystickymenupopup-widget-status-overlay",function(e){ |
| 605 | e.preventDefault(); |
| 606 | var widget_id = $(this).data('id'); |
| 607 | var widget_status = 1; |
| 608 | set_widget_status( widget_id, widget_status ); |
| 609 | jQuery("#mystickymenu-widget-enabled-"+widget_id).prop('checked', true); |
| 610 | |
| 611 | }); |
| 612 | |
| 613 | function set_widget_status( widget_id, widget_status ) { |
| 614 | jQuery.ajax({ |
| 615 | url: ajaxurl, |
| 616 | type:'post', |
| 617 | data: 'action=mystickymenu_widget_status&widget_id='+widget_id+'&widget_status=' + widget_status +'&wpnonce=' + mystickymenu.ajax_nonce, |
| 618 | success: function( data ){ |
| 619 | $('#widget-status-dialog-' + widget_id).hide(); |
| 620 | $('#mystickymenu-status-popup-overlay-' + widget_id).hide(); |
| 621 | }, |
| 622 | }); |
| 623 | } |
| 624 | |
| 625 | jQuery(document).on("click","#close-first-popup, .btn-close-dashboard",function(e){ |
| 626 | e.preventDefault(); |
| 627 | jQuery('.first-widget-popup').hide(); |
| 628 | jQuery('.mystickymenupopup-overlay').hide(); |
| 629 | }); |
| 630 | |
| 631 | jQuery(document).on("click","#first_widget_overlay",function(){ |
| 632 | jQuery('.first-widget-popup').hide(); |
| 633 | jQuery(this).hide(); |
| 634 | }); |
| 635 | |
| 636 | |
| 637 | |
| 638 | jQuery(document).on("click","#btn-config-disable",function(e){ |
| 639 | e.preventDefault(); |
| 640 | jQuery("#stickymenu_status_popupbox").show(); |
| 641 | jQuery("#stickymenuconfig-overlay-popup").show(); |
| 642 | }); |
| 643 | |
| 644 | jQuery(document).on("click","#stickymenuconfig-overlay-popup",function(){ |
| 645 | jQuery("#stickymenu_status_popupbox").hide(); |
| 646 | jQuery(this).hide(); |
| 647 | }); |
| 648 | |
| 649 | jQuery(document).on("click","#stickymenu_status_turnoff",function(e){ |
| 650 | e.preventDefault(); |
| 651 | var stickymenu_status = 0; |
| 652 | set_stickymenu_status( stickymenu_status ); |
| 653 | }); |
| 654 | |
| 655 | jQuery(document).on("click","#stickymenu_status_nevermind",function(e){ |
| 656 | e.preventDefault(); |
| 657 | jQuery("#stickymenu_status_popupbox").hide(); |
| 658 | jQuery("#stickymenuconfig-overlay-popup").hide(); |
| 659 | }); |
| 660 | |
| 661 | function set_stickymenu_status( stickymenu_status ){ |
| 662 | jQuery.ajax({ |
| 663 | url: ajaxurl, |
| 664 | type:'post', |
| 665 | data: 'action=stickymenu_status_update&stickymenu_status=' + stickymenu_status +'&wpnonce=' + mystickymenu.ajax_nonce, |
| 666 | success: function( data ){ |
| 667 | location.reload(); |
| 668 | }, |
| 669 | }); |
| 670 | } |
| 671 | |
| 672 | jQuery(document).on("click",".close-button",function(){ |
| 673 | if(jQuery(this).data("from") == 'welcome-bar-status'){ |
| 674 | var id = jQuery(this).data("id"); |
| 675 | jQuery("#widget-status-dialog-"+id).hide(); |
| 676 | jQuery("#mystickymenu-status-popup-overlay-"+id).hide(); |
| 677 | var widget_status = 1; |
| 678 | set_widget_status( id, widget_status ); |
| 679 | jQuery("#mystickymenu-widget-enabled-"+id).prop('checked', true) |
| 680 | |
| 681 | }else if( jQuery(this).data("from") == "stickymenu-status"){ |
| 682 | jQuery("#stickymenu_status_popupbox").hide(); |
| 683 | jQuery("#stickymenuconfig-overlay-popup").hide(); |
| 684 | |
| 685 | }else if( jQuery(this).data("from") == "stickymenu-confirm" ){ |
| 686 | jQuery("#mysticky-sticky-save-confirm").hide(); |
| 687 | jQuery("#stickymenu-option-overlay-popup").hide(); |
| 688 | }else if( jQuery(this).data("from") == "welcombar-confirm" ){ |
| 689 | jQuery("#welcomebar-save-confirm").hide(); |
| 690 | jQuery("#welcombar-sbmtvalidation-overlay-popup").hide(); |
| 691 | }else{ |
| 692 | var id = jQuery(this).data("id"); |
| 693 | jQuery("#widget-delete-dialog-"+id).hide(); |
| 694 | jQuery("#mystickymenu-delete-popup-overlay-"+id).hide(); |
| 695 | } |
| 696 | }); |
| 697 | |
| 698 | |
| 699 | jQuery(document).on("click","#stickymenu-option-overlay-popup",function(){ |
| 700 | $("#mysticky-sticky-save-confirm").hide(); |
| 701 | $(this).hide(); |
| 702 | }); |
| 703 | |
| 704 | |
| 705 | jQuery(document).on("click","#welcombar-sbmtvalidation-overlay-popup",function(){ |
| 706 | $("#welcomebar-save-confirm").hide(); |
| 707 | $(this).hide(); |
| 708 | }); |
| 709 | |
| 710 | |
| 711 | jQuery(document).on("change","#mysticky-welcomebar-countdown-enabled",function(){ |
| 712 | var url = jQuery(this).data("url"); |
| 713 | jQuery(this).prop('checked',false); |
| 714 | window.open(url, '_blank'); |
| 715 | }); |
| 716 | |
| 717 | jQuery(document).on("click",".btn-save-stickymenu" , function(event){ |
| 718 | if ( $( '#mysticky-stickymenu-form-enabled' ).prop( 'checked' ) == false && $('#save_stickymenu').val() == "" ) { |
| 719 | event.preventDefault(); |
| 720 | $("#mysticky-sticky-save-confirm").show(); |
| 721 | $("#stickymenu-option-overlay-popup").show(); |
| 722 | |
| 723 | $('#stickymenu_status_ok').attr('data-clickfrom', 'save'); |
| 724 | $('#stickymenu_status_dolater').attr('data-clickfrom', 'save'); |
| 725 | } |
| 726 | }); |
| 727 | |
| 728 | jQuery(document).on("click",".save_view_dashboard" , function(event){ |
| 729 | if ( $( '#mysticky-stickymenu-form-enabled' ).prop( 'checked' ) == false && $('#save_stickymenu').val() == "" ) { |
| 730 | event.preventDefault(); |
| 731 | $("#mysticky-sticky-save-confirm").show(); |
| 732 | $("#stickymenu-option-overlay-popup").show(); |
| 733 | |
| 734 | $('#stickymenu_status_ok').attr('data-clickfrom', 'dashboard'); |
| 735 | $('#stickymenu_status_dolater').attr('data-clickfrom', 'dashboard'); |
| 736 | } |
| 737 | }); |
| 738 | |
| 739 | jQuery(document).on("click","#stickymenu_status_ok",function(){ |
| 740 | var clickFrom = $(this).data("clickfrom"); |
| 741 | $('#save_stickymenu').val("1"); |
| 742 | $( '#mysticky-stickymenu-form-enabled' ).prop( 'checked' , true ) |
| 743 | $("#mysticky-sticky-save-confirm").hide(); |
| 744 | $("#stickymenu-option-overlay-popup").hide(); |
| 745 | if(clickFrom == 'dashboard'){ |
| 746 | $('.save_view_dashboard').trigger("click"); |
| 747 | }else{ |
| 748 | $('.btn-save-stickymenu').trigger("click"); |
| 749 | } |
| 750 | }); |
| 751 | |
| 752 | jQuery(document).on("click","#stickymenu_status_dolater",function(){ |
| 753 | var clickFrom = $(this).data("clickfrom"); |
| 754 | $('#save_stickymenu').val("1"); |
| 755 | if(clickFrom == 'dashboard'){ |
| 756 | $('.save_view_dashboard').trigger("click"); |
| 757 | }else{ |
| 758 | $('.btn-save-stickymenu').trigger("click"); |
| 759 | } |
| 760 | }); |
| 761 | |
| 762 | jQuery(document).on( 'click','.welcombar_save', function(e){ |
| 763 | |
| 764 | if ( $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_enable]"]' ).prop( 'checked' ) == false && $( 'input#save_welcome_bar' ).val() == '' ) { |
| 765 | e.preventDefault(); |
| 766 | $("#welcomebar-save-confirm").show(); |
| 767 | $("#welcombar-sbmtvalidation-overlay-popup").show(); |
| 768 | $("#welcombar_sbmtbtn_off").attr("data-clickfrom",'save_button'); |
| 769 | $("#welcomebar_yes_sbmtbtn").attr("data-clickfrom",'save_button'); |
| 770 | } |
| 771 | }); |
| 772 | |
| 773 | |
| 774 | jQuery(document).on( 'click','.save_view_dashboard', function(e){ |
| 775 | |
| 776 | if ( $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_enable]"]' ).prop( 'checked' ) == false && $( 'input#save_welcome_bar' ).val() == '' ) { |
| 777 | e.preventDefault(); |
| 778 | $("#welcomebar-save-confirm").show(); |
| 779 | $("#welcombar-sbmtvalidation-overlay-popup").show(); |
| 780 | $("#welcombar_sbmtbtn_off").attr("data-clickfrom",'save_dashboard_button'); |
| 781 | $("#welcomebar_yes_sbmtbtn").attr("data-clickfrom",'save_dashboard_button'); |
| 782 | } |
| 783 | }); |
| 784 | $( document ).on( 'change', '#mysticky-welcomebar-contact-form-enabled', function(){ |
| 785 | $("span.mystickybar-visible, span.mystickybar-hidden").hide(); |
| 786 | if( $(this).prop('checked') == true ) { |
| 787 | $("span.mystickybar-visible").show(); |
| 788 | } else { |
| 789 | $("span.mystickybar-hidden").show(); |
| 790 | } |
| 791 | }) |
| 792 | |
| 793 | jQuery(document).on("click","#welcomebar_yes_sbmtbtn",function(){ |
| 794 | |
| 795 | var clickFrom = $(this).data("clickfrom"); |
| 796 | |
| 797 | $("#welcomebar-save-confirm").hide(); |
| 798 | $("#welcombar-sbmtvalidation-overlay-popup").hide(); |
| 799 | $( 'input#welcome_save_anyway' ).val('1'); |
| 800 | $( 'input#save_welcome_bar' ).val('1'); |
| 801 | $( 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_enable]"]' ).prop( 'checked',true ); |
| 802 | if(clickFrom == 'save_dashboard_button'){ |
| 803 | $( '.mystickybar-tabs-buttons button.save_view_dashboard' ).trigger('click'); |
| 804 | }else{ |
| 805 | $( '.mystickybar-tabs-buttons button.welcombar_save' ).trigger('click'); |
| 806 | } |
| 807 | }); |
| 808 | |
| 809 | jQuery(document).on("click","#welcombar_sbmtbtn_off",function(){ |
| 810 | var clickFrom = $(this).data("clickfrom"); |
| 811 | |
| 812 | $("#welcomebar-save-confirm").hide(); |
| 813 | $("#welcombar-sbmtvalidation-overlay-popup").hide(); |
| 814 | $( 'input#welcome_save_anyway' ).val('1'); |
| 815 | $( 'input#save_welcome_bar' ).val('1'); |
| 816 | |
| 817 | if(clickFrom == 'save_dashboard_button'){ |
| 818 | $( '.mystickybar-tabs-buttons button.save_view_dashboard' ).trigger('click'); |
| 819 | }else{ |
| 820 | $( '.mystickybar-tabs-buttons button.welcombar_save' ).trigger('click'); |
| 821 | } |
| 822 | }); |
| 823 | |
| 824 | jQuery(document).on("click","#mysticky-welcomebar-showcoupon-enabled",function(){ |
| 825 | var url = jQuery(this).data("url"); |
| 826 | jQuery(this).prop('checked',false); |
| 827 | window.open(url, '_blank'); |
| 828 | }); |
| 829 | |
| 830 | if( $("#mysticky-welcomebar-collectlead-enabled").prop("checked") == true ){ |
| 831 | $( '.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-collectlead-active' ); |
| 832 | } |
| 833 | jQuery(document).on("change","#mysticky-welcomebar-collectlead-enabled",function(){ |
| 834 | |
| 835 | var button_text = $(this).data("button-text"); |
| 836 | |
| 837 | if( $(this).prop("checked") == true ){ |
| 838 | |
| 839 | $(".timer-message").show(); |
| 840 | $(".mysticky-welcomebar-collect-lead").show(); |
| 841 | $(".welcomebar_height_content").hide(); |
| 842 | $( '.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-collectlead-active' ); |
| 843 | $(".mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed .mysticky-welcomebar-content").css("width","90%"); |
| 844 | $(".mysticky-welcomebar-lead-content").show(); |
| 845 | $(".mysticky-welcomebar-btn a").text("Send me"); |
| 846 | $("#mysticky_welcomebar_btn_text").val("Send me"); |
| 847 | $(".mysticky-welcomebar-btn").addClass("collect-lead"); |
| 848 | $(".height-setting").hide(); |
| 849 | }else{ |
| 850 | |
| 851 | button_text = ( button_text == 'Send me' ) ? 'Got it!' : button_text; |
| 852 | $(".timer-message").hide(); |
| 853 | $(".welcomebar_height_content").show(); |
| 854 | $(".mysticky-welcomebar-collect-lead").hide(); |
| 855 | $( '.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed' ).removeClass( 'mysticky-welcomebar-collectlead-active' ); |
| 856 | $(".mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed .mysticky-welcomebar-content").css("width","75%"); |
| 857 | $(".mysticky-welcomebar-lead-content").hide(); |
| 858 | $(".mysticky-welcomebar-btn a").text(button_text); |
| 859 | $("#mysticky_welcomebar_btn_text").val(button_text); |
| 860 | $(".height-setting").show(); |
| 861 | $(".mysticky-welcomebar-btn").removeClass("collect-lead"); |
| 862 | } |
| 863 | }); |
| 864 | |
| 865 | jQuery(document).on("click","#send_lead_email_enable",function(){ |
| 866 | var url = jQuery(this).data("url"); |
| 867 | jQuery(this).prop('checked',false); |
| 868 | window.open(url, '_blank'); |
| 869 | }); |
| 870 | |
| 871 | |
| 872 | jQuery(document).on("keyup","#lead-name-placeholder,#lead-email-placeholder,#lead-phone-placeholder",function(e){ |
| 873 | if( $(this).attr("id") == "lead-name-placeholder" ){ |
| 874 | $(".preview-lead-name").attr("placeholder",$(this).val()); |
| 875 | }else if( $(this).attr("id") == "lead-email-placeholder" ){ |
| 876 | $(".preview-lead-email").attr("placeholder",$(this).val()); |
| 877 | }else{ |
| 878 | $(".preview-lead-phone").attr("placeholder",$(this).val()); |
| 879 | } |
| 880 | }); |
| 881 | /* Welcomebar Text*/ |
| 882 | jQuery(document).on("change","input[name='mysticky_option_welcomebar[mysticky_welcomebar_text_type]']",function(){ |
| 883 | if( $(this).val() == 'static_text' ){ |
| 884 | $("#mysticky_welcomebar_static_text_setting").show(); |
| 885 | $("#mysticky_welcomebar_sliding_text_setting").hide(); |
| 886 | $("#mysticky_welcomebar_sliding_text_transition_style,#mysticky_welcomebar_sliding_text_transition_speed").hide(); |
| 887 | }else{ |
| 888 | $("#mysticky_welcomebar_static_text_setting").hide(); |
| 889 | $("#mysticky_welcomebar_sliding_text_setting").show(); |
| 890 | $("#mysticky_welcomebar_sliding_text_transition_style,#mysticky_welcomebar_sliding_text_transition_speed").show(); |
| 891 | } |
| 892 | |
| 893 | }); |
| 894 | |
| 895 | jQuery(document).on("change","input[name='mysticky_option_welcomebar[mysticky_welcomebar_lead_input]']",function(){ |
| 896 | if( $(this).val() == 'email_address' ){ |
| 897 | $("#lead-email-content").show(); |
| 898 | $("#lead-phone-content").hide(); |
| 899 | $(".preview-lead-email").show(); |
| 900 | $(".preview-lead-phone").hide(); |
| 901 | }else{ |
| 902 | $("#lead-email-content").hide(); |
| 903 | $("#lead-phone-content").show(); |
| 904 | $(".preview-lead-email").hide(); |
| 905 | $(".preview-lead-phone").show(); |
| 906 | } |
| 907 | |
| 908 | }); |
| 909 | |
| 910 | /* Mystickymenu : Single delete contact lead data - Contact lead page */ |
| 911 | |
| 912 | jQuery(document).on("click",".mystickymenu-delete-entry",function(event){ |
| 913 | |
| 914 | var deleterowid = $( this ).attr( "data-delete" ); |
| 915 | var confirm_delete = window.confirm("Are you sure you want to delete Record with ID# "+deleterowid); |
| 916 | if (confirm_delete == true) { |
| 917 | jQuery.ajax({ |
| 918 | type: 'POST', |
| 919 | url: ajaxurl, |
| 920 | data: {"action": "mystickymenu_delete_contact_lead","ID": deleterowid, delete_nonce: jQuery("#delete_nonce").val(),"wpnonce": mystickymenu.ajax_nonce}, |
| 921 | success: function(data){ |
| 922 | location.href = window.location.href; |
| 923 | }, |
| 924 | error: function(XMLHttpRequest, textStatus, errorThrown) { |
| 925 | alert("Status: " + textStatus); alert("Error: " + errorThrown); |
| 926 | } |
| 927 | }); |
| 928 | } |
| 929 | |
| 930 | }); |
| 931 | |
| 932 | /* Mystickymenu : Bulk delete all contact lead data - Contact lead page */ |
| 933 | |
| 934 | jQuery(document).on("click","#mystickymenu_delete_all_leads", function(){ |
| 935 | var confirm_delete = window.confirm("Are you sure you want to delete all Record from the database?"); |
| 936 | if (confirm_delete == true) { |
| 937 | jQuery.ajax({ |
| 938 | type: 'POST', |
| 939 | url: ajaxurl, |
| 940 | data: {"action": "mystickymenu_delete_contact_lead", 'all_leads': 1 , delete_nonce: jQuery("#delete_nonce").val(),"wpnonce": mystickymenu.ajax_nonce}, |
| 941 | success: function(data){ |
| 942 | location.href = window.location.href; |
| 943 | }, |
| 944 | error: function(XMLHttpRequest, textStatus, errorThrown) { |
| 945 | alert("Status: " + textStatus); alert("Error: " + errorThrown); |
| 946 | } |
| 947 | }); |
| 948 | } |
| 949 | return false; |
| 950 | }); |
| 951 | |
| 952 | /* Mystickymenu : Bulk do action trigger in contact lead table */ |
| 953 | |
| 954 | jQuery(document).on('click','#doaction',function(e){ |
| 955 | e.preventDefault(); |
| 956 | var bulks = []; |
| 957 | jQuery( '.cb-select-blk' ).each( function(){ |
| 958 | if (this.checked) { |
| 959 | bulks.push( jQuery(this).val() ); |
| 960 | } |
| 961 | } ); |
| 962 | |
| 963 | jQuery.ajax({ |
| 964 | type: 'POST', |
| 965 | url: ajaxurl, |
| 966 | data: {"action": "my_sticky_menu_bulks","bulks": bulks,"wpnonce": mystickymenu.ajax_nonce}, |
| 967 | success: function(data){ |
| 968 | location.href = window.location.href; |
| 969 | }, |
| 970 | error: function(XMLHttpRequest, textStatus, errorThrown) { |
| 971 | alert("Status: " + textStatus); alert("Error: " + errorThrown); |
| 972 | } |
| 973 | }); |
| 974 | } ); |
| 975 | |
| 976 | jQuery(document).on( 'change','#mysticky-welcomebar-close-automatically-enabled', function(){ |
| 977 | $(this).prop("checked",false); |
| 978 | var url = $(this).data("url"); |
| 979 | window.open(url, '_blank'); |
| 980 | }); |
| 981 | |
| 982 | jQuery(document).on("click",".save_change",function(){ |
| 983 | $( '.mystickybar-tabs-buttons button.welcombar_save' ).trigger('click'); |
| 984 | }); |
| 985 | |
| 986 | jQuery(document).on( 'change','#mysticky_welcomebar_show_success_message', function(){ |
| 987 | if( $( this ).prop( "checked" ) == true ) { |
| 988 | $('#mysticky-welcomebar-thankyou-wrap').show(); |
| 989 | } else { |
| 990 | $('#mysticky-welcomebar-thankyou-wrap').hide(); |
| 991 | } |
| 992 | }); |
| 993 | |
| 994 | //rating popup |
| 995 | $(document).on("keyup", "#upgrade-review-comment", function(){ |
| 996 | var commentLength = 1000 - parseInt($.trim($(this).val()).length); |
| 997 | if(commentLength < 0) { |
| 998 | var userComment = $.trim($(this).val()); |
| 999 | userComment = userComment.slice(0, 1000); |
| 1000 | $(".upgrade-review-textarea label span").text(0); |
| 1001 | $(this).val(userComment); |
| 1002 | } else { |
| 1003 | $(".upgrade-review-textarea label span").text(commentLength); |
| 1004 | } |
| 1005 | }); |
| 1006 | |
| 1007 | $(document).on("change", "#upgrade-review-comment", function(){ |
| 1008 | var commentLength = 1000 - parseInt($.trim($(this).val()).length); |
| 1009 | if(commentLength < 0) { |
| 1010 | var userComment = $.trim($(this).val()); |
| 1011 | userComment = userComment.slice(0, 1000); |
| 1012 | $(".upgrade-review-textarea label span").text(0); |
| 1013 | $(this).val(userComment); |
| 1014 | } else { |
| 1015 | $(".upgrade-review-textarea label span").text(commentLength); |
| 1016 | } |
| 1017 | }); |
| 1018 | |
| 1019 | $(document).on("click", ".welcomebar-full-screen-btn", function(){ |
| 1020 | $( this ).hide(); |
| 1021 | $( '.welcomebar-minimise-screen-btn' ).show(); |
| 1022 | $( '.mysticky-welcomebar-preview' ).addClass( 'mysticky-welcomebar-full-screen-preview' ); |
| 1023 | $( '.mysticky-welcomebar-preview-wrap' ).addClass( 'mysticky-welcomebar-full-screen-preview-body' ); |
| 1024 | }); |
| 1025 | |
| 1026 | $(document).on("click", ".welcomebar-minimise-screen-btn", function(){ |
| 1027 | $( this ).hide(); |
| 1028 | $( '.welcomebar-full-screen-btn' ).show(); |
| 1029 | $( '.mysticky-welcomebar-preview' ).removeClass( 'mysticky-welcomebar-full-screen-preview' ); |
| 1030 | $( '.mysticky-welcomebar-preview-wrap' ).removeClass( 'mysticky-welcomebar-full-screen-preview-body' ); |
| 1031 | }); |
| 1032 | |
| 1033 | $(document).on("click", ".mysticky-welcomebar-full-screen-preview-body", function(event){ |
| 1034 | if( $(event.target).hasClass( 'mysticky-welcomebar-full-screen-preview-body') == true || $(event.target).hasClass( 'mysticky-welcomebar-header-title') == true){ |
| 1035 | $( '.welcomebar-minimise-screen-btn' ).trigger( 'click' ); |
| 1036 | } |
| 1037 | }); |
| 1038 | |
| 1039 | $(document).ready( |
| 1040 | function () { |
| 1041 | if( $("#mystickymenu-rating").length != 0 ) { |
| 1042 | $("#rating-modal-popup").show(); |
| 1043 | $("#mystickymenu-rating").starRating({ |
| 1044 | initialRating : 0, |
| 1045 | useFullStars : true, |
| 1046 | strokeColor : '#FDB10C', |
| 1047 | ratedColor : '#FDB10C', |
| 1048 | activeColor : '#FDB10C', |
| 1049 | strokeWidth : 0, |
| 1050 | minRating : 1, |
| 1051 | starSize : 32, |
| 1052 | useGradient : 0, |
| 1053 | onHover: function(currentRate) { |
| 1054 | $(".upgrade-user-rating span").text(currentRate+"/5"); |
| 1055 | $(".upgrade-user-rating" ).css('visibility', 'visible'); |
| 1056 | }, |
| 1057 | onLeave: function(currentRate) { |
| 1058 | $(".upgrade-user-rating" ).css('visibility', 'hidden'); |
| 1059 | }, |
| 1060 | callback( currentRate ) { |
| 1061 | console.log(currentRate); |
| 1062 | if( currentRate !== 5 ) { |
| 1063 | $(".rating-modal-steps").removeClass("active"); |
| 1064 | $(".rating-modal-steps#step-2").addClass("active"); |
| 1065 | $("#mystickymenu-rated-rating").html(""); |
| 1066 | for(let i=0 ; i< parseInt(currentRate); i++) { |
| 1067 | var ratingStar = '<div class="jq-star"><svg shape-rendering="geometricPrecision" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="305px" height="305px" viewBox="60 -62 309 309" style="enable-background:new 64 -59 305 305; stroke-width:0px;" xml:space="preserve"> <polygon data-side="center" className="svg-empty-28" points="281.1,129.8 364,55.7 255.5,46.8 214,-59 172.5,46.8 64,55.4 146.8,129.7 121.1,241 212.9,181.1 213.9,181 306.5,241 " style="fill: transparent; stroke: #ffa83e;"></polygon> <polygon data-side="left" className="svg-empty-28" points="281.1,129.8 364,55.7 255.5,46.8 214,-59 172.5,46.8 64,55.4 146.8,129.7 121.1,241 213.9,181.1 213.9,181 306.5,241 " style="stroke-opacity: 0;"></polygon> <polygon data-side="right" className="svg-empty-28" points="364,55.7 255.5,46.8 214,-59 213.9,181 306.5,241 281.1,129.8 " style="stroke-opacity: 0;"></polygon> </svg></div>'; |
| 1068 | $("#mystickymenu-rated-rating").append(ratingStar); |
| 1069 | } |
| 1070 | } else { |
| 1071 | window.open("https://wordpress.org/support/plugin/mystickymenu/reviews/#new-post", '_blank'); |
| 1072 | set_mystickymenu_review_reminder(-1); |
| 1073 | } |
| 1074 | } |
| 1075 | }) |
| 1076 | } |
| 1077 | |
| 1078 | $(document).on("click", ".close-popup-button a.hide-upgrade-modal", function(){ |
| 1079 | if($(".rating-modal-steps#step-3").hasClass("active")) { |
| 1080 | set_mystickymenu_review_reminder(14); |
| 1081 | } else { |
| 1082 | $(".rating-modal-steps").removeClass("active"); |
| 1083 | $(".rating-modal-steps#step-3").addClass("active"); |
| 1084 | } |
| 1085 | }); |
| 1086 | |
| 1087 | $(document).on("click", "#upgrade-review-button", function(){ |
| 1088 | $("#rating-modal-popup").hide(); |
| 1089 | var review_reminder = ($('.upgrade-review-reminder').length >= 1) ? $('.upgrade-review-reminder').val(): "-1"; |
| 1090 | jQuery.ajax({ |
| 1091 | type:'post', |
| 1092 | url: mystickymenu.ajaxurl, |
| 1093 | data: { |
| 1094 | action: "mystickymenu_review_box_message", |
| 1095 | rating: $("#mystickymenu-rated-rating .jq-star").length, |
| 1096 | nonce: mystickymenu.ajax_nonce, |
| 1097 | message: $.trim($("#upgrade-review-comment").val()) |
| 1098 | }, |
| 1099 | success: function() { |
| 1100 | set_mystickymenu_review_reminder(review_reminder); |
| 1101 | } |
| 1102 | }); |
| 1103 | }); |
| 1104 | |
| 1105 | |
| 1106 | function set_mystickymenu_review_reminder(noOfDays) { |
| 1107 | $.ajax({ |
| 1108 | type: "post", |
| 1109 | url: mystickymenu.ajaxurl, |
| 1110 | data: { |
| 1111 | action: "mystickymenu_review_box", |
| 1112 | days: noOfDays, |
| 1113 | nonce: mystickymenu.ajax_nonce |
| 1114 | }, |
| 1115 | |
| 1116 | success: function() { |
| 1117 | |
| 1118 | } |
| 1119 | }); |
| 1120 | $("#rating-modal-popup").remove(); |
| 1121 | } |
| 1122 | |
| 1123 | $(document).on("click", ".mystickymenu-popup-form", function( e ){ |
| 1124 | if ( $(e.target).attr('id') == 'rating-modal-popup' ) { |
| 1125 | let step_id = $( '#rating-modal-popup .rating-modal-steps.active' ).attr( 'id') ; |
| 1126 | |
| 1127 | if ( step_id == 'step-1' ) { |
| 1128 | $(".rating-modal-steps").removeClass("active"); |
| 1129 | $(".rating-modal-steps#step-3").addClass("active"); |
| 1130 | } |
| 1131 | |
| 1132 | if ( step_id == 'step-3' ) { |
| 1133 | $('#upgrade-review-reminder option[value="14"]').attr("selected", "selected"); |
| 1134 | $( "#upgrade-review-button" ).trigger( 'click'); |
| 1135 | } |
| 1136 | } |
| 1137 | |
| 1138 | }); |
| 1139 | $(".welcomebar-full-screen-btn").click(function(){ |
| 1140 | var windowHeight = $(window).height()* 0.73; |
| 1141 | $('.mysticky-welcomebar-preview-screen').css('height', windowHeight + 'px'); |
| 1142 | }); |
| 1143 | $(".welcomebar-minimise-screen-btn").click(function(){ |
| 1144 | $('.mysticky-welcomebar-preview-screen').removeAttr("style"); |
| 1145 | }); |
| 1146 | |
| 1147 | /* |
| 1148 | * Bar Tab |
| 1149 | */ |
| 1150 | $( document ).on( 'click', '.mystickybar-tabs .mystickybar-tab', function(){ |
| 1151 | let tab = $(this).data( 'tab' ); |
| 1152 | let tabid = $(this).data( 'tab-id' ); |
| 1153 | |
| 1154 | $( '.mystickybar-tabs .mystickybar-tab').removeClass( 'mystickybar-tab-active' ); |
| 1155 | $( this).addClass( 'mystickybar-tab-active mystickybar-tab-completed'); |
| 1156 | $( '.mystickybar-tab-content').removeClass('mystickybar-active active'); |
| 1157 | $( '#' + tabid).addClass('mystickybar-active active'); |
| 1158 | $( '#mystickybar-widget-body-tab .mystickybar-preview-section').show(); |
| 1159 | if( tab == 'first') { |
| 1160 | $( '.mystickybar-back-button').addClass( 'disabled' ); |
| 1161 | $( '.mystickybar-next-button').removeClass( 'disabled' ); |
| 1162 | |
| 1163 | $('#mystickybar-display-rules').removeClass( 'mystickybar-tab-completed' ); |
| 1164 | $('#mystickybar-poptin-popups').removeClass( 'mystickybar-tab-completed' ); |
| 1165 | } else if( tab == 'middle' ) { |
| 1166 | $( '.mystickybar-back-button').removeClass( 'disabled' ); |
| 1167 | $( '.mystickybar-next-button').removeClass( 'disabled' ); |
| 1168 | $('#mystickybar-poptin-popups').removeClass( 'mystickybar-tab-completed' ); |
| 1169 | } else { |
| 1170 | $( '.mystickybar-back-button').removeClass( 'disabled' ); |
| 1171 | $( '.mystickybar-next-button').addClass( 'disabled' ); |
| 1172 | $('#mystickybar-display-rules').addClass( 'mystickybar-tab-completed' ); |
| 1173 | $( '#mystickybar-widget-body-tab .mystickybar-preview-section').hide(); |
| 1174 | } |
| 1175 | }); |
| 1176 | |
| 1177 | /* |
| 1178 | * Next Button |
| 1179 | */ |
| 1180 | $( document ).on( 'click', '.mystickybar-tabs-buttons .mystickybar-next-button', function(){ |
| 1181 | let tab_index = $('.mystickybar-tab.mystickybar-tab-active').data( 'tab-index' ) + 1; |
| 1182 | let tab_id = $('.mystickybar-tab[data-tab-index="'+ tab_index+'"]').attr( 'id' ); |
| 1183 | $( '#' +tab_id ).trigger( 'click' ); |
| 1184 | }); |
| 1185 | |
| 1186 | /* |
| 1187 | * Back Button |
| 1188 | */ |
| 1189 | $( document ).on( 'click', '.mystickybar-tabs-buttons .mystickybar-back-button', function(){ |
| 1190 | let tab_index = $('.mystickybar-tab.mystickybar-tab-active').data( 'tab-index' ) - 1; |
| 1191 | let tab_id = $('.mystickybar-tab[data-tab-index="'+ tab_index+'"]').attr( 'id' ); |
| 1192 | $( '#' +tab_id ).trigger( 'click' ); |
| 1193 | }); |
| 1194 | |
| 1195 | $( document ).on( 'click', '.mysticky-welcomebar-preview-wrap.mysticky-welcomebar-full-screen-preview-body .mysticky-welcomebar-close', function(){ |
| 1196 | $( '.welcomebar-minimise-screen-btn' ).trigger( 'click' ); |
| 1197 | }); |
| 1198 | |
| 1199 | $( document).on("change", "#mysticky-welcomebar-postion-relative-text", function(){ |
| 1200 | let button_text_postion = $('input[name="mysticky_option_welcomebar[mysticky_welcomebar_button_text_postion]"]:checked').val(); |
| 1201 | if( $(this).prop("checked") == true ){ |
| 1202 | $("#mysticky-welcomebar-button-text-postion").show(); |
| 1203 | $('.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed-wrap').addClass( 'mysticky-welcomebar-position-' + button_text_postion ); |
| 1204 | }else{ |
| 1205 | $("#mysticky-welcomebar-button-text-postion").hide(); |
| 1206 | $('.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed-wrap').removeClass( 'mysticky-welcomebar-position-' + button_text_postion ); |
| 1207 | } |
| 1208 | }); |
| 1209 | |
| 1210 | $( document).on("change", 'input[name="mysticky_option_welcomebar[mysticky_welcomebar_button_text_postion]"]', function(){ |
| 1211 | let button_text_postion = $( this ).val(); |
| 1212 | |
| 1213 | $('.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed-wrap').removeClass( 'mysticky-welcomebar-position-center mysticky-welcomebar-position-left mysticky-welcomebar-position-right ' ); |
| 1214 | |
| 1215 | $('.mysticky-welcomebar-preview-screen .mysticky-welcomebar-fixed-wrap').addClass( 'mysticky-welcomebar-position-' + button_text_postion ); |
| 1216 | }); |
| 1217 | |
| 1218 | }); |
| 1219 | |
| 1220 | })(jQuery); |
| 1221 |