$.isWebStorageAvailable = function() { try { localStorage.setItem("__test", "data"); } catch (e) { if (/QUOTA_?EXCEEDED/i.test(e.name)) { return false; } } return true; } $.explodeUri = function() { // Tableau de résultat var tabUri = {}; // Check le hash var Hash = window.location.hash.substr(1); tabUri["HashTab"] = Array(); $.each(Hash.split("&"), function(i, p) { var tmpTabHash = p.split("="); if(!$.isNue(tmpTabHash[1])) tabUri["HashTab"].push({"key":tmpTabHash[0],"value":tmpTabHash[1]}); }); // Check des paramètres GET var Get = location.search.substr(1); tabUri["GetTab"] = Array(); $.each(Get.split("&"), function(i, p) { var tmpTabGet = p.split("="); if(!$.isNue(tmpTabGet[1])) tabUri["GetTab"].push({"key":tmpTabGet[0],"value":tmpTabGet[1]}); }); // Check de request tabUri["Pathname"] = window.location.pathname; // Check du domaine tabUri["Hostname"] = window.location.host; // Retourne le résultat return tabUri; }; $.implodeUri = function(U) { // Check le hash var hashT = Array(); $.each(U["HashTab"], function(k, v) { hashT.push(v["key"] + "=" + v["value"]); }); var hash = (!$.isNue(hashT)) ? "#" + hashT.join("&"):""; // Check des paramètres GET var getT = Array(); $.each(U["GetTab"], function(k, v) { getT.push(v["key"] + "=" + v["value"]); }); var get = (!$.isNue(getT)) ? "?" + getT.join("&"):""; // Retourne le résultat return (U["Hostname"] + U["Pathname"] + get + hash); }; $.fn.isNue = function() { return $.isNue(this,arguments[0]); }; Array.prototype.isNue = function() { return $.isNue(this,arguments[0]) }; String.prototype.isNue = function() { return $.isNue(this,arguments[0]) }; Number.prototype.isNue = function() { return $.isNue(this,arguments[0]) }; Boolean.prototype.isNue = function() { return $.isNue(this,arguments[0]) }; $.isNue = function() { // Déclaration de la variable de résultat var V; // Avec ou sans Evaluation var Eval = (arguments[1]||false); // Avec Evaluation if(Eval) { try{ if(eval("(" + arguments[0] + ")!=undefined")) V = eval("(" + arguments[0] + ")"); else return true; } catch (ex) { return true; } } // Sans Evaluation else V = arguments[0]; // Test Empty if($.isEmpty(V)) return true; // Test Empty Array() if(($.isEmptyObject(V) && !$.isNumeric(V)) || V == []) return true; // Test Element JQuery if(V instanceof $ && V.length ==0) return true; // Pas vide return false; } String.prototype.isEmpty = function() { return $.isEmpty(this) }; $.isEmpty = function(S) { try{ return (S=="" || S==0 || S=="0" || S==0.0 || S==null || S==false || typeof(S)=="undefined") ? true:false; } catch (ex) { return true; } }; String.prototype.strReplace = function(Search,Replace) { return $.strReplace(Search,Replace,this); }; $.strReplace = function() { // Valeurs par défaut var Search = arguments[0] || ""; var Replace = arguments[1] || ""; var Subject = arguments[2] || ""; // Remplacement de la chaine tant qu'elle est trouvée while(Subject.indexOf(Search) != -1) { Subject = Subject.replace(Search, Replace); } // Retourne le résultat return Subject; }; $(document).ready(function() { // S'il ne s'agit pas d'une iframe et que les sessions js sont disponible if(window==window.top && $.isWebStorageAvailable()) { // Check si déjà affiché et autorisé if($.isNue(window.sessionStorage.getItem("cookiemsg"))) { // Tableau de traduction de la phrase d'entête var tabMsgAlerteCookie = {}; tabMsgAlerteCookie.fr = "En poursuivant votre navigation, vous acceptez l'utilisation de cookies afin de permettre le bon fonctionnement de nos services. Pour en savoir plus, cliquez ici."; tabMsgAlerteCookie.uk = "By continuing browsing, you accept the use of cookies in order to allow the proper operation of our services. To learn more click here."; tabMsgAlerteCookie.es = "Continuando la navegación, el usuario acepta usar desde Para habilitar las cookies Pide el bien de nuestra operación tiene servicios. Para obtener más información, haga clic aquí."; tabMsgAlerteCookie.de = "Weiter ihr navigations stimmen verwenden von bis aktivieren sie diese option bestellen wohle unserer operation services. Für weitere informationen, klicken Sie bitte hier."; tabMsgAlerteCookie.it = "Continuando la navigazione, l'utente accetta Usa Dal Per abilitare i cookie ordinare il bene della nostra operazione ha servizi . Per ulteriori informazioni ,clicca qui."; tabMsgAlerteCookie.nl = "Voortgezette Uw navigatiesysteem, gaat u akkoord Gebruik Van Tot de cookies Bestel de Goede Van Onze operatie diensten . Voor meer informatie, klik hier."; tabMsgAlerteCookie.ru = "Continuing Your navigation, YOU agree Use From To enable cookies ORDER The Good Of Our operation has services. To learn more click here."; // Tableau de traduction du bouton fermer var closeAlerteCookie = "Ok"; var $divAlertCookie = $("
").attr({"class":"alert-cookies"}); var $divAlertCookieTexte = $("
").attr({"class":"alert-cookies-texte"}); var $divAlertCookieClose = $("
").attr({"class":"alert-cookies-close"}); // Lien vers les mentions légales var linkML = "http://www.tsimmotransactions.fr/fr/mentionslegales.htm"; // Ajout du contenu $divAlertCookieTexte.append(tabMsgAlerteCookie['fr'].strReplace("LNK_ML",linkML),closeAlerteCookie); // Ajout du css $.injectCSS({ ".alert-cookies" : { "text-align": "left", "background": "rgba(90, 90, 90, 0.90)", "font": "12px/1.5 Sans-serif", "position": "fixed", "z-index": "9998", "bottom": "0", "left": "0", "width": "100%", "height": "auto", "color": "#FFF" }, ".alert-cookies a" : { "color": "#FFF !important", "text-decoration": "underline !important", }, ".alert-cookies-texte" : { "width": "98%", "margin": "0 auto", "padding-top": "10px", "padding": "20px 1%", "max-width": "980px", "line-height": "25px", "text-align": "center" }, "span.alert-cookies-close" : { "cursor": "pointer", "background": "#313131", "text-transform": "uppercase", "font-size": "11px", "padding": "5px 6px", "margin": "0 5px", "text-decoration": "none !important" }, "span.alert-cookies-close:hover" : { "background": "#1d1d1d", "text-decoration": "none !important" } }); // Ajout en entête de body $divAlertCookie.append($divAlertCookieTexte); $("body").prepend($divAlertCookie); // Ajout de l'évenementiel sur le bouton close $(".alert-cookies-close").on("click", function () { $(".alert-cookies").remove(); }) // Ajout du cookie d'autorisation window.sessionStorage.setItem("cookiemsg", true); } // S'il n'a pas fait ou pas encore le choix de ne pas stocker de cookie if($.isNue(window.sessionStorage.getItem("nocookie"))) { // Ajout du bouton de désactivation des cookies $(".ml-table table").append($("").append($("Cliquez ici pour désactiver les cookies."))); $("div.cookie-allow").append($("
Cliquez ici pour désactiver les cookies.
")); // Ajout de l'évenementiel de désactivation du cookies au click $(".disable-cookies").on("click", function() { // Mémorisation du choix window.sessionStorage.setItem("nocookie", true); // Rechargement de la page avec le paramètre nocookie var tabUri = $.explodeUri(); if(document.location.search.indexOf("nocookie")==-1) tabUri["GetTab"].push({"key":"nocookie","value":"1"}); document.location.href = "http://" + $.implodeUri(tabUri); }); } // Uniquement s'il a choisi de ne pas stocker les cookies else { // Affichage navigation sans cookie $(".ml-table table").append($("").append($("Votre navigation est effective sans aucun cookie."))); $("div.cookie-allow").append($("
Votre navigation est effective sans aucun cookie.
")); } } });