Skip to content
Snippets Groups Projects
Commit 33648764 authored by Shane Tomlinson's avatar Shane Tomlinson
Browse files

Add some dev menu features.

* clear localStorage
* clear emails for sites
* force "Is this your computer?" screen
parent 0370c802
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,9 @@
<li><a id="showDelay" href="/">Show Delay</a></li>
<li><a id="showWait" href="/">Show Wait</a></li>
<li><a id="hideAll" href="/">Hide Screens</a></li>
<li><a id="clearLocalStorage" href="/">Clear localStorage</a></li>
<li><a id="clearEmailsForSites" href="/">Clear Site&lt;-&gt;Emails</a></li>
<li><a id="forceIsThisYourComputer" href="/">Force "Is This Your Computer"</a></li>
<li><a id="closeDevelopment" href="/">Close</a></li>
</ul>
......@@ -10,14 +10,16 @@ BrowserID.Modules.Development = (function() {
var bid = BrowserID,
dom = bid.DOM,
renderer = bid.Renderer,
count = 0;
storage = bid.Storage,
network = bid.Network,
clickCount = 0;
function onDevelopmentClick(event) {
count++;
clickCount++;
if(count === 4) {
if(clickCount === 4) {
if(!document.getElementById("development")) {
renderer.append("body", "development", {});
}
......@@ -27,6 +29,9 @@ BrowserID.Modules.Development = (function() {
this.click("#showDelay", showDelay);
this.click("#showWait", showWait);
this.click("#hideAll,footer,#errorBackground", hideScreens);
this.click("#clearLocalStorage", clearLocalStorage);
this.click("#clearEmailsForSites", clearEmailsForSites);
this.click("#forceIsThisYourComputer", forceIsThisYourComputer);
this.click("#closeDevelopment", close);
}
}
......@@ -64,10 +69,23 @@ BrowserID.Modules.Development = (function() {
this.hideWait();
}
function clearLocalStorage() {
for(var key in localStorage) {
localStorage.removeItem(key);
}
}
function clearEmailsForSites() {
localStorage.removeItem("siteInfo");
}
function forceIsThisYourComputer() {
storage.usersComputer.forceAsk(network.userid());
}
function close() {
dom.removeClass("body", "development");
count = 0;
clickCount = 0;
}
var Module = bid.Modules.PageModule.extend({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment