Permalink
Browse files

remove the connection form and display the connection state

  • Loading branch information...
Geal committed Jul 1, 2012
1 parent 193b99b commit 153ace832896697b1b9fbfd062b9b68d2ce8128a
Showing with 24 additions and 5 deletions.
  1. +8 −1 css/screen.css
  2. +6 −4 index.html
  3. +10 −0 src/helper.js
View
@@ -63,7 +63,14 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq
}
#intro { position:fixed; top:.5em; left:11em; z-index:11; }
-#bookmark { position:fixed; top:3em; }
+#bookmark { position:fixed; top:3em; display:none }
+
+#disconnect {
+ display: none
+}
+#connect-string {
+ display: none
+}
View
@@ -15,11 +15,13 @@
<div id="header">
<h1>Unpapered</h1>
<ul>
- <li><input type="submit" id="connect" value="Connect to remoteStorage" /></li>
<li><input type="submit" id="disconnect" value="Disconnect" class="hidden" /></li>
- <li><input type="text" id="userAddress" placeholder="yourusername@5apps.com" /></li>
- <li><label for="userAddress">Your user address:</label></li>
- <li><span id="connectionState">disconnected</span></li>
+ <li id="connect-form">
+ <label for="userAddress">Your user address:</label>
+ <input type="text" id="userAddress" placeholder="yourusername@5apps.com" />
+ <input type="submit" id="connect" value="Connect to remoteStorage" />
+ </li>
+ <li id="connect-string">Connected as <span id="username"></span></li>
</ul>
</div>
<div class="container">
View
@@ -15,8 +15,13 @@ var helper = (function() {
}
$('#connectionState').html('connected');
$('#connect').hide();
+ $('#connect-form').hide();
$('#disconnect').show();
+ $('#username').html(localStorage.getItem('userAddress'));
+ $('#connect-string').show();
$('#userAddress').val(localStorage.getItem('userAddress'));
+ $('#bookmark').show();
+ $('#content').show();
} else {
for (var i = 0; i < elementIds.length; i++) {
$('#' + elementIds[i]).attr('disabled', 'disabled');
@@ -25,6 +30,11 @@ var helper = (function() {
$('#connect').show();
$('#disconnect').hide();
$('#userAddress').val('');
+ $('#connect-form').show();
+ $('#connect-string').hide();
+ $('#username').html('');
+ $('#bookmark').hide();
+ $('#content').hide();
deauthorize();
}
$('#connectionState').toggleClass('enabled', connected);

0 comments on commit 153ace8

Please sign in to comment.