disable not-working history fix

This commit is contained in:
Milan
2019-10-04 00:34:12 +02:00
parent bad6d301e5
commit 1cb4c6b23e

View File

@@ -50,24 +50,28 @@ function isNewToHistory(url){
var history = getHistory(); var history = getHistory();
//last page already in history //last page already in history
if (history[0] == url) return null; if ( history[0] == url) return null;
//replace url in history by current one, if controller is the same //replace url in history by current one, if controller is the same
var urlController=url.split('.cgi').shift(); var urlController=url.split('.cgi').shift();
var historyController=history[0].split('.cgi').shift(); var historyController=history[0].split('.cgi').shift();
//remove last entry on same controller //remove last entry on same controller
if(urlController==historyController){ if(urlController==historyController){
var ignore=0; console.log("same controller\n"+url+"\n"+history[0])
//var ignore=0;
//provide back to series from series details //provide back to series from series details
if(contains(url,'series')){ //if(contains(url,'series')){
//console.log(url); //console.log(url);
//console.log(history[0]); //console.log(history[0]);
if( (contains(url,'series_id')==true) && (contains(history[0],'series_id')==false)) ignore=1; //if( (contains(url,'series_id')==true) && (contains(history[0],'series_id')==false)) ignore=1;
//console.log(ignore); //console.log(ignore);
//}
//if (ignore==0)
//history.shift();
return null;
} }
if (ignore==0) history.shift();
}
return history; return history;
} }
@@ -101,22 +105,22 @@ function appendHistory(url, rewrite){
function showHistory(){ function showHistory(){
var history=getHistory(); var history=getHistory();
var s='<pre style="z-index:110;position:absolute;right:0;top:0">'; var s='<pre style="z-index:110;position:absolute;right:0;top:0;padding:0">';
for (var i=5; i>=0;i--){ for (var i=5; i>=0;i--){
if(history[i]!=null) s+=i+" "+history[i]+"\n"; if(history[i]!=null) s+=i+" "+history[i]+"\n";
} }
s+='</pre>'; s+='</pre>';
//alert(s)
$('#content').prepend(s); $('#content').prepend(s);
} }
function getBack(){ function getBack(){
var history=getHistory(); var history=getHistory();
//alert("getBack")
if (history.length==0)return; if (history.length==0)return;
//remove current page //remove current page
history.shift(); var url=history.shift();
if (history.length==0)return; if (history.length==0)return;
//remove previous page //remove previous page
var url=history.shift(); var url=history.shift();
setCookie("history", history.join("|")); setCookie("history", history.join("|"));