This file contains hidden or 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
Ti.include('overrideTabs.js'); | |
/* | |
This is a typical new project -- a tab group with three tabs. | |
*/ | |
var tabGroup = Ti.UI.createTabGroup(); | |
/* | |
Tab 1. |
This file contains hidden or 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
/* | |
* Napp Framework | |
* (c) 2012 Napp ApS | |
* www.napp.dk | |
* | |
* NAPP SQL ALLOY ADAPTER | |
* Dual SQLite/SQL sync adapter which will store all models in | |
* an on device database | |
*/ |
This file contains hidden or 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
//method 1: minklasse.js | |
function MinKlasse(args){ | |
function hejsa(){ | |
return 1; | |
} | |
return { | |
hejsa:function(){ | |
return 1; |
This file contains hidden or 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
//Setup module to run Behave tests | |
require('behave').andSetup(this); | |
describe('SQLREST: create a model', function() { | |
it.eventually('*** creates a new model', function(done) { | |
var model = Alloy.createModel('wine', { | |
name : "CHATEAU LE DOYENNE", | |
year : 2012, | |
grapes : "Merlot", | |
country : "France", |
This file contains hidden or 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 collection = Alloy.Collections.collection; | |
var openAddItem = function(){ | |
var win = Alloy.createController("CollectionDetail").getView(); | |
win.open(); | |
} | |
function dataTransform(model) { | |
var transform = model.toJSON(); | |
transform.title = transform.first + " " + transform.last; |
This file contains hidden or 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
migration.up = function(db) { | |
db.createTable({ | |
"columns": { | |
"id":"INTEGER PRIMARY KEY AUTOINCREMENT", | |
"userid":"INTEGER", | |
"title":"text", | |
"description":"text", | |
"image":"text", | |
"thumb":"text", | |
"modules":"text", |
This file contains hidden or 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 executeSql (sql, data) { | |
if(data != undefined && data.length > 0) { | |
var final_sql = sql; | |
for(var value in data) { | |
final_sql = final_sql.replace(sqlSeperator, '"' + escapeSql(data[value]) + '"'); | |
} | |
return db_instance.execute(final_sql); | |
} else { | |
return db_instance.execute(sql); |
This file contains hidden or 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
Alloy.Globals.fontAwesome = require('IconicFont').IconicFont({ | |
font: 'FontAwesome' | |
}); | |
Alloy.Globals.fontAwesomeBackButton = Alloy.Globals.fontAwesome.icon('icon-chevron-left'); | |
var NappAppearance = require('dk.napp.appearance'); | |
NappAppearance.setGlobalStyling({ | |
barButton:{ | |
color:"#ffffff", | |
shadowColor: "transparent", |
This file contains hidden or 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 is an example of use. | |
// Here we use the new Bearer Token thats make it possible to get tweets without user login | |
// More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth | |
// Full Codebird API is here: https://github.com/mynetx/codebird-js | |
var Codebird = require("codebird"); | |
var cb = new Codebird(); | |
cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY'); | |
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null); |
This file contains hidden or 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 need to add the following proxies to our project before Napp UI works. | |
// This is due to some limitations of the Titanium Module SDK | |
// Please run this after you require the | |
exports.initNappUI() { | |
require('dk.napp.ui'); // require the module | |
// window and tabs |
OlderNewer