1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-06-26 11:59:02 +02:00
ttrss/mobile/mobile.js
2008-12-16 08:13:09 +01:00

49 lines
1.1 KiB
JavaScript

function debug(msg) {
// no-op
}
function setCookie(name, value, lifetime, path, domain, secure) {
var d = false;
if (lifetime) {
d = new Date();
d.setTime(d.getTime() + (lifetime * 1000));
}
debug("setCookie: " + name + " => " + value + ": " + d);
int_setCookie(name, value, d, path, domain, secure);
}
function int_setCookie(name, value, expires, path, domain, secure) {
document.cookie= name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function exception_error(location, e, silent) {
var msg;
if (e.fileName) {
var base_fname = e.fileName.substring(e.fileName.lastIndexOf("/") + 1);
msg = "Exception: " + e.name + ", " + e.message +
"\nFunction: " + location + "()" +
"\nLocation: " + base_fname + ":" + e.lineNumber;
} else if (e.description) {
msg = "Exception: " + e.description + "\nFunction: " + location + "()";
} else {
msg = "Exception: " + e + "\nFunction: " + location + "()";
}
if (!silent) {
alert(msg);
}
}