/*jslint es6 */ /*jslint white:true, for:true */ /*global window, document, console, setInterval, clearInterval, Cookies, $, fc, text_fr, text_en */ "use strict"; fc.qs=""; fc.parseQueryString=function(){ let qs=""; try { qs = document.location.href.split("?")[1].split("&"); } catch(e){ console.log(e); qs=""; } return(qs); }; fc.thisPage=1; fc.nextPage=2; fc.numPages=12; fc.getThisPage = function(){ let thisPage = 1; try { thisPage = Number(document.location.href.split("?")[1].split("&")[0].split("pp=")[1]); } catch(e){ console.log(e); thisPage = 1; } return thisPage; }; fc.getNumPages = function() { let numPages = Number(document.location.href.split("&pages=")[1]); return numPages; }; fc.getPage = function(p){ switch (p) { case 'previous': fc.nextPage = Number(fc.thisPage)-1; if(fc.nextPage < 1){ fc.nextPage = fc.numPages; } console.log("Getting: p"+fc.nextPage+".html?pp="+fc.nextPage+"&pages="+fc.numPages); document.location.href = "p"+fc.nextPage+".html?pp="+fc.nextPage+"&pages="+fc.numPages; break; case 'next': fc.nextPage = Number(fc.thisPage)+1; if(fc.nextPage>fc.numPages) { fc.nextPage = 1; } console.log("Getting: p"+fc.nextPage+".html?pp="+fc.nextPage+"&pages="+fc.numPages); document.location.href = "p"+fc.nextPage+".html?pp="+fc.nextPage+"&pages="+fc.numPages; break; } }; fc.langSwitch = function(l){ fc.movieGraphics.shutDown(); fc.movieGraphics.resetScreen(); let text_en=undefined; let text_fr=undefined; switch(Number(l)){ case 0: console.log('Switching to english'); Cookies.set('language', 'en'); text_en = document.getElementById("text_en").innerHTML.split("\n"); fc.movieGraphics.selectedArray = text_en; fc.movieGraphics.startScroller(); break; case 1: console.log('Passant au Français'); Cookies.set('language', 'fr'); text_fr = document.getElementById("text_fr").innerHTML.split("\n"); fc.movieGraphics.selectedArray = text_fr; fc.movieGraphics.startScroller(); break; } }; fc.navSelect = function(){ let navhd = document.getElementsByClassName("nav-hd"); let navsd = document.getElementsByClassName("nav-sd"); if(window.innerWidth < 480) { // Make HD invisible for(let i=0; i 480) { // Make HD visible for(let i=0; i