Les Soulèvements de la Terre. Appel à reprendre les terres et à bloquer les industries qui les dévorent.
Collectif
function msgPostTittleFR() {
var msgPostTittle = [{
href: "https://www.linternationaledessavoirspourtous.org/p/la-science-pour-le-plus-grand-nombre.html",
tittle: "La science pour le plus grand nombre, pas pour l'argent"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/qui-sommes-nous.html",
tittle: "Qui sommes-nous ?"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/contacts.html",
tittle: "Contacts"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/critiques.html",
tittle: "Critiques"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/luttes.html",
tittle: "Luttes"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/alternatives.html",
tittle: "Alternatives"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/liens.html",
tittle: "Liens"
}
];
return msgPostTittle;
}
function msgPostTittleEN() {
var msgPostTittle = [{
href: "https://www.linternationaledessavoirspourtous.org/p/la-science-pour-le-plus-grand-nombre.html",
tittle: "Science for the many, not for money"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/qui-sommes-nous.html",
tittle: "Who are we?"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/contacts.html",
tittle: "Contacts"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/critiques.html",
tittle: "Critics"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/luttes.html",
tittle: "Struggles"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/alternatives.html",
tittle: "Alternatives"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/liens.html",
tittle: "Links"
}
];
return msgPostTittle;
}
function msgPostTittleDE() {
var msgPostTittle = [{
href: "https://www.linternationaledessavoirspourtous.org/p/la-science-pour-le-plus-grand-nombre.html",
tittle: "Wissenschaft für die Vielen statt Wissenschaft für Profit"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/qui-sommes-nous.html",
tittle: "Über uns"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/contacts.html",
tittle: "Kontakt"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/critiques.html",
tittle: "Kritik"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/luttes.html",
tittle: "Kämpfe"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/alternatives.html",
tittle: "Alternativlösungen"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/liens.html",
tittle: "Links"
}
];
return msgPostTittle;
}
function msgPostTittleIT() {
var msgPostTittle = [{
href: "https://www.linternationaledessavoirspourtous.org/p/la-science-pour-le-plus-grand-nombre.html",
tittle: "La scienza per i molti, e non per i soldi"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/qui-sommes-nous.html",
tittle: "Chi siamo?"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/contacts.html",
tittle: "Contatti"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/critiques.html",
tittle: "Critiche"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/luttes.html",
tittle: "Lotte"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/alternatives.html",
tittle: "Alternative"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/liens.html",
tittle: "Links"
}
];
return msgPostTittle;
}
function msgPostTittlePT() {
var msgPostTittle = [{
href: "https://www.linternationaledessavoirspourtous.org/p/la-science-pour-le-plus-grand-nombre.html",
tittle: "Ciência para todos, não para o dinheiro"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/qui-sommes-nous.html",
tittle: "Quem somos nós?"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/contacts.html",
tittle: "Contactos"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/critiques.html",
tittle: "Críticas"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/luttes.html",
tittle: "Lutas"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/alternatives.html",
tittle: "Alternativas"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/liens.html",
tittle: "Links"
}
];
return msgPostTittle;
}
function msgPostTittleES() {
var msgPostTittle = [{
href: "https://www.linternationaledessavoirspourtous.org/p/la-science-pour-le-plus-grand-nombre.html",
tittle: "Ciencia para todos, no por dinero"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/qui-sommes-nous.html",
tittle: "¿Quiénes somos?"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/contacts.html",
tittle: "Contactos"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/critiques.html",
tittle: "Críticas"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/luttes.html",
tittle: "Luchas"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/alternatives.html",
tittle: "Alternativas"
},
{
href: "https://www.linternationaledessavoirspourtous.org/p/liens.html",
tittle: "Enlaces"
}
];
return msgPostTittle;
}
function curRootSite() {
return 'www.linternationaledessavoirspourtous.org';
}
LangForSummary = ["fr", "en", "de", "es", "it", "pt"];
img_thumb_width = 180; // Image Thumbnail Width
img_thumb_height = 180; // Image Thumbnail Height
summary_noimg = 500; // Length of Summary Text if no image is Used
summary_img_reg = 400; // Length of Summary Text if regular post has Image Thumbnail
summary_img_feat = 1000; // Length of Summary Text if featured post has Image Thumbnail
callFBSDKinit();
var frHandler = document.getElementById("frHandler");
frHandler.addEventListener("click", frLangTB, false);
var enHandler = document.getElementById("enHandler");
enHandler.addEventListener("click", enLangTB, false);
var enHandler = document.getElementById("deHandler");
enHandler.addEventListener("click", deLangTB, false);
var enHandler = document.getElementById("itHandler");
enHandler.addEventListener("click", itLangTB, false);
var enHandler = document.getElementById("ptHandler");
enHandler.addEventListener("click", ptLangTB, false);
var enHandler = document.getElementById("esHandler");
enHandler.addEventListener("click", esLangTB, false);
function frLangTB() {
var msgPostTittle = msgPostTittleFR();
var msgLangInscription = {
header : "L'Internationale des Savoirs pour Tous",
btInscrire : "s'inscrire",
loc : 'fr_FR',
setInscription : "S'inscrire à ce blog",
setSharingText : "Obtenir le lien",
setGetLinkText : "Lien copié dans le presse-papier",
setCallforEmail : 'Adresse e-mail',
setRecMsg : 'Recevoir des notifications par e-maill',
setJumpLink : 'Lire la suite',
setPopularPosts : 'Posts les plus consultés de ce blog',
//setFeaturedPost : 'à la une...',
setFeaturedPost : '',
setLocforDates : 'fr-FR',
searchInput : "Rechercher dans ce blog",
searchAction : "rechercher",
setOtherPosts : "Autres articles",
setPostFilter1 : "Affichage des posts correspondant à la recherche du terme",
setPostFilter2 : "Tout Afficher"
};
setLanguageTB("fr", msgPostTittle, msgLangInscription, "frnavigation");
}
function enLangTB() {
var msgPostTittle = msgPostTittleEN();
var msgLangInscription = {
header : "The International of Knowledge for All",
btInscrire : "subscribe",
loc : 'en_GB',
setInscription : 'Subscribe to this blog',
setSharingText : "Get the link",
setGetLinkText : "Link copied to clipboard",
setCallforEmail : 'Email Address',
setRecMsg : 'Get email notifications',
setJumpLink : 'Read more',
setPopularPosts : 'Popular posts from this blog',
//setFeaturedPost : 'feature post...',
setFeaturedPost : '',
setLocforDates : "en-US",
searchInput : "Search this blog",
searchAction : "Search",
setOtherPosts : "More posts",
setPostFilter1 : "Showing posts matching the search for",
setPostFilter2 : "SHOW ALL"
};
setLanguageTB("en", msgPostTittle, msgLangInscription, "ennavigation");
}
function deLangTB() {
var msgPostTittle = msgPostTittleDE();
var msgLangInscription = {
header : 'Internationales Netzwerk « Wissen für Alle »',
btInscrire : "anmeldung",
loc : 'de_DE',
setInscription : 'Diesen Blog abonnieren',
setSharingText : "Holen Sie sich den Link",
setGetLinkText : "Link in die Zwischenablage kopiert",
setCallforEmail : 'Email Adresse',
setRecMsg : 'E-mail benachrichtigungen erhalten',
setJumpLink : 'Weiterlesen',
setPopularPosts : 'Beliebte Posts aus diesem Blog',
//setFeaturedPost : 'Feature-Post...',
setFeaturedPost : '',
setLocforDates : "de-DE",
searchInput : "Suche im Blog",
searchAction : "Suche",
setOtherPosts : "WEITERE POSTS",
setPostFilter1 : "Posts für die Suchanfrage",
setPostFilter2 : "ALLE ANZEIGEN"
};
setLanguageTB("de", msgPostTittle, msgLangInscription, "denavigation");
}
function itLangTB() {
var msgPostTittle = msgPostTittleIT();
var msgLangInscription = {
header : "L'Internazionale della Conoscenza per Tutti",
btInscrire : "iscriviti",
loc : 'it_IT',
setInscription : 'Iscriviti a questo blog',
setSharingText : "Ottieni il link",
setGetLinkText : "Link copiato negli appunti",
setCallforEmail : 'Indirizzo email',
setRecMsg : 'Ricevi Notifiche email',
setJumpLink : 'Continua a leggere',
setPopularPosts : 'Post popolari in questo blog',
//setFeaturedPost : 'caratteristica post',
setFeaturedPost : '',
setLocforDates : "it-IT",
searchInput : "Cerca nel blog",
searchAction : "circa",
setOtherPosts : "ALTRI POST",
setPostFilter1 : "Visualizzazione dei post corrispondenti alla ricerca",
setPostFilter2 : "MOSTRA TUTTO"
};
setLanguageTB("it", msgPostTittle, msgLangInscription, "itnavigation");
}
function ptLangTB() {
var msgPostTittle = msgPostTittlePT();
var msgLangInscription = {
header : "Internacional do Saber para Todos",
btInscrire : "subscrever",
loc : 'pt_PT',
setInscription : 'Subscrever este blogue',
setSharingText : "Obter o link",
setGetLinkText : "Link copiado para a área de transferência",
setCallforEmail : 'Endereço de email',
setRecMsg : 'Obter notificações por email',
setJumpLink : 'Ler mais',
setPopularPosts : 'Mensagens populares deste blogue',
//setFeaturedPost : 'postagem de recurso',
setFeaturedPost : '',
setLocforDates : "pt-PT",
searchInput : "Pesquisar nest blogue",
searchAction : "pesquisar",
setOtherPosts : "MAIS POSTAGENS",
setPostFilter1 : "Mostrando postagens que correspondem à pesquisa por",
setPostFilter2 : "MOSTRAR TUDO"
};
setLanguageTB("pt", msgPostTittle, msgLangInscription, "ptnavigation");
}
function esLangTB() {
var msgPostTittle = msgPostTittleES();
var msgLangInscription = {
header : "La Internacional del Saber para Todos",
btInscrire : "subscribirse",
loc : 'es_ES',
setInscription : 'Registrare en este blog',
setSharingText : "Obtenga el enlace",
setGetLinkText : "Enlace copiado al portapapeles",
setCallforEmail : 'Dirección de correo electrónico',
setRecMsg : 'Recibir notificaciones por correo electrónico',
setJumpLink : 'Leer más',
setPopularPosts : 'Entradas populares de este blog',
//setFeaturedPost : 'feature post',
setFeaturedPost : '',
setLocforDates : "es-ES",
searchInput : "Buscar este blog",
searchAction : "buscar",
setOtherPosts : "MÁS ENTRADAS",
setPostFilter1 : "Mostrando las entradas que coinciden con la búsqueda de",
setPostFilter2 : "MOSTRAR TODO"
};
setLanguageTB("es", msgPostTittle, msgLangInscription, "esnavigation");
}
function setLanguageTB(Lang, msgPostTittle, msgLangInscription, navID) {
var rootSite = curRootSite();
setLangByTagNameTB(Lang, "div");
setLangByLocalFlagonTagTB(msgLangInscription.setLocforDates, "article");
navIDSauv = navID;
sauvMenuBarTyp = { navID : 0, DrpTyp : "" }
setNavigation();
setDivWidth();
setRedirectOnLang(Lang, rootSite);
var firstPostTittleLang = setPostTitleLang(msgPostTittle);
setDataForSummary(Lang, msgPostTittle);
setLangInscriptionTB(Lang, msgLangInscription, rootSite, firstPostTittleLang);
if( postTyp() == "home" ) {
setHomeCustom();
}
function setHomeCustom() {
return;
var elem = document.querySelector("#Blog1");
elem.style.display = 'none';
var elem = document.getElementsByClassName("blog-posts");
for (var i = 0; i < elem.length; i++) {
elem[i].style.display = 'none';
}
}
function setRedirectOnLang(Lang, rootSite) {
var myLinks = document.getElementsByTagName('a');
for (var i = 0; i < myLinks.length; i++) {
var isHref = myLinks[i].href;
if (isHref.indexOf(rootSite) > -1 && isHref.indexOf('#') == -1) {
var trgLang = 'lang=' + Lang;
if (isHref.indexOf("lang=") > -1) {
var debLang = isHref.indexOf("lang=");
var finLang = isHref.indexOf("lang=") + 7;
var initLang = isHref.substring(debLang, finLang);
isHref = isHref.replace(initLang, trgLang);
}
else if(isHref.indexOf("?") > -1) {
isHref += '&' + trgLang;
} else {
isHref += '?' + trgLang;
}
myLinks[i].href = isHref;
}
}
}
function setLangInscriptionTB(Lang, msg, rootSite, firstPostTittleLang) {
var acc = document.getElementsByName('loc');
var btInscrire = document.getElementsByClassName('subscribe-button');
// On cache, pour l'instant, le bouton d'inscription à la lettre d'information
//btInscrire[0].style.display = 'none';
var setInscription = document.getElementsByClassName('subscribe-title');
//var setSharingText = document.getElementsByClassName('platform-sharing-text');
//var setGetLinkText = document.getElementsByClassName('modal-dialog-content');
var setCallforEmail = document.getElementsByClassName('follow-by-email-address');
setRedirectOnLang(Lang, rootSite);
var setRecMsg = document.getElementsByClassName('follow-by-email-submit');
var setJumpLink = document.getElementsByClassName('jump-link');
var setPopularPosts = document.getElementById('PopularPosts1');
var setFeaturedPost = document.getElementById('FeaturedPost1');
var setOtherPosts = document.getElementById('blog-pager');
var setPostFilter = document.getElementsByClassName('post-filter-message');
var options = {
year: "numeric",
month: "long",
day: "numeric"
};
var myDates = document.getElementsByTagName('Time');
document.getElementsByClassName('header-widget')[0].children[0].children[0].innerHTML = msg.header;
//btInscrire[0].innerHTML = msg.btInscrire;
//acc[0].value = msg.loc;
//setInscription[0].innerHTML = msg.setInscription;
//setSharingText[0].innerHTML = msg.setSharingText;
//setGetLinkText[0].innerHTML = msg.setGetLinkText;
//setCallforEmail[0].placeholder = msg.setCallforEmail;
//setRecMsg[0].value = msg.setRecMsg;
for (var i = 0; i < setJumpLink.length; i++) {
if (setJumpLink[i].children.length > 0) {
setJumpLink[i].children[0].innerHTML = msg.setJumpLink;
}
else {
setJumpLink[i].innerHTML = msg.setJumpLink;
}
}
if (setPopularPosts != null) {
setPopularPosts.children[0].innerHTML = msg.setPopularPosts;
}
if (setFeaturedPost != null) {
setFeaturedPost.children[0].innerHTML = msg.setFeaturedPost;
}
if ( (setOtherPosts != null) && (setOtherPosts.children.length > 0) ) {
setOtherPosts.children[0].innerHTML = msg.setOtherPosts;
}
if( setPostFilter.length > 0 ) {
var innerHTML = setPostFilter[0].children[0].innerHTML;
innerHTML = msg.setPostFilter1 + ' ' + innerHTML.substring(innerHTML.indexOf("<"), innerHTML.length);
setPostFilter[0].children[0].innerHTML = innerHTML;
setPostFilter[0].children[1].children[0].innerHTML = msg.setPostFilter2;
}
for (var i = 0; i < myDates.length; i++) {
var isDate = myDates[i].dateTime;
var date = new Date(isDate);
//var postLang = document.getElementsByClassName('post-lang');
if ( (i != 0) || (firstPostTittleLang != '' ) || (window.location.pathname == "/search") ) {
myDates[i].innerHTML = date.toLocaleString(msg.setLocforDates, options);
} else setLocalFlags();
}
document.getElementsByClassName('search-input')[0].children[0].setAttribute("placeholder", msg.searchInput);
document.getElementsByClassName('search-input')[0].children[0].setAttribute("id", 'searchText');
document.getElementsByClassName('search-input')[0].children[0].setAttribute("data-lang", Lang);
document.getElementsByClassName('search-action')[0].value = msg.searchAction;
document.getElementsByClassName('search-action')[0].setAttribute("id", 'searchButton');
document.getElementById("searchButton").onclick = doSearch;
var mySignatures = document.getElementById("signatures-country-name");
if( typeof mySignatures !== 'undefined' && mySignatures !== null) mySignatures.setAttribute("data-lang", Lang);
function doSearch() {
var searchText = document.getElementById("searchText");
var v = searchText.value;
var lang = searchText.getAttribute('data-lang')
//window.location = "search?q=" + v + "&lang=" + lang;
window.location.href = "https://www.linternationaledessavoirspourtous.org/search?q=" + v + "&lang=" + lang;
return false; // not entirely necessary, but just in case
}
}
function setPostTitleLang(msgPostTittle) {
var myPosts = document.getElementsByClassName('post-title');
var firstPostTitleLang = '';
for (var i = 0; i < myPosts.length; i++) {
var pathname = window.location.pathname;
var href;
if( postTyp() == "home" || i > 0 ) {
href = myPosts[i].children[0].href.split("?")[0];
} else {
href = window.location.href.split("?")[0];
}
var postTitle =
checkPostTitleLang(href, msgPostTittle);
if (postTitle != '') {
if( postTyp() == "home" || i > 0 ) {
myPosts[i].children[0].innerHTML = postTitle;
} else {
myPosts[0].innerHTML = postTitle;
firstPostTitleLang = postTitle;
}
}
}
return firstPostTitleLang;
}
function setDataForSummary(Lang, msgPostTittle) {
var divSocNet = document.getElementById('showBodyforSocialNetworks');
if (postTyp() != "home") {
divSocNet.style.display = "block";
var dataSocNet = document.getElementById('postBodyforSocialNetworks');
var myPosts = document.getElementsByClassName('post-title');
var path = window.location.href;
var href = path.split("?")[0];
dataSocNet.dataset.url = href;
//dataSocNet.dataset.title = myPosts[0].innerHTML;
dataSocNet.dataset.title = myPosts[0].innerText;
var postTitle =
checkPostTitleLang(href, msgPostTittle);
if (postTitle != '') dataSocNet.dataset.title = postTitle;
var img = dataSocNet.getElementsByTagName("img");
if (img.length >= 1) {
imgtag = img[0].src;
}
else {
imgtag = 'https://2.bp.org/-S2Q4C1j8nBM/XAf7ErxMHVI/AAAAAAAAiA4/00GFdrlKzdsdFL2DKDkFcl76NLnqCMXCwCLcBGAs/s320/Biblioteca_dell%2527Universita_di_Bologna.jpg';
}
dataSocNet.dataset.imgtag = imgtag;
if(dataSocNet.dataset.url.indexOf('?') > -1) {
dataSocNet.dataset.url += '&lang=' + Lang;
} else {
dataSocNet.dataset.url += '?lang=' + Lang;
}
var result = getLinkContent(dataSocNet.dataset.url);
//dataSocNet.innerHTML = result.body.replace('PopularPosts1','');
dataSocNet.dataset.innerHTML = result.body;
/*if( path.indexOf("&lngloc") == -1 ) {
result = compSumAndImg(dataSocNet.innerHTML, summary_noimg, Lang, 'lang="', 'yes');
} else {
var lngloc = path.substring(path.length - 5, path.length);
result = compSumAndImg(dataSocNet.innerHTML, summary_noimg, lngloc, 'class="local-lang ', 'yes');
var curPostTitle = document.getElementsByClassName("html2pdf-post-title");
//var forLength = Math.min(currentBtn.length, curPostTitle.length);
for (var i = 0; i < curPostTitle.length; i++) {
if (curPostTitle[i].className.indexOf(lngloc) > -1) {
dataSocNet.dataset.title = curPostTitle[i].innerText;
break;
}
}
}
result = compSumAndImg(dataSocNet.innerHTML, summary_noimg, Lang, 'lang="', 'yes');
var summary = result.summary;
dataSocNet.dataset.caption = summary.replace(/\ \;/g, "") + '...';
var img = result.img;
dataSocNet.dataset.imgtag = img;*/
if( postTitle != '' ) {
result = compSumAndImg(dataSocNet.dataset.innerHTML, summary_noimg, Lang, 'lang="', 'yes');
var summary = result.summary;
dataSocNet.dataset.caption = summary.replace(/\ \;/g, "") + '...';
var img = result.img;
dataSocNet.dataset.imgtag = img;
}
dataSocNet.dataset.lang = Lang;
/*alert('FB Lang = ' + dataSocNet.dataset.lang
+ '\n url = ' + dataSocNet.dataset.url
+ '\n title = ' + dataSocNet.dataset.title
+ '\n caption = ' + dataSocNet.dataset.caption );*/
}
}
function checkPostTitleLang(href, msgPostTittle) {
var hrefBas = href;
if( href.indexOf('#') > -1) hrefBas = href.split("#")[0];
for (var i = 0; i < msgPostTittle.length; i++) {
if (hrefBas == msgPostTittle[i].href) {
return msgPostTittle[i].tittle;
}
}
return "";
}
function postTyp() {
//var pathname = window.location.origin + window.location.pathname;
var pathname = window.location.pathname;
//if ((pathname == "/") || (pathname == "/search")) {
if ((pathname == "/") || (pathname == "/search") || (pathname == "/p/la-science-pour-le-plus-grand-nombre")) {
return 'home';
}
if (pathname.indexOf("/p/") > -1) {
return 'page';
}
return 'post';
}
function setDivWidth() {
var contNaveFlags = document.getElementById("contNavetFlags");
var contFlags = document.getElementById("Flags");
var contNav = document.getElementById("navigationGB");
var pathname = window.location.pathname;
if ((pathname != "/") && (pathname != "/search") && (pathname.indexOf("/p/la-science-pour-le-plus-grand-nombre") == -1)) {
//if (window.location.pathname != '/') {
contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = "block";
contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.children[0].style.display = "inline-block";
contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.children[1].style.display = "inline-block";
}
/*contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.width='98%';
contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.textAlign='left';*/
//contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.style.width = '98%';
contNaveFlags.parentNode.parentNode.parentNode.parentNode.style.width = '98%';
contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.style.textAlign = 'left';
/*contNaveFlags.parentNode.parentNode.parentNode.parentNode.style.width='98%';
contNaveFlags.parentNode.parentNode.parentNode.parentNode.style.textAlign='left';
contNaveFlags.parentNode.parentNode.parentNode.style.width='98%';
contNaveFlags.parentNode.parentNode.style.width='98%';*/
contNaveFlags.parentNode.style.width = '98%';
//contNaveFlags.parentNode.parentNode.style.background='#E7C296';
//contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.background='Teal';
contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.width = '100%';
//contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.children[0].style.background='Lime';
//contNaveFlags.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.children[1].style.background='Olive';
//contNaveFlags.style.background='Silver';
if (window.location.pathname != '/') contNaveFlags.style.marginLeft = '-2em';
contNaveFlags.style.width = '105%';
//contFlags.style.background='Purple';
//contNav.style.background='Maroon';
if (sauvMenuBarTyp.DrpTyp == "false") {
contNav.style.width = "77%";
contFlags.style.width = "20fi%";
}
else {
contNav.style.width = "65%";
contFlags.style.width = "33%";
}
/*var widthContNaveFlags = contNaveFlags.offsetWidth;
var widthFlags = contFlags.offsetWidth;
var widthNavNum = (widthContNaveFlags - widthFlags)-10;
var widthNavStr = widthNavNum + "px";
document.getElementById("navigationGB").style.setProperty('width', widthNavStr);
//document.getElementById("navigationGB").style.setProperty('width', '1000px');
var widthNav = document.getElementById("navigationGB").style.width;
alert("widthContNaveFlags = " + widthContNaveFlags
+ "\n widthNavNum = " + widthNavNum
+ "\n widthNavStr = " + widthNavStr
+ "\n widthNav = " + widthNav
+ "\n widthFlags = " + widthFlags );*/
}
function setLangByTagNameTB(Lang, TagName) {
var myElems = document.getElementsByTagName(TagName);
for (var i=0; i < myElems.length; i++) {
var isLang = myElems[i].hasAttribute("lang");
if ( isLang ) {
if ( myElems[i].lang == Lang ) {
myElems[i].style.display = 'block';
} else {
myElems[i].style.display = 'none';
}
}
}
}
function setLangByLocalFlagonTagTB(Lang, TagName) {
$(TagName + ' .local-flags').each(function() {
if ($(this).hasClass(Lang) || (Lang == 'en-US' && $(this).hasClass('en-EN'))) {
$(this).click();
}
})
}
}
function setNavigation() {
var navID = navIDSauv;
var newMenuBarTyp = { navID : 0, DrpTyp : "" }
newMenuBarTyp.navID = navID;
newMenuBarTyp.DrpTyp = setMenuBarType();
//if( (sauvMenuBarTyp.navID == newMenuBarTyp.navID)
//&& (sauvMenuBarTyp.DrpTyp == newMenuBarTyp.DrpTyp) ) return;
sauvMenuBarTyp.navID = newMenuBarTyp.navID;
sauvMenuBarTyp.DrpTyp = newMenuBarTyp.DrpTyp;
var navbar = document.getElementById("navigationGB");
var href;
var path = window.location.href;
var children = document.getElementById(navID).children;
var isMatched = false;
var isPlus = false;
for (var i = 0; i < children.length; i++) {
var tableChild = children[i];
var myA = tableChild.children[0];
var href = myA.getAttribute("href");
if (!myA.getAttribute('data-isplus')) {
//if (href != "") {
if (tableChild.children.length == 1) {
if ( (path.split("?")[0] == href.split("?")[0]) || (path.split("search?")[0] == href.split("?")[0]) ) {
tableChild.setAttribute('class', 'active');
isMatched = true;
}
else {
tableChild.setAttribute('class', 'inactive');
}
}
else {
var isNewMatched = setMenu(tableChild, path);
isMatched = isMatched || isNewMatched;
}
if (isPlus) myA.style.display = 'none';
else myA.style.display = 'inline-block';
}
else {
if (myA.dataset.isplus == "true") isPlus = true;
if (isPlus) myA.parentNode.style.display = 'inline-block';
else myA.parentNode.style.display = 'none';
}
}
if (isMatched) {
//tableChild.style.color = '#ffffff';
navbar.style.display = "inline-block";
}
else {
//tableChild.style.color = '#F4F43E';
}
function setMenu(tableChild, path) {
var subchildren = tableChild.children[1].children;
tableChild.setAttribute('class', 'inactive');
var isMatched = false;
for (var j = 0; j < subchildren.length; j++) {
var tableSubChild = subchildren[j];
var href = tableSubChild.children[0].getAttribute("href");
//if (href != "") {
if (tableSubChild.children.length == 1) {
if ( (path.split("?")[0] == href.split("?")[0]) || (path.split("search?")[0] == href.split("?")[0]) ) {
tableSubChild.setAttribute('class', 'active');
isMatched = true;
}
else {
tableSubChild.setAttribute('class', 'inactive');
}
}
else {
var isNewMatched = setMenu(tableSubChild, path);
isMatched = isMatched || isNewMatched;
//tableSubChild.children[1].style.setProperty("margin-left", "171px");
//tableSubChild.children[1].style.setProperty("margin-top", "-1.7em");
}
}
if (isMatched) {
tableChild.children[0].style.color = '#ffffff';
}
else {
//tableChild.children[0].style.color = '#F4F43E';
}
return isMatched;
}
}
function setMenuBarType() {
var w = window.innerWidth;
/*if (window.innerWidth > 1600) {
setDropdownGB(-6);
//alert('windowWidth is 6 ' + window.innerWidth);
return "false";
} else if (window.innerWidth > 1450) {
setDropdownGB(5);
//alert('windowWidth is 5 ' + window.innerWidth);
return "true";*/
if (window.innerWidth > 1450) {
setDropdownGB(-5);
//alert('windowWidth is 5 ' + window.innerWidth);
return "false";
} else if (window.innerWidth > 1350) {
setDropdownGB(4);
//alert('windowWidth is 4 ' + window.innerWidth);
return "true";
} else if (window.innerWidth > 1200) {
setDropdownGB(3);
//alert('windowWidth is 3 ' + window.innerWidth);
return "true";
} else if (window.innerWidth > 1100) {
setDropdownGB(2);
//alert('windowWidth is 2 ' + window.innerWidth);
return "true";
} else {
setDropdownGB(1);
//alert('windowWidth is 1 ' + window.innerWidth);
return "true";
}
}
function getUrlVarsTB() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
}
function getUrlParamTB(parameter, defaultvalue){
var urlparameter = defaultvalue;
if(window.location.href.indexOf(parameter) > -1){
urlparameter = getUrlVarsTB()[parameter];
}
return urlparameter;
}
function callFBSDKinit() {
window.fbAsyncInit = function() {
FB.init({
appId: '2258091117847688',
//appId: '2198362993711491',
autoLogAppEvents: true,
xfbml: true,
version: 'v3.2'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {
return;
}
js = d.createElement(s);
js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
function fbSummarize() {
var dataSocNet = document.getElementById('postBodyforSocialNetworks');
var encodedURL = encodeURI(dataSocNet.dataset.url + '&test');
/*FB.ui({
//display: 'popup',
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object: {
'og:url': encodedURL, // your url to share
'og:title': 'test facebook', // dataSocNet.dataset.title,
'og:description': 'ceci est un test...', // dataSocNet.dataset.caption,
'og:image': dataSocNet.dataset.imgtag,
'fb:app_id': '2258091117847688'
}
})
},
// callback
function(response) {
if (response && !response.error_message) {
alert('Posting completed.');
}
else {
alert('Error while posting.');
}
}
);*/
FB.ui({
display: 'popup',
method: 'share_open_graph',
action_type: 'og.shares',
action_properties: JSON.stringify({
object: {
'og:url': encodedURL, // your url to share
'og:title': dataSocNet.dataset.title,
'og:description': dataSocNet.dataset.caption,
'og:image': dataSocNet.dataset.imgtag,
}
})
/*method: 'share',
href: dataSocNet.dataset.url,
message: 'getting educated about Facebook Connect',
caption: dataSocNet.dataset.caption,
picture: dataSocNet.dataset.imgtag,
redirect_uri: encodedURL*/
},
// callback
function(response) {
if (response && !response.error_message) {
//alert('Posting completed.');
}
else {
//alert('Error while posting.');
}
}
);
/*FB.api('https://graph.facebook.com/', 'post', {
id: encodedURL,
scrape: true,
access_token: 'EAAgFuM7zJIgBAH6R2305MtL7KK34ya1tI9utq8SJB7dUYuzkAanlospKTkUehI1YZBoH7IfhdYXvZA920ZCAwZByIDm3CaTMTJZABrfAPaZA7jDAzNYvLio3FztdxdqZByEj7M2cBlOdj2kPxXKPysUGNiDXImANl5ewciPV0NjVVWlK2xQO21aFp7vZBoPdfz7zBtHA7ujhLQZDZD'
}, function(response) {
console.log('rescrape!',response);
}
);*/
}
// triggers the modal menubar
function frDropdownGB() {
var myNavigation = document.getElementById('frnavigation');
showDropdownGB(myNavigation);
}
function enDropdownGB() {
var myNavigation = document.getElementById('ennavigation');
showDropdownGB(myNavigation);
}
function itDropdownGB() {
var myNavigation = document.getElementById('itnavigation');
showDropdownGB(myNavigation);
}
function ptDropdownGB() {
var myNavigation = document.getElementById('ptnavigation');
showDropdownGB(myNavigation);
}
function esDropdownGB() {
var myNavigation = document.getElementById('esnavigation');
showDropdownGB(myNavigation);
}
function showDropdownGB(id) {
//typeDropdownGB( true, 'navigationcss' );
swtIdClass( id, 'navigationcss', 'dropdown-content' );
typeDropdownGB( true, 'dropdown-content' );
}
function setDropdownGB(isDropdownGB) {
var isPlus;
if (isDropdownGB > 0) isPlus = isDropdownGB;
else {
isPlus = -isDropdownGB;
stopDropdownGB();
}
var allDropDown = document.getElementsByClassName('navigationcss');
for (var i = 0; i < allDropDown.length; i++) {
var allLi = allDropDown[i].children;
for (var j = 0; j < allLi.length; j++) {
var allA = allLi[j].children;
var myA = allA[0];
if (myA.getAttribute('data-isplus')) {
if (j < isPlus) {
for (var k = j; k < isPlus; k++) {
var kk = k;
allLi[kk + 1].parentNode.insertBefore(allLi[kk + 1], allLi[kk]);
}
}
else if (j > isPlus) {
for (var k = j; k > isPlus; k--) {
var kk = k;
allLi[kk].parentNode.insertBefore(allLi[kk], allLi[kk - 1]);
}
}
}
}
if (typeof allLi[isPlus] !== 'undefined') {
var myA = allLi[isPlus].getElementsByTagName('a')[0];
if (isDropdownGB > 0) {
myA.dataset.isplus = 'true';
}
else {
myA.dataset.isplus = 'false';
}
}
}
}
/*function setDropdownGB(isDropdownGB) {
var isPlus;
if (isDropdownGB > 0) isPlus = isDropdownGB;
else {
isPlus = -isDropdownGB;
stopDropdownGB();
}
var allDropDown = document.getElementsByClassName('navigationcss');
for (var i = 0; i < allDropDown.length; i++) {
var allLi = allDropDown[i].getElementsByTagName('li');
for (var j = 0; j < allLi.length; j++) {
var allA = allLi[j].getElementsByTagName('a');
var myA = allA[0];
if (myA.getAttribute('data-isplus')) {
if (j < isPlus) {
var k = j;
while(k < isPlus) {
var kk = k, kknew=k+1;
while( !allLi[kk].parentNode.isEqualNode(allLi[kknew].parentNode)) kknew++;
allLi[kk].parentNode.insertBefore(allLi[kknew], allLi[kk]);
k = kknew;
}
}
else if (j > isPlus) {
var k = j;
while(k > isPlus) {
var kk = k, kknew=k-1;
while( !allLi[kk].parentNode.isEqualNode(allLi[kknew].parentNode)) kknew--;
allLi[kk].parentNode.insertBefore(allLi[kk], allLi[kknew]);
k = kknew;
}
}
}
}
if (typeof allLi[isPlus] !== 'undefined') {
var myA = allLi[isPlus].getElementsByTagName('a')[0];
if (isDropdownGB > 0) {
myA.dataset.isplus = 'true';
}
else {
myA.dataset.isplus = 'false';
}
}
}
}*/
function typeDropdownGB(fullNav, navClassName) {
var allDropDown = document.getElementsByClassName(navClassName);
for (var i = 0; i < allDropDown.length; i++) {
var allLi = allDropDown[i].getElementsByTagName('li');
var isPlus = false;
for (var j = 0; j < allLi.length; j++) {
if(allLi[j].children[0].style.color == 'rgb(255, 255, 255)') {
allLi[j].children[0].style.color = 'red';
}
var allA = allLi[j].getElementsByTagName('a');
for (var k = 0; k < allA.length; k++) {
var myA = allA[k];
if ( myA.dataset.isplus == "true" ) {
isPlus = true;
if ( fullNav ) myA.parentNode.style.display = 'none';
else myA.parentNode.style.display = 'inline-block';
} else {
if( isPlus ) {
if ( fullNav ) myA.style.display = 'inline-block';
else myA.style.display = 'none';
}
}
}
}
}
}
function swtIdClass(d, oldClass, newClass) {
//var d = document.getElementById(id);
// removing class navigationcss of id='frnavigation'
d.className = d.className.replace(' ' + oldClass, ''); //must keep a space before class name
// adding class dropdown-content of id='frnavigation'
var myClassName = ' ' + newClass; //must keep a space before class name
d.className = d.className.replace(myClassName, ""); // first remove the class name if that already exists
d.className = d.className + myClassName; // adding new class name
}
// When the user clicks anywhere outside of the modal menubar, close it
window.onclick = function(event) {
var myNavigation;
var myTarget = event.target;
if (myTarget.dataset.isplus != "true") {
stopDropdownGB();
}
}
function stopDropdownGB() {
var allDropDown = document.getElementsByClassName('dropdown-content');
for (var i = 0; i < allDropDown.length; i++) {
var isPlus = false;
var allLi = allDropDown[i].getElementsByTagName('li');
for (var j = 0; j < allLi.length; j++) {
var allA = allLi[j].getElementsByTagName('a');
for (var k = 0; k < allA.length; k++) {
var myA = allA[k];
if (myA.dataset.isplus == "true") {
isPlus = true;
myA.parentNode.style.display = 'inline-block';
var myNavigation = myA.parentNode.parentNode;
}
else {
if (isPlus) myA.style.display = 'none';
}
}
}
if (isPlus) swtIdClass(myNavigation, 'dropdown-content', 'navigationcss');
}
}
// window.resize callback function
timeout = false, // holder for timeout id
delay = 250, // delay after event is "complete" to run callback
calls = 0;
function getDimensions() {
calls += 1;
alert("Width = " + window.innerWidth + "\n Height = " + window.innerHeight + "\n calls = " + calls )
}
// window.resize event listener
window.addEventListener('resize', function() {
// clear the timeout
clearTimeout(timeout);
// start timing for event "completion"
//timeout = setTimeout(getDimensions, delay);
timeout = setTimeout(setNavigation, delay);
});
window.addEventListener('DOMContentLoaded', function(){
// Hamburger Menu is hidden
var myHambugerMenu = document.getElementsByClassName('hamburger-menu');
if( myHambugerMenu.length == 1) {
myHambugerMenu[0].style.display = "none";
}
var myLang = getUrlParamTB('lang','fr');
switch (myLang) {
case "fr":
frLangTB();
break;
case "en":
enLangTB();
break;
case "de":
deLangTB();
break;
case "it":
itLangTB();
break;
case "pt":
ptLangTB();
break;
case "es":
esLangTB();
break;
default:
frLangTB();
}
});
function setArticle(article, href, lang, title, authors, sumImg, sumContent) {
var divArticle = document.getElementById(article);
//var onclickTagname = divArticle.children[0].children[0].children[0].children[0].tagName;
var onclickTagname = divArticle.children[0].children[0].children[0].tagName;
if (sumContent == '') {
var div = document.getElementById("testTranslate");
var result = getLinkContent(href);
div.innerHTML = result.lang;
lang = div.innerHTML;
//title = $(result.title).html();
div.innerHTML = result.title;
title = div.innerHTML;
//authors = $(result.authors).html();
div.innerHTML = result.authors;
authors = div.innerHTML;
div.innerHTML = result.body;
result = removeHtmlTagforAllLangs(div.innerHTML, 400, lang.split(' '), 'class="local-lang ', 'no');
div.innerHTML = '';
// remplace le code ASCII de l'espace insécable par son code HTML
//sumContent = $(result.summary.replace(/\ \;/g, " ")).html();
sumContent = result.summary.replace(/\ \;/g, " ");
sumImg = result.img;
}
if ((onclickTagname == "A")) {
divArticle.children[0].children[0].children[0].href = href;
divArticle.children[0].children[0].children[0].setAttribute("onclick","return " + gotoOnClick + "(this);");
}
//if ((onclickTagname == "A")) divArticle.children[0].children[0].children[0].href = href + '?lang=en&lngloc=fr-FR';
divArticle.children[0].children[0].children[0].innerHTML = title;
//divArticle.children[0].children[0].children[1].src = getFlagfromLang(lang);
divArticle.children[0].children[1].innerHTML = title;
if (authors != "") divArticle.children[0].children[2].innerHTML = authors;
var sumImgCont = divArticle.children[1].children[0].children[0].children[0];
if (sumImg == '') {
sumImgCont.dataset.img = 'no';
}
else {
sumImgCont.src = sumImg;
}
divArticle.children[1].children[0].children[1].innerHTML = sumContent;
divFlags = divArticle.children[0].children[0];
createFlags('', lang, divFlags, "setSumFlagsOnClick");
}
function gotoOnClick(e) {
//alert(e.href + '&lngloc=' + e.getAttribute("data-lngloc"));
window.location = e.href + '&lngloc=' + e.getAttribute("data-lngloc");
return false;
}
function createFlags(lngloc, strLang, divFlag, foncOnClick) {
strLang = strLang.split(' ');
if(lngloc == '') lngloc = strLang[0];
var elem = [];
//for (i = 0; i < strLang.length; i++) {
for( var i = strLang.length-1; i > -1; i-- ) {
var src;
switch (strLang[i]) {
case "fr-FR":
src = flagsRepository.France.img;
break;
case "en-EN":
src = flagsRepository.RoyaumesUnis.img;
break;
case "en-US":
src = flagsRepository.USA.img;
break;
case "de-DE":
src = flagsRepository.Allemagne.img;
break;
case "it-IT":
src = flagsRepository.Italie.img;
break;
case "pt-PT":
src = flagsRepository.Portugal.img;
break;
case "es-ES":
src = flagsRepository.Espagne.img;
break;
}
elem[i] = createFlag(src, strLang[i], divFlag, foncOnClick);
}
for( var i = strLang.length-1; i > -1; i-- ) {
if ((lngloc == strLang[i]) && (foncOnClick != '')) {
elem[i].click();
break;
}
}
function createFlag(src, lang, divFlag, foncOnClick) {
var x = document.createElement("IMG");
x.setAttribute("src", src);
x.setAttribute("width", "32");
x.setAttribute("height", "32");
x.setAttribute("alt", lang);
x.setAttribute("border", "0");
x.setAttribute("style", "cursor:pointer; margin-left: 5px; float: right;");
if( foncOnClick != '') x.setAttribute("onclick", "return " + foncOnClick + "(this);");
x.setAttribute("class", "local-flags " + lang);
divFlag.appendChild(x);
return x;
}
}
function setLocalFlags() {
var divFlag = document.getElementById("local-flags");
var path = window.location.href;
var isHref = document.getElementsByClassName("html2pdf-post-title");
if( isHref.length == 0 ) return;
var href = isHref[0].children[0].href;
document.getElementById("contNavetFlags").style.display = 'none';
var postLang = document.getElementsByClassName("post-lang")[0];
var postLangHTML = postLang.innerHTML;
var lngloc = '';
if (path.indexOf('&lngloc=') > -1) {
lngloc = path.split('&lngloc=')[1].substring(0,5);
}
else if (path.indexOf('?lang=') > -1) {
var lang = path.split('?lang=')[1].substring(0,2);
var strlang = postLangHTML;
strlang = strlang.split(' ');
for (var i = 0; i < strlang.length; i++) {
if (lang == strlang[i].substring(0, 2)) {
lngloc = strlang[i];
break;
}
}
}
createFlags(lngloc, postLangHTML, divFlag, "setLocalFlagsOnClick");
}
function setLocalFlagsOnClick(e) {
var currentBtn = e.parentNode.children;
for (var i = 0; i < currentBtn.length; i++) {
currentBtn[i].classList.remove("flag-active");
}
var localLang = e.className.split("local-flags ")[1];
e.classList.add("flag-active");
var pathname = window.location.pathname;
if (pathname != "/") {
// traduction du titre
var curPostTitle = document.getElementsByClassName("html2pdf-post-title");
var forLength = Math.min(currentBtn.length, curPostTitle.length);
for (var i = 0; i < forLength; i++) {
if (forLength == 1 || curPostTitle[i].className.indexOf(localLang) > -1) {
document.getElementsByClassName('post-title')[0].innerHTML = curPostTitle[i].innerHTML;
// update Facebook information
var dataSocNet = document.getElementById('postBodyforSocialNetworks');
dataSocNet.dataset.title = curPostTitle[i].innerText;
result = compSumAndImg(dataSocNet.dataset.innerHTML, summary_noimg, localLang, 'class="local-lang ', 'yes');
var summary = result.summary;
dataSocNet.dataset.caption = summary.replace(/\ \;/g, "") + '...';
var img = result.img;
dataSocNet.dataset.imgtag = img;
if (dataSocNet.dataset.url.indexOf('&lngloc=') == -1) {
dataSocNet.dataset.url += '&lngloc=' + localLang;
} else {
var lngloc = dataSocNet.dataset.url.split('&lngloc=')[1].substring(0,5);
dataSocNet.dataset.url = dataSocNet.dataset.url.replace(lngloc,localLang);
}
break;
}
}
}
// traduction des auteurs
var curPostAuth = document.getElementsByClassName("post-authors");
var forLength = Math.min(currentBtn.length, curPostAuth.length);
for (var i = 0; i < forLength; i++) {
if (curPostAuth[i].className.indexOf(localLang) > -1) curPostAuth[i].style.display = 'block';
else curPostAuth[i].style.display = 'none';
}
// traduction de la date document.getElementsByClassName("post-lang")[0].className = 'lang-in-post post-lang ' + localLang;
var myDates = document.getElementsByTagName('Time');
var isDate = myDates[0].dateTime;
var date = new Date(isDate);
myDates[0].innerHTML = date.toLocaleString(localLang, {
year: "numeric",
month: "long",
day: "numeric"
});
$(".post-body.entry-content.float-container").find("div").each(function() {
var className = this.className;
if (typeof className !== 'undefined') {
if (this.className.indexOf('local-lang') > -1) {
if (this.className.split(' ')[1] == localLang) this.style.display = 'block';
else this.style.display = 'none';
}
}
});
/*var currentDiv = e.parentNode.parentNode.parentNode.getElementsByTagName("div");
for (var i = 0; i < currentDiv.length; i++) {
if (currentDiv[i].className.indexOf('local-lang') > -1) {
currentDiv[i].style.display = 'none';
}
}
for (var i = 0; i < currentDiv.length; i++) {
if (currentDiv[i].className.indexOf('local-lang') > -1) {
if (currentDiv[i].className.split(' ')[1] == localLang) currentDiv[i].style.display = 'block ';
}
}*/
var pdfRef = document.getElementById("pdf-ref");
if (pdfRef != null) {
var href = pdfRef.href;
switch (localLang) {
case "fr-FR":
if ("fr" in pdfRef.dataset) href = pdfRef.dataset.fr;
break;
case "en-EN":
if ("en" in pdfRef.dataset) href = pdfRef.dataset.en;
break;
case "en-US":
if ("en" in pdfRef.dataset) href = pdfRef.dataset.en;
break;
case "de-DE":
if ("de" in pdfRef.dataset) href = pdfRef.dataset.de;
break;
case "it-IT":
if ("it" in pdfRef.dataset) href = pdfRef.dataset.it;
break;
case "pt-PT":
if ("pt" in pdfRef.dataset) href = pdfRef.dataset.pt;
break;
case "es-ES":
if ("es" in pdfRef.dataset) href = pdfRef.dataset.es;
break;
}
pdfRef.href = href;
}
return false;
}
function setSumFlagsOnClick(e) {
var localLang = e.className.split("local-flags ")[1];
/*var href = e.parentNode.parentNode.children[0].href;
href = href.substring(0, href.length - 5) + localLang;
e.parentNode.parentNode.children[0].href = href;*/
e.parentNode.children[0].setAttribute("data-lngloc", localLang);
//var myRoot = $(".post-body.entry-content.float-container")
var myRoot = $(e.closest('article'));
//var myRoot = e.parentNode.parents('article');
//var myRoot = $(e.parentNode.parentNode.parentNode);
myRoot.find("div").each(function() {
var className = this.className;
if (typeof className !== 'undefined') {
if (this.className.indexOf('local-lang') > -1) {
if (this.className.split(' ')[1] == localLang) this.style.display = 'block';
else this.style.display = 'none';
}
}
});
/*var currentDiv = e.parentNode.parentNode.parentNode.getElementsByTagName("div");
for (var i = 0; i < currentDiv.length; i++) {
if (currentDiv[i].className.indexOf('local-lang') > -1) {
currentDiv[i].style.display = 'none';
}
}
for (var i = 0; i < currentDiv.length; i++) {
if (currentDiv[i].className.indexOf('local-lang') > -1) {
if (currentDiv[i].className.split(' ')[1] == localLang) currentDiv[i].style.display = 'block ';
}
}*/
return false;
}
function getFlagfromLang( lang ) {
var flag;
switch (lang) {
case "fr-FR":
flag = flagsRepository.France.img;
break;
case "en-EN":
flag = flagsRepository.RoyaumesUnis.img;
break;
case "en-US":
src = flagsRepository.USA.img;
break;
case "de-DE":
flag = flagsRepository.Allemagne.img;
break;
case "it-IT":
flag = flagsRepository.Italie.img;
break;
case "pt-PT":
flag = flagsRepository.Portugal.img;
break;
case "es-ES":
flag = flagsRepository.Espagne.img;
break;
default:
flag = flagsRepository.France.img;
}
return flag;
}
function showSummary(el) {
var onclickTagname = el.tagName;
if (onclickTagname == "IMG") {
var eyeOpen = "https://lh3.googleusercontent.com/-Wv-aBi5_sbw/XCvi-zlsFiI/AAAAAAAAiHw/wmVW3KBeJE0_V0toQkUSqLqcb1F60nS6gCHMYCw/s0/eye-open.png";
var eyeClosed = "https://lh3.googleusercontent.com/-q3AVmPQD_gY/XCvbMfSSkjI/AAAAAAAAiHk/V_N9sg6HpNEUSfK_5YtSeDPcGfJpej0ggCHMYCw/s0/eye-1103592_960_720.png";
var divEye = el.parentNode;
//var divTitle = divEye.parentNode;
//var divArticle = divTitle.parentNode;
var divArticle = divEye.parentNode;
var divSum = divArticle.children[1];
var spanImgLink = divSum.children[0].children[0];
if (divSum.style.display == 'none') {
el.src = eyeClosed;
divSum.style.display = 'block';
//divTitle.children[0].children[0].style.display = 'none';
//divTitle.children[0].children[1].style.display = 'block';
divEye.children[0].children[0].style.display = 'none';
divEye.children[0].children[1].style.display = 'block';
if (spanImgLink.children[0].dataset.img == 'no') {
spanImgLink.style.display = 'none';
}
}
else {
el.src = eyeOpen;
divSum.style.display = 'none';
//divTitle.children[0].children[0].style.display = 'block';
//divTitle.children[0].children[1].style.display = 'none';
divEye.children[0].children[0].style.display = 'block';
divEye.children[0].children[1].style.display = 'none';
}
}
else {
var eyeOpen = "https://lh3.googleusercontent.com/-Wv-aBi5_sbw/XCvi-zlsFiI/AAAAAAAAiHw/wmVW3KBeJE0_V0toQkUSqLqcb1F60nS6gCHMYCw/s0/eye-open.png";
var eyeClosed = "https://lh3.googleusercontent.com/-q3AVmPQD_gY/XCvbMfSSkjI/AAAAAAAAiHk/V_N9sg6HpNEUSfK_5YtSeDPcGfJpej0ggCHMYCw/s0/eye-1103592_960_720.png";
var divLink = el.parentNode.parentNode;
var divArticle = divLink.parentNode;
var divSum = divArticle.children[1];
var spanImgLink = divSum.children[0].children[0];
if( divSum.style.display == 'none') {
divSum.style.display = 'block';
if( spanImgLink.children[0].dataset.img == 'no' ) {
spanImgLink.style.display = 'none';
}
} else {
divSum.style.display = 'none';
}
}
}
function getLinkContent(theURL) {
var xmlhttp = false;
loadXMLDoc(theURL);
if (xmlhttp == false) {
//alert("timeout");
return '';
}
else {
var allText = xmlhttp.responseText;
return getBody(allText);
}
function getBody(content) {
var element; var result = {title: '', authors: '',body: ''};
var element = '// Fin des scripts, à ne pas supprimer (voir) getBody';
content = getPart(content, element, 1, 'no') ;
element = 'post-lang';
result.lang = getPart(content, element, 0, 'no').split("<")[0];
var langs = result.lang.split(' ');
/*element = 'post-title entry-title';
result.title = getPart(content, element, 0, 'no').split("<")[0];
element = 'post-authors';
result.authors = getPart(content, element, 0, 'yes').split("<")[0];*/
var title = '';
var authors ='';
/*if( langs.length == 1) {
element = 'post-title entry-title';
title = getPart(content, element, 0, 'no').split("<")[0];
element = 'post-authors';
authors = getPart(content, element, 0, 'no').split("<")[0];
} else {*/
for( var i=0; i < langs.length; i++ ) {
element = 'html2pdf-post-title ' + langs[i];
//title.push( getPart(content, element, 0, 'no').split("<")[1].split(">")[1] );
title += '
' + getPart(content, element, 0, 'no').split("<")[1].split(">")[1] + '
';
element = 'authors-in-post post-authors ' + langs[i];
//authors.push( getPart(content, element, 0, 'no').split("<")[0] );
authors += '
' + getPart(content, element, 0, 'no').split("<")[0] + '
';
}
//}
result.title = title;
result.authors = authors;
var element = 'post-body entry-content float-container';
result.body = getPart(content, element, 0, 'no') ;
return result;
}
function getPart(content, element, iIndex, iShow) {
var indices = [];
var idx = content.indexOf(element);
while (idx != -1) {
indices.push(idx);
idx = content.indexOf(element, idx + 1);
}
if( iShow == 'yes' ) {
for (var i = 0; i < indices.length; i++) {
var x = indices[i];
x = content.indexOf(">", x + 1);
var y = content.lastIndexOf("