Macadamian/titanium_mobile — pull request #91 by alexandergalstyan (2012-07-02 12:46:10+00:00)
Title: TIMOB-9539: BlackBerry: Implement include()

Reviewers: DavidC, DavidL

ChangeLog:
- Added include functionality to Ti namespace.

Test Cases:
- Run tibbtest.
- Make sure include_test.js included in bar-descriptor.xml
- Make sure Ti.include() works correctly.
- Use the following app.js snippet:

////////////////////////////////////////
:app.js
var win1 = Titanium.UI.createWindow({
backgroundColor:'#F00'
});

var label1 = Ti.UI.createLabel({
text:'Hello, world!',
color:'green',
top: 200
});

win1.add(label1);

Ti.include('include_test.js');

// open window
win1.open();
////////////////////////////////////////
:include_test.js
var mybutton=Ti.UI.createButton
(
{top: 100,title: 'Push Me'}
);

mybutton.addEventListener
(
'click',
function(e)
{
e.source.title='Pushed!';
slider1.backgroundColor='#00F';
progress1.backgroundColor='#0F0';
}
);

win1.add(mybutton);