function setCookie(name, value) { document.cookie = name + "=" + value + "; SameSite=strict;" } function clearCookie(name) { document.cookie = name + "=; " } function getCookie(name) { var cookies = document.cookie.split('; '); for(var i=0; i propably POST? var history=isNewToHistory(url); if (history==null) return; //remove first element if(rewrite!=null)history.shift(); //limit size if(history.length>20) history.pop(); if(history.length==0){ setCookie("history", url); }else{ var content=url; var i=0; for (i in history){ if ((history[i]!=null)&&(history[i]!=''))content+='|'+history[i]; } setCookie("history", content); } //showHistory(); } function showHistory(){ var history=getHistory(); var s='
';
    for (var i=5; i>=0;i--){
        if(history[i]!=null) s+=i+" "+history[i]+"\n";
    }
    s+='
'; $('#content').prepend(s); } function getBack(){ var history=getHistory(); if (history.length==0)return; //remove current page var url=history.shift(); if (history.length==0)return; //remove previous page var url=history.shift(); setCookie("history", history.join("|")); window.location.href=url; } // add back button if not existing function addBackButton(){ var backButton=$('#backButton'); if(backButton.length>0)return; if (loc['button_back']==null)return; // add back button if history exists var history=getHistory(); //console.log(history.length); if (history.length>1){ $('#calcms_nav').first().prepend( '
' +'' +' ' +loc['button_back'] +'
' ); } setupMenuHeight(); //showHistory(); } $(document).ready(function(){ //clearCookie(); appendHistory(); });