|
@@ -257,6 +257,13 @@ class ParseCard {
|
|
|
_iframe.style.cssText = 'border:medium none; width:375px; min-height:300px;'
|
|
|
return _iframe
|
|
|
}
|
|
|
+ createNftGroupIframe({ project_Id }) {
|
|
|
+ let _iframe = document.createElement('iframe')
|
|
|
+ _iframe.id = project_Id
|
|
|
+ _iframe.src = chrome.runtime.getURL('/iframe/nft-group-card.html') + `?projectId=${project_Id}`;
|
|
|
+ _iframe.style.cssText = 'border:medium none; width:505px; min-height:180px;'
|
|
|
+ return _iframe
|
|
|
+ }
|
|
|
isHasIframeByArticle(dom_card) {
|
|
|
if (!dom_card || !dom_card.parentElement) {
|
|
|
return
|
|
@@ -402,5 +409,26 @@ class ParseCard {
|
|
|
dom.appendChild(this.createIframe({ post_Id, tweet_author }, true))
|
|
|
}
|
|
|
}
|
|
|
+ replaceNftGroupDomRedPacket({ dom_card, tweet_Id, post_Id, time, short_url }) {
|
|
|
+ if (!dom_card || !dom_card.parentElement) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let dom = dom_card.querySelector('div[aria-labelledby]')
|
|
|
+ if (dom) {
|
|
|
+ for (let i = 0; i < dom.childNodes.length; i++) {
|
|
|
+ if (dom.children[i].tagName.toLowerCase() != 'iframe') {
|
|
|
+ dom.children[i].style.display = 'none'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ dom = dom_card.querySelector('div[lang][dir=auto]').parentElement
|
|
|
+ }
|
|
|
+
|
|
|
+ dom.style = 'min-height:180px'
|
|
|
+ if (dom) {
|
|
|
+ let project_Id = post_Id.replace('nft_group/', '');
|
|
|
+ dom.appendChild(this.createNftGroupIframe({ project_Id }))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
export default new ParseCard()
|