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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*!
2 * This file is part of help.eyeo.com.
3 * Copyright (C) 2017-present eyeo GmbH
4 *
5 * help.eyeo.com is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * help.eyeo.com is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with help.eyeo.com. If not, see <http://www.gnu.org/licenses/>.
17 */
18 !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.a ccordion=e;for(var t=this.accordion.getElementsByClassName("accordion-toggle-but ton"),o=0;o<t.length;o++)0!==o&&(t[o].setAttribute("aria-expanded","false"),docu ment.getElementById(t[o].getAttribute("aria-controls")).setAttribute("hidden","t rue"));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_BROW SERS=["chrome","opera","samsungBrowser","yandexbrowser","maxthon","msie","msedge ","firefox","ios","safari"],this.DEFAULT_BROWSER="chrome",this.select.addEventLi stener("click",this._onClickOrKeyDown.bind(this),!1),this.select.addEventListene r("keydown",this._onClickOrKeyDown.bind(this),!1);var o=localStorage.getItem(thi s.BROWSER_STORAGE_KEY);o?this.selectOption(o):this.detectBrowser()}document.docu mentElement.className="js";for(var s=document.getElementsByClassName("toggle-nav bar-collapse"),i=0;i<s.length;i++)s[i].addEventListener("click",e,!1);t.prototyp e._onFocusOut=function(){setTimeout(function(){var e=document.activeElement;e.cl assList.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.contai ns("custom-select-selected")){"true"==this.select.querySelector(".custom-select- options").getAttribute("aria-hidden")?this.open():this.close()}},t.prototype.ope n=function(){this.select.querySelector(".custom-select-selected").setAttribute(" aria-expanded","true"),this.select.querySelector(".custom-select-options").remov eAttribute("aria-hidden")},t.prototype.close=function(){this.select.querySelecto r(".custom-select-selected").setAttribute("aria-expanded","false"),this.select.q uerySelector(".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.setA ttribute("aria-expanded","false"),document.getElementById(t.getAttribute("aria-c ontrols")).setAttribute("hidden","true")),t!==e&&(e.setAttribute("aria-expanded" ,"true"),document.getElementById(e.getAttribute("aria-controls")).removeAttribut e("hidden"))},o.prototype.focusNextSection=function(){var e=document.activeEleme nt,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.prev iousElementSibling;t?t.previousElementSibling.firstElementChild.focus():this.acc ordion.lastElementChild.previousElementSibling.firstElementChild.focus()},o.prot otype._onKeyDown=function(e){e.target.classList.contains("accordion-toggle-butto n")&&("ArrowUp"==e.key||38==e.keyCode?this.focusPrevSection():"ArrowDown"!=e.key &&40!=e.keyCode||this.focusNextSection())},o.prototype._onClick=function(e){e.ta rget.classList.contains("accordion-toggle-button")&&this.toggleSection(e.target) };var c=document.getElementById("product-topics-accordion");c&&new o(c),n.protot ype=Object.create(t.prototype),n.prototype.constructor=n,n.prototype.detectBrows er=function(){for(var e=0;e<this.SUPPORTED_BROWSERS.length;e++){var t=this.SUPPO RTED_BROWSERS[e];if(bowser[t])return localStorage.setItem(this.BROWSER_AUTODETEC TED_STORAGE_KEY,"true"),this.selectOption(t)}this.selectOption(this.DEFAULT_BROW SER)},n.prototype.selectOption=function(e){localStorage.setItem(this.BROWSER_STO RAGE_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]);docume nt.body.classList.add("ua-"+e);var n=this.select.querySelector("[data-value='"+e +"']");n.setAttribute("aria-checked","true");var s=n.innerHTML;if(localStorage.g etItem(this.BROWSER_AUTODETECTED_STORAGE_KEY)){s+="<span class='muted'>("+docume nt.getElementById("browser-select-autodetected").innerHTML+")</span>"}this.selec t.querySelector(".custom-select-selected").innerHTML=s,document.querySelector(". platform-"+e)||this.handleNoContentForBrowser(e)},n.prototype.handleNoContentFor Browser=function(e){var t=document.createElement("section");t.classList.add("pla tform-"+e),t.innerHTML=document.getElementById("no-content-for-platform-message" ).innerHTML,document.querySelector(".article-body").insertAdjacentElement("after begin",t)},n.prototype._onClickOrKeyDown=function(e){var t=e.target.closest(".cu stom-select-option");if(t){var o="Enter"==e.key||13==e.keyCode;e.keyCode&&!o||(l ocalStorage.removeItem(this.BROWSER_AUTODETECTED_STORAGE_KEY),this.select.queryS elector("[aria-checked='true']").setAttribute("aria-checked","false"),this.selec tOption(t.getAttribute("data-value")),this.close())}};var r=document.getElementB yId("browser-select");r&&new n(r)},!1)}();
19 //# sourceMappingURL=main.min.js.map
OLDNEW
« 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