From debd52b91147fcdfb8b0ae57f3fb9f370656f1a1 Mon Sep 17 00:00:00 2001 From: englishextra Date: Wed, 8 May 2019 13:33:27 +0300 Subject: [PATCH] https://github.com/nodejs/node-gyp/issues/1717 --- libs/serguei-uwp/js/bundle.js | 974 +++++++++++----------------------- 1 file changed, 315 insertions(+), 659 deletions(-) diff --git a/libs/serguei-uwp/js/bundle.js b/libs/serguei-uwp/js/bundle.js index 9f8513b..ec25179 100644 --- a/libs/serguei-uwp/js/bundle.js +++ b/libs/serguei-uwp/js/bundle.js @@ -1,25 +1,5 @@ -function _typeof(obj) { - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function _typeof(obj) { - return typeof obj; - }; - } else { - _typeof = function _typeof(obj) { - return obj && - typeof Symbol === "function" && - obj.constructor === Symbol && - obj !== Symbol.prototype - ? "symbol" - : typeof obj; - }; - } - return _typeof(obj); -} - /*jslint browser: true */ - /*jslint node: true */ - /*global $readMoreJS, AdaptiveCards, addClass, addListener, console, dataSrcIframeClass, dataSrcImgClass, debounce, doesFontExist, earlySvgSupport, earlySvgasimgSupport, earlyHasTouch, earlyDeviceType, earlyDeviceFormfactor, @@ -29,167 +9,123 @@ macyIsActiveClass, needsPolyfills, openDeviceBrowser, parseLink, progressBar, removeClass, removeListener, require, runAbout, runGallery, runHome, runPictures, runWorks, supportsCanvas, supportsPassive, supportsSvgSmilAnimation, throttle*/ - /*property console, join, split */ - /*! * safe way to handle console.log * @see {@link https://github.com/paulmillr/console-polyfill} */ -(function(root, document) { +(function (root, document) { "use strict"; - if (!root.console) { root.console = {}; } - var con = root.console; var prop; var method; - - var dummy = function dummy() {}; - + var dummy = function () {}; var properties = ["memory"]; - var methods = [ - "assert,clear,count,debug,dir,dirxml,error,exception,group,", + var methods = ["assert,clear,count,debug,dir,dirxml,error,exception,group,", "groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,", - "show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn" - ]; + "show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn"]; methods.join("").split(","); - for (; (prop = properties.pop()); ) { if (!con[prop]) { con[prop] = {}; } } - for (; (method = methods.pop()); ) { if (!con[method]) { con[method] = dummy; } } - prop = method = dummy = properties = methods = null; + /*! * supportsPassive */ - - root.supportsPassive = (function() { + root.supportsPassive = (function () { var support = false; - try { - var opts = - Object.defineProperty && - Object.defineProperty({}, "passive", { - get: function get() { + var opts = Object.defineProperty && Object.defineProperty({}, "passive", { + get: function () { support = true; } }); - root.addEventListener("test", function() {}, opts); + root.addEventListener("test", function () {}, opts); } catch (err) {} - return support; })(); + /*! * supportsSvgSmilAnimation */ - - root.supportsSvgSmilAnimation = (function() { + root.supportsSvgSmilAnimation = (function () { var toStringFn = {}.toString; - return ( - (!!document.createElementNS && - /SVGAnimate/.test( - toStringFn.call( - document.createElementNS( - "http://www.w3.org/2000/svg", - "animate" - ) - ) - )) || - "" - ); + return !!document.createElementNS && + (/SVGAnimate/).test(toStringFn.call(document.createElementNS("http://www.w3.org/2000/svg", "animate"))) || ""; })(); + /*! * supportsCanvas */ - - root.supportsCanvas = (function() { + root.supportsCanvas = (function () { var elem = document.createElement("canvas"); return !!(elem.getContext && elem.getContext("2d")); })(); + /*! * needsPolyfills */ - - root.needsPolyfills = (function() { - return ( - !String.prototype.startsWith || - !supportsPassive || - !root.requestAnimationFrame || - !root.matchMedia || - ("undefined" === typeof root.Element && - !("dataset" in document.documentElement)) || - !("classList" in document.createElement("_")) || - (document.createElementNS && - !( - "classList" in - document.createElementNS("http://www.w3.org/2000/svg", "g") - )) || - (root.attachEvent && !root.addEventListener) || - !("onhashchange" in root) || - !Array.prototype.indexOf || - !root.Promise || - !root.fetch || - !document.querySelectorAll || - !document.querySelector || - !Function.prototype.bind || - (Object.defineProperty && - Object.getOwnPropertyDescriptor && - Object.getOwnPropertyDescriptor( - Element.prototype, - "textContent" - ) && - !Object.getOwnPropertyDescriptor( - Element.prototype, - "textContent" - ).get) || - !( - "undefined" !== typeof root.localStorage && - "undefined" !== typeof root.sessionStorage - ) || - !root.WeakMap || - !root.MutationObserver - ); + root.needsPolyfills = (function () { + return !String.prototype.startsWith || + !supportsPassive || + !root.requestAnimationFrame || + !root.matchMedia || + ("undefined" === typeof root.Element && !("dataset" in document.documentElement)) || + !("classList" in document.createElement("_")) || + document.createElementNS && !("classList" in document.createElementNS("http://www.w3.org/2000/svg", "g")) || + (root.attachEvent && !root.addEventListener) || + !("onhashchange" in root) || + !Array.prototype.indexOf || + !root.Promise || + !root.fetch || + !document.querySelectorAll || + !document.querySelector || + !Function.prototype.bind || + (Object.defineProperty && + Object.getOwnPropertyDescriptor && + Object.getOwnPropertyDescriptor(Element.prototype, "textContent") && + !Object.getOwnPropertyDescriptor(Element.prototype, "textContent").get) || + !("undefined" !== typeof root.localStorage && "undefined" !== typeof root.sessionStorage) || + !root.WeakMap || + !root.MutationObserver; })(); + /*! * getHumanDate */ - - root.getHumanDate = (function() { - var newDate = new Date(); + root.getHumanDate = (function () { + var newDate = (new Date()); var newDay = newDate.getDate(); var newYear = newDate.getFullYear(); var newMonth = newDate.getMonth(); - newMonth += 1; - + (newMonth += 1); if (10 > newDay) { newDay = "0" + newDay; } - if (10 > newMonth) { newMonth = "0" + newMonth; } - return newYear + "-" + newMonth + "-" + newDay; })(); + /*! * Super-simple wrapper around addEventListener and attachEvent (old IE). * Does not handle differences in the Event-objects. * @see {@link https://github.com/finn-no/eventlistener} */ - - var setListener = function setListener(standard, fallback) { - return function(el, type, listener, useCapture) { + var setListener = function (standard, fallback) { + return function (el, type, listener, useCapture) { if (el[standard]) { el[standard](type, listener, useCapture); } else { @@ -199,175 +135,133 @@ supportsSvgSmilAnimation, throttle*/ } }; }; - root.addListener = setListener("addEventListener", "attachEvent"); root.removeListener = setListener("removeEventListener", "detachEvent"); + /*! * get elements by class name wrapper */ - - root.getByClass = function(parent, name) { + root.getByClass = function (parent, name) { if (!document.getElementsByClassName) { var children = (parent || document.body).getElementsByTagName("*"), - elements = [], - classRE = new RegExp("\\b" + name + "\\b"), - child; - var i, l; - + elements = [], + classRE = new RegExp("\\b" + name + "\\b"), + child; + var i, + l; for (i = 0, l = children.length; i < l; i += 1) { child = children[i]; - if (classRE.test(child.className)) { elements.push(child); } } - i = l = null; return elements; } else { return parent ? parent.getElementsByClassName(name) : ""; } }; + /*! * class list wrapper */ - var hasClass; var addClass; var removeClass; - if ("classList" in document.documentElement) { - hasClass = function hasClass(el, name) { + hasClass = function (el, name) { return el.classList.contains(name); }; - - addClass = function addClass(el, name) { + addClass = function (el, name) { el.classList.add(name); }; - - removeClass = function removeClass(el, name) { + removeClass = function (el, name) { el.classList.remove(name); }; } else { - hasClass = function hasClass(el, name) { + hasClass = function (el, name) { return new RegExp("\\b" + name + "\\b").test(el.className); }; - - addClass = function addClass(el, name) { + addClass = function (el, name) { if (!hasClass(el, name)) { el.className += " " + name; } }; - - removeClass = function removeClass(el, name) { - el.className = el.className.replace( - new RegExp("\\b" + name + "\\b", "g"), - "" - ); + removeClass = function (el, name) { + el.className = el.className.replace(new RegExp("\\b" + name + "\\b", "g"), ""); }; } - root.hasClass = hasClass; root.addClass = addClass; root.removeClass = removeClass; - - root.toggleClass = function(el, name) { + root.toggleClass = function (el, name) { if (hasClass(el, name)) { removeClass(el, name); } else { addClass(el, name); } }; + /*! * parseLink */ - /*jshint bitwise: false */ - - root.parseLink = function(url, full) { + root.parseLink = function (url, full) { var _full = full || ""; - - return (function() { - var _replace = function _replace(s) { + return (function () { + var _replace = function (s) { return s.replace(/^(#|\?)/, "").replace(/\:$/, ""); }; - var _location = location || ""; - - var _protocol = function _protocol(protocol) { + var _protocol = function (protocol) { switch (protocol) { - case "http:": - return _full ? ":" + 80 : 80; - - case "https:": - return _full ? ":" + 443 : 443; - - default: - return _full ? ":" + _location.port : _location.port; + case "http:": + return _full ? ":" + 80 : 80; + case "https:": + return _full ? ":" + 443 : 443; + default: + return _full ? ":" + _location.port : _location.port; } }; - - var _isAbsolute = 0 === url.indexOf("//") || !!~url.indexOf("://"); - + var _isAbsolute = (0 === url.indexOf("//") || !!~url.indexOf("://")); var _locationHref = root.location || ""; - - var _origin = function _origin() { - var o = - _locationHref.protocol + + var _origin = function () { + var o = _locationHref.protocol + "//" + _locationHref.hostname + (_locationHref.port ? ":" + _locationHref.port : ""); return o || ""; }; - - var _isCrossDomain = function _isCrossDomain() { + var _isCrossDomain = function () { var c = document.createElement("a"); c.href = url; - var v = - c.protocol + - "//" + - c.hostname + - (c.port ? ":" + c.port : ""); + var v = c.protocol + "//" + c.hostname + (c.port ? ":" + c.port : ""); return v !== _origin(); }; - var _link = document.createElement("a"); - _link.href = url; return { href: _link.href, origin: _origin(), host: _link.host || _location.host, - port: - "0" === _link.port || "" === _link.port - ? _protocol(_link.protocol) - : _full - ? _link.port - : _replace(_link.port), + port: ("0" === _link.port || "" === _link.port) ? + _protocol(_link.protocol) : + (_full ? _link.port : _replace(_link.port)), hash: _full ? _link.hash : _replace(_link.hash), hostname: _link.hostname || _location.hostname, - pathname: - _link.pathname.charAt(0) !== "/" - ? _full - ? "/" + _link.pathname - : _link.pathname - : _full - ? _link.pathname - : _link.pathname.slice(1), - protocol: - !_link.protocol || ":" === _link.protocol - ? _full - ? _location.protocol - : _replace(_location.protocol) - : _full - ? _link.protocol - : _replace(_link.protocol), + pathname: _link.pathname.charAt(0) !== "/" ? + (_full ? "/" + _link.pathname : _link.pathname) : + (_full ? _link.pathname : _link.pathname.slice(1)), + protocol: !_link.protocol || + ":" === _link.protocol ? + (_full ? _location.protocol : _replace(_location.protocol)) : + (_full ? _link.protocol : _replace(_link.protocol)), search: _full ? _link.search : _replace(_link.search), query: _full ? _link.search : _replace(_link.search), isAbsolute: _isAbsolute, isRelative: !_isAbsolute, isCrossDomain: _isCrossDomain(), - hasHTTP: /^(http|https):\/\//i.test(url) ? true : false + hasHTTP: (/^(http|https):\/\//i).test(url) ? true : false }; })(); }; @@ -376,32 +270,23 @@ supportsSvgSmilAnimation, throttle*/ /*! * getHTTP */ - - var getHTTP = function getHTTP(force) { + var getHTTP = function (force) { var any = force || ""; var locProtocol = root.location.protocol || ""; - return "http:" === locProtocol - ? "http" - : "https:" === locProtocol - ? "https" - : any - ? "http" - : ""; + return "http:" === locProtocol ? "http" : "https:" === locProtocol ? "https" : any ? "http" : ""; }; - root.getHTTP = getHTTP; root.forcedHTTP = getHTTP(true); + /*! * throttle */ - - root.throttle = function(func, wait) { + root.throttle = function (func, wait) { var ctx; var args; var rtn; var timeoutID; var last = 0; - function call() { timeoutID = 0; last = +new Date(); @@ -409,12 +294,10 @@ supportsSvgSmilAnimation, throttle*/ ctx = null; args = null; } - return function throttled() { ctx = this; args = arguments; var delta = new Date() - last; - if (!timeoutID) { if (delta >= wait) { call(); @@ -422,27 +305,24 @@ supportsSvgSmilAnimation, throttle*/ timeoutID = setTimeout(call, wait - delta); } } - return rtn; }; }; + /*! * debounce */ - - root.debounce = function(func, wait) { + root.debounce = function (func, wait) { var timeout; var args; var context; var timestamp; - return function() { + return function () { context = this; args = [].slice.call(arguments, 0); timestamp = new Date(); - - var later = function later() { - var last = new Date() - timestamp; - + var later = function () { + var last = (new Date()) - timestamp; if (last < wait) { timeout = setTimeout(later, wait - last); } else { @@ -450,52 +330,36 @@ supportsSvgSmilAnimation, throttle*/ func.apply(context, args); } }; - if (!timeout) { timeout = setTimeout(later, wait); } }; }; + /*! * isNodejs isElectron isNwjs; */ - - root.isNodejs = - ("undefined" !== typeof process && "undefined" !== typeof require) || - ""; - - root.isElectron = (function() { - if ( - typeof root !== "undefined" && - _typeof(root.process) === "object" && - root.process.type === "renderer" - ) { + root.isNodejs = "undefined" !== typeof process && "undefined" !== typeof require || ""; + root.isElectron = (function () { + if (typeof root !== "undefined" && + typeof root.process === "object" && + root.process.type === "renderer") { return true; } - - if ( - typeof root !== "undefined" && + if (typeof root !== "undefined" && typeof root.process !== "undefined" && - _typeof(root.process.versions) === "object" && - !!root.process.versions.electron - ) { + typeof root.process.versions === "object" && + !!root.process.versions.electron) { return true; } - - if ( - (typeof navigator === "undefined" - ? "undefined" - : _typeof(navigator)) === "object" && + if (typeof navigator === "object" && typeof navigator.userAgent === "string" && - navigator.userAgent.indexOf("Electron") >= 0 - ) { + navigator.userAgent.indexOf("Electron") >= 0) { return true; } - return false; })(); - - root.isNwjs = (function() { + root.isNwjs = (function () { if ("undefined" !== typeof isNodejs && isNodejs) { try { if ("undefined" !== typeof require("nw.gui")) { @@ -505,42 +369,31 @@ supportsSvgSmilAnimation, throttle*/ return false; } } - return false; })(); + /*! * openDeviceBrowser */ - - root.openDeviceBrowser = function(url) { - var onElectron = function onElectron() { + root.openDeviceBrowser = function (url) { + var onElectron = function () { var es = isElectron ? require("electron").shell : ""; return es ? es.openExternal(url) : ""; }; - - var onNwjs = function onNwjs() { + var onNwjs = function () { var ns = isNwjs ? require("nw.gui").Shell : ""; return ns ? ns.openExternal(url) : ""; }; - - var onLocal = function onLocal() { + var onLocal = function () { return root.open(url, "_system", "scrollbars=1,location=no"); }; - if (isElectron) { onElectron(); } else if (isNwjs) { onNwjs(); } else { var locProtocol = root.location.protocol || ""; - var hasHTTP = locProtocol - ? "http:" === locProtocol - ? "http" - : "https:" === locProtocol - ? "https" - : "" - : ""; - + var hasHTTP = locProtocol ? "http:" === locProtocol ? "http" : "https:" === locProtocol ? "https" : "" : ""; if (hasHTTP) { return true; } else { @@ -548,21 +401,21 @@ supportsSvgSmilAnimation, throttle*/ } } }; + /*! * setVisible */ - - root.setVisible = function(e) { + root.setVisible = function (e) { if (e) { e.style.visibility = "visible"; e.style.opacity = 1; } }; + /*! * removeElement */ - - root.removeElement = function(e) { + root.removeElement = function (e) { if (e) { if ("undefined" !== typeof e.remove) { return e.remove(); @@ -571,80 +424,61 @@ supportsSvgSmilAnimation, throttle*/ } } }; + /*! * manageExternalLinkAll */ - - root.manageExternalLinkAll = function() { + root.manageExternalLinkAll = function () { var link = document.getElementsByTagName("a") || ""; - - var arrange = function arrange(e) { - var handleLink = function handleLink(url, ev) { + var arrange = function (e) { + var handleLink = function (url, ev) { ev.stopPropagation(); ev.preventDefault(); - - var logic = function logic() { + var logic = function () { openDeviceBrowser(url); }; - debounce(logic, 200).call(root); }; - var externalLinkIsBindedClass = "external-link--is-binded"; - if (!hasClass(e, externalLinkIsBindedClass)) { var url = e.getAttribute("href") || ""; - - if ( - url && - parseLink(url).isCrossDomain && - parseLink(url).hasHTTP - ) { - e.title = - "" + - (parseLink(url).hostname || "") + - " откроется в новой вкладке"; - + if (url && parseLink(url).isCrossDomain && parseLink(url).hasHTTP) { + e.title = "" + (parseLink(url).hostname || "") + " откроется в новой вкладке"; if (root.getHTTP && root.getHTTP()) { e.target = "_blank"; e.rel = "noopener"; } else { addListener(e, "click", handleLink.bind(null, url)); } - addClass(e, externalLinkIsBindedClass); } } }; - if (link) { - var i, l; - + var i, + l; for (i = 0, l = link.length; i < l; i += 1) { arrange(link[i]); } - i = l = null; } }; + /*! * manageDataSrcImgAll * @see {@link https://github.com/verlok/lazyload} */ - root.dataSrcImgClass = "data-src-img"; - root.lazyLoadDataSrcImgInstance = null; - root.manageDataSrcImgAll = function(callback) { - var cb = function cb() { + root.lazyLoadDataSrcImgInstance = null; + root.manageDataSrcImgAll = function (callback) { + var cb = function () { return callback && "function" === typeof callback && callback(); }; - var isActiveClass = "is-active"; var dataSrcImgIsBindedClass = "data-src-img--is-binded"; var images = getByClass(document, dataSrcImgClass) || ""; var i = images.length; - while (i--) { if (!hasClass(images[i], dataSrcImgIsBindedClass)) { addClass(images[i], dataSrcImgIsBindedClass); @@ -652,37 +486,32 @@ supportsSvgSmilAnimation, throttle*/ addListener(images[i], "load", cb); } } - i = null; - if (root.LazyLoad) { if (root.lazyLoadDataSrcImgInstance) { root.lazyLoadDataSrcImgInstance.destroy(); } - root.lazyLoadDataSrcImgInstance = new LazyLoad({ - elements_selector: "." + dataSrcImgClass - }); + elements_selector: "." + dataSrcImgClass + }); } }; + /*! * manageDataSrcIframeAll * @see {@link https://github.com/verlok/lazyload} */ - root.dataSrcIframeClass = "data-src-iframe"; - root.lazyLoadDataSrcIframeInstance = null; - root.manageDataSrcIframeAll = function(callback) { - var cb = function cb() { + root.lazyLoadDataSrcIframeInstance = null; + root.manageDataSrcIframeAll = function (callback) { + var cb = function () { return callback && "function" === typeof callback && callback(); }; - var isActiveClass = "is-active"; var dataSrcIframeIsBindedClass = "data-src-iframe--is-binded"; var iframes = getByClass(document, dataSrcIframeClass) || ""; var i = iframes.length; - while (i--) { if (!hasClass(iframes[i], dataSrcIframeIsBindedClass)) { addClass(iframes[i], dataSrcIframeIsBindedClass); @@ -696,114 +525,106 @@ supportsSvgSmilAnimation, throttle*/ iframes[i].setAttribute("allowfullscreen", "true"); } } - i = null; - if (root.LazyLoad) { if (root.lazyLoadDataSrcIframeInstance) { root.lazyLoadDataSrcIframeInstance.destroy(); } - root.lazyLoadDataSrcIframeInstance = new LazyLoad({ - elements_selector: "." + dataSrcIframeClass - }); + elements_selector: "." + dataSrcIframeClass + }); } }; + /*! * manageImgLightbox * @see {@link https://github.com/englishextra/img-lightbox} */ - - root.manageImgLightbox = function() { + root.manageImgLightbox = function () { var imgLightboxLinkClass = "img-lightbox-link"; var link = getByClass(document, imgLightboxLinkClass) || ""; - - var initScript = function initScript() { + var initScript = function () { imgLightbox(imgLightboxLinkClass, { - onLoaded: function onLoaded() { + onLoaded: function () { LoadingSpinner.hide(); }, - onClosed: function onClosed() { + onClosed: function () { LoadingSpinner.hide(); }, - onCreated: function onCreated() { + onCreated: function () { LoadingSpinner.show(); }, touch: false }); }; - if (root.imgLightbox && link) { initScript(); } }; + /*! * manageIframeLightbox * @see {@link https://github.com/englishextra/iframe-lightbox} */ - - root.manageIframeLightbox = function() { + root.manageIframeLightbox = function () { var link = getByClass(document, "iframe-lightbox-link") || ""; - - var initScript = function initScript() { - var arrange = function arrange(e) { + var initScript = function () { + var arrange = function (e) { e.lightbox = new IframeLightbox(e, { - onLoaded: function onLoaded() { - LoadingSpinner.hide(); - }, - onClosed: function onClosed() { - LoadingSpinner.hide(); - }, - onOpened: function onOpened() { - LoadingSpinner.show(); - }, - touch: false - }); + onLoaded: function () { + LoadingSpinner.hide(); + }, + onClosed: function () { + LoadingSpinner.hide(); + }, + onOpened: function () { + LoadingSpinner.show(); + }, + touch: false + }); }; - - var i, l; - + var i, + l; for (i = 0, l = link.length; i < l; i += 1) { arrange(link[i]); } - i = l = null; }; - if (root.IframeLightbox && link) { initScript(); } }; + /*! * Macy */ - root.macyClass = "macy"; + root.macyItemIsBindedClass = "macy__item--is-binded"; + root.macyIsActiveClass = "macy--is-active"; + root.macyInstance = null; - var updateMacy = function updateMacy(delay) { + var updateMacy = function (delay) { var timeout = delay || 100; var logThis; - - logThis = function logThis() { + logThis = function () { console.log("updateMacy"); }; - if (root.macyInstance) { - var timer = setTimeout(function() { - clearTimeout(timer); - timer = null; - logThis(); - root.macyInstance.recalculate(true, true); - }, timeout); + var timer = setTimeout(function () { + clearTimeout(timer); + timer = null; + logThis(); + root.macyInstance.recalculate(true, true); + }, timeout); } }; var updateMacyThrottled = throttle(updateMacy, 1000); - var initMacy = function initMacy(macyClass, options) { + var initMacy = function (macyClass, options) { var defaultSettings = { /* container: ".macy", */ trueOrder: false, @@ -822,29 +643,21 @@ supportsSvgSmilAnimation, throttle*/ var settings = options || {}; settings.container = "." + macyClass; var opt; - for (opt in defaultSettings) { - if ( - defaultSettings.hasOwnProperty(opt) && - !settings.hasOwnProperty(opt) - ) { + if (defaultSettings.hasOwnProperty(opt) && !settings.hasOwnProperty(opt)) { settings[opt] = defaultSettings[opt]; } } - opt = null; var macy = getByClass(document, macyClass)[0] || ""; - if (macy) { try { if (root.macyInstance) { root.macyInstance.remove(); root.macyInstance = null; } - root.macyInstance = new Macy(settings); /* this will be set later after rendering all macy items */ - /* addClass(macy, macyIsActiveClass); */ } catch (err) { throw new Error("cannot init Macy " + err); @@ -852,9 +665,8 @@ supportsSvgSmilAnimation, throttle*/ } }; - var manageMacy = function manageMacy(macyClass, options) { + var manageMacy = function (macyClass, options) { var macy = getByClass(document, macyClass)[0] || ""; - if (root.Macy && macy) { if (!hasClass(macy, macyIsActiveClass)) { initMacy(macyClass, options); @@ -866,127 +678,91 @@ supportsSvgSmilAnimation, throttle*/ root.updateMacyThrottled = updateMacyThrottled; root.manageMacy = manageMacy; - root.onMacyImagesLoaded = function(macy, callback) { - var cb = function cb() { + root.onMacyImagesLoaded = function (macy, callback) { + var cb = function () { return callback && "function" === typeof callback && callback(); }; - var img = macy.getElementsByTagName("img") || ""; var imgLength = img.length || 0; var imgCounter = 0; var onLoad; var onError; - - var addListeners = function addListeners(e) { + var addListeners = function (e) { addListener(e, "load", onLoad, false); addListener(e, "error", onError, false); }; - - var removeListeners = function removeListeners(e) { + var removeListeners = function (e) { removeListener(e, "load", onLoad, false); removeListener(e, "error", onError, false); }; - - onLoad = function onLoad() { + onLoad = function () { removeListeners(this); imgCounter++; - if (imgCounter === imgLength) { cb(); - console.log( - "onMacyImagesLoaded: loaded " + imgCounter + " images" - ); + console.log("onMacyImagesLoaded: loaded " + imgCounter + " images"); } }; - - onError = function onError() { + onError = function () { removeListeners(this); - console.log( - "onMacyImagesLoaded: failed to load image: " + this.src - ); + console.log("onMacyImagesLoaded: failed to load image: " + this.src); }; - if (img) { - var i, l; - + var i, + l; for (i = 0, l = img.length; i < l; i += 1) { addListeners(img[i]); } - i = l = null; } }; - root.manageMacyItemAll = function(macy) { + root.manageMacyItemAll = function (macy) { try { - var macyItems = macy - ? macy.children || - macy.querySelectorAll("." + macyClass + " > *") || - "" - : ""; + var macyItems = macy ? (macy.children || macy.querySelectorAll("." + macyClass + " > *") || "") : ""; var anyResizeEventIsBindedClass = "any-resize-event--is-binded"; - if (macyItems) { - var i, l; - + var i, + l; for (i = 0, l = macyItems.length; i < l; i += 1) { if (!hasClass(macyItems[i], anyResizeEventIsBindedClass)) { addClass(macyItems[i], anyResizeEventIsBindedClass); - addListener( - macyItems[i], - "onresize", - updateMacyThrottled, - { - passive: true - } - ); + addListener(macyItems[i], "onresize", updateMacyThrottled, {passive: true}); } } - i = l = null; } } catch (err) { throw new Error("cannot manageMacyItemAll " + err); } }; + /*! * renderAC */ - - root.renderAC = function( - acGrid, - cardObj, - renderOptions, - onExecute, - callback - ) { + root.renderAC = function (acGrid, cardObj, renderOptions, onExecute, callback) { if (root.AdaptiveCards && acGrid) { var adaptiveCard = new AdaptiveCards.AdaptiveCard(); - adaptiveCard.hostConfig = new AdaptiveCards.HostConfig( - renderOptions - ); + adaptiveCard.hostConfig = new AdaptiveCards.HostConfig(renderOptions); adaptiveCard.onExecuteAction = onExecute; adaptiveCard.parse(cardObj); var renderedCard = adaptiveCard.render(); acGrid.appendChild(renderedCard); - if (callback && "function" === typeof callback) { callback(); } - adaptiveCard = renderedCard = null; } }; + /*! * manageReadMore */ - - root.manageReadMore = function(callback, options) { - var cb = function cb() { + root.manageReadMore = function (callback, options) { + var cb = function () { return callback && "function" === typeof callback && callback(); }; - - var initScript = function initScript() { + var initScript = function () { var defaultSettings = { target: ".dummy", numOfWords: 10, @@ -998,286 +774,234 @@ supportsSvgSmilAnimation, throttle*/ }; var settings = options || {}; var opt; - for (opt in defaultSettings) { - if ( - defaultSettings.hasOwnProperty(opt) && - !settings.hasOwnProperty(opt) - ) { + if (defaultSettings.hasOwnProperty(opt) && !settings.hasOwnProperty(opt)) { settings[opt] = defaultSettings[opt]; } } - opt = null; $readMoreJS.init(settings); var rmLink = getByClass(document, "rm-link") || ""; - - var arrange = function arrange(e) { + var arrange = function (e) { var rmLinkIsBindedClass = "rm-link--is-binded"; - if (!hasClass(e, rmLinkIsBindedClass)) { addClass(e, rmLinkIsBindedClass); addListener(e, "click", cb); } }; - - var i, l; - + var i, + l; for (i = 0, l = rmLink.length; i < l; i += 1) { arrange(rmLink[i]); } - i = l = null; }; - if (root.$readMoreJS) { initScript(); } }; + /*! * UWP layout */ - - var setUWPBody = function setUWPBody(attrName, attrValue) { + var setUWPBody = function (attrName, attrValue) { document.body.setAttribute(attrName, attrValue); }; - - var getUWPButtons = function getUWPButtons() { + var getUWPButtons = function () { var container = getByClass(document, "layout-type-buttons")[0] || ""; - return container ? container.getElementsByTagName("button") || "" : ""; + return container ? (container.getElementsByTagName("button") || "") : ""; }; - - root.layoutTypeToTabs = function(e) { + root.layoutTypeToTabs = function (e) { var ev = root.event || e; ev.preventDefault(); - Array.prototype.slice.call(getUWPButtons()).forEach(function(el) { + Array.prototype.slice.call(getUWPButtons()).forEach(function (el) { return (el.disabled = false); }); ev.target.disabled = true; setUWPBody("data-layout-type", "tabs"); }; - - root.layoutTypeToOverlay = function(e) { + root.layoutTypeToOverlay = function (e) { var ev = root.event || e; ev.preventDefault(); - Array.prototype.slice.call(getUWPButtons()).forEach(function(el) { + Array.prototype.slice.call(getUWPButtons()).forEach(function (el) { return (el.disabled = false); }); ev.target.disabled = true; setUWPBody("data-layout-type", "overlay"); }; - - root.layoutTypeToDockedMinimized = function(e) { + root.layoutTypeToDockedMinimized = function (e) { var ev = root.event || e; ev.preventDefault(); - Array.prototype.slice.call(getUWPButtons()).forEach(function(el) { + Array.prototype.slice.call(getUWPButtons()).forEach(function (el) { return (el.disabled = false); }); ev.target.disabled = true; setUWPBody("data-layout-type", "docked-minimized"); }; - - root.layoutTypeToDocked = function(e) { + root.layoutTypeToDocked = function (e) { var ev = root.event || e; ev.preventDefault(); - Array.prototype.slice.call(getUWPButtons()).forEach(function(el) { + Array.prototype.slice.call(getUWPButtons()).forEach(function (el) { return (el.disabled = false); }); ev.target.disabled = true; setUWPBody("data-layout-type", "docked"); }; + /*! * revealYandexMap */ - - root.revealYandexMap = function(_this) { - var yandexMap = - document.getElementsByClassName("yandex-map-iframe")[0] || ""; + root.revealYandexMap = function (_this) { + var yandexMap = document.getElementsByClassName("yandex-map-iframe")[0] || ""; var isActiveClass = "is-active"; - if (yandexMap) { yandexMap.src = yandexMap.dataset.src; addClass(yandexMap, isActiveClass); - if (_this.parentNode.parentNode !== null) { _this.parentNode.parentNode.removeChild(_this.parentNode); } } }; + /*! * LoadingSpinner */ - - root.LoadingSpinner = (function() { + root.LoadingSpinner = (function () { var uwpLoading = getByClass(document, "uwp-loading")[0] || ""; var isActiveClass = "is-active"; - if (!uwpLoading) { return; } - return { - hide: function hide() { + hide: function () { removeClass(uwpLoading, isActiveClass); }, - show: function show() { + show: function () { addClass(uwpLoading, isActiveClass); } }; })(); + /*! * modified loadExt * @see {@link https://gist.github.com/englishextra/ff9dc7ab002312568742861cb80865c9} * passes jshint */ - - root.loadJsCss = function(files, callback, type) { + root.loadJsCss = function (files, callback, type) { var _this = this; - _this.files = files; _this.js = []; _this.head = document.getElementsByTagName("head")[0] || ""; _this.body = document.body || ""; _this.ref = document.getElementsByTagName("script")[0] || ""; - - _this.callback = callback || function() {}; - + _this.callback = callback || function () {}; _this.type = type ? type.toLowerCase() : ""; - - _this.loadStyle = function(file) { + _this.loadStyle = function (file) { var link = document.createElement("link"); link.rel = "stylesheet"; link.type = "text/css"; link.href = file; link.media = "only x"; - - link.onload = function() { + link.onload = function () { this.onload = null; this.media = "all"; }; - link.setAttribute("property", "stylesheet"); /* _this.head.appendChild(link); */ - (_this.body || _this.head).appendChild(link); }; - - _this.loadScript = function(i) { + _this.loadScript = function (i) { var script = document.createElement("script"); script.type = "text/javascript"; script.async = true; script.src = _this.js[i]; - - var loadNextScript = function loadNextScript() { + var loadNextScript = function () { if (++i < _this.js.length) { _this.loadScript(i); } else { _this.callback(); } }; - - script.onload = function() { + script.onload = function () { loadNextScript(); }; - _this.head.appendChild(script); /* if (_this.ref.parentNode) { - _this.ref.parentNode[insertBefore](script, _this.ref); - } else { - (_this.body || _this.head).appendChild(script); - } */ - + _this.ref.parentNode[insertBefore](script, _this.ref); + } else { + (_this.body || _this.head).appendChild(script); + } */ (_this.body || _this.head).appendChild(script); }; - - var i, l; - + var i, + l; for (i = 0, l = _this.files.length; i < l; i += 1) { - if (/\.js$|\.js\?/.test(_this.files[i]) || _this.type === "js") { + if ((/\.js$|\.js\?/).test(_this.files[i]) || _this.type === "js") { _this.js.push(_this.files[i]); } - - if ( - /\.css$|\.css\?|\/css\?/.test(_this.files[i]) || - _this.type === "css" - ) { + if ((/\.css$|\.css\?|\/css\?/).test(_this.files[i]) || _this.type === "css") { _this.loadStyle(_this.files[i]); } } - i = l = null; - if (_this.js.length > 0) { _this.loadScript(0); } else { _this.callback(); } }; + /*! * loadDeferred */ - - root.loadDeferred = function(urlArray, callback) { + root.loadDeferred = function (urlArray, callback) { var timer; - - var handle = function handle() { + var handle = function () { clearTimeout(timer); timer = null; var load; load = new loadJsCss(urlArray, callback); }; - var req; - - var raf = function raf() { + var raf = function () { cancelAnimationFrame(req); timer = setTimeout(handle, 0); }; - if (root.requestAnimationFrame) { req = requestAnimationFrame(raf); } else { addListener(root, "load", handle); } }; + /*! * early utility classes */ - - root.earlyDeviceFormfactor = (function(selectors) { + root.earlyDeviceFormfactor = (function (selectors) { var orientation; var size; - - var addClasses = function addClasses(e) { + var addClasses = function (e) { var classesList = e.split(" "); - if (selectors) { var i; - for (i = 0; i < classesList.length; i += 1) { e = classesList[i]; selectors.add(e); } - i = null; } }; - - var removeClasses = function removeClasses(e) { + var removeClasses = function (e) { var classesList = e.split(" "); - if (selectors) { var i; - for (i = 0; i < classesList.length; i += 1) { e = classesList[i]; selectors.remove(e); } - i = null; } }; - var orientationMq = { landscape: "all and (orientation:landscape)", portrait: "all and (orientation:portrait)" @@ -1289,12 +1013,8 @@ supportsSvgSmilAnimation, throttle*/ }; var matchMedia = "matchMedia"; var matches = "matches"; - - var toggleOrientationClasses = function toggleOrientationClasses( - mqList, - classText - ) { - var handleMq = function handleMq(mqList) { + var toggleOrientationClasses = function (mqList, classText) { + var handleMq = function (mqList) { if (mqList[matches]) { addClasses(classText); orientation = classText; @@ -1302,13 +1022,11 @@ supportsSvgSmilAnimation, throttle*/ removeClasses(classText); } }; - handleMq(mqList); mqList.addListener(handleMq); }; - - var toggleSizeClasses = function toggleSizeClasses(mqList, classText) { - var handleMq = function handleMq(mqList) { + var toggleSizeClasses = function (mqList, classText) { + var handleMq = function (mqList) { if (mqList[matches]) { addClasses(classText); size = classText; @@ -1316,28 +1034,20 @@ supportsSvgSmilAnimation, throttle*/ removeClasses(classText); } }; - handleMq(mqList); mqList.addListener(handleMq); }; - var key; - for (key in orientationMq) { if (orientationMq.hasOwnProperty(key)) { - toggleOrientationClasses( - root[matchMedia](orientationMq[key]), - key - ); + toggleOrientationClasses(root[matchMedia](orientationMq[key]), key); } } - for (key in sizeMq) { if (sizeMq.hasOwnProperty(key)) { toggleSizeClasses(root[matchMedia](sizeMq[key]), key); } } - key = null; return { orientation: orientation || "", @@ -1345,51 +1055,29 @@ supportsSvgSmilAnimation, throttle*/ }; })(document.documentElement.classList || ""); - root.earlyDeviceType = (function(mobile, desktop, opera) { - var selector = - /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test( - opera - ) || - /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test( - opera.substr(0, 4) - ) - ? mobile - : desktop; + root.earlyDeviceType = (function (mobile, desktop, opera) { + var selector = (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i).test(opera) || + (/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i).test(opera.substr(0, 4)) ? + mobile : + desktop; addClass(document.documentElement, selector); return selector; - })( - "mobile", - "desktop", - navigator.userAgent || navigator.vendor || root.opera - ); - - root.earlySvgSupport = (function(selector) { - selector = document.implementation.hasFeature( - "http://www.w3.org/2000/svg", - "1.1" - ) - ? selector - : "no-" + selector; + })("mobile", "desktop", navigator.userAgent || navigator.vendor || (root).opera); + + root.earlySvgSupport = (function (selector) { + selector = document.implementation.hasFeature("http://www.w3.org/2000/svg", "1.1") ? selector : "no-" + selector; addClass(document.documentElement, selector); return selector; })("svg"); - root.earlySvgasimgSupport = (function(selector) { - selector = document.implementation.hasFeature( - "http://www.w3.org/TR/SVG11/feature#Image", - "1.1" - ) - ? selector - : "no-" + selector; + root.earlySvgasimgSupport = (function (selector) { + selector = document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1") ? selector : "no-" + selector; addClass(document.documentElement, selector); return selector; })("svgasimg"); - root.earlyHasTouch = (function(selector) { - selector = - "ontouchstart" in document.documentElement - ? selector - : "no-" + selector; + root.earlyHasTouch = (function (selector) { + selector = "ontouchstart" in document.documentElement ? selector : "no-" + selector; addClass(document.documentElement, selector); return selector; })("touch"); @@ -1397,8 +1085,7 @@ supportsSvgSmilAnimation, throttle*/ /*! * app logic */ - -(function(root, document) { +(function (root, document) { "use strict"; var docElem = document.documentElement || ""; @@ -1408,61 +1095,50 @@ supportsSvgSmilAnimation, throttle*/ addClass(docElem, "svganimate"); } - var run = function run() { + var run = function () { + removeClass(docElem, "no-js"); addClass(docElem, "js"); - var userBrowser = - " [" + + + var userBrowser = " [" + (getHumanDate ? getHumanDate : "") + (earlyDeviceType ? " " + earlyDeviceType : "") + - (earlyDeviceFormfactor.orientation - ? " " + earlyDeviceFormfactor.orientation - : "") + - (earlyDeviceFormfactor.size - ? " " + earlyDeviceFormfactor.size - : "") + + (earlyDeviceFormfactor.orientation ? " " + earlyDeviceFormfactor.orientation : "") + + (earlyDeviceFormfactor.size ? " " + earlyDeviceFormfactor.size : "") + (earlySvgSupport ? " " + earlySvgSupport : "") + (earlySvgasimgSupport ? " " + earlySvgasimgSupport : "") + (earlyHasTouch ? " " + earlyHasTouch : "") + "]"; + var hashBang = "#/"; - var onPageLoad = function onPageLoad() { + var onPageLoad = function () { if (document.title) { document.title = document.title + userBrowser; } - - var hashName = root.location.hash - ? root.location.hash.split(hashBang)[1] - : ""; - var routes = [ - { - hash: "", - fn: runHome - }, - { - hash: "home", - fn: runHome - }, - { - hash: "works", - fn: runWorks - }, - { - hash: "pictures", - fn: runPictures - }, - { - hash: "gallery", - fn: runGallery - }, - { - hash: "about", - fn: runAbout + var hashName = root.location.hash ? root.location.hash.split(hashBang)[1] : ""; + var routes = [{ + "hash": "", + "fn": runHome + }, { + "hash": "home", + "fn": runHome + }, { + "hash": "works", + "fn": runWorks + }, { + "hash": "pictures", + "fn": runPictures + }, { + "hash": "gallery", + "fn": runGallery + }, { + "hash": "about", + "fn": runAbout } ]; - var i, l; - + var i, + l; for (i = 0, l = routes.length; i < l; i += 1) { if (hashName === routes[i].hash) { if ("function" === typeof routes[i].fn) { @@ -1471,7 +1147,6 @@ supportsSvgSmilAnimation, throttle*/ } } } - i = l = null; }; @@ -1495,54 +1170,46 @@ supportsSvgSmilAnimation, throttle*/ }); } - var switchLayoutType = function switchLayoutType() { - var arrange = function arrange(mqString, callback) { - var handleMq = function handleMq(x) { + var switchLayoutType = function () { + + var arrange = function (mqString, callback) { + var handleMq = function (x) { if (x.matches) { if (callback && "function" === typeof callback) { callback(); } } }; - var mqList = root.matchMedia(mqString); handleMq(mqList); mqList.addListener(handleMq); }; - var onMatch = function onMatch(attrName, layoutType) { + var onMatch = function (attrName, layoutType) { docBody.setAttribute(attrName, layoutType); }; - var mqItems = [ - { + var mqItems = [{ val: "(max-width: 639px)", fn: onMatch.bind(null, "data-layout-type", "overlay") - }, - { + }, { val: "(min-width: 640px) and (max-width: 1023px)", fn: onMatch.bind(null, "data-layout-type", "tabs") - }, - { + }, { val: "(min-width: 1024px)", - fn: onMatch.bind( - null, - "data-layout-type", - "docked-minimized" - ) + fn: onMatch.bind(null, "data-layout-type", "docked-minimized") } ]; - var i, l; + var i, + l; for (i = 0, l = mqItems.length; i < l; i += 1) { if ("function" === typeof mqItems[i].fn) { arrange(mqItems[i].val, mqItems[i].fn); } } - i = l = null; }; - switchLayoutType(); }; @@ -1554,33 +1221,24 @@ supportsSvgSmilAnimation, throttle*/ scripts.push( "./libs/serguei-uwp/js/vendors.min.js", - "./libs/serguei-uwp/js/pages.min.js" - ); + "./libs/serguei-uwp/js/pages.min.js"); - var loadOnFontsReady = function loadOnFontsReady(bodyFontFamily, useCheck) { + var loadOnFontsReady = function (bodyFontFamily, useCheck) { var slot; - - var init = function init() { + var init = function () { clearInterval(slot); slot = null; - - if ( - !supportsSvgSmilAnimation && - "undefined" !== typeof progressBar - ) { + if (!supportsSvgSmilAnimation && "undefined" !== typeof progressBar) { progressBar.increase(20); } - var load; load = new loadJsCss(scripts, run); }; - - var check = function check() { + var check = function () { if (doesFontExist(bodyFontFamily)) { init(); } }; - if (useCheck && supportsCanvas) { slot = setInterval(check, 100); } else { @@ -1590,11 +1248,9 @@ supportsSvgSmilAnimation, throttle*/ }; var bodyFontFamily = "Roboto"; - loadDeferred( - [ + + loadDeferred([ "./libs/serguei-uwp/css/vendors.min.css", "./libs/serguei-uwp/css/pages.min.css" - ], - loadOnFontsReady.bind(null, bodyFontFamily, null) - ); + ], loadOnFontsReady.bind(null, bodyFontFamily, null)); })("undefined" !== typeof window ? window : this, document);