Skip to content

Instantly share code, notes, and snippets.

@donayama
donayama / app.js
Created October 31, 2010 05:58
Titanium Mobile iPadSample
// -------------------------
// TabGroup&Tabの定義と表示
// -------------------------
//
// ※余談ですが、SplitViewをコンテナとしてTabGroupを持つ事が出来ません。
// そういう構成を組みたい場合はwin3.jsサンプルのようにViewを分割し、
// 左側のViewにTabGroupをセットするようなやり方になります。
//
var tabGroup = Ti.UI.createTabGroup();
tabGroup.addTab(Ti.UI.createTab({
@donayama
donayama / app.js
Created February 27, 2011 08:12
Online Code Testing for Titanium Mobile (not secure)
// Test Runner - Online Code Debuging Framework for Titanium Mobile(iOS)
var tabGroup = Titanium.UI.createTabGroup();
tabGroup.addTab(Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Test Runner',
window: Titanium.UI.createWindow({
title:'Test Runner',
backgroundColor:'#fff',
url: 'testrunner.js'
})
@donayama
donayama / app.js
Created February 27, 2011 11:06 — forked from donayama/app.js
// Test Runner - Online Code Debuging Framework for Titanium Mobile(iOS)
var tabGroup = Titanium.UI.createTabGroup();
tabGroup.addTab(Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Test Runner',
window: Titanium.UI.createWindow({
title:'Test Runner',
backgroundColor:'#fff',
url: 'testrunner.js'
})
@donayama
donayama / app.js
Created June 5, 2011 13:09
FlickrShow
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
Titanium.UI.iPhone.statusBarStyle = Titanium.UI.iPhone.StatusBar.OPAQUE_BLACK;
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
@donayama
donayama / gist:1376645
Created November 18, 2011 14:48
cameraでtabを押すと...
Ti.Media.showCamera({
success : function(event) {
alert('Your photo was saved to the Photo Gallery');
},
cancel : function() {
},
error : function(error) {
var message;
if (error.code == Ti.Media.NO_CAMERA) {
message = 'Device does not have video recording capabilities';
@donayama
donayama / app.js
Created December 7, 2011 13:21
タイタにうもん第一話 サンプルコード
// (1) ウィンドウ(Window)を作る
var window = Titanium.UI.createWindow({
backgroundColor : 'white'
});
// (2)ボタン(Button)を作る
var button = Titanium.UI.createButton({
title : 'カメラ',
top : 10,
left : 100,
@donayama
donayama / fc_init.js
Created December 19, 2011 22:28
Filterable Cameraの利用例(in 聖地巡礼S) これをapp.jsからTi.include してグローバルイベントでcallしてます
var module = require('jp.msmc.filterablecamera');
var presets = {
/*
* Normal
*/
Normal : new module.Filter(function() {
// NO OPERATION
}),
/*
* Gray
@donayama
donayama / InputDialog.coffee
Created February 9, 2012 14:49
InputDialog(KeyPad) for Titanium Mobile
#-----------------------------------------------------------------------
# InputDialog for Titanium Mobile (by @donayama)
#
# Original JS Version by @k0sukey
# http://k0sukey.tumblr.com/post/17082188960
#-----------------------------------------------------------------------
# Sample
#-----------------------------------------------------------------------
# InputDialog = require 'InputDialog'
#
@donayama
donayama / PlatformRequire.js
Created March 26, 2012 22:22
TiShadow iOS Simulator Patch (from line:29)
var log = require("/api/Log");
var os = Ti.Platform.osname;
// The TiShadow build of the Titanium SDK does not cache CommonJS modules loaded
// from the applicationDataDirectory. This is so that if an update to the app is
// deployed, i.e. a file in the applicationDataDirectory is modified, the changes
// while be loaded. That said loading a CommonJS module every time that it is loaded
// make the deployed bundle run slowly. So we will manage the caching of those
// modules here in the code.
@donayama
donayama / app.js
Created August 18, 2012 13:14
Toolbarをくるくる回転…させられなかった。
var window = Ti.UI.createWindow();
var mapView = Ti.Map.createView({
bottom : 44
});
var flex = Ti.UI.createButton({
systemButton : Ti.UI.iPhone.SystemButton.FLEXIBLE_SPACE
});
var button1 = Ti.UI.createButton({