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
| /* | |
| * Copyright (c) 2008 David Crawshaw <[email protected]> | |
| * | |
| * Permission to use, copy, modify, and distribute this software for any | |
| * purpose with or without fee is hereby granted, provided that the above | |
| * copyright notice and this permission notice appear in all copies. | |
| * | |
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
| * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
| * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
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 sample lets you record and share video with Appcelerator Titanium on Android. | |
| * REQUIRES THE 1.6.0 RC OF TITANIUM MOBILE SDK | |
| * http://developer.appcelerator.com/blog/2011/02/release-candidate-for-titanium-mobile-1-6-0.html | |
| */ | |
| /** | |
| * First, create our UI. We'll have two buttons: record, and share. | |
| */ | |
| var win = Titanium.UI.createWindow({ |
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
| Titanium.Media.showCamera({ | |
| allowEditing: true, | |
| success: function(event) { | |
| var image = event.media; | |
| var pxhr = Titanium.Network.createHTTPClient(); | |
| pxhr.onerror = function() { | |
| Ti.UI.createNotification({ | |
| message:'Upload failed, please try again.' | |
| }).show(); | |
| } |
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
| /** | |
| * Override a tab group's tab bar on iOS. | |
| * | |
| * NOTE: Call this function on a tabGroup AFTER you have added all of your tabs to it! We'll look at the tabs that exist | |
| * to generate the overriding tab bar view. If your tabs change, call this function again and we'll update the display. | |
| * | |
| * @param tabGroup The tab group to override | |
| * @param backgroundOptions The options for the background view; use properties like backgroundColor, or backgroundImage. | |
| * @param selectedOptions The options for a selected tab button. | |
| * @param deselectedOptions The options for a deselected tab button. |
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 GetLocation(callback){ | |
| if (!Ti.Network.online) | |
| { | |
| callback({success: false}); | |
| return; | |
| } | |
| var PROVIDER = Titanium.Geolocation.PROVIDER_GPS; | |
| var timeout; |
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
| Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST; | |
| Titanium.Geolocation.distanceFilter = 0; | |
| var win = Ti.UI.createWindow({backgroundColor: '#fff'}); | |
| var label = Ti.UI.createLabel(); | |
| win.add(label); | |
| win.open(); | |
| function reportPosition(e) { | |
| if (!e.success || e.error) { |
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
| <?php | |
| /** | |
| * Gets the current global post type if one is set | |
| */ | |
| function x_get_current_post_type() { | |
| global $post, $typenow, $current_screen; | |
| if( $post && $post->post_type ) | |
| $post_type = $post->post_type; | |
| elseif( $typenow ) |
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
| /* Media queries used on blog.staydecent.ca by Adrian Unger | |
| check my full source at: | |
| http://blog.staydecent.ca/static/css/style-0.1.6.css */ | |
| @media only screen and (min-width:768px) and (max-width:1269px) { | |
| /* In my particular design, I used a fluid grid limited to a | |
| max-width of 1140px, while (if there is enough room) | |
| pushing the menu outside of layout, requiring a total | |
| limit of at least 1270px. | |
| So, this first query applies to any screen-width less |