2018-12-02 15:38:27 +00:00
|
|
|
'use strict'
|
2018-11-29 18:03:55 +00:00
|
|
|
/* global dijit, __ */
|
|
|
|
|
2018-11-29 19:21:09 +00:00
|
|
|
let init_params = {};
|
|
|
|
let _label_base_index = -1024;
|
|
|
|
let loading_progress = 0;
|
|
|
|
let notify_hide_timerid = false;
|
2011-12-26 08:02:52 +00:00
|
|
|
|
|
|
|
Ajax.Base.prototype.initialize = Ajax.Base.prototype.initialize.wrap(
|
|
|
|
function (callOriginal, options) {
|
|
|
|
|
|
|
|
if (getInitParam("csrf_token") != undefined) {
|
|
|
|
Object.extend(options, options || { });
|
|
|
|
|
|
|
|
if (Object.isString(options.parameters))
|
|
|
|
options.parameters = options.parameters.toQueryParams();
|
|
|
|
else if (Object.isHash(options.parameters))
|
|
|
|
options.parameters = options.parameters.toObject();
|
|
|
|
|
|
|
|
options.parameters["csrf_token"] = getInitParam("csrf_token");
|
|
|
|
}
|
|
|
|
|
|
|
|
return callOriginal(options);
|
|
|
|
}
|
|
|
|
);
|
2008-05-15 04:21:00 +00:00
|
|
|
|
2018-11-29 19:21:09 +00:00
|
|
|
/* xhr shorthand helpers */
|
|
|
|
|
|
|
|
function xhrPost(url, params, complete) {
|
|
|
|
console.log("xhrPost:", params);
|
2018-11-30 12:07:44 +00:00
|
|
|
return new Ajax.Request(url, {
|
|
|
|
parameters: params,
|
|
|
|
onComplete: complete
|
|
|
|
});
|
2018-11-29 19:21:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function xhrJson(url, params, complete) {
|
2018-11-30 12:07:44 +00:00
|
|
|
return xhrPost(url, params, (reply) => {
|
|
|
|
try {
|
|
|
|
const obj = JSON.parse(reply.responseText);
|
|
|
|
complete(obj);
|
|
|
|
} catch (e) {
|
|
|
|
console.error("xhrJson", e, reply);
|
|
|
|
complete(null);
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
2018-11-29 19:21:09 +00:00
|
|
|
}
|
|
|
|
|
2007-05-15 11:41:39 +00:00
|
|
|
/* add method to remove element from array */
|
|
|
|
Array.prototype.remove = function(s) {
|
2018-11-29 17:07:23 +00:00
|
|
|
for (let i=0; i < this.length; i++) {
|
2007-05-15 11:41:39 +00:00
|
|
|
if (s == this[i]) this.splice(i, 1);
|
|
|
|
}
|
2011-12-10 17:26:59 +00:00
|
|
|
};
|
2007-05-15 11:41:39 +00:00
|
|
|
|
2018-12-02 17:07:57 +00:00
|
|
|
/* common helpers not worthy of separate Dojo modules */
|
|
|
|
|
2018-12-02 07:33:58 +00:00
|
|
|
const Lists = {
|
|
|
|
onRowChecked: function(elem) {
|
2018-12-02 08:25:32 +00:00
|
|
|
const checked = elem.domNode ? elem.attr("checked") : elem.checked;
|
2018-12-02 07:16:25 +00:00
|
|
|
// account for dojo checkboxes
|
|
|
|
elem = elem.domNode || elem;
|
|
|
|
|
2018-12-02 08:25:32 +00:00
|
|
|
const row = elem.up("li");
|
|
|
|
|
|
|
|
if (row)
|
|
|
|
checked ? row.addClassName("Selected") : row.removeClassName("Selected");
|
2018-12-02 07:16:25 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-12-02 07:46:09 +00:00
|
|
|
// noinspection JSUnusedGlobalSymbols
|
2018-12-02 07:33:58 +00:00
|
|
|
const Tables = {
|
|
|
|
onRowChecked: function(elem) {
|
|
|
|
// account for dojo checkboxes
|
2018-12-02 08:25:32 +00:00
|
|
|
const checked = elem.domNode ? elem.attr("checked") : elem.checked;
|
2018-12-02 07:33:58 +00:00
|
|
|
elem = elem.domNode || elem;
|
|
|
|
|
2018-12-02 08:25:32 +00:00
|
|
|
const row = elem.up("tr");
|
|
|
|
|
|
|
|
if (row)
|
|
|
|
checked ? row.addClassName("Selected") : row.removeClassName("Selected");
|
|
|
|
|
|
|
|
},
|
|
|
|
select: function(elemId, selected) {
|
|
|
|
$(elemId).select("tr").each((row) => {
|
|
|
|
const checkNode = row.select(".dijitCheckBox,input[type=checkbox]")[0];
|
|
|
|
if (checkNode) {
|
|
|
|
const widget = dijit.getEnclosingWidget(checkNode);
|
|
|
|
|
|
|
|
if (widget) {
|
|
|
|
widget.attr("checked", selected);
|
|
|
|
} else {
|
|
|
|
checkNode.checked = selected;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.onRowChecked(widget);
|
|
|
|
}
|
|
|
|
});
|
2018-12-02 07:46:09 +00:00
|
|
|
},
|
|
|
|
getSelected: function(elemId) {
|
|
|
|
const rv = [];
|
|
|
|
|
|
|
|
$(elemId).select("tr").each((row) => {
|
|
|
|
if (row.hasClassName("Selected")) {
|
|
|
|
// either older prefix-XXX notation or separate attribute
|
|
|
|
const rowId = row.getAttribute("data-row-id") || row.id.replace(/^[A-Z]*?-/, "");
|
|
|
|
|
|
|
|
if (!isNaN(rowId))
|
|
|
|
rv.push(parseInt(rowId));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return rv;
|
2018-12-02 07:33:58 +00:00
|
|
|
}
|
2018-12-02 07:46:09 +00:00
|
|
|
};
|
2018-12-02 07:33:58 +00:00
|
|
|
|
2018-12-02 17:07:57 +00:00
|
|
|
const Cookie = {
|
|
|
|
set: function (name, value, lifetime) {
|
|
|
|
const d = new Date();
|
|
|
|
d.setTime(d.getTime() + lifetime * 1000);
|
|
|
|
const expires = "expires=" + d.toUTCString();
|
|
|
|
document.cookie = name + "=" + encodeURIComponent(value) + "; " + expires;
|
|
|
|
},
|
|
|
|
get: function (name) {
|
|
|
|
name = name + "=";
|
|
|
|
const ca = document.cookie.split(';');
|
|
|
|
for (let i=0; i < ca.length; i++) {
|
|
|
|
let c = ca[i];
|
|
|
|
while (c.charAt(0) == ' ') c = c.substring(1);
|
|
|
|
if (c.indexOf(name) == 0) return decodeURIComponent(c.substring(name.length, c.length));
|
|
|
|
}
|
|
|
|
return "";
|
|
|
|
},
|
|
|
|
delete: function(name) {
|
|
|
|
const expires = "expires=Thu, 01-Jan-1970 00:00:01 GMT";
|
|
|
|
document.cookie = name + "=" + "" + "; " + expires;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/* error reporting */
|
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
function report_error(message, filename, lineno, colno, error) {
|
2017-03-05 07:50:15 +00:00
|
|
|
exception_error(error, null, filename, lineno);
|
2017-03-04 11:34:44 +00:00
|
|
|
}
|
2007-02-18 07:30:16 +00:00
|
|
|
|
2017-03-05 07:50:15 +00:00
|
|
|
function exception_error(e, e_compat, filename, lineno, colno) {
|
2017-03-04 11:34:44 +00:00
|
|
|
if (typeof e == "string") e = e_compat;
|
2009-01-23 14:20:36 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
if (!e) return; // no exception object, nothing to report.
|
2009-02-04 20:19:16 +00:00
|
|
|
|
2009-01-23 17:19:17 +00:00
|
|
|
try {
|
2017-03-05 07:50:15 +00:00
|
|
|
console.error(e);
|
2018-11-29 17:07:23 +00:00
|
|
|
const msg = e.toString();
|
2009-01-23 14:20:36 +00:00
|
|
|
|
2013-04-20 06:43:21 +00:00
|
|
|
try {
|
2018-11-29 19:21:09 +00:00
|
|
|
xhrPost("backend.php",
|
|
|
|
{op: "rpc", method: "log",
|
2017-03-05 07:50:15 +00:00
|
|
|
file: e.fileName ? e.fileName : filename,
|
|
|
|
line: e.lineNumber ? e.lineNumber : lineno,
|
|
|
|
msg: msg, context: e.stack},
|
2018-11-29 19:21:09 +00:00
|
|
|
(transport) => {
|
2017-03-05 07:50:15 +00:00
|
|
|
console.warn(transport.responseText);
|
2018-11-29 19:21:09 +00:00
|
|
|
});
|
2013-04-20 06:43:21 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
} catch (e) {
|
|
|
|
console.error("Exception while trying to log the error.", e);
|
2013-04-20 06:43:21 +00:00
|
|
|
}
|
|
|
|
|
2018-11-29 17:07:23 +00:00
|
|
|
let content = "<div class='fatalError'><p>" + msg + "</p>";
|
2011-03-18 11:31:54 +00:00
|
|
|
|
2017-03-05 07:30:49 +00:00
|
|
|
if (e.stack) {
|
2017-03-04 11:34:44 +00:00
|
|
|
content += "<div><b>Stack trace:</b></div>" +
|
|
|
|
"<textarea name=\"stack\" readonly=\"1\">" + e.stack + "</textarea>";
|
2009-01-23 14:20:36 +00:00
|
|
|
}
|
|
|
|
|
2010-11-15 10:12:02 +00:00
|
|
|
content += "</div>";
|
|
|
|
|
2011-03-06 07:56:08 +00:00
|
|
|
content += "<div class='dlgButtons'>";
|
|
|
|
|
|
|
|
content += "<button dojoType=\"dijit.form.Button\" "+
|
2011-03-18 11:31:54 +00:00
|
|
|
"onclick=\"dijit.byId('exceptionDlg').hide()\">" +
|
2011-03-06 07:56:08 +00:00
|
|
|
__('Close') + "</button>";
|
|
|
|
content += "</div>";
|
|
|
|
|
2011-04-21 11:27:09 +00:00
|
|
|
if (dijit.byId("exceptionDlg"))
|
|
|
|
dijit.byId("exceptionDlg").destroyRecursive();
|
2010-11-14 20:46:49 +00:00
|
|
|
|
2018-11-29 17:07:23 +00:00
|
|
|
const dialog = new dijit.Dialog({
|
2011-03-06 07:56:08 +00:00
|
|
|
id: "exceptionDlg",
|
2010-11-15 10:12:02 +00:00
|
|
|
title: "Unhandled exception",
|
|
|
|
style: "width: 600px",
|
|
|
|
content: content});
|
|
|
|
|
|
|
|
dialog.show();
|
2010-11-14 20:46:49 +00:00
|
|
|
|
2013-04-20 06:43:21 +00:00
|
|
|
} catch (ei) {
|
2017-03-04 11:34:44 +00:00
|
|
|
console.error("Exception while trying to report an exception:", ei);
|
|
|
|
console.error("Original exception:", e);
|
2013-04-20 06:43:21 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
alert("Exception occured while trying to report an exception.\n" +
|
|
|
|
ei.stack + "\n\nOriginal exception:\n" + e.stack);
|
2005-12-14 07:29:38 +00:00
|
|
|
}
|
|
|
|
|
2005-11-26 10:06:56 +00:00
|
|
|
}
|
|
|
|
|
2007-03-02 19:58:58 +00:00
|
|
|
function notify_real(msg, no_hide, n_type) {
|
2005-08-22 05:28:27 +00:00
|
|
|
|
2018-11-29 17:07:23 +00:00
|
|
|
const n = $("notify");
|
2005-08-22 05:28:27 +00:00
|
|
|
|
2013-04-17 06:50:46 +00:00
|
|
|
if (!n) return;
|
2005-09-05 12:02:00 +00:00
|
|
|
|
2006-05-19 05:44:23 +00:00
|
|
|
if (notify_hide_timerid) {
|
|
|
|
window.clearTimeout(notify_hide_timerid);
|
|
|
|
}
|
|
|
|
|
2005-11-19 18:01:06 +00:00
|
|
|
if (msg == "") {
|
2014-11-02 17:58:46 +00:00
|
|
|
if (n.hasClassName("visible")) {
|
|
|
|
notify_hide_timerid = window.setTimeout(function() {
|
|
|
|
n.removeClassName("visible") }, 0);
|
2006-05-19 05:44:23 +00:00
|
|
|
}
|
|
|
|
return;
|
2005-11-19 18:01:06 +00:00
|
|
|
}
|
2005-08-22 05:28:27 +00:00
|
|
|
|
2007-03-02 19:58:58 +00:00
|
|
|
/* types:
|
|
|
|
|
|
|
|
1 - generic
|
|
|
|
2 - progress
|
|
|
|
3 - error
|
|
|
|
4 - info
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2013-04-17 06:50:46 +00:00
|
|
|
msg = "<span class=\"msg\"> " + __(msg) + "</span>";
|
2007-03-06 06:54:47 +00:00
|
|
|
|
2014-11-02 17:58:46 +00:00
|
|
|
if (n_type == 2) {
|
2017-02-09 20:19:26 +00:00
|
|
|
msg = "<span><img src=\""+getInitParam("icon_indicator_white")+"\"></span>" + msg;
|
2013-04-17 06:50:46 +00:00
|
|
|
no_hide = true;
|
2007-03-02 19:58:58 +00:00
|
|
|
} else if (n_type == 3) {
|
2017-02-09 20:19:26 +00:00
|
|
|
msg = "<span><img src=\""+getInitParam("icon_alert")+"\"></span>" + msg;
|
2007-03-02 19:58:58 +00:00
|
|
|
} else if (n_type == 4) {
|
2017-02-09 20:19:26 +00:00
|
|
|
msg = "<span><img src=\""+getInitParam("icon_information")+"\"></span>" + msg;
|
2013-03-18 12:44:23 +00:00
|
|
|
}
|
|
|
|
|
2017-02-09 20:19:26 +00:00
|
|
|
msg += " <span><img src=\""+getInitParam("icon_cross")+"\" class=\"close\" title=\"" +
|
2013-04-17 06:50:46 +00:00
|
|
|
__("Click to close") + "\" onclick=\"notify('')\"></span>";
|
2013-03-18 12:44:23 +00:00
|
|
|
|
2013-04-17 06:50:46 +00:00
|
|
|
n.innerHTML = msg;
|
2006-05-18 07:56:52 +00:00
|
|
|
|
2014-11-09 17:31:29 +00:00
|
|
|
window.setTimeout(function() {
|
|
|
|
// goddamnit firefox
|
|
|
|
if (n_type == 2) {
|
|
|
|
n.className = "notify notify_progress visible";
|
|
|
|
} else if (n_type == 3) {
|
|
|
|
n.className = "notify notify_error visible";
|
|
|
|
msg = "<span><img src='images/alert.png'></span>" + msg;
|
|
|
|
} else if (n_type == 4) {
|
|
|
|
n.className = "notify notify_info visible";
|
|
|
|
} else {
|
|
|
|
n.className = "notify visible";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!no_hide) {
|
|
|
|
notify_hide_timerid = window.setTimeout(function() {
|
2014-11-02 17:58:46 +00:00
|
|
|
n.removeClassName("visible") }, 5*1000);
|
2014-11-09 17:31:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}, 10);
|
|
|
|
|
2006-05-18 12:01:09 +00:00
|
|
|
}
|
|
|
|
|
2007-03-02 19:58:58 +00:00
|
|
|
function notify(msg, no_hide) {
|
|
|
|
notify_real(msg, no_hide, 1);
|
2006-05-18 12:01:09 +00:00
|
|
|
}
|
|
|
|
|
2007-03-02 19:58:58 +00:00
|
|
|
function notify_progress(msg, no_hide) {
|
|
|
|
notify_real(msg, no_hide, 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
function notify_error(msg, no_hide) {
|
|
|
|
notify_real(msg, no_hide, 3);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function notify_info(msg, no_hide) {
|
|
|
|
notify_real(msg, no_hide, 4);
|
2005-08-22 05:28:27 +00:00
|
|
|
}
|
|
|
|
|
2018-12-01 08:18:35 +00:00
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
|
|
function displayIfChecked(checkbox, elemId) {
|
|
|
|
if (checkbox.checked) {
|
|
|
|
Effect.Appear(elemId, {duration : 0.5});
|
2007-08-11 16:43:45 +00:00
|
|
|
} else {
|
2018-12-01 08:18:35 +00:00
|
|
|
Effect.Fade(elemId, {duration : 0.5});
|
2007-08-11 16:43:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-05-23 06:15:49 +00:00
|
|
|
function getInitParam(key) {
|
2007-03-26 05:23:15 +00:00
|
|
|
return init_params[key];
|
2006-05-23 06:15:49 +00:00
|
|
|
}
|
2006-05-23 05:34:50 +00:00
|
|
|
|
2010-01-12 08:48:31 +00:00
|
|
|
function setInitParam(key, value) {
|
2007-05-11 07:50:02 +00:00
|
|
|
init_params[key] = value;
|
2007-03-21 15:36:24 +00:00
|
|
|
}
|
|
|
|
|
2009-01-23 17:19:17 +00:00
|
|
|
function fatalError(code, msg, ext_info) {
|
2017-03-04 11:34:44 +00:00
|
|
|
if (code == 6) {
|
|
|
|
window.location.href = "index.php";
|
|
|
|
} else if (code == 5) {
|
|
|
|
window.location.href = "public.php?op=dbupdate";
|
|
|
|
} else {
|
2011-03-18 11:31:54 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
if (msg == "") msg = "Unknown error";
|
2007-03-02 19:58:58 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
if (ext_info) {
|
|
|
|
if (ext_info.responseText) {
|
|
|
|
ext_info = ext_info.responseText;
|
2011-02-18 09:28:03 +00:00
|
|
|
}
|
2017-03-04 11:34:44 +00:00
|
|
|
}
|
2011-02-18 09:28:03 +00:00
|
|
|
|
2018-12-01 08:18:35 +00:00
|
|
|
/* global ERRORS */
|
2017-03-04 11:34:44 +00:00
|
|
|
if (ERRORS && ERRORS[code] && !msg) {
|
|
|
|
msg = ERRORS[code];
|
|
|
|
}
|
2011-03-18 11:31:54 +00:00
|
|
|
|
2018-11-29 17:07:23 +00:00
|
|
|
let content = "<div><b>Error code:</b> " + code + "</div>" +
|
2017-03-04 11:34:44 +00:00
|
|
|
"<p>" + msg + "</p>";
|
2011-02-18 09:28:03 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
if (ext_info) {
|
|
|
|
content = content + "<div><b>Additional information:</b></div>" +
|
|
|
|
"<textarea style='width: 100%' readonly=\"1\">" +
|
|
|
|
ext_info + "</textarea>";
|
|
|
|
}
|
2011-02-18 09:28:03 +00:00
|
|
|
|
2018-11-29 17:07:23 +00:00
|
|
|
const dialog = new dijit.Dialog({
|
2017-03-04 11:34:44 +00:00
|
|
|
title: "Fatal error",
|
|
|
|
style: "width: 600px",
|
|
|
|
content: content});
|
2011-02-18 09:28:03 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
dialog.show();
|
2011-02-18 09:28:03 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
}
|
2006-05-23 07:15:48 +00:00
|
|
|
|
2017-03-04 11:34:44 +00:00
|
|
|
return false;
|
2011-02-18 09:28:03 +00:00
|
|
|
|
2006-05-23 07:15:48 +00:00
|
|
|
}
|
|
|
|
|
2018-12-01 19:39:29 +00:00
|
|
|
/* function strip_tags(s) {
|
|
|
|
return s.replace(/<\/?[^>]+(>|$)/g, "");
|
|
|
|
} */
|
2013-11-12 10:21:28 +00:00
|
|
|
|
2018-12-01 19:39:29 +00:00
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
|
|
function uploadIconHandler(rc) {
|
|
|
|
switch (rc) {
|
|
|
|
case 0:
|
|
|
|
notify_info("Upload complete.");
|
|
|
|
if (App.isPrefs()) {
|
|
|
|
Feeds.reload();
|
|
|
|
} else {
|
|
|
|
setTimeout('Feeds.reload(false, false)', 50);
|
2017-03-04 11:34:44 +00:00
|
|
|
}
|
2018-12-01 19:39:29 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
notify_error("Upload failed: icon is too big.");
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
notify_error("Upload failed.");
|
|
|
|
break;
|
2017-03-04 11:34:44 +00:00
|
|
|
}
|
2010-02-03 13:54:17 +00:00
|
|
|
}
|
2010-02-15 12:16:53 +00:00
|
|
|
|
2010-11-08 22:04:00 +00:00
|
|
|
|
2018-12-01 08:18:35 +00:00
|
|
|
// noinspection JSUnusedGlobalSymbols
|
2013-03-27 05:40:07 +00:00
|
|
|
function label_to_feed_id(label) {
|
|
|
|
return _label_base_index - 1 - Math.abs(label);
|
|
|
|
}
|
|
|
|
|
2018-12-01 08:18:35 +00:00
|
|
|
// noinspection JSUnusedGlobalSymbols
|
2013-03-27 05:40:07 +00:00
|
|
|
function feed_to_label_id(feed) {
|
|
|
|
return _label_base_index - 1 + Math.abs(feed);
|
|
|
|
}
|
|
|
|
|
2013-11-12 10:21:28 +00:00
|
|
|
// http://stackoverflow.com/questions/6251937/how-to-get-selecteduser-highlighted-text-in-contenteditable-element-and-replac
|
|
|
|
function getSelectionText() {
|
2018-11-29 17:07:23 +00:00
|
|
|
let text = "";
|
2013-11-12 10:21:28 +00:00
|
|
|
|
|
|
|
if (typeof window.getSelection != "undefined") {
|
2018-11-29 17:07:23 +00:00
|
|
|
const sel = window.getSelection();
|
2013-11-12 10:21:28 +00:00
|
|
|
if (sel.rangeCount) {
|
2018-11-29 17:07:23 +00:00
|
|
|
const container = document.createElement("div");
|
|
|
|
for (let i = 0, len = sel.rangeCount; i < len; ++i) {
|
2013-11-12 10:21:28 +00:00
|
|
|
container.appendChild(sel.getRangeAt(i).cloneContents());
|
|
|
|
}
|
|
|
|
text = container.innerHTML;
|
|
|
|
}
|
|
|
|
} else if (typeof document.selection != "undefined") {
|
|
|
|
if (document.selection.type == "Text") {
|
|
|
|
text = document.selection.createRange().textText;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return text.stripTags();
|
|
|
|
}
|
2015-09-11 10:05:08 +00:00
|
|
|
|
2018-12-01 08:18:35 +00:00
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
|
|
function popupOpenUrl(url) {
|
2018-11-29 17:07:23 +00:00
|
|
|
const w = window.open("");
|
2017-02-08 12:07:05 +00:00
|
|
|
|
|
|
|
w.opener = null;
|
|
|
|
w.location = url;
|
|
|
|
}
|
2018-12-01 08:18:35 +00:00
|
|
|
|
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
|
|
function popupOpenArticle(id) {
|
2018-11-29 17:07:23 +00:00
|
|
|
const w = window.open("",
|
2015-09-11 10:05:08 +00:00
|
|
|
"ttrss_article_popup",
|
|
|
|
"height=900,width=900,resizable=yes,status=no,location=no,menubar=no,directories=no,scrollbars=yes,toolbar=no");
|
2017-02-08 12:07:05 +00:00
|
|
|
|
|
|
|
w.opener = null;
|
|
|
|
w.location = "backend.php?op=article&method=view&mode=raw&html=1&zoom=1&id=" + id + "&csrf_token=" + getInitParam("csrf_token");
|
2017-03-04 11:34:44 +00:00
|
|
|
}
|