Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: static/dist/js/main.min.js

Issue 29624561: Issue 6104 - Minified code in help center repository (Closed) Base URL: https://hg.adblockplus.org/help.eyeo.com
Patch Set: Move all requires to top of gulpfile.js Created Dec. 4, 2017, 2:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: static/dist/js/main.min.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/static/dist/js/main.min.js
@@ -0,0 +1,19 @@
+/*!
+ * This file is part of help.eyeo.com.
+ * Copyright (C) 2017-present eyeo GmbH
+ *
+ * help.eyeo.com is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * help.eyeo.com is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with help.eyeo.com. If not, see <http://www.gnu.org/licenses/>.
+ */
+!function(){document.addEventListener("DOMContentLoaded",function(){function e(){for(var e=this.parentElement.getElementsByClassName("navbar-collapse"),t=0;t<e.length;t++)e[t].classList.toggle("open")}function t(e){this.select=e,this.close(),this.select.addEventListener("click",this._onClick.bind(this),!1),this.select.addEventListener("focusout",this._onFocusOut.bind(this),!1)}function o(e){this.accordion=e;for(var t=this.accordion.getElementsByClassName("accordion-toggle-button"),o=0;o<t.length;o++)0!==o&&(t[o].setAttribute("aria-expanded","false"),document.getElementById(t[o].getAttribute("aria-controls")).setAttribute("hidden","true"));this.accordion.addEventListener("click",this._onClick.bind(this),!1),this.accordion.addEventListener("keydown",this._onKeyDown.bind(this),!1)}function n(e){this.select=e,t.apply(this,[this.select]),this.BROWSER_STORAGE_KEY="BROWSER",this.BROWSER_AUTODETECTED_STORAGE_KEY="BROWSER_AUTODETECTED",this.SUPPORTED_BROWSERS=["chrome","opera","samsungBrowser","yandexbrowser","maxthon","msie","msedge","firefox","ios","safari"],this.DEFAULT_BROWSER="chrome",this.select.addEventListener("click",this._onClickOrKeyDown.bind(this),!1),this.select.addEventListener("keydown",this._onClickOrKeyDown.bind(this),!1);var o=localStorage.getItem(this.BROWSER_STORAGE_KEY);o?this.selectOption(o):this.detectBrowser()}document.documentElement.className="js";for(var s=document.getElementsByClassName("toggle-navbar-collapse"),i=0;i<s.length;i++)s[i].addEventListener("click",e,!1);t.prototype._onFocusOut=function(){setTimeout(function(){var e=document.activeElement;e.classList.contains("custom-select-selected")||e.classList.contains("custom-select-option")||e.parentElement.classList.contains("custom-select-option")||this.close()}.bind(this),1)},t.prototype._onClick=function(e){if(e.target.classList.contains("custom-select-selected")){"true"==this.select.querySelector(".custom-select-options").getAttribute("aria-hidden")?this.open():this.close()}},t.prototype.open=function(){this.select.querySelector(".custom-select-selected").setAttribute("aria-expanded","true"),this.select.querySelector(".custom-select-options").removeAttribute("aria-hidden")},t.prototype.close=function(){this.select.querySelector(".custom-select-selected").setAttribute("aria-expanded","false"),this.select.querySelector(".custom-select-options").setAttribute("aria-hidden","true")},new t(document.getElementById("language-select")),o.prototype.toggleSection=function(e){var t=this.accordion.querySelector("button[aria-expanded='true']");t&&(t.setAttribute("aria-expanded","false"),document.getElementById(t.getAttribute("aria-controls")).setAttribute("hidden","true")),t!==e&&(e.setAttribute("aria-expanded","true"),document.getElementById(e.getAttribute("aria-controls")).removeAttribute("hidden"))},o.prototype.focusNextSection=function(){var e=document.activeElement,t=e.parentElement.nextElementSibling.nextElementSibling;t?t.firstElementChild.focus():this.accordion.firstElementChild.firstElementChild.focus()},o.prototype.focusPrevSection=function(){var e=document.activeElement,t=e.parentElement.previousElementSibling;t?t.previousElementSibling.firstElementChild.focus():this.accordion.lastElementChild.previousElementSibling.firstElementChild.focus()},o.prototype._onKeyDown=function(e){e.target.classList.contains("accordion-toggle-button")&&("ArrowUp"==e.key||38==e.keyCode?this.focusPrevSection():"ArrowDown"!=e.key&&40!=e.keyCode||this.focusNextSection())},o.prototype._onClick=function(e){e.target.classList.contains("accordion-toggle-button")&&this.toggleSection(e.target)};var c=document.getElementById("product-topics-accordion");c&&new o(c),n.prototype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.detectBrowser=function(){for(var e=0;e<this.SUPPORTED_BROWSERS.length;e++){var t=this.SUPPORTED_BROWSERS[e];if(bowser[t])return localStorage.setItem(this.BROWSER_AUTODETECTED_STORAGE_KEY,"true"),this.selectOption(t)}this.selectOption(this.DEFAULT_BROWSER)},n.prototype.selectOption=function(e){localStorage.setItem(this.BROWSER_STORAGE_KEY,e);for(var t=Array.prototype.slice.call(document.body.classList),o=0;o<t.length;o++)t[o].indexOf("ua-")>-1&&document.body.classList.remove(t[o]);document.body.classList.add("ua-"+e);var n=this.select.querySelector("[data-value='"+e+"']");n.setAttribute("aria-checked","true");var s=n.innerHTML;if(localStorage.getItem(this.BROWSER_AUTODETECTED_STORAGE_KEY)){s+="<span class='muted'>("+document.getElementById("browser-select-autodetected").innerHTML+")</span>"}this.select.querySelector(".custom-select-selected").innerHTML=s,document.querySelector(".platform-"+e)||this.handleNoContentForBrowser(e)},n.prototype.handleNoContentForBrowser=function(e){var t=document.createElement("section");t.classList.add("platform-"+e),t.innerHTML=document.getElementById("no-content-for-platform-message").innerHTML,document.querySelector(".article-body").insertAdjacentElement("afterbegin",t)},n.prototype._onClickOrKeyDown=function(e){var t=e.target.closest(".custom-select-option");if(t){var o="Enter"==e.key||13==e.keyCode;e.keyCode&&!o||(localStorage.removeItem(this.BROWSER_AUTODETECTED_STORAGE_KEY),this.select.querySelector("[aria-checked='true']").setAttribute("aria-checked","false"),this.selectOption(t.getAttribute("data-value")),this.close())}};var r=document.getElementById("browser-select");r&&new n(r)},!1)}();
+//# sourceMappingURL=main.min.js.map
« gulpfile.js ('K') | « static/dist/js/main.js.map ('k') | static/dist/js/main.min.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld