Created
March 4, 2012 23:03
-
-
Save gosuri/1975261 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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