function showTrgmRelated(id) {
try {
- var query = "backend.php?op=pluginhandler&plugin=af_psql_trgm&method=showrelated¶m=" + param_escape(id);
+ const query = "backend.php?op=pluginhandler&plugin=af_psql_trgm&method=showrelated¶m=" + param_escape(id);
if (dijit.byId("trgmRelatedDlg"))
dijit.byId("trgmRelatedDlg").destroyRecursive();
console.log("af_zz_noautoplay!");
console.log(row);
- var videos = row.getElementsByTagName("video");
+ const videos = row.getElementsByTagName("video");
console.log(row.innerHTML);
for (i = 0; i < videos.length; i++) {
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function (row) {
if (row) {
- var videos = row.getElementsByTagName("video");
+ const videos = row.getElementsByTagName("video");
for (i = 0; i < videos.length; i++) {
videos[i].removeAttribute("autoplay");
return true;
});
});
-});
\ No newline at end of file
+});
function embedOriginalArticle(id) {
try {
- var hasSandbox = "sandbox" in document.createElement("iframe");
+ const hasSandbox = "sandbox" in document.createElement("iframe");
if (!hasSandbox) {
alert(__("Sorry, your browser does not support sandboxed iframes."));
return;
}
- var query = "op=pluginhandler&plugin=embed_original&method=getUrl&id=" +
+ const query = "op=pluginhandler&plugin=embed_original&method=getUrl&id=" +
param_escape(id);
- var c = false;
+ let c = false;
if (isCdmMode()) {
c = $$("div#RROW-" + id + " div[class=cdmContentInner]")[0];
}
if (c) {
- var iframe = c.parentNode.getElementsByClassName("embeddedContent")[0];
+ const iframe = c.parentNode.getElementsByClassName("embeddedContent")[0];
if (iframe) {
Element.show(c);
new Ajax.Request("backend.php", {
parameters: query,
onComplete: function(transport) {
- var ti = JSON.parse(transport.responseText);
+ const ti = JSON.parse(transport.responseText);
if (ti) {
- var iframe = new Element("iframe", {
+ const iframe = new Element("iframe", {
class: "embeddedContent",
src: ti.url,
width: (c.parentNode.offsetWidth-5)+'px',
function mailtoArticle(id) {
try {
if (!id) {
- var ids = getSelectedArticleIds2();
+ const ids = getSelectedArticleIds2();
if (ids.length == 0) {
alert(__("No articles are selected."));
if (dijit.byId("emailArticleDlg"))
dijit.byId("emailArticleDlg").destroyRecursive();
- var query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle¶m=" + param_escape(id);
+ const query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle¶m=" + param_escape(id);
dialog = new dijit.Dialog({
id: "emailArticleDlg",
function expandSizeWrapper(id) {
try {
- var row = $(id);
+ const row = $(id);
console.log(row);
if (row) {
- var content = row.select(".contentSizeWrapper")[0];
- var link = row.select(".expandPrompt")[0];
+ const content = row.select(".contentSizeWrapper")[0];
+ const link = row.select(".expandPrompt")[0];
if (content) content.removeClassName("contentSizeWrapper");
if (link) Element.hide(link);
window.setTimeout(function() {
if (row) {
- var c_inner = row.select(".cdmContentInner")[0];
- var c_inter = row.select(".cdmIntermediate")[0];
+ const c_inner = row.select(".cdmContentInner")[0];
+ const c_inter = row.select(".cdmIntermediate")[0];
if (c_inner && c_inter &&
row.offsetHeight >= _shorten_expanded_threshold * window.innerHeight) {