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 win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var web = Ti.UI.createWebView({ | |
url: 'http://www.appcelerator.com/' | |
}); | |
var linkJS = 'document.titaniumLinkQueue = [];' | |
+ '(function(){' | |
+ 'var links = document.getElementsByTagName("a");' | |
+ 'for(var i = 0, l = links.length; i < l; i++) {' |
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 win = Ti.UI.createWindow({ | |
backgroundColor: '#333' | |
}); | |
var menuWidth = 200; | |
var container = Ti.UI.createScrollView({ | |
disableBounce: false, | |
horizontalBounce: true, | |
contentWidth: Ti.Platform.displayCaps.platformWidth + menuWidth |
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
<html> | |
<head> | |
<style type="text/css"> | |
body { | |
font: 14px Verdana, Geneva, sans-serif; | |
height: 500px; | |
width: 700px; | |
margin: 10px 20px; | |
} |
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
function validateForm() { | |
var formIsValid = true; | |
function enforceTextFieldMinLength(field, minLength) { | |
if (!field.value || field.value.length < minLength) { | |
formIsValid = false; | |
} | |
} | |
function enforceLabelHasText(label) { | |
if (!label.text) { | |
formIsValid = false; |
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 win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var button = Ti.UI.createButton({ title: 'Share' }); | |
win.add(button); | |
win.open(); | |
button.addEventListener('click', function() { | |
var intent = Ti.Android.createIntent({ | |
action: Ti.Android.ACTION_SEND, | |
type: 'text/plain' | |
}); |
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
#cs ---------------------------------------------------------------------------- | |
Version: v1 | |
Author: Dawson Toth | |
Script Function: | |
Taps the tiny unit deselection arrow in They Are Billions 1 to 10 times. | |
To use, download AutoIt, then drop this in a file named TheyAreBillions-Hotkeys.au3. | |
Run the script, and then whenever you press `, you can then press ESC or ` to cancel, | |
or 1, 2, 3, 4 ... 9, or 0 (which means 10) to left click on the deselect arrow in TAB. |
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
/** | |
* This sample lets you record and share video with Appcelerator Titanium on Android. | |
* REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK | |
* http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html | |
*/ | |
/** | |
* First, create our UI. We'll have two buttons: record, and share. | |
*/ | |
var win = Titanium.UI.createWindow({ |
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
/** | |
* Define our parser class. It takes in some text, and then you can call "linkifyURLs", or one of the other methods, | |
* and then call "getHTML" to get the fully parsed text back as HTML! | |
* @param text that you want parsed | |
*/ | |
function Parser(text) { | |
var html = text; | |
var urlRegex = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi; |
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
/** | |
* We're going to create an infinite loading table view. Whenever you get close to the bottom, we'll load more rows. | |
*/ | |
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); | |
var isAndroid = Ti.Platform.osname === 'android'; | |
/** | |
* Create our UI elements. | |
*/ | |
var table = Ti.UI.createTableView({ top: 0, right: 0, bottom: 0, left: 0 }); |
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
function getStackTrace() { | |
let obj = {}; | |
Error.captureStackTrace(obj, getStackTrace); | |
return obj.stack; | |
} | |
window.activeFuncs = {}; | |
window.originalSetTimeout = window.setTimeout; | |
window.originalClearTimeout = window.clearTimeout; | |
window.originalSetInterval = window.setInterval; |