put Conf back into global scope

This commit is contained in:
James Campos 2012-03-17 04:58:06 -07:00
parent 2c331a5d0f
commit 6343cb878a
2 changed files with 31 additions and 29 deletions

View File

@ -73,7 +73,7 @@
*/
(function() {
var $, $$, Anonymize, AutoGif, Config, ExpandComment, ExpandThread, Favicon, FileInfo, Filter, GetTitle, ImageExpand, ImageHover, Keybinds, Main, Nav, Options, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, ReplyHiding, ReportButton, RevealSpoilers, Sauce, StrikethroughQuotes, ThreadHiding, ThreadStats, Threading, Time, TitlePost, UI, Unread, Updater, Watcher, d, g, _base;
var $, $$, Anonymize, AutoGif, Conf, Config, ExpandComment, ExpandThread, Favicon, FileInfo, Filter, GetTitle, ImageExpand, ImageHover, Keybinds, Main, Nav, Options, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, ReplyHiding, ReportButton, RevealSpoilers, Sauce, StrikethroughQuotes, ThreadHiding, ThreadStats, Threading, Time, TitlePost, UI, Unread, Updater, Watcher, d, flatten, g, _base;
Config = {
main: {
@ -192,6 +192,22 @@
}
};
Conf = {};
(flatten = function(parent, obj) {
var key, val;
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
for (key in obj) {
val = obj[key];
flatten(key, val);
}
} else {
Conf[parent] = obj;
}
})(null, Config);
d = document;
g = {};
@ -3777,21 +3793,7 @@
Main = {
init: function() {
var Conf, cutoff, flatten, hiddenThreads, id, key, now, path, pathname, temp, timestamp, val, _ref;
Conf = {};
(flatten = function(parent, obj) {
var key, val;
if (obj instanceof Array) {
Conf[parent] = obj[0];
} else if (typeof obj === 'object') {
for (key in obj) {
val = obj[key];
flatten(key, val);
}
} else {
Conf[parent] = obj;
}
})(null, Config);
var cutoff, hiddenThreads, id, key, now, path, pathname, temp, timestamp, val, _ref;
path = location.pathname;
pathname = path.slice(1).split('/');
g.BOARD = pathname[0], temp = pathname[1];

View File

@ -154,6 +154,19 @@ Config =
'Auto Update': [true, 'Automatically fetch new posts']
'Interval': 30
# flatten the config
Conf = {}
(flatten = (parent, obj) ->
if obj instanceof Array
Conf[parent] = obj[0]
else if typeof obj is 'object'
for key, val of obj
flatten key, val
else # string or number
Conf[parent] = obj
return
) null, Config
d = document
g = {}
@ -3142,19 +3155,6 @@ ImageExpand =
Main =
init: ->
# flatten the config
Conf = {}
(flatten = (parent, obj) ->
if obj instanceof Array
Conf[parent] = obj[0]
else if typeof obj is 'object'
for key, val of obj
flatten key, val
else # string or number
Conf[parent] = obj
return
) null, Config
path = location.pathname
pathname = path[1..].split '/'
[g.BOARD, temp] = pathname