summaryrefslogtreecommitdiff
path: root/static/js/src/main.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2012-07-18 00:02:21 -0400
committerJules Laplace <jules@okfoc.us>2012-07-18 00:02:21 -0400
commitc4338d2ae878a167c409e91dea6d1783fc7e30ba (patch)
tree1e54fac722ac3153f9180a5a8332f2b19e11c00c /static/js/src/main.js
parentd891a7ae1b205716c086363fba17a3249a665deb (diff)
put away back
Diffstat (limited to 'static/js/src/main.js')
-rw-r--r--static/js/src/main.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/static/js/src/main.js b/static/js/src/main.js
new file mode 100644
index 0000000..ddb4111
--- /dev/null
+++ b/static/js/src/main.js
@@ -0,0 +1,48 @@
+// The root domain is used so that subdomains don't result in
+// spurious extra urls (e.g. both dump.fm/nick and sub.dump.fm/nick)
+var RootDomain = location.href.match(/http:\/\/(\w)+\./)
+ ? 'http://dump.fm/' : '/';
+
+var cache = {};
+var PendingMessages = {};
+var MessageContentCache = {};
+var RawFavs = {};
+var MaxImagePosts = 30;
+
+// todo: preload these. also, look into image sprites (no go on animating their sizes tho)
+// css clipping perhaps?
+Imgs = {
+ "chatThumb": "/static/img/thumbs/smallheartfaved.gif",
+ "chatThumbBig": "/static/img/thumbs/chatheartover.gif",
+ "chatThumbOff": "/static/img/thumbs/smallheart.gif",
+ "chatThumbDot": "/static/img/thumbs/smallheart.gif",
+ "logThumb": "/static/img/thumbs/heartfaved.gif",
+ "logThumbBig": "/static/img/thumbs/heartover.gif",
+ "logThumbOff": "/static/img/thumbs/heart.gif"
+}
+
+Anim = {
+ "chatThumbBig": {"width": "54px", "height": "54px", "right": "0px", "bottom": "2px"},
+ "chatThumbTiny": {"width": "16px", "height": "16px", "right": "8px", "bottom": "8px"},
+ "chatThumb": {"width": "16px", "height": "16px", "right": "4px", "bottom": "4px"},
+ "logThumb": {"width": "27px", "height": "27px", "marginRight": "0px", "marginTop": "0px"},
+ "logThumbBig": {"width": "64px", "height": "64px", "marginRight": "-2px", "marginTop": "-2px"}
+}
+
+
+var Preferences = {
+ "Domain": '.dump.fm',
+
+ "getProperty": function(prop, defaultValue) {
+ var value = $.cookie(prop);
+ return (value !== null) ? value : defaultValue;
+ },
+
+ "setProperty": function(prop, val) {
+ $.cookie(prop, val, { domain: Preferences.Domain, path: '/' });
+ },
+
+ "delProperty": function(prop) {
+ $.cookie(prop, null, { domain: Preferences.Domain, path: '/' });
+ }
+};