Created
December 10, 2009 21:19
-
-
Save JackDanger/253687 to your computer and use it in GitHub Desktop.
This file contains 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
// 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