Advertisement
Guest User

Untitled

a guest
May 6th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ! function(a, b, c, d) {
  2.     function e() {
  3.         a("body").removeClass("av-resolved"), a("body").removeClass("av-unresolved"), a("html").removeClass("av-resolved"), a("html").removeClass("av-unresolved"), a("body").addClass("av-hidden"), a("html").addClass("av-hidden"), a("#av-wrap").css({
  4.             opacity: 0
  5.         }), a(b).off("resize"), setTimeout(function() {
  6.             a("#av-wrap").remove()
  7.         }, 330)
  8.     }
  9.  
  10.     function f() {
  11.         var b = !1;
  12.         if ("birthday" == y.mode) {
  13.             var c = new Date,
  14.                 e = new Date;
  15.             c.setDate(a("#select-day").val()), c.setMonth(a("#select-month").val()), c.setYear(a("#select-year").val()), e.getTime() - c.getTime() > 365 * y.minimum_age * 24 * 60 * 60 * 1e3 && (b = !0)
  16.         }
  17.         if ("age" == y.mode && parseInt(a("#field-age").html(), 10) >= y.minimum_age && (b = !0), "confirmation" == y.mode && a("#form-confirm-checkbox").hasClass("form-confirm-checkbox-checked") && (b = !0), b && a.age_verifier_user_verified != d && (a.age_verifier_user_verified(), s())) {
  18.             if (1 == parseInt(localStorage.age_verifier_preview, 10)) return localStorage.age_verifier_preview = 0, b;
  19.             localStorage.ageVerifierId = a.age_verifier_id, localStorage.ageVerifierDate = (new Date).getTime()
  20.         }
  21.         return b
  22.     }
  23.  
  24.     function g() {
  25.         a("#av-error").addClass("av-error-visible")
  26.     }
  27.  
  28.     function h() {
  29.         b.location.href = y.safe_url
  30.     }
  31.  
  32.     function i() {
  33.         var b = new Date;
  34.         a("#select-year").val(b.getFullYear()), a("#select-month").val(b.getMonth()), a("#select-day").val(b.getDate()), a(".birthday-select").chosen({
  35.             width: "100%",
  36.             disable_search_threshold: 1e6
  37.         })
  38.     }
  39.  
  40.     function j() {
  41.         a(b).on("resize", function() {
  42.             "age" == y.mode && k()
  43.         }), a("#slider-age-wrap").on("mousedown", function(a) {
  44.             A || D || (D = !0, m(), n(a))
  45.         }), a(c).on("mousemove", function(a) {
  46.             A || D && n(a)
  47.         }), a(c).on("mouseup", function(a) {
  48.             A || D && (D = !1, o())
  49.         }), a("#slider-age-wrap").on("touchstart", function(a) {
  50.             A = !0, D || (D = !0, m(), n(a))
  51.         }), a(c).on("touchmove", function(a) {
  52.             A = !0, D && n(a)
  53.         }), a(c).on("touchend", function(a) {
  54.             A = !0, D && (D = !1, o())
  55.         })
  56.     }
  57.  
  58.     function k() {
  59.         H = a("#slider-age-bar"), B = a("#slider-age").offset().left, C = a("#slider-age").width(), I = a("#field-age")
  60.     }
  61.  
  62.     function l() {
  63.         var b = parseInt(a("#field-age").data("initial-age"), 10),
  64.             c = 100 * b / (K - J) + 0;
  65.         H.css({
  66.             width: c + "%"
  67.         }), F = c, I.html(b)
  68.     }
  69.  
  70.     function m() {
  71.         k(), a("#slider-age").addClass("slider-dragging")
  72.     }
  73.  
  74.     function n(a) {
  75.         var b = 0;
  76.         b = a.pageX != d ? a.pageX : a.originalEvent.touches[0].pageX;
  77.         var c = B,
  78.             e = C,
  79.             f = 100 * (b - c) / e;
  80.         f = f > 100 ? 100 : f, f = 0 > f ? 0 : f, G = f, p()
  81.     }
  82.  
  83.     function o() {
  84.         a("#slider-age").removeClass("slider-dragging")
  85.     }
  86.  
  87.     function p() {
  88.         E == d && (E = setInterval(function() {
  89.             Math.abs(F - G) > .1 ? (F = r(F, G, .3), H.css({
  90.                 width: F + "%"
  91.             }), I.html(Math.round(J + F * (K - J) / 100))) : (clearInterval(E), E = d)
  92.         }, 16))
  93.     }
  94.  
  95.     function q() {
  96.         var b = a(".av-content-node"),
  97.             c = b.length,
  98.             d = c - 1,
  99.             e = 100;
  100.         "slide" == y.animation && (e = 160);
  101.         var f = setInterval(function() {
  102.             d >= 0 ? (a(b[d]).removeClass("av-unresolved-content"), d--) : clearInterval(f)
  103.         }, e)
  104.     }
  105.  
  106.     function r(a, b, c) {
  107.         return (1 - c) * a + c * b
  108.     }
  109.  
  110.     function s() {
  111.         try {
  112.             var a = b.localStorage,
  113.                 c = "__storage_test__";
  114.             return a.setItem(c, c), a.removeItem(c), !0
  115.         } catch (d) {
  116.             return console.log("Local storage is NOT supported!"), !1
  117.         }
  118.     }
  119.  
  120.     function t(a) {
  121.         var b = "",
  122.             c = "";
  123.         "birthday" == a.mode && (c = u()), "age" == a.mode && (c = v()), "confirmation" == a.mode && (c = w()), a.text = a.text.replace(/\\n/g, "<br>"), a.text = a.text.replace(/\n/g, "<br>");
  124.         var d = "";
  125.         "pop_in" == a.animation && (d = "av-animation-pop-in"), "slide" == a.animation && (d = "av-animation-slide");
  126.         var e = a.error_message.replace("[age]", a.minimum_age),
  127.             f = "background-color: " + a.background + "; ";
  128.         "image" == a.background_type && (f += "background-image: url(" + a.background_image_url + ")");
  129.         var g = "color: " + a.text_color,
  130.             b = "";
  131.         return b += '<div id="av-wrap" class="' + d + '" style="' + f + "; " + g + '">', b += '    <div id="av-inner">', b += '        <div id="av-content">', b += '            <div id="av-title" class="av-content-node"><img src="http://www.dalabryggeri.se/wp-content/uploads/2016/02/DalaBryggeri_big-logo.png" style="display: block; margin: 0px auto  40px auto; width: 300px; max-width: 90%;">', b += "                " + a.title, b += "            </div>", b += '            <div id="av-text" class="av-content-node">', b += "                " + a.text, b += "            </div>", b += '            <div id="av-form" class="av-content-node">', b += "                " + c, b += "            </div>", b += "            <br />", b += '            <div id="av-submit" class="av-content-node">', b += "                " + a.submit_text, b += "            </div><br>", b += '            <div id="av-error" class="av-content-node">', b += '               <div id="av-error-inner">', b += '                   <div id="av-error-icon">', b += '                       <div class="glyphicon glyphicon-ban-circle"></div>', b += "                   </div>", b += "                   " + e, b += "               </div>", b += "            </div>", b += "        </div>", b += "    </div>", b += "</div>"
  132.     }
  133.  
  134.     function u() {
  135.         var a = "";
  136.         a += '<div id="form-birthday">', a += '    <div id="form-birthday-inner">', a += '        <div class="birthday-select-wrap av-first">', a += '            <select id="select-day" class="birthday-select">';
  137.         for (var b = 1; 31 >= b; b++) a += '                <option value="' + b + '">' + b + "</option>";
  138.         a += "            </select>", a += "        </div>", a += '        <div class="birthday-select-wrap">', a += '            <select id="select-month" class="birthday-select">', a += '                <option value="0">January</option>', a += '                <option value="1">February</option>', a += '                <option value="2">March</option>', a += '                <option value="3">April</option>', a += '                <option value="4">May</option>', a += '                <option value="5">June</option>', a += '                <option value="6">July</option>', a += '                <option value="7">August</option>', a += '                <option value="8">September</option>', a += '                <option value="9">October</option>', a += '                <option value="10">November</option>', a += '                <option value="11">December</option>', a += "            </select>", a += "        </div>", a += '        <div class="birthday-select-wrap av-last">', a += '            <select id="select-year" class="birthday-select">';
  139.         for (var c = (new Date).getFullYear(), b = c; b > c - 110; b--) a += '                <option value="' + b + '">' + b + "</option>";
  140.         return a += "            </select>", a += "        </div>", a += "    </div>", a += "</div>"
  141.     }
  142.  
  143.     function v() {
  144.         var a = "";
  145.         a += '<div id="form-age">', a += '    <div id="field-age" data-initial-age="' + y.minimum_age + '">', a += "        24", a += "    </div>", a += '    <div id="slider-age-wrap">';
  146.         var b = x(y.text_color);
  147.         return a += '        <div id="slider-age" style="background: rgba(' + b.r + "," + b.g + "," + b.b + ',0.35)">', a += '           <div id="slider-age-bar" style="background: ' + y.text_color + '">', a += '               <div id="slider-age-handle" style="background: ' + y.text_color + '"></div>', a += "           </div>", a += "        </div>", a += "    </div>", a += "</div>"
  148.     }
  149.  
  150.     function w() {
  151.         var a = "";
  152.         return a += '<div id="form-confirm">', a += '    <div id="form-confirm-checkbox">', a += "    </div>", a += '    <div id="form-confirm-text">', a += "        Jag är över " + y.minimum_age + " år.", a += "    </div>", a += "</div>"
  153.     }
  154.  
  155.     function x(a) {
  156.         var b = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a);
  157.         return b ? {
  158.             r: parseInt(b[1], 16),
  159.             g: parseInt(b[2], 16),
  160.             b: parseInt(b[3], 16)
  161.         } : null
  162.     }
  163.     var y = d,
  164.         z = d,
  165.         A = !1,
  166.         B = 0,
  167.         C = 0,
  168.         D = !1,
  169.         E = d,
  170.         F = 0,
  171.         G = 0,
  172.         H = d,
  173.         I = d,
  174.         J = 1,
  175.         K = 110;
  176.     a.AgeVerifier = function(c) {
  177.         y = c, z = t(y);
  178.         var d = (new Date).getTime();
  179.         return s() && parseInt(a.age_verifier_id, 10) == parseInt(localStorage.ageVerifierId, 10) && 0 == parseInt(localStorage.age_verifier_preview, 10) && d / 1e3 - parseInt(localStorage.ageVerifierDate, 10) / 1e3 < 86400 * parseInt(y.cookie_expiration, 10) ? void a("body, html").css({
  180.             opacity: 1
  181.         }) : (a("body").addClass("av-unresolved"), a("html").addClass("av-unresolved"), a("body").prepend(z), a(".av-content-node").addClass("av-unresolved-content"), a("body").addClass("av-resolved"), a("html").addClass("av-resolved"), q(), b.onload = function() {
  182.             setTimeout(function() {
  183.                 scrollTo(0, -1)
  184.             }, 0)
  185.         }, "birthday" == y.mode && i(), "age" == y.mode && (j(), k(), l()), a("#av-submit").on("click", function() {
  186.             f() ? e() : 1 == parseInt(y.safe_url_enabled, 10) ? h() : g()
  187.         }), void a("#form-confirm").on("click", function() {
  188.             a("#form-confirm-checkbox").toggleClass("form-confirm-checkbox-checked")
  189.         }))
  190.     }
  191. }(jQuery, window, document);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement