From cf93f899dc39445d69fd2a2a820be733bc3dd9ac Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Wed, 19 Dec 2012 10:50:50 -0700 Subject: [PATCH] Disable explorer view unless debug cookie is set --- public/js/Cookie.js | 2 +- public/js/HTMLApi.js | 3 ++- public/view/body.hbs | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public/js/Cookie.js b/public/js/Cookie.js index 5feff52..84a3f8f 100644 --- a/public/js/Cookie.js +++ b/public/js/Cookie.js @@ -77,5 +77,5 @@ Cookie.getAll = function() Cookie.remove = function(name) { - document.cookie = name+'=null; expires=Wed, 24 Feb 1982 18:42:00 UTC; path=/'; + document.cookie = name+'=null; expires=Wed, 24 Feb 1982 18:42:00 UTC'; } diff --git a/public/js/HTMLApi.js b/public/js/HTMLApi.js index c83424e..7913233 100644 --- a/public/js/HTMLApi.js +++ b/public/js/HTMLApi.js @@ -205,7 +205,8 @@ HTMLApi.prototype.render = function(cb) var tpl = { data: this._data, - docs: this._docs + docs: this._docs, + explorer: Cookie.get('debug') }; document.body.innerHTML = Handlebars.templates['body'](tpl); diff --git a/public/view/body.hbs b/public/view/body.hbs index ea153a5..97db9ee 100644 --- a/public/view/body.hbs +++ b/public/view/body.hbs @@ -7,7 +7,9 @@ Sort Pagination - Explorer View
+ {{#if explorer}} + Explorer View
+ {{/if}} {{#if docs}} Documentation
{{/if}}