Disable explorer view unless debug cookie is set

This commit is contained in:
Vincent Fiduccia 2012-12-19 10:50:50 -07:00
parent f3716d3100
commit cf93f899dc
3 changed files with 6 additions and 3 deletions

View File

@ -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';
}

View File

@ -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);

View File

@ -7,7 +7,9 @@
<th width="200">Sort</th>
<th width="150">Pagination</th>
<th width="120" rowspan="2" style="vertical-align: top; text-align: right; font-weight: normal;">
{{#if explorer}}
<a href="#" onclick="Cookie.set('apiview','explorer'); explorer.show(); return false">Explorer View</a><br/>
{{/if}}
{{#if docs}}
<a href="{{docs}}" target="cloudapidocs">Documentation</a><br/>
{{/if}}