I hereby claim:
- I am pegli on github.
- I am pegli (https://keybase.io/pegli) on keybase.
- I have a public key whose fingerprint is 1766 EA7E 3933 251A CACE 7827 3BEA 9CE8 8856 8305
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
var win = Ti.UI.createWindow({ | |
backgroundColor: "white", | |
}); | |
var label = Ti.UI.createLabel({ | |
text: "init" | |
}); | |
win.add(label); | |
The Titanium CLI isn't compatible with node 0.12 (TIMOB-18538). If you use homebrew and have already upgraded to 0.12, you can go back to 0.10.36 by running the following commands:
cd $( brew --prefix )
git checkout b64d9b9 Library/Formula/node.rb
brew unlink node
brew install node
You might want to use brew pin node
to keep brew upgrade
from updating that formula until the CLI is fixed.
$.win.open(); | |
function webviewLoad() { | |
alert("loaded"); | |
} | |
function loadGoogle() { | |
$.webview.url = "http://google.com/"; | |
} |
var win = Ti.UI.createWindow(); | |
var webview = Ti.UI.createWebView({ | |
url: 'local.html' | |
}); | |
var button = Ti.UI.createButton({ | |
title: 'fromTitanium', | |
height: '50dp', | |
width: '130dp' | |
}); | |
button.addEventListener('click', function(e) { |
extendModel: function(Model) { | |
_.extend(Model.prototype, { | |
answers: function() { | |
var coll = Alloy.createCollection('answer'); | |
coll.fetch({ query: 'select * from answers where question_id = ' + this.get('id')}); | |
return coll; | |
}, | |
}); | |
return Model; | |
} |
$.index.open(); |
function do_something(e) { | |
if (e.source.type == 'a') { | |
// something specific to a | |
} | |
else if (e.source.type == 'b') { | |
// something specific to b | |
} | |
} |
var c = require('window_view_controller').createController(); |
These files show how to use Mads Møller's sqlrest
adapter to fetch the remove video metadata and cache it locally in a sqlite database. Replace the underscores in the file names with slashes to get their actual location in your project.
There were two issues with the adapter code that you posted in pastie: the columns were missing from the adapter definition, and you needed to specify a custom parser function in order to pull out the embedded videos[i].video
objects. Also, the data that were posted to pastie were not valid JSON, so I had to fix that. The data used for this example can be found here: http://pastie.org/8580518.
The index.xml
file above shows a basic list view that uses item templates and Alloy's data binding to create a list of video titles. The docs for ListView show more details about how to set up list item templates and bind model properties. In brief: