Skip to content

Instantly share code, notes, and snippets.

View bob-sims's full-sized avatar

Bob Sims bob-sims

View GitHub Profile
@19h
19h / TiYoutube.js
Last active November 11, 2015 16:24
Titanium Mobile SDK iPhone / Android: Extract Youtube Video URL / URI from video-id / identification / name and play mp4 file. (Workaround for the recent change of security in Youtube)
Titanium.App.addEventListener("playvideo", function (e) {
var win11 = Titanium.UI.createWindow({
orientationModes: [Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT],
title: "Video",
zIndex: 222222
});
var activeMovie = Titanium.Media.createVideoPlayer({
fullscreen: !0,
autoplay: !0,
@mauropm
mauropm / app.js
Created August 7, 2012 04:50
Facebook 'alike' menu in Appcelerator
/*
* Facebook 'alike' menu in Titanium Appcelerator
* Mauro Parra-Miranda <mauropm@gmail.com>
* License: Free to use, no support at all.
* USAGE: Create a new mobile project in Ti Studio, paste this file into app.js
*/
var win = Ti.UI.createWindow({
backgroundColor : 'white',
});
@raulriera
raulriera / LoadingTableViewRow.js
Created August 20, 2012 13:31
Loading indicador for tableviews in Titanium Appcelerator
LoadingTableViewRow = function(message) {
var row = Titanium.UI.createTableViewRow({
height: 70,
touchEnabled: false
});
var indicator = Titanium.UI.createActivityIndicator({
width:"auto",
height: 30,
color: "665b5b",
@pec1985
pec1985 / app.js
Created September 4, 2012 20:41
UI module with callbacks - Titanium Appcelerator
var UI = require('ui');
var btn = UI.Button({
title: 'Hello World',
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
onClick: function(){
alert('Button Clicked');
}
});
@raulriera
raulriera / DialogWindow.js
Created September 9, 2012 11:08
CustomAlertDialog commonJS module for Titanium Appcelerator. Similar to the "Tweetbot" (but will need more makeup of course) where the information is displayed below the title bar instead of an intrusive popup
DialogWindow = function(message, type){
// Default params
var message = message || "How about you add some message to this? :)";
var type = type || "error";
var window = Titanium.UI.createWindow({
width: 320,
height: 44,
top: 44,
@aaronksaunders
aaronksaunders / app.js
Created September 14, 2012 12:12
handling links in a webview
## jQuery [plain_text]
Make sure you make a reference to the jQuery library in the header of your HTML. Also remember that you must load the HTML into the WebView from a local file.
## This event definition goes in you app.js [javascript]
Ti.App.addEventListener('openBrowser',function(e){
Ti.Platform.openURL(e.URL);
});
## This JQuery goes in the HTML file [javascript]
@aaronksaunders
aaronksaunders / app.js
Created September 18, 2012 21:07
Integrating ACS with NODE JS - This works, BUT I want to migrate it to using the new Node.ACS platform
// SEE QUESTION IN QA FORUM
// http://developer.appcelerator.com/question/142378/integrating-nodeacs-with-expressjs-not-working
// @aaronksaunders
//
/**
* Module dependencies.
*/
var express = require('express');
@Xaynder
Xaynder / app.js
Created November 5, 2012 12:35
Titanium iOS Sliding Menu
//// ---- Menu window, positioned on the left
var menuWindow = Ti.UI.createWindow({
top:0,
left:0,
width:150
});
menuWindow.open();
//// ---- Menu Table
// Menu Titles
@ricardoalcocer
ricardoalcocer / index.js
Created November 23, 2012 19:49
Basic Alloy : Dynamic TableView Handling
function showItems(e) {
Ti.API.info(e.rowData.itemName);
}
var rowData=[];
for(var i=1;i<=10;i++){
var payload={
rowId:i,
itemName:'Test' + i
}
exports.definition =
config:
adapter:
type: "rest"
name: "Agent"
extendModel: (Model) ->
_.extend Model::,
url: ->