<dom-module id="landing-page">
<template>
firebase-auth id="fbLogin" provider="anonymous" location="https://xxx.firebaseio.com" user="{{fbUser}}" statusKnown="{{statusKnown}}"></firebase-auth>
<firebase-collection id="fbLanding" location="https://xxx.firebaseio.com/" dataReady="{{userReady}}"></firebase-collection>
<style>
.form-section {
background-color: white;
padding: 14px;
min-width: 200px;
}
.main {
height:400px;
margin:auto;
}
.errorClass{
background-color:red;
color:white;
}
</style>
<div class="main fit">
<div class="horizontal center layout center-justified">
<div>
<h1>Polydeals.com</h1>
<h4>Something is brewing ... </h4>
<h4>Fill below to get launch updates</h4>
<paper-material elevation="3">
<div class="form-section">
<form is="iron-form" id="formPost" method="post">
<gold-email-input required error-message="Please enter a valid email" label="Email Address" value="{{email}}" name="email" id="email" ></gold-email-input>
</br>
<paper-button type="submit" name="submit" raised on-click="buttonClick">Notify Me!</paper-button>
</form>
</div>
</paper-material>
</div>
</div>
</br>
<div class="horizontal center layout center-justified">
<div>
<a href="http://goo.gl/forms/XoQ47NhGWQ">Online Survey for tagline/slogan</a>
</div>
</div>
</div>
<footer-page></footer-page>
<paper-toast id="toast1"></paper-toast>
</template>
<script>
Polymer({
is: 'landing-page',
ready: function() {
window.addEventListener('offline', function() {
Firebase.goOffline();
});
window.addEventListener('online', function() {
Firebase.goOnline();
});
},
buttonClick: function() {
this.$.fbLogin.login(); //this goes through fine
this.$.fbLanding.add({
timeStamp:Firebase.ServerValue.TIMESTAMP,
email:this.$.email.value
}); //this does not go through.
},
listeners: {
'firebase-child-added': 'fireBaseResponse'
},
fireBaseResponse: function(event) {
var sessionId = event.key();
if (!sessionId){
this.$.toast1.text="Ah Oh! something went wrong";
this.$.toast1.toggleClass('errorClass', true);
}
else{
this.$.toast1.toggleClass('errorClass', false);
this.$.toast1.text="Thanks!";
}
this.$.toast1.show();
}
});
</script>
</dom-module>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |