Sha256: 2f6acdd7641e9da91da8fa17f030b6316806ef36caccd406c950d890cc59a069

Contents?: true

Size: 987 Bytes

Versions: 82

Compression:

Stored size: 987 Bytes

Contents

/*
 * Cookie Storage for jQuery Collapse
 * --
 * source: http://github.com/danielstocks/jQuery-Collapse/
 * site: http://webcloud.se/jQuery-Collapse
 *
 * @author Daniel Stocks (http://webcloud.se)
 * Copyright 2013, Daniel Stocks
 * Released under the MIT, BSD, and GPL Licenses.
 */

(function($) {

  var cookieStorage = {
    expires: function() {
      var now = new Date();
      return now.setDate(now.getDate() + 1);
    }(),
    setItem: function(key, value) {
      document.cookie = key + '=' + value + '; expires=' + this.expires +'; path=/';
    },
    getItem: function(key) {
      key+= "=";
      var item = "";
      $.each(document.cookie.split(';'), function(i, cookie) {
        while (cookie.charAt(0)==' ') cookie = cookie.substring(1,cookie.length);
        if(cookie.indexOf(key) === 0) {
          item = cookie.substring(key.length,cookie.length);
        }
      });
      return item;
    }
  };

  $.fn.collapse.cookieStorage = cookieStorage;

})(jQuery);

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
trusty-festivity-extension-2.5.3 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.5.2 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.5.1 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.5.0 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.4.6 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.4.5 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.4.4 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.4.3 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.4.2 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.4.1 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.4.0 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.30 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.29 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.28 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.27 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.26 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.25 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.24 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.23 app/assets/javascripts/jquery.collapse_cookie_storage.js
trusty-festivity-extension-2.3.22 app/assets/javascripts/jquery.collapse_cookie_storage.js