Skip to content

Instantly share code, notes, and snippets.

@JackDanger
Created December 10, 2009 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JackDanger/253687 to your computer and use it in GitHub Desktop.
Save JackDanger/253687 to your computer and use it in GitHub Desktop.
// A javascript DOM application framework API that just feels right.
// TODO: please build this into an actual framework for me. KTHXBYE.
App('chat', function(selection){
// anything you want to run at
// initialization you can add here
selection.click(function(){
// do something based on a user click
// clicked element and even details available in selection.click
})
selection.input(function(){
// if the user has hit a key that was caught by this application's
// DOM element (but not by some specific element that's already
// configured to respond to input) then respond to it.
// good place to configure hotkeys.
})
})
App.load('chat', document.getElementById("chat_window"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment