Skip to content

Instantly share code, notes, and snippets.

@gosuri
Created March 4, 2012 23:03
Show Gist options
  • Save gosuri/1975261 to your computer and use it in GitHub Desktop.
Save gosuri/1975261 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
$("#new.btn").live("click",function(event){
event.preventDefault();
window.router.newNote();
});
$("#delete.btn").live("click",function(event){
event.preventDefault();
window.currentNote.destroy();
window.router.index();
});
});
window.fbHandler = {
bind: function(note) {
var fbURL = "http://angelhack.firebase.com/quicknotes-" + window.env + "/" + note.id;
window.fbRef = new Firebase(fbURL);
note.on("change", function() {
window.fbRef.set({content: note.get("content")});
});
window.fbRef.on('value', function(remote_note) {
content = remote_note.val().content;
console.debug(content);
$(".editor").html(window.editor.render().el);
});
},
unbind: function(note) {
// Unbind Code
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment