Merge pull request #37 from k1792539/linksMS
[mediaserver] Añadir link original en el footer
This commit is contained in:
@@ -113,6 +113,7 @@ class platform(Platformtools):
|
|||||||
JsonData["data"]["viewmode"] = parent_item.viewmode
|
JsonData["data"]["viewmode"] = parent_item.viewmode
|
||||||
JsonData["data"]["category"] = parent_item.category.capitalize()
|
JsonData["data"]["category"] = parent_item.category.capitalize()
|
||||||
JsonData["data"]["host"] = self.controller.host
|
JsonData["data"]["host"] = self.controller.host
|
||||||
|
if parent_item.url: JsonData["data"]["url"] = parent_item.url
|
||||||
|
|
||||||
# Recorremos el itemlist
|
# Recorremos el itemlist
|
||||||
for item in itemlist:
|
for item in itemlist:
|
||||||
|
|||||||
@@ -77,7 +77,9 @@ function get_response(data) {
|
|||||||
document.getElementById("itemlist").scrollTop = 0;
|
document.getElementById("itemlist").scrollTop = 0;
|
||||||
show_images();
|
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)
|
//console.debug(nav_history)
|
||||||
send_data({
|
send_data({
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ function focus_element(element) {
|
|||||||
function image_error(thumbnail) {
|
function image_error(thumbnail) {
|
||||||
var src = thumbnail.src;
|
var src = thumbnail.src;
|
||||||
if (thumbnail.src.indexOf(domain) == 0) {
|
if (thumbnail.src.indexOf(domain) == 0) {
|
||||||
thumbnail.src = "http://media.tvalacarta.info/pelisalacarta/thumb_folder2.png";
|
thumbnail.src = "https://github.com/alfa-addon/addon/raw/master/plugin.video.alfa/resources/media/general/default/thumb_folder.png";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
thumbnail.src = domain + "/proxy/" + encodeURIComponent(btoa(thumbnail.src));
|
thumbnail.src = domain + "/proxy/" + encodeURIComponent(btoa(thumbnail.src));
|
||||||
@@ -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(){
|
function show_images(){
|
||||||
var container = document.getElementById("itemlist");
|
var container = document.getElementById("itemlist");
|
||||||
var images = container.getElementsByTagName("img");
|
var images = container.getElementsByTagName("img");
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ var nav_history = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"newResponse": function (data, category) {
|
"newResponse": function (data, category, url) {
|
||||||
if (!this.confirmed) {
|
if (!this.confirmed) {
|
||||||
if (this.states[this.current].focus >= 0) {
|
if (this.states[this.current].focus >= 0) {
|
||||||
document.getElementById("itemlist").children[this.states[this.current].focus].children[0].focus();
|
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].end = new Date().getTime();
|
||||||
this.states[this.current].data = data;
|
this.states[this.current].data = data;
|
||||||
this.states[this.current].category = category;
|
this.states[this.current].category = category;
|
||||||
|
this.states[this.current].source_url = url;
|
||||||
this.confirmed = true;
|
this.confirmed = true;
|
||||||
if (settings.builtin_history && !this.from_nav) {
|
if (settings.builtin_history && !this.from_nav) {
|
||||||
if (this.current > 0) {
|
if (this.current > 0) {
|
||||||
@@ -86,6 +87,7 @@ var nav_history = {
|
|||||||
this.states[this.current].end = new Date().getTime();
|
this.states[this.current].end = new Date().getTime();
|
||||||
this.states[this.current].data = data;
|
this.states[this.current].data = data;
|
||||||
this.states[this.current].category = category;
|
this.states[this.current].category = category;
|
||||||
|
this.states[this.current].source_url = url;
|
||||||
this.states = this.states.slice(0, this.current + 1);
|
this.states = this.states.slice(0, this.current + 1);
|
||||||
}
|
}
|
||||||
this.from_nav = false;
|
this.from_nav = false;
|
||||||
@@ -116,6 +118,7 @@ var nav_history = {
|
|||||||
if (this.states[this.current].end - this.states[this.current].start > this.cache) {
|
if (this.states[this.current].end - this.states[this.current].start > this.cache) {
|
||||||
document.getElementById("itemlist").innerHTML = this.states[this.current].data.join("");
|
document.getElementById("itemlist").innerHTML = this.states[this.current].data.join("");
|
||||||
set_category(this.states[this.current].category)
|
set_category(this.states[this.current].category)
|
||||||
|
set_original_url(this.states[this.current].source_url)
|
||||||
if (this.states[this.current].focus >= 0) {
|
if (this.states[this.current].focus >= 0) {
|
||||||
document.getElementById("itemlist").children[this.states[this.current].focus].children[0].focus();
|
document.getElementById("itemlist").children[this.states[this.current].focus].children[0].focus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,7 +214,7 @@
|
|||||||
<div class="left">
|
<div class="left">
|
||||||
</div>
|
</div>
|
||||||
<div class="links">
|
<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>
|
||||||
<div class="status" id="status">Desconectado</div>
|
<div class="status" id="status">Desconectado</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user