Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
trivalent
dashboard-trivalent
Commits
d4dfb266
Commit
d4dfb266
authored
Dec 14, 2018
by
Daniel Suarez Souto
Browse files
Fixed problems in Firefox
parent
a66b822f
Changes
3
Hide whitespace changes
Inline
Side-by-side
demo/elements/news-chart/news-chart.html
View file @
d4dfb266
...
...
@@ -16,8 +16,8 @@
<div
style=
"height: 600px; overflow-x: hidden; overflow-y: auto;"
>
<template
is=
"dom-repeat"
items=
"{{data}}"
as=
"news"
>
<div
class
$="
tweet
{{
checkSentiment
(
news.sentiments
)}}
same-height
"
ident
$="
subitem
[[
index
]]"
style=
" text-align: center;"
>
<div
class=
"row"
>
<div
class
$="
tweet
{{
checkSentiment
(
news.sentiments
)}}
same-height
"
ident
$="
subitem
[[
index
]]"
style=
" text-align:
center; min-height: 65px;display: flex;align-items: center;justify-content:
center;"
>
<div
class=
"row"
style=
"width: 100%;"
>
<button
data-toggle=
"modal"
data-target
$="
#subitem
[[
index
]]"
style=
"background: none; border: none; cursor: pointer; width: 100%;"
title=
"Check the new"
>
<div
class=
"col-md-12 headline"
>
<div
class=
"col-md-2 img-wrapper"
>
...
...
@@ -32,7 +32,7 @@
<div
class=
"modal fade"
id
$="
subitem
[[
index
]]"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
style=
"overflow: hidden;"
>
<div
class=
"modal-dialog modal-lg"
>
<div
class=
"modal-content"
style=
"height: fit-content;"
>
<div
class=
"modal-header"
style=
"height:80px;background-color: #449DD5; box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); border-radius: 5px 5px 0 0;"
>
<div
class=
"modal-header"
style=
"height:80px;background-color: #449DD5; box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); border-radius: 5px 5px 0 0;
display: flex;align-items: center;justify-content: center;
"
>
<!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close" style="color: #fff;opacity: inherit;"><span aria-hidden="true">×</span></button> -->
<div
class=
"col-md-12"
style=
"display: flex;flex-direction: row;justify-content: space-around;align-content: center;"
>
<div
class=
"col-md-2 img-wrapper"
style=
"width:13%"
>
...
...
demo/elements/news-chart/tweet-chart.css
View file @
d4dfb266
...
...
@@ -20,6 +20,7 @@
.headline
{
text-align
:
left
;
display
:
flex
;
}
.emotion-box
{
...
...
demo/elements/propaganda-chart/propaganda-chart.html
View file @
d4dfb266
...
...
@@ -27,9 +27,9 @@
<div
style=
"height: 600px; overflow-x: hidden; overflow-y: auto;"
>
<template
is=
"dom-repeat"
items=
"{{data}}"
as=
"news"
>
<div
class
$="
tweet
{{
checkSentiment
(
news.sentiments
)}}
same-height
"
ident
$="
subitem
[[
index
]]"
style=
" text-align: center; min-height:
5
5px"
>
<div
class=
"row"
>
<button
data-toggle=
"modal"
data-target
$="
#article
[[
index
]]"
style=
"background: none; border: none; cursor: pointer;"
title=
"Check the article"
>
<div
class
$="
tweet
{{
checkSentiment
(
news.sentiments
)}}
same-height
"
ident
$="
subitem
[[
index
]]"
style=
" text-align: center; min-height:
6
5px
;display: flex;align-items: center;justify-content: center; width: 100%
"
>
<div
class=
"row"
style=
"width: 100%;"
>
<button
data-toggle=
"modal"
data-target
$="
#article
[[
index
]]"
style=
"background: none; border: none; cursor: pointer;
width: 100%;
"
title=
"Check the article"
>
<div
class=
"col-md-12 headline"
>
<div
class=
"col-md-2"
style=
"justify-self: center; align-self: center;"
>
...
...
@@ -45,7 +45,7 @@
<div
class=
"modal fade"
id
$="
article
[[
index
]]"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
style=
"overflow: hidden;"
>
<div
class=
"modal-dialog modal-lg"
>
<div
class=
"modal-content"
style=
"height: fit-content;"
>
<div
class=
"modal-header"
style=
"height:80px;background-color: #449DD5; box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); border-radius: 5px 5px 0 0;"
>
<div
class=
"modal-header"
style=
"height:80px;background-color: #449DD5; box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2); border-radius: 5px 5px 0 0;
display: flex; align-items: center;justify-content: center;
"
>
<!-- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> -->
<div
class=
"col-md-12"
style=
"display: flex;flex-direction: row;justify-content: space-around;align-content: center;"
>
...
...
@@ -93,13 +93,13 @@
</template>
</div>
<div
class=
"col-md-7"
style=
"overflow-x: hidden; overflow-y:
auto
; height: 100%;"
>
<div
class=
"col-md-7"
style=
"overflow-x: hidden; overflow-y:
hidden
; height: 100%;"
>
<ul
class=
"nav nav-tabs"
role=
"tablist"
>
<li
class=
"active"
id=
"tabText"
><a
data-toggle=
"tab"
href
$="
#propaganda
[[
index
]]"
>
Text
</a></li>
<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: auto; height:
calc(100% - 45px)
; width: 100%;"
>
<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:
100%
; width: 100%;"
>
<div
id
$="{{
getID
(
news
)}}"
style=
"text-align: justify; white-space: pre-line;"
>
{{getArticle(news)}}
</div>
...
...
@@ -377,23 +377,35 @@
// Select the tab
$
(
'
#tabText a
'
).
tab
(
'
show
'
)
//Dynamic Scroll
setTimeout
(
function
()
{
/*
setTimeout(function() {
$('#'+element.parentElement.id).animate({scrollTop: $('#'+element.parentElement.id).scrollTop() + $('#'+element.parentElement.id + ' span').position().top - 200}, 400)
},
200
)
}, 200)*/
//console.log($('#'+element.parentElement.id))
$
(
'
#
'
+
element
.
parentElement
.
id
).
animate
({
scrollTop
:
$
(
'
#
'
+
element
.
parentElement
.
id
).
scrollTop
()
+
$
(
'
#
'
+
element
.
parentElement
.
id
+
'
span
'
).
position
().
top
-
200
},
400
)
}
},
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
'
];
var
page
=
parseInt
(
news
[
'
schema:pageStart
'
])
if
(
news
[
'
magazine
'
]
===
'
Rumiyah
'
){
page
+=
1
}
var
uri
=
"
http://trivalent-resources.cluster.gsi.dit.upm.es/
"
+
news
[
'
magazine
'
].
toLowerCase
()
+
"
/
"
+
news
[
'
magazine
'
].
toLowerCase
()
+
news
[
'
number
'
]
+
"
.pdf#page=
"
+
page
;
/*var uri= "http://localhost:8080/magazines/"+news['magazine'].toLowerCase()+"/data/"+news['magazine'].toLowerCase()+news['number']+".pdf#page="+news['schema:pageStart'];*/
//console.log(uri)
$
(
'
#article
'
+
index
).
off
();
$
(
'
#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%
'
)
;
var
iframe
=
$
(
'
<iframe>
'
).
attr
(
'
src
'
,
uri
).
width
(
'
100%
'
).
height
(
'
91%
'
);
$
(
'
#article
'
+
index
).
on
(
'
shown.bs.modal
'
,
function
(
event
)
{
if
(
$
(
'
#article
'
+
index
+
'
li#tabArticle
'
).
hasClass
(
'
active
'
)
)
$
(
'
#article
'
+
index
+
'
#pdf
'
+
index
).
html
(
iframe
);
}
});
$
(
'
#article
'
+
index
+
'
li#tabArticle a
'
).
on
(
'
shown.bs.tab
'
,
function
(
event
)
{
$
(
'
#article
'
+
index
+
'
#pdf
'
+
index
).
html
(
iframe
);
});
$
(
'
#article
'
+
index
).
on
(
'
hidden.bs.modal
'
,
function
(
event
)
{
$
(
'
#article
'
+
index
+
'
#pdf
'
+
index
).
empty
();
});
}
...
...
@@ -424,7 +436,7 @@
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)
$
(
'
#tabText a
'
).
tab
(
'
show
'
)
//console.log($('#'+element.parentElement.id+' span').position().top)
$
(
'
#
'
+
element
.
parentElement
.
id
).
animate
({
scrollTop
:
$
(
'
#
'
+
element
.
parentElement
.
id
).
scrollTop
()
+
$
(
'
#
'
+
element
.
parentElement
.
id
+
'
span
'
).
position
().
top
-
200
},
400
)
}
...
...
@@ -445,10 +457,6 @@
element.innerHTML = text_highlighted*/
//console.log(text_highlighted)
//console.log(cnt)
//console.log($('#'+element.parentElement.id+' span').position().top)
$
(
'
#
'
+
element
.
parentElement
.
id
).
animate
({
scrollTop
:
$
(
'
#
'
+
element
.
parentElement
.
id
).
scrollTop
()
+
$
(
'
#
'
+
element
.
parentElement
.
id
+
'
span
'
).
position
().
top
-
200
},
400
)
},
getCategory
:
function
(
category
){
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment