summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'static/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..b2fe1a9
--- /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)
+window.RootDomain = location.href.match(/http:\/\/(\w)+\./)
+ ? 'http://dump.fm/' : '/';
+
+window.cache = {};
+window.PendingMessages = {};
+window.MessageContentCache = {};
+window.RawFavs = {};
+window.MaxImagePosts = 30;
+
+// todo: preload these. also, look into image sprites (no go on animating their sizes tho)
+// css clipping perhaps?
+window.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"
+}
+
+window.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"}
+}
+
+
+window.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: '/' });
+ }
+};