detectmobilebrowser.js
5 years ago
iris-script.js
5 years ago
mystickymenu-admin.js
4 years ago
mystickymenu.js
5 years ago
mystickymenu.min.js
5 years ago
select2.min.js
5 years ago
iris-script.js
107 lines
| 1 | (function (factory) { |
| 2 | "use strict"; |
| 3 | if (typeof define === 'function' && define.amd) { |
| 4 | define(['jquery'], factory); |
| 5 | } |
| 6 | else if(typeof module !== 'undefined' && module.exports) { |
| 7 | module.exports = factory(require('jquery')); |
| 8 | } |
| 9 | else { |
| 10 | factory(jQuery); |
| 11 | } |
| 12 | }(function ($, undefined) { |
| 13 | var priceOptions = {"50_websites":{"1_year":{"price":79,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=3"},"2_year":{"price":125,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=15"},"lifetime":{"price":199,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=9"}},"500_websites":{"1_year":{"price":139,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=16"},"2_year":{"price":225,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=17"},"lifetime":{"price":359,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=18"}},"1000_websites":{"1_year":{"price":199,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=19"},"2_year":{"price":315,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=20"},"lifetime":{"price":499,"link":"https:\/\/go.premio.io\/?edd_action=add_to_cart&download_id=2199&edd_options[price_id]=21"}}}; |
| 14 | $(document).ready(function($){ |
| 15 | $('.my-color-field').wpColorPicker(); |
| 16 | $(document).on('click', '.sticky-header-upgrade-now', function(e){ |
| 17 | //e.preventDefault(); |
| 18 | //$(".sticky-header-menu ul li a:last").trigger("click"); |
| 19 | }); |
| 20 | |
| 21 | $(document).on("click", ".pricing-table-content", function(){ |
| 22 | if(!$(this).hasClass("active")) { |
| 23 | $(".pricing-table-content").removeClass("active"); |
| 24 | $(this).addClass("active"); |
| 25 | var datFor = $(this).data("option"); |
| 26 | $(".multiple-options").each(function(){ |
| 27 | $(this).find("option").prop("selected", false); |
| 28 | $(this).find("option[data-option='"+datFor+"']").prop("selected", true); |
| 29 | $(this).trigger("change"); |
| 30 | }) |
| 31 | } |
| 32 | }); |
| 33 | |
| 34 | if($(".multiple-options").length) { |
| 35 | $(".multiple-options").select2({ |
| 36 | minimumResultsForSearch: -1 |
| 37 | }); |
| 38 | } |
| 39 | if($(".multiple-web-options").length) { |
| 40 | $(".multiple-web-options").select2({ |
| 41 | minimumResultsForSearch: -1 |
| 42 | }); |
| 43 | } |
| 44 | $(document).on("change", ".multiple-options", function(){ |
| 45 | priceText = $(this).find("option:selected").attr("data-header"); |
| 46 | thisValue = $(this).val(); |
| 47 | thisPrice = $(this).find("option:selected").attr("data-price"); |
| 48 | if(!$(this).hasClass("has-multiple-websites")) { |
| 49 | $(this).closest(".price-table").find("a.cart-link").attr("href", thisValue); |
| 50 | $(this).closest(".price-table").find(".plan-price").text("$" + thisPrice); |
| 51 | } else { |
| 52 | var webOption = $(".multiple-web-options").val(); |
| 53 | var priceSettings = priceOptions[webOption]; |
| 54 | var yearPlan = $(".multiple-options.has-multiple-websites option:selected").attr("data-option"); |
| 55 | if(priceSettings[yearPlan] != undefined) { |
| 56 | priceSettings = priceSettings[yearPlan]; |
| 57 | thisValue = priceSettings.link; |
| 58 | thisPrice = priceSettings.price; |
| 59 | } |
| 60 | } |
| 61 | thisOption = $(this).find("option:selected").attr("data-option"); |
| 62 | if(thisOption == "1_year") { |
| 63 | thisPrice = thisPrice+"<span>/year</span>"; |
| 64 | priceText = "Renewals for <b>25% off</b>"; |
| 65 | } else if(thisOption == "2_year") { |
| 66 | thisPrice = thisPrice+"<span>/2 years</span>"; |
| 67 | priceText = "Renewals for <b>25% off</b>"; |
| 68 | } else { |
| 69 | thisPrice = thisPrice+"<span>/lifetime</span>"; |
| 70 | priceText = "For lifetime"; |
| 71 | } |
| 72 | $(this).closest(".price-table").find("a.cart-link").attr("href", thisValue); |
| 73 | $(this).closest(".price-table").find(".plan-price").html("$" + thisPrice); |
| 74 | $(this).closest(".price-table").find(".price-offer").html(priceText); |
| 75 | }); |
| 76 | |
| 77 | $(document).on("change", ".multiple-web-options", function(){ |
| 78 | $(".multiple-options.has-multiple-websites").trigger("change"); |
| 79 | }); |
| 80 | |
| 81 | if($(".multiple-options.has-multiple-websites").length) { |
| 82 | $(".multiple-options.has-multiple-websites").trigger("change"); |
| 83 | } |
| 84 | checkForPricingPos(); |
| 85 | $(window).on("scroll", function(){ |
| 86 | checkForPricingPos(); |
| 87 | }); |
| 88 | |
| 89 | $(window).on("resize", function(){ |
| 90 | checkForPricingPos(); |
| 91 | }); |
| 92 | |
| 93 | function checkForPricingPos() { |
| 94 | $(".bottom-position").each(function(){ |
| 95 | if( $(this).offset().top - $(window).scrollTop() - $(window).height() < -3) { |
| 96 | $(this).closest(".price-table").removeClass("is-fixed"); |
| 97 | $(this).closest(".price-table").find(".price-table-bottom").prop("style", ""); |
| 98 | } else { |
| 99 | $(this).closest(".price-table").addClass("is-fixed"); |
| 100 | $(this).closest(".price-table").find(".price-table-bottom").css("top", ($(window).height() - 125 )+"px"); |
| 101 | $(this).closest(".price-table").find(".price-table-bottom").css("left", $(this).offset().left+"px"); |
| 102 | $(this).closest(".price-table").find(".price-table-bottom").outerWidth($(this).closest(".price-table").width()); |
| 103 | } |
| 104 | }); |
| 105 | } |
| 106 | }); |
| 107 | })); |