Commit a9e97a12 authored by Daniel Suarez Souto's avatar Daniel Suarez Souto
Browse files

Fixed visualization problems on the magazines

parent 6bf27a52
......@@ -81,7 +81,7 @@
<li id="tabArticle"><a data-toggle="tab" href$="#pdf[[index]]">Magazine</a></li>
</ul>
<div class="tab-content">
<div id$="propaganda[[index]]" class="tab-pane fade in active" style="background-color: #eeeeee96; float: right; border: 1px solid #B3BFC7; padding: 20px; overflow-y: auto; height: calc(100% - 45px);">
<div id$="propaganda[[index]]" class="tab-pane fade in active" style="background-color: #eeeeee96; float: right; border: 1px solid #B3BFC7; padding: 20px; overflow: auto; height: calc(100% - 45px); width: 100%;">
<div id$="{{getID(news)}}" style="text-align: justify; white-space: pre-line;">
{{getArticle(news)}}
</div>
......@@ -276,14 +276,14 @@
},
getUri: function(news){
var uri="http://trivalent-resources.cluster.gsi.dit.upm.es/"+news['magazine'].toLowerCase()+"/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart']+"&view=FitB";
//var uri="http://trivalent-resources.cluster.gsi.dit.upm.es/"+news['magazine'].toLowerCase()+"/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart']+"&view=FitB";
//console.log(uri)
//var uri= "/magazines/"+news['magazine'].toLowerCase()+"/data/"+news['magazine'].toLowerCase()+news['number']+".pdf";
//console.log(uri)
//return uri;
return '/resources/'+(news['@id'].split('/')[4]);
//return '/resources/'+(news['@id'].split('/')[4]);
},
getemotion: function(emotion) {
//console.log(emotion)
......@@ -334,22 +334,28 @@
var endIndex = e.model.__data__.entity["nif:endIndex"] + 1
if (beginIndex >= 0) {
text = text.substring(0,beginIndex) + "<span class='highlight' style='background-color:yellow'>" + text.substring(beginIndex,endIndex) + "</span>" + text.substring(endIndex)
element.innerHTML = text
//console.log(text)
//Dynamic Scroll
$('#'+element.parentElement.id).animate({scrollTop: $('#'+element.parentElement.id).scrollTop() + $('#'+element.parentElement.id + ' span').position().top - 200}, 400)
text = text.substring(0,beginIndex) + "<span class='highlight' style='background-color:yellow'>" + text.substring(beginIndex,endIndex) + "</span>" + text.substring(endIndex)
element.innerHTML = text
//console.log(text)
// Select the tab
$('#tabText a').tab('show')
//Dynamic Scroll
setTimeout(function() {
$('#'+element.parentElement.id).animate({scrollTop: $('#'+element.parentElement.id).scrollTop() + $('#'+element.parentElement.id + ' span').position().top - 200}, 400)
}, 200)
}
},
setPDF: function(news, index) {
function loadPDF() {
var uri= "http://trivalent-resources.cluster.gsi.dit.upm.es/"+news['magazine'].toLowerCase()+"/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart']+1;
var uri= "http://trivalent-resources.cluster.gsi.dit.upm.es/"+news['magazine'].toLowerCase()+"/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart'];
$('#article'+index).off();
$('#article'+index).on('shown.bs.modal', function(event) {
var iframe = $('<iframe>').attr('src', uri).width('100%').height('91%');
$('#article'+index+' #pdf'+index).html(iframe);
$('#article'+index+' li#tabArticle a').on('shown.bs.tab', function(event) {
if ($('#article'+index+' iframe').length === 0) {
var iframe = $('<iframe>').attr('src', uri).width('100%').height('91%');
$('#article'+index+' #pdf'+index).html(iframe);
}
});
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment