Created
December 4, 2009 15:41
-
-
Save kwhinnery/249080 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
var ta1 = Titanium.UI.createTextArea({ | |
id:'idOfADOMElement', | |
value: 'Here\'s a new #tweet @joeschmoe', | |
keyboardType:Titanium.UI.KEYBOARD_ASCII, | |
autocorrect:false, | |
textAlign:'left', | |
height:100, | |
width:255 | |
}); | |
//recalculate on every change | |
ta1.addEventListener("change", function(e) { | |
var text = e.value; | |
var tweetLimitStatus = 140 - text.length; | |
// tweetLimitStatus is now how many characters remaining in a tweet, can be negative | |
// if the tweet were too long | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment