Sha256: d27679a0b42de503f68e28294a32d2fc88c56aec386d222b6fcbf63b70902337

Contents?: true

Size: 552 Bytes

Versions: 8

Compression:

Stored size: 552 Bytes

Contents

Trestle.cookie = {
  get: function(name) {
    name += '=';

    var cookies = document.cookie.split(/;\s*/)

    for (i = cookies.length - 1; i >= 0; i--) {
      if (!cookies[i].indexOf(name)) {
        var value = cookies[i].replace(name, '');
        return decodeURIComponent(value);
      }
    }

    return "";
  },

  set: function(name, value) {
    document.cookie = name + "=" + encodeURIComponent(value) + "; path=/";
  },

  delete: function(name) {
    document.cookie = name + "=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT";
  }
};

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
trestle-0.8.13 app/assets/javascripts/trestle/core/_cookies.js
trestle-0.8.12 app/assets/javascripts/trestle/core/_cookies.js
trestle-0.8.11 app/assets/javascripts/trestle/core/_cookies.js
trestle-0.8.10 app/assets/javascripts/trestle/core/_cookies.js
trestle-0.8.9 app/assets/javascripts/trestle/core/_cookies.js
trestle-0.8.8 app/assets/javascripts/trestle/core/_cookies.js
trestle-0.8.7 app/assets/javascripts/trestle/core/_cookies.js
trestle-0.8.6 app/assets/javascripts/trestle/core/_cookies.js