/*jslint es6 */ /*jslint white:true, for:true */ /*global window, document, console, Cookies, fc */ "use strict"; fc.runStartUp = function(){ if(document.location.href.indexOf("/index.html") > -1) { console.log("Welcome!"); fc.thisPage=0; } // We're on a page butr for some reason our qs has gone missing, invent something snazzy, truth is optional else if(document.location.href.indexOf("/p") > 1 && document.location.href.indexOf(".html") > 1 && document.location.href.indexOf("?") === -1) { fc.nextPage = Number(document.location.href.split("federicocontreras.com/p")[1].split(".html")[0]); document.location.href += "?pp="+fc.nextPage+"&pages="+fc.numPages; } else { fc.qs = fc.parseQueryString(); fc.thisPage = fc.getThisPage(); } // Use this file when you want fancy typewriting. // Otherwise just use lang-select.js, it does the language selection right away without typing. fc.movieGraphics.options.targetElement = "scrollingDisplay"; try { let text_en = document.getElementById("text_en").innerHTML.split("\n"); let text_fr = document.getElementById("text_fr").innerHTML.split("\n"); document.getElementById("text_en").style.display = 'none'; document.getElementById("text_fr").style.display = 'none'; let lng = Cookies.get('language'); if(!Cookies.get('language')){ Cookies.set('language', 'fr'); lng = Cookies.get('language'); } switch (lng) { case 'en': fc.movieGraphics.selectedArray = text_en; fc.movieGraphics.startScroller(); break; case 'fr': fc.movieGraphics.selectedArray = text_fr; fc.movieGraphics.startScroller(); break; } } catch(e){ // If we're here, this one doesn't have translatable text... fc.movieGraphics.shutDown(); fc.movieGraphics.resetScreen(); return; } };