Created
November 2, 2010 20:05
-
-
Save anonymous/660203 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
//SourceSubmissionForm: creates a form used for source submission | |
var SourceSubmissionForm = function() { | |
var _thisInstance = this; | |
//instance members | |
this.index = -1; | |
this.element = null; | |
this.value = ""; | |
//add this instance to list | |
SourceSubmissionForm.instances.push(this); | |
//update index | |
this.index = SourceSubmissionForm.instances.length - 1; | |
//create new form | |
this.element = $('<textarea id="sourceForm' + this.index + '"/>'); | |
this.element.css({'width' : '200px', 'height' : '200px'}); | |
this.element.appendTo("#mid1"); | |
//register change event | |
this.element.change(function() { | |
_thisInstance.onTextChange(); | |
}); | |
}; | |
//static members | |
SourceSubmissionForm.instances = []; | |
//proto methods | |
SourceSubmissionForm.prototype.onTextChange = function() { | |
console.log("inner update"); | |
this.value = $(this.element).val(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment