hugosoucycc

[ARCHIVED] Another old source code of <hugo.soucy.cc>.
Log | Files | Refs | Submodules

commit 793f9d9ba8e6dd0babdd2a15a7772df3e3a5101a
parent ca70559eb0de467419bec4667d3f7ab3954c5e71
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Wed, 27 Sep 2017 11:05:42 -0400

Autogenerate JSs

Diffstat:
Mstatic/prod/js/script.js | 6++++++
Mstatic/prod/js/script.min.js | 2+-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/static/prod/js/script.js b/static/prod/js/script.js @@ -445,6 +445,12 @@ function setNavigation() { $nav_close.focus(); } ); + + du.setEvent( + $nav_panel, 'focus', function() { + $nav_button.focus(); + } + ); } } diff --git a/static/prod/js/script.min.js b/static/prod/js/script.min.js @@ -28,5 +28,5 @@ function triggerEvent(el,eventType){if(document.createEvent){var event=document. function triggerCustomEvent(el,eventType,eventData){var customEvent;if(window.CustomEvent){customEvent=new CustomEvent(eventType,{detail:eventData});}else{customEvent=document.createEvent('CustomEvent');customEvent.initCustomEvent(eventType,true,true,eventData);} el.dispatchEvent(customEvent);} function isElementInViewport(el){var elRect=el.getBoundingClientRect();return(elRect.top>=0&&elRect.left>=0&&elRect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&elRect.right<=(window.innerWidth||document.documentElement.clientWidth));} -return{doExtend:doExtend,queryAll:queryAll,setAttrs:setAttrs,setEvent:setEvent,setEventList:setEventList,getIndex:getIndex,getClosest:getClosest,getHeight:getHeight,setClass:setClass,unsetClass:unsetClass,hasClass:hasClass,toggleClass:toggleClass,setDebounce:setDebounce,setThrottle:setThrottle,isElement:isElement,isObject:isObject,triggerEvent:triggerEvent,triggerCustomEvent:triggerCustomEvent,isElementInViewport:isElementInViewport};})(window);function setNavigation(){'use strict';var $nav=document.querySelector('.nav');var visible='state--visible';var hidden='state--hidden';var $nav_panel;var $nav_button;var $nav_close;if(du.isElement($nav)){$nav_panel=$nav.querySelector('.nav__panel');document.body.insertAdjacentHTML('afterbegin',document.querySelector('#navButtonTpl').innerHTML);$nav_panel.insertAdjacentHTML('afterbegin',document.querySelector('#navCloseTpl').innerHTML);$nav_panel.insertAdjacentHTML('afterbegin',document.querySelector('#navTrapTpl').innerHTML);$nav_panel.insertAdjacentHTML('beforeend',document.querySelector('#navTrapTpl').innerHTML);$nav_button=document.querySelector('.nav-button');$nav_close=$nav_panel.querySelector('.nav__close');du.setClass($nav_panel,hidden);du.setEvent($nav_button,'click',function(thatEvt){thatEvt.preventDefault();du.toggleClass($nav_panel,hidden);du.toggleClass($nav_panel,visible);$nav_close.focus();});du.setEvent($nav_close,'click',function(thatEvt){thatEvt.preventDefault();du.toggleClass($nav_panel,hidden);du.toggleClass($nav_panel,visible);$nav_button.focus();});du.setEventList($nav_panel.querySelectorAll('.nav__trap'),'focus',function(){$nav_close.focus();});}} +return{doExtend:doExtend,queryAll:queryAll,setAttrs:setAttrs,setEvent:setEvent,setEventList:setEventList,getIndex:getIndex,getClosest:getClosest,getHeight:getHeight,setClass:setClass,unsetClass:unsetClass,hasClass:hasClass,toggleClass:toggleClass,setDebounce:setDebounce,setThrottle:setThrottle,isElement:isElement,isObject:isObject,triggerEvent:triggerEvent,triggerCustomEvent:triggerCustomEvent,isElementInViewport:isElementInViewport};})(window);function setNavigation(){'use strict';var $nav=document.querySelector('.nav');var visible='state--visible';var hidden='state--hidden';var $nav_panel;var $nav_button;var $nav_close;if(du.isElement($nav)){$nav_panel=$nav.querySelector('.nav__panel');document.body.insertAdjacentHTML('afterbegin',document.querySelector('#navButtonTpl').innerHTML);$nav_panel.insertAdjacentHTML('afterbegin',document.querySelector('#navCloseTpl').innerHTML);$nav_panel.insertAdjacentHTML('afterbegin',document.querySelector('#navTrapTpl').innerHTML);$nav_panel.insertAdjacentHTML('beforeend',document.querySelector('#navTrapTpl').innerHTML);$nav_button=document.querySelector('.nav-button');$nav_close=$nav_panel.querySelector('.nav__close');du.setClass($nav_panel,hidden);du.setEvent($nav_button,'click',function(thatEvt){thatEvt.preventDefault();du.toggleClass($nav_panel,hidden);du.toggleClass($nav_panel,visible);$nav_close.focus();});du.setEvent($nav_close,'click',function(thatEvt){thatEvt.preventDefault();du.toggleClass($nav_panel,hidden);du.toggleClass($nav_panel,visible);$nav_button.focus();});du.setEventList($nav_panel.querySelectorAll('.nav__trap'),'focus',function(){$nav_close.focus();});du.setEvent($nav_panel,'focus',function(){$nav_button.focus();});}} setNavigation(); \ No newline at end of file