diff options
author | Andrew Dolgov <[email protected]> | 2008-12-16 08:13:09 +0100 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2008-12-16 08:13:09 +0100 |
commit | 7c33dbd479df8b95c0ec05dcacad0666d9550194 (patch) | |
tree | 1cf76c816f49dba8cf555c2d217f9480db23f55b /mobile/mobile.js | |
parent | ed0551c27442c87442c4e6ada790eabc8fc34f77 (diff) |
translations support for mobile version
Diffstat (limited to 'mobile/mobile.js')
-rw-r--r-- | mobile/mobile.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/mobile/mobile.js b/mobile/mobile.js new file mode 100644 index 000000000..64d581410 --- /dev/null +++ b/mobile/mobile.js @@ -0,0 +1,48 @@ +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); + } +} + |