// Generated by CoffeeScript 1.9.3 (function() { "use strict"; var slice = [].slice; (function($) { if (window.FS2 == null) { window.FS2 = {}; } window.FS2.ns = function(namespace, defs) { var i, len, node, nodes, ref, space; space = window.FS2; ref = namespace.split("."), nodes = 1 <= ref.length ? slice.call(ref, 0) : []; for (i = 0, len = nodes.length; i < len; i++) { node = nodes[i]; space = space[node] != null ? space[node] : space[node] = {}; } $.extend(space, defs); return space; }; FS2.ns("utils", { getURLParameter: function(name, source) { var matches; if (typeof source === "undefined") { source = location.href; } matches = new RegExp("[?|&|#]" + name + "=([^&;]+?)(&|#|;|$)").exec(source); if (matches === null || matches.length < 2) { return null; } return decodeURIComponent(matches[1].replace(/\+/g, "%20")) || null; }, isSSL: function() { return "https:" === location.protocol; }, getShopKey: function(source) { var matches; if (typeof source === "undefined") { source = location.href; } matches = source.match(/\/fs\/([a-zA-Z0-9]+)\//); if (matches === null || matches.length < 1) { return null; } return matches[1]; }, getCenterWindowOption: function(width, height) { var arr, x, y; arr = []; x = (screen.width - width) / 2; y = (screen.height - height) / 2; arr.push(["width", width].join("=")); arr.push(["height", height].join("=")); arr.push(["screenX", x].join("=")); arr.push(["screenY", y].join("=")); arr.push(["left", x].join("=")); arr.push(["top", y].join("=")); return arr.join(","); }, uuid: function() { var random, time; random = Math.floor(Math.random() * 1000); time = new Date().getTime().toString(); return "" + random + time; }, rotate: function($el, degrees) { return $el.css({ "-webkit-transform": "rotate(" + degrees + "deg)", "-moz-transform": "rotate(" + degrees + "deg)", "-ms-transform": "rotate(" + degrees + "deg)", "-o-transform": "rotate(" + degrees + "deg)", "transform": "rotate(" + degrees + "deg)", "zoom": 1 }); }, comma: function(num) { var str; str = String(num); if (!/^[0-9]+$/.test(str)) { return str; } return str.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); }, _shield: function(e) { if (e.keyCode === 9 || e.keyCode === 13) { e.preventDefault(); e.returnValue = false; return false; } return true; }, disableOperation: function() { $(window).on("keydown", FS2.utils._shield); }, enableOperation: function() { $(window).off("keydown", FS2.utils._shield); }, addEnterEventListener: function($el, func) { var that; that = this; $el.on("keydown", function(e) { if (e.keyCode === 13) { e.preventDefault(); e.returnValue = false; func.call(that); return false; } }); } }); })(jQuery); }).call(this);