1jQuery(document).ready(function ($) { 2 3 var VariableSubscriptionPrepaid = function (el) { 4 this.$container = el; 5 6 this.init = function () { 7 $(".single_variation_wrap").on("show_variation", this.loadVariationPrepaidOptions.bind(this)); 8 9 $(".single_variation_wrap").on("hide_variation", (function () { 10 this.$container.html(''); 11 }).bind(this)); 12 13 $(document).on('reset_data', (function () { 14 this.$container.html(''); 15 }).bind(this)); 16 } 17 18 this.loadVariationPrepaidOptions = function (event, variation) { 19 $.post(document.location.origin + document.location.pathname + '?wc-ajax=' + this.getLoadPrepaidOptionsAction(), { 20 variation_id: variation['variation_id'], 21 nonce: this.getLoadPrepaidOptionsNonce() 22 }, (function (response) { 23 this.$container.html(response); 24 25 setTimeout(function () { 26 jQuery('[name=prepaid_plan]').filter(':selected').trigger('change'); 27 }, 200); 28 }).bind(this)); 29 } 30 31 this.getLoadPrepaidOptionsAction = function () { 32 return this.$container.data('load-prepaid-options-action'); 33 } 34 35 this.getLoadPrepaidOptionsNonce = function () { 36 return this.$container.data('load-prepaid-options-nonce'); 37 } 38 } 39 40 jQuery.each($('[data-variable-subscription-prepaid-plans-container]'), function (i, el) { 41 var variableSubscriptionPrepaid = new VariableSubscriptionPrepaid($(el)); 42 variableSubscriptionPrepaid.init(); 43 }); 44});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.