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
| /* Kosso : March 12th 2011 | |
| This the only way I managed to do this without the app crashing on resume. | |
| Done slightly differently to the KS example, since they unregister the service and | |
| do not use a setInterval timer. | |
| */ | |
| //############ in app.js : | |
| // test for iOS 4+ |
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
| //////////////////////push_notifications.js/////////////////////// | |
| var apns = function(){ | |
| var pref = require('preferences').preferences; | |
| Titanium.Network.registerForPushNotifications({ | |
| types: [ | |
| Titanium.Network.NOTIFICATION_TYPE_BADGE, | |
| Titanium.Network.NOTIFICATION_TYPE_ALERT | |
| ], | |
| success:function(e) |
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
| // Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
| // Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
| var FORMAT_ONELINE = 'One-line'; | |
| var FORMAT_MULTILINE = 'Multi-line'; | |
| var FORMAT_PRETTY = 'Pretty'; | |
| var LANGUAGE_JS = 'JavaScript'; | |
| var LANGUAGE_PYTHON = 'Python'; |
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 scrollView = new Y.ScrollView({ | |
| srcNode: '#resultList', | |
| height: 260, | |
| flick: { | |
| minDistance:1, | |
| minVelocity:0.4, | |
| axis: "y" | |
| }, | |
| deceleration: 0.983, | |
| bounce:0.65, |
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 scrollView = Titanium.UI.createScrollView({ | |
| contentWidth: 'auto', | |
| contentHeight: 'auto', | |
| top: 0, | |
| bottom: 0, | |
| showVerticalScrollIndicator: true, | |
| showHorizontalScrollIndicator: true, |
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 matrix(rows, cols, defaultValue) { | |
| var arr = []; | |
| for (var i = 0; i < rows; i++) { | |
| arr.push([]); | |
| arr[i].push(new Array(cols)); | |
| for (var j = 0; j < cols; j++) { | |
| arr[i][j] = defaultValue; | |
| } | |
| } | |
| return arr; |
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 iconStore = Ti.Filesystem.applicationDataDirectory + '/CachedRemoteImages'; | |
| var dir = Ti.Filesystem.getFile(iconStore); | |
| if (!dir.exists()) { | |
| dir.createDirectory(); | |
| } | |
| function cacheRemoteURL(image, imageURL) { | |
| if (imageURL) { | |
| var hashedSource = Ti.Utils.md5HexDigest(imageURL + '') + '.' + imageURL.split('.').pop(); | |
| var localIcon = Ti.Filesystem.getFile(iconStore, hashedSource); | |
| if (localIcon.exists()) { |
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
| <html> | |
| <head> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| <script> | |
| $(document).ready(function(){ | |
| var json_Album_URI = "https://picasaweb.google.com/data/feed/base/" | |
| + "user/" + "thewoodsmyth" | |
| + "?alt=" + "json" | |
| + "&kind=" + "album" |
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 customEventExample() { | |
| $('body').bind('custom_event', function(e, data) { | |
| var data = data || e.data; | |
| console.log("This is data." + data.init); | |
| }); | |
| $("body").trigger('custom_event', { | |
| init : true | |
| }); |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <link href="ext-touch.css" rel="stylesheet"> | |
| <style> | |
| #h_panel { | |
| min-width: 2000px; | |
| background-color: #f5f5f5; | |
| border: 1px solid black; | |
| } |