4chan-x/src/General/Globals.coffee

22 lines
434 B
CoffeeScript
Executable File

Conf = {}
c = console
d = document
doc = d.documentElement
g =
VERSION: '<%= meta.version %>'
NAMESPACE: '<%= meta.name %>.'
boards: {}
E = do ->
str = {'&': '&amp;', "'": '&#039;', '"': '&quot;', '<': '&lt;', '>': '&gt;'}
r = String::replace
regex = /[&"'<>]/g
fn = (x) ->
str[x]
(text) -> r.call text, regex, fn
E.cat = (templates) ->
html = ''
html += x.innerHTML for x in templates
html