Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

docs; persist api checked condition

  • Loading branch information...
commit 05fea1d3884ce62bab50368c0b6fbb162e7cc0c0 1 parent c46036b
@aheckmann aheckmann authored
Showing with 15 additions and 1 deletion.
  1. +11 −1 docs/api.jade
  2. +4 −0 docs/js/cookies.min.js
View
12 docs/api.jade
@@ -499,10 +499,20 @@ html(lang='en')
document.body.className = 'load';
include includes/googleanalytics
script(src="/docs/js/zepto.min.js")
+ script(src="/docs/js/cookies.min.js")
script.
$(".module").on("click", ".showcode", function (e) {
$(this).closest(".item").find(".sourcecode").first().toggle();
});
$("#content .controls input").on("click", function (e) {
$(".private").toggle()
- })
+ var checked = $(this).prop('checked');
+ Cookies.set('prv', checked);
+ });
+ ;(function(){
+ var checked = 'true' === Cookies.get('prv');
+ if (checked) {
+ $("#content .controls input").prop('checked', 'checked');
+ $(".private").show()
+ }
+ })()
View
4 docs/js/cookies.min.js
@@ -0,0 +1,4 @@
+/*! Cookies.js - 0.2.0; Copyright (c) 2012, Scott Hamper; http://www.opensource.org/licenses/MIT */
+(function(f,e){var b=function(c,d,a){return 1===arguments.length?b.get(c):b.set(c,d,a)};b.get=function(c){f.cookie!==b._cacheString&&b._populateCache();return b._cache[c]};b.defaults={path:"/"};b.set=function(c,d,a){a={path:a&&a.path||b.defaults.path,domain:a&&a.domain||b.defaults.domain,expires:a&&a.expires||b.defaults.expires,secure:a&&a.secure!==e?a.secure:b.defaults.secure};d===e&&(a.expires=-1);switch(typeof a.expires){case "number":a.expires=new Date((new Date).getTime()+1E3*a.expires);break;
+case "string":a.expires=new Date(a.expires)}c=encodeURIComponent(c)+"="+(d+"").replace(/[^!#-+\--:<-[\]-~]/g,encodeURIComponent);c+=a.path?";path="+a.path:"";c+=a.domain?";domain="+a.domain:"";c+=a.expires?";expires="+a.expires.toGMTString():"";c+=a.secure?";secure":"";f.cookie=c;return b};b.expire=function(c,d){return b.set(c,e,d)};b._populateCache=function(){b._cache={};b._cacheString=f.cookie;for(var c=b._cacheString.split("; "),d=0;d<c.length;d++){var a=c[d].indexOf("="),g=decodeURIComponent(c[d].substr(0,
+a)),a=decodeURIComponent(c[d].substr(a+1));b._cache[g]===e&&(b._cache[g]=a)}};b.enabled=function(){var c="1"===b.set("cookies.js","1").get("cookies.js");b.expire("cookies.js");return c}();"function"===typeof define&&define.amd?define(function(){return b}):"undefined"!==typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.Cookies=b):window.Cookies=b})(document);
Please sign in to comment.
Something went wrong with that request. Please try again.