Revised basepath url. Check uri_thumbnail not null
This commit is contained in:
parent
e40c69e9a6
commit
cc746e0fef
|
@ -3,7 +3,7 @@
|
||||||
*/
|
*/
|
||||||
window.customElements.define('d4s-social-posts', class extends HTMLElement {
|
window.customElements.define('d4s-social-posts', class extends HTMLElement {
|
||||||
|
|
||||||
#basepath = 'https://api.d4science.org/rest'
|
#basepath = 'https://api.d4science.org'
|
||||||
|
|
||||||
#from = 1
|
#from = 1
|
||||||
#quantity = 10
|
#quantity = 10
|
||||||
|
@ -14,9 +14,9 @@ window.customElements.define('d4s-social-posts', class extends HTMLElement {
|
||||||
#shadowRoot = null
|
#shadowRoot = null
|
||||||
#unorderedlist = null
|
#unorderedlist = null
|
||||||
|
|
||||||
//#restRecentPosts = '/2/posts/get-posts-vre' // old get, gets all posts unfiltered
|
//#restRecentPosts = '/rest/2/posts/get-posts-vre' // old get, gets all posts unfiltered
|
||||||
#restRecentPosts = '/2/posts/get-recent-posts-vre-by-range'
|
#restRecentPosts = '/rest/2/posts/get-recent-posts-vre-by-range'
|
||||||
#restComments = '/2/comments/get-comments-by-post-id'
|
#restComments = '/rest/2/comments/get-comments-by-post-id'
|
||||||
|
|
||||||
#style = `<style>
|
#style = `<style>
|
||||||
.d4s-social-posts {
|
.d4s-social-posts {
|
||||||
|
@ -244,8 +244,10 @@ window.customElements.define('d4s-social-posts', class extends HTMLElement {
|
||||||
if (post.link_title !== "") {
|
if (post.link_title !== "") {
|
||||||
var attimg = document.createElement('div')
|
var attimg = document.createElement('div')
|
||||||
attimg.classList.add('attachment-div')
|
attimg.classList.add('attachment-div')
|
||||||
|
if (post.uri_thumbnail != "null") {
|
||||||
attimg.innerHTML += `<img src="${post.uri_thumbnail}" class="attachment-img" onerror="this.style.display='none'"/>`
|
attimg.innerHTML += `<img src="${post.uri_thumbnail}" class="attachment-img" onerror="this.style.display='none'"/>`
|
||||||
li.querySelector('.d4s-post-attachment').appendChild(attimg)
|
li.querySelector('.d4s-post-attachment').appendChild(attimg)
|
||||||
|
}
|
||||||
var attdesc = document.createElement('div')
|
var attdesc = document.createElement('div')
|
||||||
attdesc.classList.add('attachment-info')
|
attdesc.classList.add('attachment-info')
|
||||||
attdesc.innerHTML += `
|
attdesc.innerHTML += `
|
||||||
|
|
Loading…
Reference in New Issue