// JavaScript Document
const mytitle = " VOYAGE À NEW YORK ";
const mysubtitle = "Cours INF-5075-2: Photoshop";
const copywrite = "© 2018 Patric Fontaine";
const footerLeft = "Index des contenus";
const footerCenter = "Information sur la SA";
const footerRight = "ENG | Patric Fontaine 2019 — Licence Creative Commons BY-NC";
/*jshint multistr: true */
const myfooter = '\
\
\
\
';
function gotoLink(mylink){
location.href = mylink;
}
function storeValues(lbl,answ)
{
localStorage.setItem(lbl, answ);
return true;
}
function storeValuesEdge(lbl, setmyVariable) {
storeValues(lbl, setmyVariable)
}
function showArticle(hide, show, goto) { // FadeIn - FadeOut the articles
var box1 = document.getElementById(hide);
var box2 = document.getElementById(show);
box1.addEventListener("transitionend", function() {
box1.style.display = "none";
box2.style.opacity = "1";
if(typeof goto !== "undefined"){
location.href = goto;
}
}, false);
box1.style.opacity = "0";
box2.classList.toggle("articleShow");
box2.style.display = "block";
}
function fadeIn(Art) { // Function to FadeIn the article Title bar
var box = document.getElementById(Art);
box.addEventListener("transitionend", function() {
// location.href = "#top";
}, false);
// setTimeout(ChangeDisplay, 2000);
setTimeout(ChangeDisplay, 500);
function ChangeDisplay() {
box.style.display = "block";
// setTimeout(ChangeOpacity, 1000);
setTimeout(ChangeOpacity, 250);
}
function ChangeOpacity() {
box.style.opacity = "1";
}
}
function slideText(slideout,slidein) {
$(slideout).slideUp(500);
$(slidein).slideDown(500);
}
function loadAnswers(qu) {
let str = localStorage.getItem(qu);
str = str.replace(/(\n)+/g, '
');
document.getElementById(qu).innerHTML = str;
}
function loadAnswerIfSet(targ,qu) {
if (localStorage.getItem(qu) !== null) {
document.getElementById(targ).value = localStorage.getItem(qu);
}
}
// fonction to resize left and right borders to match container height
jQuery(document).ready(function($){
// Get the height of our container
const container_height = $('.container').height();
// Set target DIVs height to container height
$("#leftborder, #rightborder").height(container_height);
});
$( window ).resize(function() {
// Get the height of our container
const container_height = $('.container').height();
// Set target DIVs height to container height
$("#leftborder, #rightborder").height(container_height);
});
function checkrequired(val, question, hideArt, showArt) {
const answ = val;
if (answ !== "") {
storeValues(question, val);
slideText(hideArt, showArt);
}
}
document.addEventListener("DOMContentLoaded", function(event) {
function checkValidationAnswers(par1, par2, par3, par4, par5) {
var thisAnsw1 = localStorage.getItem(par1);
var thisAnsw2 = localStorage.getItem(par2);
var thisAnsw3 = localStorage.getItem(par3);
var thisAnsw4 = localStorage.getItem(par4);
var thisAnsw5 = localStorage.getItem(par5);
if (thisAnsw1 == 5 || thisAnsw2 == 5 || thisAnsw3 == 5 || thisAnsw4 == 5 || thisAnsw5 == 5 || thisAnsw1 == 4 || thisAnsw2 == 4 || thisAnsw3 == 4 || thisAnsw4 == 4 || thisAnsw5 == 4) {
var thisText = "Tu sembles avoir de la difficulté. Peut-être devrais-tu revoir les notions avec lesquellles tu as de la difficulté avant de poursuivre.";
} else {
var thisText = "Excellent! Passons maintenant à la prochaine étape.";
}
document.getElementById("ValidationFeedback").innerHTML = thisText;
}
});