]>
git.wh0rd.org - tt-rss.git/blob - plugins/embed_original/init.js
6bc13ddfa88dd9575024092626804df6677983c8
1 function embedOriginalArticle(id
) {
3 const hasSandbox
= "sandbox" in document
.createElement("iframe");
6 alert(__("Sorry, your browser does not support sandboxed iframes."));
13 c
= $$("div#RROW-" + id
+ " div[class=cdmContentInner]")[0];
14 } else if (id
== getActiveArticleId()) {
15 c
= $$("div[class=postContent]")[0];
19 const iframe
= c
.parentNode
.getElementsByClassName("embeddedContent")[0];
23 c
.parentNode
.removeChild(iframe
);
26 cdmScrollToArticleId(id
, true);
33 const query
= { op
: "pluginhandler", plugin
: "embed_original", method
: "getUrl", id
: id
};
35 xhrJson("backend.php", query
, (reply
) => {
37 const iframe
= new Element("iframe", {
38 class: "embeddedContent",
40 width
: (c
.parentNode
.offsetWidth
- 5) + 'px',
41 height
: (c
.parentNode
.parentNode
.offsetHeight
- c
.parentNode
.firstChild
.offsetHeight
- 5) + 'px',
42 style
: "overflow: auto; border: none; min-height: " + (document
.body
.clientHeight
/ 2) + "px;",
43 sandbox
: 'allow-scripts',
48 c
.parentNode
.insertBefore(iframe
, c
);
51 cdmScrollToArticleId(id
, true);
58 exception_error("embedOriginalArticle", e
);