Skip to content

Instantly share code, notes, and snippets.

View geniuswebtools's full-sized avatar

Marion Dorsett geniuswebtools

View GitHub Profile
@geniuswebtools
geniuswebtools / import.js
Created January 10, 2012 12:59
Import JavaScript files like you would your CSS files.
/*
Directions:
1. Place all of your JavaScripts in the same folder as
this one, or resolve the path to match the scriptURI var.
2. Add the filenames of the JavaScripts you want to load
automatically as a comma seperated list of arguments
in the gLoadJS function call.
3. Link this JavaScript file to your HTML document, and
@geniuswebtools
geniuswebtools / ui.orientation.js
Created January 10, 2012 12:52
Set device orientation in Titanium Studio
isAndroid = (Ti.Platform.osname == 'android') ? true : false; // Detect Android OS
Ti.UI.orientation = Ti.UI.PORTRAIT; // Force portrait view
if(isAndroid === true)// Force orientation to maintain portrait
{
Ti.Gesture.addEventListener('orientationchange', function(e)
{
Ti.Android.currentActivity.setRequestedOrientation(Ti.Android.SCREEN_ORIENTATION_PORTRAIT);
});
} // end if