Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- v
- var URL_ROOT = "https://phazza.com/";
- var URL_CLIENT_RES = "https://phazza.com/client/res/";
- var URL_VERSION = "https://phazza.com/";
- var URL_VERSION_RES = "https://phazza.com/client/ver-user/res/";
- var browser, d = document,
- de = document.documentElement,
- UNDEF = "undefined",
- NOT_EXISTS = -2147483647,
- EXISTS = -2147483646,
- WRONG_FILE_EXTENTION = -2147483640,
- EMAIL_REG_EXP = "[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})",
- page, page_cpanel, mobile, E = 1E-5,
- Strings = {
- EMPTY: "",
- TRUE: "t",
- FALSE: "f",
- OK: "0",
- ERROR: "1",
- NOT_EXISTS: "-2147483647"
- },
- Browsers = {
- FIREFOX: "Firefox",
- OPERA: "Opera",
- CHROME: "Chrome",
- SAFARI: "Safari",
- IE: "IE",
- EDGE: "EDGE"
- },
- Results = {
- OK: 0,
- ERROR: 1
- },
- Colors = {
- WHITE: "#fff",
- LIGHT_RED: "#ffd7d7",
- RED: "#f00",
- BLACK: "#000",
- GRAY128: "#808080",
- GRAY230: "#e6e6e6",
- GRAY242: "#f2f2f2",
- TRANSPARENT: "rgba(0, 0, 0, 0)"
- },
- ScreenMetrics = {
- width: NOT_EXISTS,
- height: NOT_EXISTS,
- mobile_limit: 768,
- scale: 1
- },
- months = "January February March April May June July August September Octomber November December".split(" ");
- function getElementById(a) {
- a = d.getElementById(a);
- a.removeAttribute("id");
- return a
- }
- function getElementByIdSafe(a) {
- a = d.getElementById(a);
- null !== a && a.removeAttribute("id");
- return a
- }
- function getScreenX(a) {
- return a.getBoundingClientRect().left
- }
- function getScreenY(a) {
- return a.getBoundingClientRect().top
- }
- function getX(a) {
- for (var b = 0; a;) b += a.offsetLeft, a = a.offsetParent;
- return b
- }
- function getY(a) {
- for (var b = 0; a;) b += a.offsetTop, a = a.offsetParent;
- return b
- }
- function getScrollTop() {
- return (window.pageYOffset || de.scrollTop) - (de.clientTop || 0)
- }
- function setScrollTop(a) {
- de.scrollTop = d.body.scrollTop = a
- }
- function getScrollLeft() {
- return (window.pageXOffset || de.scrollLeft) - (de.clientLeft || 0)
- }
- function checkBrowser() {
- browser_version = "";
- var a = navigator.userAgent;
- if (0 <= a.indexOf("Edge")) browser = Browsers.EDGE;
- else if (0 <= a.indexOf("Firefox")) browser = Browsers.FIREFOX;
- else if (0 <= a.indexOf("OPR")) browser = Browsers.OPERA;
- else if (0 <= a.indexOf("hrome")) browser = Browsers.CHROME;
- else if (0 <= a.indexOf("afari")) browser = Browsers.SAFARI;
- else {
- var b = "";
- 0 <= a.indexOf("MSIE") ? b = a.indexOf("MSIE") + 4 : 0 <= a.indexOf(".NET") && (b = a.indexOf("rv:") + 3);
- if (b !== Strings.EMPTY) {
- for (browser = Browsers.IE;
- " " === a.charAt(b);) ++b;
- do browser_version += a.charAt(b++); while ("0" <= a.charAt(b) && "9" >= a.charAt(b))
- }
- }
- }
- function makeHTML5ElemetsForIE() {
- document.createElement("article");
- document.createElement("footer");
- document.createElement("header");
- document.createElement("main");
- document.createElement("menu");
- document.createElement("menuitem");
- document.createElement("nav");
- document.createElement("section");
- document.createElement("canvas")
- }
- function isCurrentPage(a) {
- var b = "/" !== d.URL[d.URL.length - 1] ? d.URL + "/" : d.URL;
- "/" !== a[a.length - 1] && (a += "/");
- return -1 !== b.indexOf(a)
- }
- function getChildByClassName(a, b) {
- for (var c, e = a.childNodes, f = e.length - 1; 0 <= f; --f)
- if (c = e[f].className, null !== c && "undefined" !== typeof c) {
- c = c.split(" ");
- for (var g = c.length - 1; 0 <= g; --g)
- if (c[g] === b) return e[f]
- } return null
- }
- function getChildrenHeight(a) {
- a = a.childNodes;
- for (var b = 0, c = a.length - 1; 0 <= c; --c) typeof a[c].offsetHeight !== UNDEF && (b += a[c].offsetHeight);
- return b
- }
- function dim(a, b) {
- var c = d.getElementById("dim");
- null === c && (c = d.createElement("div"), c.id = "dim", c.setAttribute("v", "0"), d.body.appendChild(c));
- c.style.opacity = 1;
- c.setAttribute("v", parseInt(c.getAttribute("v")) + 1);
- typeof b !== UNDEF && (c.style.zIndex = b - 1);
- requestAnimationFrame(function() {
- c.style.backgroundColor = "rgba(0, 0, 0, 0.6)"
- }, 0);
- typeof a !== UNDEF && null !== a && (c.onclick = function() {
- PopupWindow.hide(a)
- })
- }
- function undim() {
- var a = d.getElementById("dim");
- if (null !== a) {
- var b = parseInt(a.getAttribute("v")) - 1;
- 0 > b && (b = 0);
- a.setAttribute("v", b);
- a.style.zIndex = 2048;
- "0" === a.getAttribute("v") && (a.addEventListener("transitionend", function() {
- "0" === a.getAttribute("v") && null !== a.parentNode && d.body.removeChild(a)
- }), a.style.opacity = 0)
- }
- }
- function disableActions() {
- var a, b = d.getElementById("disable_actions");
- null === b && (b = d.createElement("div"), b.onclick = function(a) {
- a.stopPropagation()
- }, b.id = "disable_actions", d.body.appendChild(b), a = d.createElement("span"), a.id = "disable_label", a.className = "Purple", a.innerHTML = "Working...", d.body.appendChild(a), requestAnimationFrame(function() {
- b.style.backgroundColor = "rgba(0, 0, 0, 0.1)";
- a.style.transform = "translateY(0)"
- }))
- }
- function enableActions() {
- var a = d.getElementById("disable_label"),
- b = d.getElementById("disable_actions");
- null !== b && (requestAnimationFrame(function() {
- b.style.opacity = 0;
- a.style.transform = "translateY(-32px)"
- }), setTimeout(function() {
- null !== b.parentNode && d.body.removeChild(b);
- null !== a.parentNode && d.body.removeChild(a)
- }, 250))
- }
- function addClassArray(a, b) {
- for (var c = a.length; 0 < c--;) addClass(a[c], b)
- }
- function addClass(a, b) {
- if (!1 === hasClass(a, b)) {
- var c = a.getAttribute("class");
- null === c && (c = Strings.EMPTY);
- a.setAttribute("class", c + " " + b)
- }
- }
- function removeClassArray(a, b) {
- for (var c = a.length; 0 < c--;) removeClass(a[c], b)
- }
- function removeClass(a, b) {
- var c = a.getAttribute("class");
- if (null !== c) {
- for (var e = 0, c = c.split(" "), f = b.split(" "), g = c.length; 0 < g--;)
- for (var h = f.length; 0 < h--;)
- if (c[g] === f[h]) {
- ++e;
- c[g] = Strings.EMPTY;
- break
- } if (0 !== e) {
- f = Array(c.length - e);
- for (g = e = 0; g < c.length; ++g) c[g] !== Strings.EMPTY && (f[e++] = c[g]);
- a.setAttribute("class", f.join(" "))
- }
- }
- }
- function hasClass(a, b) {
- var c = a.getAttribute("class");
- if (null === c) return !1;
- for (var c = c.split(" "), e = c.length; 0 < e--;)
- if (c[e] === b) return !0;
- return !1
- }
- function checkForCorrectField(a, b, c) {
- var e = a.value;
- !0 !== c && (e = e.trim());
- a.blur();
- a.oninput = function() {
- a.style.backgroundColor = typeof b === UNDEF ? Colors.GRAY242 : b
- };
- if (e === Strings.EMPTY) return a.style.backgroundColor = Colors.LIGHT_RED, null;
- a.style.backgroundColor = typeof b === UNDEF ? Colors.GRAY242 : b;
- return e
- }
- function checkForCorrectEmail(a, b) {
- var c, e;
- a.blur();
- a.oninput = function() {
- a.style.backgroundColor = typeof b === UNDEF ? Colors.GRAY242 : b
- };
- c = a.value.trim();
- e = c.match(EMAIL_REG_EXP);
- if (c === Strings.EMPTY || null === e) return a.style.backgroundColor = Colors.LIGHT_RED, null;
- a.style.backgroundColor = typeof b === UNDEF ? Colors.GRAY242 : b;
- return c
- }
- function checkForCorrectPass(a, b, c) {
- var e, f;
- e = checkForCorrectField(a, c, !0);
- f = checkForCorrectField(b, c, !0);
- if (e !== f || null === e) return a.style.backgroundColor = b.style.backgroundColor = Colors.LIGHT_RED, null;
- a.style.backgroundColor = b.style.backgroundColor = typeof c === UNDEF ? Colors.GRAY128 : c;
- return e
- }
- function filterPhone(a) {
- if (isSystemKey(a)) return !0;
- a = String.fromCharCode(a.which);
- return "+" === a ? this.value === Strings.EMPTY : "0" <= a && "9" >= a || " " === a
- }
- function filterNumber(a) {
- if (isSystemKey(a)) return !0;
- a = String.fromCharCode(a.which);
- return "+" === a || "-" === a ? this.value === Strings.EMPTY : "0" <= a && "9" >= a
- }
- function filterFloat(a) {
- if (isSystemKey(a)) return !0;
- a = String.fromCharCode(a.which);
- return "+" === a || "-" === a ? this.value === Strings.EMPTY : "0" <= a && "9" >= a ? !0 : "." === a ? -1 === this.value.indexOf(".") : !1
- }
- function filterNumberUnsigned(a) {
- var b = String.fromCharCode(a.which);
- return isSystemKey(a) ? !0 : "0" <= b && "9" >= b
- }
- function isSystemKey(a) {
- return 8 === a.keyCode || 46 === a.keyCode || 35 <= a.keyCode && 40 >= a.keyCode ? !0 : 0 === a.which
- }
- function getCookieValue(a) {
- for (var b, c = document.cookie.split(";"), e = c.length - 1; 0 <= e; --e)
- if (b = c[e].split("="), b[0].trim() === a) return b[1];
- return Strings.EMPTY
- }
- function deleteCookie(a) {
- var b = new Date;
- b.setFullYear(b.getFullYear() - 10);
- d.cookie = a + "=1; expires=" + b.toGMTString() + "; path=/"
- }
- function setSelectValue(a, b) {
- for (var c = a.options.length - 1; 0 <= c; --c)
- if (a.options[c].value == b) {
- a.selectedIndex = c;
- break
- }
- }
- function stopPropagation(a) {
- a.stopPropagation()
- }
- function l() {
- console.log.apply(this, arguments)
- }
- String.prototype.replaceAllChar = function(a, b) {
- for (var c = -1, e = "", f = this.length, g = 0; g < f; ++g) this[g] === a && (e += this.substring(c + 1, g) + b, c = g);
- return e += this.substring(c + 1)
- };
- String.prototype.replaceAll = function(a, b, c) {
- var e;
- c = typeof c === UNDEF ? 0 : c;
- var f, g = a.length;
- for (e = this.substring(0, c);;) {
- f = this.indexOf(a, c);
- if (-1 === f) {
- e += this.substring(c);
- break
- }
- e += this.substring(c, f) + b;
- c = f + g
- }
- return e
- };
- String.prototype.replaceAt = function(a, b) {
- return this.substring(0, a) + b + this.substring(a + b.length)
- };
- Date.prototype.formatCalendarDate = function() {
- return this.getDate().formatSpace(2) + "." + (this.getMonth() + 1).formatSpace(2) + "." + this.getFullYear()
- };
- Date.prototype.formatCalendarTime = function() {
- return this.getHours().formatSpace(2) + ":" + this.getMinutes().formatSpace(2)
- };
- Date.prototype.equalsCalendarDate = function(a) {
- a = "number" === typeof a ? new Date(a) : a;
- return this.getDate() === a.getDate() && this.getMonth() === a.getMonth() && this.getFullYear() === a.getFullYear()
- };
- Date.prototype.clearTime = function() {
- this.setHours(0);
- this.setMinutes(0);
- this.setSeconds(0);
- this.setMilliseconds(0)
- };
- Date.prototype.clear = function() {
- this.clearTime();
- this.setYear(1970);
- this.setMonth(0);
- this.setDate(1)
- };
- Array.prototype.removeElement = function(a) {
- for (var b = this.length; 0 < b--;)
- if (this[b] === a) {
- this.splice(b, 1);
- break
- }
- };
- function Ajax(b) {
- var a = this;
- a.GET = "GET";
- a.POST = "POST";
- a.ajax = new XMLHttpRequest;
- a.ajax.onreadystatechange = function() {
- a.listener()
- };
- a.ajax.onprogress = function() {
- a.onprogresslistener()
- };
- a.background = typeof b === UNDEF ? !1 : b;
- a.method = Strings.EMPTY;
- a.url = Strings.EMPTY;
- a.async = null;
- a.headers = [];
- a.request_query_builder = new a.RequestQueryBuilder;
- a.onreadystatechange = null;
- a.onprogress = null;
- a.onerror = null;
- a.onwipe = null;
- a.responseText = null;
- a.readyState = NOT_EXISTS;
- a.status = NOT_EXISTS;
- a.wiped = !1
- }
- Ajax.prototype.open = function(b, a, c) {
- this.method = b;
- this.url = a;
- this.async = typeof c === UNDEF ? !0 : c;
- this.method === this.POST && this.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
- };
- Ajax.prototype.setRequestHeader = function(b, a) {
- this.headers.push(new this.Header(b, a))
- };
- Ajax.prototype.addParam = function(b, a) {
- this.request_query_builder.add(b, a)
- };
- Ajax.prototype.getResponseHeader = function(b) {
- return this.ajax.getResponseHeader(b)
- };
- Ajax.prototype.send = function() {
- var b;
- !1 === this.background && disableActions();
- this.ajax.open(this.method, this.url + (this.method === this.GET ? "?" + this.request_query_builder.build() : Strings.EMPTY), this.async);
- for (var a = this.headers.length - 1; 0 <= a; --a) b = this.headers[a], this.ajax.setRequestHeader(b.name, b.value);
- this.ajax.send(this.method === this.POST ? this.request_query_builder.build() : Strings.EMPTY)
- };
- Ajax.prototype.listener = function() {
- if (!0 === this.wiped) {
- if (null !== this.onwipe) this.onwipe()
- } else if (this.readyState = this.ajax.readyState, this.status = this.ajax.status, 4 === this.ajax.readyState)
- if (!1 === this.background && enableActions(), 200 !== this.ajax.status) {
- if (null !== this.onerror) this.onerror(this.status);
- Alert.show("There is connection problem, please reload the page", function() {
- window.location.reload()
- })
- } else if (this.responseText = this.ajax.responseText, null !== this.onreadystatechange) this.onreadystatechange()
- };
- Ajax.prototype.onprogresslistener = function(b) {
- if (null !== this.onprogress) this.onprogress(b)
- };
- Ajax.prototype.Header = function(b, a) {
- this.name = b;
- this.value = a
- };
- Ajax.prototype.RequestQueryBuilder = function() {
- var b = this;
- this.params = [];
- this.add = function(a, c) {
- b.params.push(a + "=" + encodeURIComponent(c))
- };
- this.build = function() {
- return b.params.join("&")
- }
- };
- Ajax.prototype.wipe = function() {
- this.wiped = !0;
- !1 === this.background && enableActions()
- };
- var Alert = {
- object: null,
- Class: function() {
- var a = this;
- a.root_view = null;
- a.alert_view;
- a.msg;
- a.positive;
- a.negative;
- a.neutral;
- a.positiveListener;
- a.negativeListener;
- a.neutralListener;
- a.content = function() {
- a.initViews();
- return a.root_view
- };
- a.initViews = function() {
- if (null === a.root_view) {
- var b;
- a.root_view = d.createElement("div");
- a.root_view.className = "AlertWrapper Table";
- a.root_view.innerHTML = '<div class="Tablet Cell"><div class="Alert ShadowDark"></div></div>';
- a.alert_view = a.root_view.childNodes[0].childNodes[0];
- a.msg = d.createElement("div");
- a.msg.className = "Msg ScrollView";
- a.alert_view.appendChild(a.msg);
- a.positive = d.createElement("div");
- a.positive.className = "TextButton Cursor";
- a.positive.setAttribute("hl", "GrayHL");
- a.positive.onclick = a.positiveCallback;
- a.alert_view.appendChild(a.positive);
- a.negative = d.createElement("div");
- a.negative.className = "TextButton Cursor MagentaBg MagentaBgHL";
- a.negative.style.marginLeft = "16px";
- a.negative.setAttribute("hl", "GrayHL");
- a.negative.onclick = a.negativeCallback;
- a.alert_view.appendChild(a.negative);
- a.neutral = d.createElement("div");
- a.neutral.className = "TextButton FLeft Cursor";
- a.neutral.setAttribute("hl", "GrayHL");
- a.neutral.onclick = a.neutralCallback;
- a.alert_view.appendChild(a.neutral);
- b = d.createElement("div");
- b.className = "Cleaner";
- a.alert_view.appendChild(b);
- a.hide()
- }
- };
- a.setPositiveLabel = function(b) {
- a.positive.innerHTML = b;
- a.positive.style.display = "inline-block"
- };
- a.setNegativeLabel = function(b) {
- a.negative.innerHTML = b;
- a.negative.style.display = "inline-block"
- };
- a.setNeutralLabel = function(b) {
- a.neutral.innerHTML =
- b;
- a.neutral.style.display = "inline-block"
- };
- a.setMsg = function(b) {
- a.msg.innerHTML = b
- };
- a.show = function() {
- a.isShown() || (dim(null, 4098), a.root_view.style.opacity = 0, a.root_view.style.display = "table", a.layout(), requestAnimationFrame(function() {
- a.root_view.style.opacity = 1
- }))
- };
- a.hide = function() {
- undim();
- a.root_view.style.display = "none";
- a.alert_view.className = "Alert";
- a.msg.style.maxHeight = "none";
- a.positiveListener = a.negativeListener = a.neutralListener = null;
- a.positive.style.display = a.negative.style.display = a.neutral.style.display =
- "none"
- };
- a.isShown = function() {
- return "none" !== a.root_view.style.display
- };
- a.requestLayout = function() {
- a.isShown() && requestAnimationFrame(a.layout)
- };
- a.layout = function() {
- a.root_view.style.width = ScreenMetrics.width + "px";
- a.root_view.style.height = ScreenMetrics.height + "px";
- a.root_view.style.transform = "translate(0px, " + getScrollTop() + "px)"
- };
- a.positiveCallback = function(b) {
- null !== a.positiveListener && a.positiveListener(b);
- a.hide()
- };
- a.negativeCallback = function(b) {
- null !== a.negativeListener && a.negativeListener(b);
- a.hide()
- };
- a.neutralCallback = function(b) {
- null !== a.neutralListener && a.neutralListener(b);
- a.hide()
- }
- },
- init: function() {
- Alert.object = new Alert.Class;
- d.body.appendChild(Alert.object.content());
- d.body.addEventListener("keyup", function(a) {
- 27 === a.keyCode && Alert.object.isShown() && Alert.object.hide()
- })
- },
- setPositiveLabel: function(a) {
- Alert.object.setPositiveLabel(a)
- },
- setNegativeLabel: function(a) {
- Alert.object.setNegativeLabel(a)
- },
- setNeutralLabel: function(a) {
- Alert.object.setNeutralLabel(a)
- },
- setPositiveListener: function(a) {
- Alert.object.positiveListener =
- a
- },
- setNegativeListener: function(a) {
- Alert.object.negativeListener = a
- },
- setNeutralListener: function(a) {
- Alert.object.neutralListener = a
- },
- setMsg: function(a) {
- Alert.object.setMsg(a)
- },
- show: function(a, b, c) {
- void 0 !== a && (Alert.object.setMsg(a), Alert.object.setPositiveLabel("OK"), void 0 !== b && (Alert.object.positiveListener = b), void 0 !== c && (Alert.object.setPositiveLabel("Yes"), Alert.object.setNegativeLabel("No"), Alert.object.negativeListener = c));
- Alert.object.show()
- },
- hide: function() {
- Alert.object.hide()
- },
- requestLayout: function() {
- Alert.object.requestLayout()
- }
- };
- function onBeforeLoad() {
- ScreenMetrics.width = de.clientWidth;
- ScreenMetrics.height = de.clientHeight;
- Ripple.init();
- Alert.init();
- typeof PopupWindow !== UNDEF && PopupWindow.init();
- if (void 0 !== General.onBeforeLoad) General.onBeforeLoad();
- if (typeof GeneralVersion !== UNDEF && void 0 !== GeneralVersion.onBeforeLoad) GeneralVersion.onBeforeLoad();
- if (void 0 !== page && void 0 !== page.onBeforeLoad) page.onBeforeLoad();
- if (void 0 !== page_cpanel && void 0 !== page_cpanel.onBeforeLoad) page_cpanel.onBeforeLoad()
- }
- function onLoad() {
- if (void 0 !== General.onLoad) General.onLoad();
- if (typeof GeneralVersion !== UNDEF && void 0 !== GeneralVersion.onLoad) GeneralVersion.onLoad();
- if (void 0 !== page && void 0 !== page.onLoad) page.onLoad();
- if (void 0 !== page_cpanel && void 0 !== page_cpanel.onLoad) page_cpanel.onLoad()
- }
- function onResize() {
- if (ScreenMetrics.width !== de.clientWidth || ScreenMetrics.height !== de.clientHeight) {
- var a, b;
- a = ScreenMetrics.width;
- b = ScreenMetrics.height;
- ScreenMetrics.width = de.clientWidth;
- ScreenMetrics.height = de.clientHeight;
- typeof PopupWindow !== UNDEF && PopupWindow.requestLayout();
- Alert.requestLayout();
- if (a !== ScreenMetrics.width) {
- if (void 0 !== General.onResizeW) General.onResizeW();
- if (typeof GeneralVersion !== UNDEF && void 0 !== GeneralVersion.onResizeW) GeneralVersion.onResizeW();
- if (void 0 !== page && void 0 !==
- page.onResizeW) page.onResizeW();
- if (void 0 !== page_cpanel && void 0 !== page_cpanel.onResizeW) page_cpanel.onResizeW()
- }
- if (b !== ScreenMetrics.height) {
- if (void 0 !== General.onResizeH) General.onResizeH();
- if (typeof GeneralVersion !== UNDEF && void 0 !== GeneralVersion.onResizeH) GeneralVersion.onResizeH();
- if (void 0 !== page && void 0 !== page.onResizeH) page.onResizeH();
- if (void 0 !== page_cpanel && void 0 !== page_cpanel.onResizeH) page_cpanel.onResizeH()
- }
- if (void 0 !== General.onResize) General.onResize();
- if (typeof GeneralVersion !== UNDEF &&
- void 0 !== GeneralVersion.onResize) GeneralVersion.onResize();
- if (void 0 !== page && void 0 !== page.onResize) page.onResize();
- if (void 0 !== page_cpanel && void 0 !== page_cpanel.onResize) page_cpanel.onResize();
- requestAnimationFrame(onResize)
- }
- }
- function onScroll() {
- Alert.requestLayout();
- if (void 0 !== General.onScroll) General.onScroll();
- if (typeof GeneralVersion !== UNDEF && void 0 !== GeneralVersion.onScroll) GeneralVersion.onScroll();
- if (void 0 !== page && void 0 !== page.onScroll) page.onScroll();
- if (void 0 !== page_cpanel && void 0 !== page_cpanel.onScroll) page_cpanel.onScroll()
- }
- function onBeforeUnload() {
- if (void 0 !== page && void 0 !== page.onBeforeUnload) page.onBeforeUnload()
- };
- var Ripple = {
- init: function() {
- for (var a = d.getElementsByClassName("Ripple"), b = a.length - 1; 0 <= b; --b) null === a[b].getAttribute("init_r") && (a[b].setAttribute("init_r", Strings.TRUE), Ripple.add(a[b]))
- },
- add: function(a) {
- a.addEventListener("mousedown", Ripple.createOnMouseDown(a))
- },
- createOnMouseDown: function(a) {
- return function(b) {
- if (0 === b.button) {
- var c = {
- valid: !0
- };
- getScreenX(a);
- getScreenY(a);
- var e = a.offsetWidth > a.offsetHeight ? a.offsetWidth << 1 : a.offsetHeight << 1;
- c.node = d.createElement("div");
- c.node.className = "RippleNode";
- null !== a.getAttribute("color") && (c.node.style.backgroundColor = a.getAttribute("color"));
- c.node.style.left = b.clientX - getScreenX(a) - (e >> 1) + "px";
- c.node.style.top = b.clientY - getScreenY(a) - (e >> 1) + "px";
- c.node.style.width = e + "px";
- c.node.style.height = e + "px";
- a.insertBefore(c.node, a.firstChild);
- requestAnimationFrame(function() {
- c.node.className += " SlowTransform"
- });
- b = Ripple.createOnMouseUp(a, c);
- a.addEventListener("mouseup", b);
- a.addEventListener("mouseout", b)
- }
- }
- },
- createOnMouseUp: function(a, b) {
- var c = function(e) {
- !1 !==
- b.value && (b.value = !1, b.node.className += " FastTransform", setTimeout(function() {
- requestAnimationFrame(function() {
- b.node.style.opacity = 0;
- setTimeout(function() {
- a.removeChild(b.node)
- }, 250)
- })
- }, 250), a.removeEventListener("mouseup", c), a.removeEventListener("mouse", c))
- };
- return c
- }
- };
- var General = {
- scale_factor: 1,
- ajax_reload: !1,
- onBeforeLoad: function() {
- General.invalidateZoom();
- General.initHover();
- General.Tooltips.init();
- General.ajax_reload = typeof GeneralVersion !== UNDEF && typeof GeneralVersion.AjaxReload !== UNDEF;
- if (!0 === General.ajax_reload) GeneralVersion.AjaxReload.onBeforeLoad()
- },
- onResize: function() {},
- onResizeW: function() {
- General.invalidateZoom()
- },
- onResizeH: function() {
- if (!0 === General.ajax_reload) GeneralVersion.AjaxReload.onResizeH()
- },
- onLoad: function() {
- General.invalidateZoom();
- General.isLegacy() &&
- Alert.show("\u0418\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0442\u0435 \u0441\u0442\u0430\u0440 \u0443\u0435\u0431 \u0431\u0440\u0430\u0443\u0437\u044a\u0440. \u0417\u0430 \u0434\u0430 \u043c\u043e\u0436\u0435 \u0434\u0430 \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0442\u0435 \u043f\u044a\u043b\u043d\u0430\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043d\u043e\u0441\u0442 \u043d\u0430 \u0441\u0430\u0439\u0442\u0430, \u043c\u043e\u043b\u044f \u0438\u0437\u043f\u043e\u043b\u0437\u0432\u0430\u0442\u0435 \u043f\u043e - \u043d\u043e\u0432 \u0431\u0440\u0430\u0443\u0437\u044a\u0440");
- if (!0 === General.ajax_reload) GeneralVersion.AjaxReload.onLoad()
- },
- isLegacy: function() {
- return browser === Browsers.IE && 9 > browser_version
- },
- initHover: function() {
- if (0 !== navigator.maxTouchPoints && 0 !== navigator.msMaxTouchPoints) {
- var a = !1,
- b = function() {
- a = !1
- };
- de.addEventListener("mousemove", function(b) {
- !0 !== a && removeClass(de, "Touchable")
- }, !0);
- de.addEventListener("touchstart", function(c) {
- a = !0;
- addClass(de, "Touchable");
- setTimeout(b, 200)
- }, !0)
- }
- },
- invalidateZoom: function() {
- mobile = window.innerWidth < ScreenMetrics.mobile_limit;
- General.scale_factor = 1;
- General.invalidateIFrameZoom()
- },
- invalidateIFrameZoom: function() {
- for (var a, b = d.getElementsByTagName("iframe"), c = b.length; 0 < c--;) a = b[c].parentNode.parentNode.parentNode.offsetWidth, a /= b[c].parentNode.parentNode.offsetWidth, browser !== Browsers.FIREFOX ? (b[c].style.zoom = 1 / (General.scale_factor * a), b[c].style.transform = "scale(" + General.scale_factor * a + ")", b[c].style.width = parseInt(b[c].getAttribute("width")) * a + "px", b[c].style.height = parseInt(b[c].getAttribute("height")) * a + "px") : b[c].style.transform =
- "scale(" + a + ")"
- },
- positionFooter: function() {
- var a = d.getElementsByTagName("footer");
- if (0 !== a.length) {
- a = a[0];
- a.style.bottom = "0";
- var b = getScreenY(a) + a.offsetHeight - ScreenMetrics.height;
- if (!(0 <= b)) {
- var c = 1 / General.scale_factor;
- a.style.bottom = b * c - a.offsetHeight * (1 - General.scale_factor) * c + "px"
- }
- }
- },
- Tooltips: {
- OFFSET: 4,
- init: function() {
- for (var a = d.body.querySelectorAll("*[tooltip]:not([init_t])"), b = a.length; 0 < b--;) General.Tooltips.addListeners(a[b]), a[b].setAttribute("init_t", Strings.EMPTY)
- },
- addListeners: function(a) {
- var b = !1,
- c = null,
- e = d.createElement("div");
- e.innerHTML = "<span></span>" + a.getAttribute("tooltip");
- e.className = "Tooltip";
- a.addEventListener("mouseover", function(a) {
- b = !0;
- null !== c && (clearTimeout(c), c = null);
- if (null === e.parentNode) {
- d.body.appendChild(e);
- var h = getScreenX(this) + getScrollLeft();
- a = getScreenY(this) + getScrollTop();
- var h = h + .5 * (this.getBoundingClientRect().width - e.offsetWidth),
- g = a - (e.offsetHeight + 8 + General.Tooltips.OFFSET);
- 0 > g ? (g = a + this.getBoundingClientRect().height + 12, addClass(e, "Bottom")) : removeClass(e,
- "Bottom");
- 0 > h ? (e.childNodes[0].style.transform = "translateX(" + (h - General.Tooltips.OFFSET) + "px)", h = General.Tooltips.OFFSET) : e.childNodes[0].style.transform = "translateX(0)";
- a = h + e.offsetWidth + General.Tooltips.OFFSET - ScreenMetrics.width;
- 0 < a ? (h -= a, e.childNodes[0].style.transform = "translateX(" + a + "px)") : e.childNodes[0].style.transform = "translateX(0)";
- e.style.transform = "translate(" + h + "px, " + g + "px)"
- }
- requestAnimationFrame(function() {
- addClass(e, "Visible")
- })
- });
- a.addEventListener("mouseout", function() {
- b = !1;
- removeClass(e,
- "Visible");
- c = setTimeout(function() {
- !0 !== b && e.parentNode.removeChild(e)
- }, 300)
- })
- }
- }
- },
- AjaxReload = {
- request_map: {},
- animation: 0,
- ajax: null,
- onBeforeLoad: function() {
- AjaxReload.initContent();
- AjaxReload.invalidateHeaderBlack();
- AjaxReload.invalidateLinks();
- window.onpopstate = AjaxReload.onPopState
- },
- onLoad: function() {
- AjaxReload.invalidateHeaderBlack()
- },
- onResizeH: function() {
- AjaxReload.invalidateHeaderBlack()
- },
- onPopState: function(a) {
- l(a);
- AjaxReload.followLink(a, a.state)
- },
- initContent: function() {
- AjaxReload.styles_n =
- getElementById("styles");
- AjaxReload.script_header_n = getElementById("script_header");
- AjaxReload.script_init_n = getElementById("script_init");
- AjaxReload.content_n = getElementById("content");
- AjaxReload.meta_title = getElementById("meta_title");
- AjaxReload.meta_desc = getElementById("meta_desc")
- },
- invalidateHeaderBlack: function() {
- var a = d.getElementById("header_black");
- if (null !== a) {
- var b = 0 === a.childNodes.length ? null : a.childNodes[0],
- c = typeof page === UNDEF || !0 !== page.large_header;
- a.style.height = .65 * ScreenMetrics.height +
- "px";
- ++AjaxReload.animation;
- setTimeout(function() {
- --AjaxReload.animation;
- onResize()
- }, 250);
- null === b && (b = d.createElement("img"), b.src = URL_ROOT + "wall.jpg", b.style.opacity = 0, b.onload = function() {
- b.removeAttribute("style")
- }, a.appendChild(b));
- a.className = c ? "Small" : Strings.TRUE
- }
- },
- invalidateLinks: function() {
- var a = [],
- b = d.getElementsByTagName("a"),
- c = d.URL,
- e = null;
- "/" !== c[c.length - 1] && (c += "/");
- location.pathname === URL_ROOT && (c = Strings.EMPTY, typeof PagesUser !== UNDEF && (c = PagesUser.HOME), typeof PagesProjectToday !==
- UNDEF && (c = PagesProjectToday.HOME), c = location.origin + c);
- for (var f = b.length; 0 < f--;) d.URL === b[f].href && (e = b[f]), null !== b[f].getAttribute("header") && (a.push(b[f]), b[f].className = b[f].className.replace(" Magenta", Strings.EMPTY)), b[f].getAttribute("done") !== Strings.TRUE && null === b[f].getAttribute("target") && (b[f].setAttribute("done", Strings.TRUE), b[f].addEventListener("click", AjaxReload.followLink));
- if (0 !== a.length) {
- for (f = a.length; 0 < f--;)
- if (0 === c.indexOf(a[f].href)) {
- e = a[f];
- break
- } null !== e && (e.className +=
- " Magenta")
- }
- },
- followLink: function(a, b, c) {
- null !== a && a.preventDefault();
- null !== AjaxReload.ajax && AjaxReload.ajax.wipe();
- var e = typeof b === UNDEF ? this.href : null === b ? URL_VERSION : b,
- f = AjaxReload.ajax = new Ajax(!0);
- AjaxReload.request_map[e] = null;
- f.open(f.GET, e, !0);
- f.onreadystatechange = function() {
- if (typeof AjaxReload.request_map[e] !== UNDEF) {
- var a, g, q, r, k, t, n, p = d.getElementById("header_black");
- delete AjaxReload.request_map[e];
- a = d.createElement("section");
- a.className = "AjaxReloadFrame";
- a.innerHTML = f.responseText.replace(decodeURIComponent("%3C!DOCTYPE%20html%3E"),
- Strings.EMPTY).replace(decodeURIComponent("%3Cbody"), "<section id='body'").replace(decodeURIComponent("%3C%2Fbody%3E"), "</section>").replaceAll(decodeURIComponent("html%3E"), "section>").replaceAll(decodeURIComponent("head%3E"), "section>");
- d.body.appendChild(a);
- g = getElementById("styles");
- q = getElementById("script_header");
- r = getElementById("script_init");
- k = getElementById("content");
- n = getElementById("body").className;
- typeof n === UNDEF && (n = Strings.EMPTY);
- AjaxReload.meta_title.innerHTML = getElementById("meta_title").innerHTML;
- AjaxReload.meta_desc.content = getElementById("meta_desc").content;
- typeof b !== UNDEF && !0 !== c || window.history.pushState(e, AjaxReload.meta_title.innerHTML, e);
- t = typeof d.body.className === UNDEF ? Strings.EMPTY : d.body.className;
- d.body.className = t + " " + n;
- null !== g && (g.parentNode.removeChild(g), AjaxReload.styles_n.parentNode.insertBefore(g, AjaxReload.styles_n));
- page = void 0;
- null !== q && eval(q.innerHTML);
- null !== r && eval(r.innerHTML);
- var m = AjaxReload.content_n.parentNode,
- v = k.offsetHeight;
- m.style.height = AjaxReload.content_n.offsetHeight +
- "px";
- m.style.transitionProperty = "height";
- k.className = AjaxReload.content_n.className += " OnTheFly";
- k.style.opacity = 0;
- k.parentNode.removeChild(k);
- m.appendChild(k);
- a.parentNode.removeChild(a);
- AjaxReload.invalidateLinks();
- if (typeof page !== UNDEF && typeof page.onBeforeLoad !== UNDEF) page.onBeforeLoad();
- var u = function() {
- AjaxReload.content_n.removeEventListener("transitionend", u);
- null !== p && (p.style.transitionProperty = "none");
- m.removeChild(AjaxReload.content_n);
- m.style.transitionProperty = "none";
- m.style.height =
- "auto";
- AjaxReload.content_n = k;
- AjaxReload.content_n.className = AjaxReload.content_n.className.replace(" OnTheFly", Strings.EMPTY);
- AjaxReload.styles_n.parentNode.removeChild(AjaxReload.styles_n);
- AjaxReload.styles_n = g;
- d.body.className = d.body.className.replace(t, Strings.EMPTY);
- if (typeof page !== UNDEF && typeof page.onLoad !== UNDEF) page.onLoad();
- --AjaxReload.animation;
- onResize();
- if (d.location.hash !== Strings.EMPTY) {
- var a = d.body.querySelector(d.location.hash);
- null !== a && setScrollTop(getY(a))
- }
- };
- setTimeout(function() {
- requestAnimationFrame(function() {
- AjaxReload.content_n.addEventListener("transitionend",
- u);
- null !== p && (p.style.transitionProperty = "height");
- AjaxReload.invalidateHeaderBlack();
- m.style.height = v + "px";
- k.style.opacity = 1;
- AjaxReload.content_n.style.opacity = 0;
- ++AjaxReload.animation
- })
- }, 0)
- }
- };
- f.send()
- }
- };
- var GeneralVersion = {
- AjaxReload: AjaxReload,
- onBeforeLoad: function() {
- GeneralVersion.Header.init()
- },
- onResize: function() {
- GeneralVersion.Header.onResize()
- },
- onScroll: function() {
- GeneralVersion.Header.onScroll()
- },
- Header: {
- init: function() {
- GeneralVersion.Header.initScroll();
- GeneralVersion.Header.initVimeoPlayer()
- },
- onResize: function() {
- GeneralVersion.Header.invalidateVimeoPlayer()
- },
- onScroll: function() {
- var a = d.body.querySelector("header");
- a.style.position = "relative";
- 0 > getScreenY(a) && (a.style.position = "fixed")
- },
- initScroll: function() {
- var a = getElementById("header_viewer"),
- e, b, c = NOT_EXISTS,
- f = NOT_EXISTS,
- h = function() {
- c === NOT_EXISTS && 0 !== b && (a.scrollLeft -= e * b, b--, requestAnimationFrame(h))
- };
- getElementById("menu_trigger").addEventListener("click", function() {
- hasClass(this.parentNode, "Active") ? removeClass(this.parentNode, "Active") : addClass(this.parentNode, "Active")
- });
- a.addEventListener("touchstart", function(a) {
- c = a.touches[0].clientX;
- f = a.touches[0].clientY
- });
- a.addEventListener("touchmove", function(b) {
- if (c !== NOT_EXISTS) {
- var g =
- b.touches[0].clientX - c;
- if (Math.abs(b.touches[0].clientY - f) > Math.abs(g)) return;
- e = 0 > g ? -1 : 1;
- a.scrollLeft -= g
- }
- c = b.touches[0].clientX;
- f = b.touches[0].clientY
- });
- a.addEventListener("touchend", function() {
- c = NOT_EXISTS;
- b = 10;
- requestAnimationFrame(h)
- })
- },
- initVimeoPlayer: function() {
- var a = d.body.querySelector(".VideoContainer iframe");
- if (null !== a) {
- var e = d.body.querySelector(".LandingContainer"),
- b = e.querySelector(".DataWrapper"),
- c = d.createElement("script");
- c.async = !0;
- c.src = "https://player.vimeo.com/api/player.js";
- c.addEventListener("load", function() {
- var c = new Vimeo.Player(a);
- c.on("play", function() {
- addClass(e, "Play");
- b.style.transform = "translateX(128px)"
- });
- c.on("pause", function() {
- removeClass(e, "Play");
- b.style.transitionDuration = "0s";
- b.style.transform = "translateX(-128px)";
- b.style.opacity = "0";
- requestAnimationFrame(function() {
- requestAnimationFrame(function() {
- b.style.transitionDuration = "0.25s";
- b.style.transform = "translateX(0px)";
- b.style.opacity = "1"
- })
- })
- })
- });
- d.head.appendChild(c);
- GeneralVersion.Header.invalidateVimeoPlayer()
- }
- },
- invalidateVimeoPlayer: function() {
- var a = d.body.querySelector(".LandingContainer .VideoContainer");
- if (null !== a) {
- var e = a.parentNode,
- b = e.offsetHeight,
- c = b / 9 * 16;
- c > e.offsetWidth && (c = e.offsetWidth, b = c / 16 * 9);
- a.style.width = c + "px";
- a.style.height = b + "px"
- }
- }
- }
- };
- var Params = {
- ACTION: "ac",
- ID: "id",
- NAME: "nm",
- PASS: "ps",
- EMAIL: "eml",
- SUBJECT: "sbj",
- MSG: "msg",
- CAPTCHA: "cpt",
- JSON: "json",
- TIMESTAMP: "ts",
- URL: "url",
- DAY_OF_YEAR: "doy",
- STATUS: "sts",
- HEADLINE: "hl",
- SEARCH_PHRASE: "sp",
- BODY: "bd",
- INDEX: "ind",
- ITEM_ID: "iid",
- TITLE: "ttl",
- AUTHOR: "author",
- DESC: "desc",
- CREATED_TS: "crt_ts",
- TYPE: "tp",
- PRICE: "prc",
- ITEM_PRICE: "prc",
- VISUAL_FACTOR: "vf",
- SEQ_COVER_IMG: "seq_c_img",
- SEQ_VIDEO: "seq_v",
- SEQ_ITEM_IMG: "seq_item_img",
- WIDTH: "w",
- HEIGHT: "h",
- ITEMS: "items",
- REMOVED_ITEMS: "rem_items",
- ARTICLE_IMG: "art_img",
- VALUE: "vl",
- POSITION: "pos",
- DOWNLOADABLE: "dld",
- ITEM_DOWNLOADABLE: "idld",
- };
- var PagesUser = {
- HOME: "https://phazza.com/home/",
- PROJECTS: "https://phazza.com/projects/",
- SESSION_IMAGE: "SESSION_IMAGE",
- SESSION_VIDEO: "SESSION_VIDEO",
- STORE: "#",
- ABOUT_US: "https://phazza.com/about-us",
- SEND_MESSAGE: "https://phazza.com/about-us/#send-message",
- };
- var PagesProjectToday = {
- HOME: "https://phazza.com/dazz/",
- HOME_NO_ENTRY: "https://phazza.com/dazz/no-entry/",
- NOT_FOUND: "https://phazza.com/not-found/",
- ENTRY_STILL_IMAGE: "https://phazza.com/dazz/entry-still-image/",
- ENTRY_SEQUENCE: "https://phazza.com/dazz/entry-sequence/",
- ENTRY_THUMBNAIL: "https://phazza.com/dazz/entry-thumbnail/",
- };
- Controllers = {
- CONTACTS: "https://phazza.com/exec/ContactsController/",
- ENTRY: "https://phazza.com/exec/EntryController/",
- SEQUENCE: "https://phazza.com/exec/SequenceController/",
- ARTICLE: "https://phazza.com/exec/ArticleController/",
- SALES: "https://phazza.com/exec/SalesController/",
- };
- var ActionsContacts = {
- SEND_INQUERY: "a",
- };
- checkBrowser();
- if (browser === Browsers.IE && browser_version < 9)
- makeHTML5ElemetsForIE();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement