Fix historial en mostrar enlace original

This commit is contained in:
k1792539
2017-08-15 15:53:40 +02:00
parent c627178009
commit 387835d5ae
5 changed files with 23 additions and 4 deletions
@@ -77,7 +77,9 @@ function get_response(data) {
document.getElementById("itemlist").scrollTop = 0;
show_images();
nav_history.newResponse(item_list, data.category);
nav_history.newResponse(item_list, data.category, data.url);
set_original_url(data.url)
//console.debug(nav_history)
send_data({
@@ -104,6 +104,19 @@ function image_error(thumbnail) {
};
};
function set_original_url(url){
currentWebLink = document.getElementById("current_web_link")
if (currentWebLink) {
if (url) {
currentWebLink.style.display = "block";
currentWebLink.href = url;
}
else {
currentWebLink.style.display = "none";
}
}
}
function show_images(){
var container = document.getElementById("itemlist");
var images = container.getElementsByTagName("img");
+4 -1
View File
@@ -59,7 +59,7 @@ var nav_history = {
}
}
},
"newResponse": function (data, category) {
"newResponse": function (data, category, url) {
if (!this.confirmed) {
if (this.states[this.current].focus >= 0) {
document.getElementById("itemlist").children[this.states[this.current].focus].children[0].focus();
@@ -68,6 +68,7 @@ var nav_history = {
this.states[this.current].end = new Date().getTime();
this.states[this.current].data = data;
this.states[this.current].category = category;
this.states[this.current].url = url;
this.confirmed = true;
if (settings.builtin_history && !this.from_nav) {
if (this.current > 0) {
@@ -86,6 +87,7 @@ var nav_history = {
this.states[this.current].end = new Date().getTime();
this.states[this.current].data = data;
this.states[this.current].category = category;
this.states[this.current].url = url;
this.states = this.states.slice(0, this.current + 1);
}
this.from_nav = false;
@@ -116,6 +118,7 @@ var nav_history = {
if (this.states[this.current].end - this.states[this.current].start > this.cache) {
document.getElementById("itemlist").innerHTML = this.states[this.current].data.join("");
set_category(this.states[this.current].category)
set_original_url(this.states[this.current].url)
if (this.states[this.current].focus >= 0) {
document.getElementById("itemlist").children[this.states[this.current].focus].children[0].focus();
}
+2 -2
View File
@@ -129,7 +129,7 @@
<a href="javascript:void(0)" onmouseover="this.focus()" onmouseout="this.blur()" onclick="send_data({'id':this.parentNode.parentNode.RequestID, 'result': 6})"></a>
<a href="javascript:void(0)" onmouseover="this.focus()" onmouseout="this.blur()" onclick="send_data({'id':this.parentNode.parentNode.RequestID, 'result': 7})"></a>
<a href="javascript:void(0)" onmouseover="this.focus()" onmouseout="this.blur()" onclick="send_data({'id':this.parentNode.parentNode.RequestID, 'result': 8})"></a>
</div>
</div>
<div class="window_footer" id="window_footer">
<a href="javascript:void(0)" class="control_button button_ok" onmouseover="this.focus()" onclick="send_data({'id':this.parentNode.parentNode.RequestID, 'result':true});dialog.closeall();loading.show();">Aceptar</a>
<a href="javascript:void(0)" class="control_button button_close" onmouseover="this.focus()" onclick="send_data({'id':this.parentNode.parentNode.RequestID, 'result':null });dialog.closeall();">Cancelar</a>
@@ -214,7 +214,7 @@
<div class="left">
</div>
<div class="links">
<a href="#">Saber más sobre Alfa</a> | <a href="#">Foro</a>
<a href="#" id="current_web_link" target="_blank" hidden>Abrir web original</a>
</div>
<div class="status" id="status">Desconectado</div>
</div>