]>
git.wh0rd.org - tt-rss.git/blob - plugins/embed_original/init.js
1 function embedOriginalArticle(id
) {
3 var hasSandbox
= "sandbox" in document
.createElement("iframe");
6 alert(__("Sorry, your browser does not support sandboxed iframes."));
10 var query
= "op=pluginhandler&plugin=embed_original&method=getUrl&id=" +
16 c
= $$("div#RROW-" + id
+ " div[class=cdmContentInner]")[0];
17 } else if (id
== getActiveArticleId()) {
18 c
= $$("div[class=postContent]")[0];
22 var iframe
= c
.parentNode
.getElementsByClassName("embeddedContent")[0];
26 c
.parentNode
.removeChild(iframe
);
29 cdmScrollToArticleId(id
, true);
36 new Ajax
.Request("backend.php", {
38 onComplete: function(transport
) {
39 var ti
= JSON
.parse(transport
.responseText
);
43 var iframe
= new Element("iframe", {
44 class: "embeddedContent",
46 width
: (c
.parentNode
.offsetWidth
-5)+'px',
47 height
: (c
.parentNode
.parentNode
.offsetHeight
-c
.parentNode
.firstChild
.offsetHeight
-5)+'px',
48 style
: "overflow: auto; border: none; min-height: "+(document
.body
.clientHeight
/2)+"px;",
49 sandbox
: 'allow-scripts',
54 c
.parentNode
.insertBefore(iframe
,c
);
57 cdmScrollToArticleId(id
, true);
66 exception_error("embedOriginalArticle", e
);