summaryrefslogtreecommitdiff
path: root/static/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2012-07-18 01:36:52 -0400
committerJules Laplace <jules@okfoc.us>2012-07-18 01:36:52 -0400
commitd52a995eca058e8c4ffb7039f0a7effc38bc5209 (patch)
treefe90d31b0c32da9b288ce0d1bd51a7eee77a9012 /static/js
parentf258d3422aa407713ff867afb9b396536e9dbdff (diff)
fix
Diffstat (limited to 'static/js')
-rw-r--r--static/js/pichat2.js114
-rw-r--r--static/js/src/away.js2
-rw-r--r--static/js/src/chat.js10
-rw-r--r--static/js/src/main.js48
-rw-r--r--static/js/src/search.js2
-rw-r--r--static/js/src/spacefill.js4
6 files changed, 66 insertions, 114 deletions
diff --git a/static/js/pichat2.js b/static/js/pichat2.js
index 754439e..46bbd52 100644
--- a/static/js/pichat2.js
+++ b/static/js/pichat2.js
@@ -198,7 +198,55 @@ var SHA1 = {
},
"bit_rol": function(num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }
}
-var Away = {
+// 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: '/' });
+ }
+};
+window.Away = {
"UnseenMsgCounter": 0,
"OrigTitle": "",
"HasFocus": true,
@@ -275,7 +323,7 @@ function initChat() {
}
-var imgZoomThreshhold = [125, 125];
+window.imgZoomThreshhold = [125, 125];
function initChatMsgs() {
$('.msgDiv .content').live('mouseenter', function(e) {
@@ -383,7 +431,7 @@ function getMessageInfo(e){
}
// Message Handling
-var ImageMsgCount = 0
+window.ImageMsgCount = 0
function removeOldMessages(){
// don't count posts that are all text
if (LastMsgContainsImage) ImageMsgCount += 1;
@@ -397,8 +445,8 @@ function removeOldMessages(){
}
}
-var TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
-var ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
+window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
+window.ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
function muteSelector() {
var muted = [];
@@ -458,7 +506,7 @@ function scrollIfPossible(){
scrollToEnd()
}
-var lastScriptedScrolledPosition = 0
+window.lastScriptedScrolledPosition = 0
function scrollToEnd(){
messageList.scrollTop = messageList.scrollHeight
lastScriptedScrolledPosition = messageList.scrollTop
@@ -927,55 +975,7 @@ function initLogThumb(selector, parentSelector) {
}
}
})
-}// 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: '/' });
- }
-};
-
// Messages
@@ -1501,7 +1501,7 @@ function setupUploadAvatar(elementId) {
}
-var Search = {
+Search = {
'term': "",
'images': [],
@@ -1756,7 +1756,7 @@ Share = {
Share.openLink(url)
}
}
-var ColumnFill = {
+window.ColumnFill = {
"init": function(){
var cfg = SpaceFill.config
var numColumns = ColumnFill.calcColumns()
@@ -1833,7 +1833,7 @@ var ColumnFill = {
}
-var SpaceFill = {
+window.SpaceFill = {
"init": function(config){
config.type = "columns"
SpaceFill.config = config
diff --git a/static/js/src/away.js b/static/js/src/away.js
index f669d6a..8d910f3 100644
--- a/static/js/src/away.js
+++ b/static/js/src/away.js
@@ -1,4 +1,4 @@
-var Away = {
+window.Away = {
"UnseenMsgCounter": 0,
"OrigTitle": "",
"HasFocus": true,
diff --git a/static/js/src/chat.js b/static/js/src/chat.js
index 07796b2..09954de 100644
--- a/static/js/src/chat.js
+++ b/static/js/src/chat.js
@@ -44,7 +44,7 @@ function initChat() {
}
-var imgZoomThreshhold = [125, 125];
+window.imgZoomThreshhold = [125, 125];
function initChatMsgs() {
$('.msgDiv .content').live('mouseenter', function(e) {
@@ -152,7 +152,7 @@ function getMessageInfo(e){
}
// Message Handling
-var ImageMsgCount = 0
+window.ImageMsgCount = 0
function removeOldMessages(){
// don't count posts that are all text
if (LastMsgContainsImage) ImageMsgCount += 1;
@@ -166,8 +166,8 @@ function removeOldMessages(){
}
}
-var TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
-var ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
+window.TextEnabled = Preferences.getProperty("chat.textEnabled", "true") == "none";
+window.ImgsEnabled = Preferences.getProperty("chat.imgsEnabled", "true") == "true";
function muteSelector() {
var muted = [];
@@ -227,7 +227,7 @@ function scrollIfPossible(){
scrollToEnd()
}
-var lastScriptedScrolledPosition = 0
+window.lastScriptedScrolledPosition = 0
function scrollToEnd(){
messageList.scrollTop = messageList.scrollHeight
lastScriptedScrolledPosition = messageList.scrollTop
diff --git a/static/js/src/main.js b/static/js/src/main.js
deleted file mode 100644
index ddb4111..0000000
--- a/static/js/src/main.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// 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: '/' });
- }
-};
diff --git a/static/js/src/search.js b/static/js/src/search.js
index d854e34..f62f432 100644
--- a/static/js/src/search.js
+++ b/static/js/src/search.js
@@ -1,5 +1,5 @@
-var Search = {
+Search = {
'term': "",
'images': [],
diff --git a/static/js/src/spacefill.js b/static/js/src/spacefill.js
index adf16bf..404adc0 100644
--- a/static/js/src/spacefill.js
+++ b/static/js/src/spacefill.js
@@ -1,4 +1,4 @@
-var ColumnFill = {
+window.ColumnFill = {
"init": function(){
var cfg = SpaceFill.config
var numColumns = ColumnFill.calcColumns()
@@ -75,7 +75,7 @@ var ColumnFill = {
}
-var SpaceFill = {
+window.SpaceFill = {
"init": function(config){
config.type = "columns"
SpaceFill.config = config