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
/*jslint devel:true */ | |
/*global window, exports */ | |
(function (root) { | |
"use strict"; | |
// Prototype extension | |
if (!Array.prototype.removeAt) { | |
Array.prototype.removeAt = function (idx) { | |
if (typeof idx !== "number") { | |
throw new TypeError("removeAt argument is required Integer"); |
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
/*jslint devel: true */ | |
/*global Titanium, require */ | |
(function (Ti, require) { | |
"use strict"; | |
// モジュール | |
var style = require("style"), | |
lib = require("lib"), | |
// UI コンポーネント | |
win = Ti.UI.createWindow(style.win), | |
thisHeadlineLabel = Ti.UI.createLabel(style.headlineLabel), |
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 fs = require("fs"); | |
var path = require("path"); | |
var util = require("util"); | |
var styl = require("stylus"); | |
var wrench = require("wrench"); | |
function compileTSS(root, view) { | |
var data = fs.readFileSync(path.join(root, view), "utf8"), | |
tss; | |
styl.render(data, function (err, css) { |
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
def p1(*args, **kwargs) | |
print args | |
print "\n" | |
print kwargs | |
end | |
p1 | |
#=> [] | |
#=> {} |
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
do (Ti) -> | |
# Load CommonJS modules | |
pocket = require("pocket").Pocket | |
consumerKey: "" # PLEASE GET CONSUMER KEY at http://getpocket.com/developer/ | |
accessTokenKey: Ti.App.Properties.getString "pocketAccessTokenKey", "" | |
pocketUserName: Ti.App.Properties.getString "pocketUserName", "" | |
# Build user interface component | |
win = Ti.UI.createWindow | |
backgroundColor: "#FFFFFF" |
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 () { | |
var win = Ti.UI.createWindow({ | |
title: "Window", | |
backgroundColor: "#FFFFFF" | |
}), | |
tableView = Ti.UI.createTableView({ | |
data: [] | |
}), | |
http = Ti.Network.createHTTPClient(); | |
win.add(tableView); |
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
# Application global object | |
apps = apps or {} | |
# Entry point | |
do -> | |
# Window | |
win1 = require("win1").init(apps); | |
# Tab | |
tab = Ti.UI.createTab | |
icon: "KS_nav_ui.png" |
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
do -> | |
# Main window | |
win = Ti.UI.createWindow | |
url: "win1.js" | |
# Tab | |
tab = Ti.UI.createTab | |
title: "Apps" | |
icon: "KS_nav_ui.png" | |
window: win | |
tabGroup = Ti.UI.createTabGroup() |
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 () { | |
// Base window | |
var base = Ti.UI.createWindow({ | |
backgroundColor: "#FFFFFF", | |
title: "Long Press" | |
}); | |
// TableView | |
var tableView = Ti.UI.createTableView({ | |
data: [], |
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 MyTabGroup = (function () { | |
function MyTabGroup() { | |
this.tabGroup = Ti.UI.createTabGroup(); | |
} | |
MyTabGroup.prototype.appendTab = function (params) { | |
for(var i = 0, l = params.length; i < l; i++) { | |
this.tabGroup.addTab(Ti.UI.createTab(params[i])); | |
} | |
}; | |
MyTabGroup.prototype.open = function () { |