diff options
| author | Jules Laplace <jules@okfoc.us> | 2012-07-18 01:37:10 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2012-07-18 01:37:10 -0400 |
| commit | babc5431eb28a296fab09ee104abc590414192b9 (patch) | |
| tree | 561cc4aadb8cdaf184e5b2fb4af60a0a575ec797 /static | |
| parent | d52a995eca058e8c4ffb7039f0a7effc38bc5209 (diff) | |
main
Diffstat (limited to 'static')
| -rw-r--r-- | static/js/src/_main.js | 48 |
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: '/' }); + } +}; |
