Merge branch 'master' of https://code-repo.d4science.org/gCubeSystem/cdn-experiments
This commit is contained in:
commit
d802ebac51
|
@ -39,7 +39,7 @@ window.customElements.define('d4s-social-search', class extends HTMLElement {
|
||||||
|
|
||||||
window.customElements.define('d4s-social-posts', class extends HTMLElement {
|
window.customElements.define('d4s-social-posts', class extends HTMLElement {
|
||||||
|
|
||||||
#basepath = 'https://api.dev.d4science.org/rest'
|
#basepath = 'https://api.d4science.org/rest'
|
||||||
#quantity = 20
|
#quantity = 20
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -63,10 +63,11 @@ window.customElements.define('d4s-social-posts', class extends HTMLElement {
|
||||||
li.setAttribute('class', 'd4s-social-post')
|
li.setAttribute('class', 'd4s-social-post')
|
||||||
const datetime = new Date(0)
|
const datetime = new Date(0)
|
||||||
datetime.setUTCMilliseconds(post.time)
|
datetime.setUTCMilliseconds(post.time)
|
||||||
|
const thumbnail = (!post.thumbnail_url.startsWith('http')) ? 'https://' + d4s.clientId + post.thumbnail_url : post.thumbnail_url
|
||||||
li.innerHTML = `
|
li.innerHTML = `
|
||||||
<div class="d4s-post-heading">
|
<div class="d4s-post-heading">
|
||||||
<div class="d4s-post-avatar">
|
<div class="d4s-post-avatar">
|
||||||
<img src="${post.thumbnail_url}" onerror="this.style.display='none'" width="32px" height="32px"></slot>
|
<img src="${thumbnail}" onerror="this.style.display='none'" width="32px" height="32px"></slot>
|
||||||
</div>
|
</div>
|
||||||
<div class="d4s-post-meta">
|
<div class="d4s-post-meta">
|
||||||
<div class="fullname">${post.full_name}</div>
|
<div class="fullname">${post.full_name}</div>
|
||||||
|
|
Loading…
Reference in New Issue