Sha256: 74040348adc86b4494fbf4f1e2389b9907deb23fa0b15c53e41b1ac9aa0c7257
Contents?: true
Size: 1.05 KB
Versions: 12
Compression:
Stored size: 1.05 KB
Contents
####** #Cookies #======= # #class up.cookies #### #up.cookie = (-> # u = up.util # # escape = encodeURIComponent # unescape = decodeURIComponent # # lastRaw = undefined # lastParsed = {} # # all = -> # currentRaw = document.cookie # if u.isUndefined(lastRaw) || lastRaw != currentRaw # lastParsed = parse() # lastRaw = currentRaw # lastParsed # # parse = -> # hash = {} # pairs = u.splitValues(document.cookie, ';') # for pair in pairs # parts = u.splitValues(pair, '=') # name = unescape(parts[0]) # value = unescape(parts[1]) # hash[name] = value # hash # # remove = (name) -> # set(name, '', 'expires=Thu, 01-Jan-70 00:00:01 GMT; path=/') # # get = (name) -> # all()[name] # # set = (name, value, meta) -> # str = escape(name) + '=' + escape(value) # str += ';' + meta if meta # document.cookie = str # lastRaw = undefined # # pop = (name) -> # value = get(name) # if u.isPresent(value) # remove(name) # value # # all: all # get: get # set: set # remove: remove # pop: pop #)()
Version data entries
12 entries across 12 versions & 1 rubygems