Permalink
Browse files

added 3.3 dir

  • Loading branch information...
1 parent 31738ac commit fe08348d9610d3bf8535986f229d67656242b0b5 geremy cohen committed Sep 6, 2012
Showing with 2,435 additions and 0 deletions.
  1. 0 titanium/{ → 3.1}/desktop/app.js
  2. 0 titanium/{ → 3.1}/desktop/index.html
  3. 0 titanium/{ → 3.1}/desktop/pubnub.js
  4. 0 titanium/{ → 3.1}/mobile/README
  5. 0 titanium/{ → 3.1}/mobile/app.js
  6. 0 titanium/{ → 3.1}/mobile/chat-example-app/.project
  7. 0 titanium/{ → 3.1}/mobile/chat-example-app/CHANGELOG.txt
  8. 0 titanium/{ → 3.1}/mobile/chat-example-app/LICENSE
  9. 0 titanium/{ → 3.1}/mobile/chat-example-app/LICENSE.txt
  10. 0 titanium/{ → 3.1}/mobile/chat-example-app/README
  11. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/KS_nav_ui.png
  12. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/KS_nav_views.png
  13. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/appicon.png
  14. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/default.png
  15. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-long-land-hdpi/default.png
  16. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-long-land-ldpi/default.png
  17. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-long-port-hdpi/default.png
  18. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-long-port-ldpi/default.png
  19. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-notlong-land-hdpi/default.png
  20. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-notlong-land-ldpi/default.png
  21. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-notlong-land-mdpi/default.png
  22. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-notlong-port-hdpi/default.png
  23. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-notlong-port-ldpi/default.png
  24. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/android/images/res-notlong-port-mdpi/default.png
  25. 0 titanium/{ → 3.1}/mobile/chat-example-app/Resources/app.js
  26. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/iphone/Default-Landscape.png
  27. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/iphone/Default-Portrait.png
  28. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/iphone/Default.png
  29. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/iphone/Default@2x.png
  30. BIN titanium/{ → 3.1}/mobile/chat-example-app/Resources/iphone/appicon.png
  31. 0 titanium/{ → 3.1}/mobile/chat-example-app/Resources/pubnub-chat.js
  32. 0 titanium/{ → 3.1}/mobile/chat-example-app/Resources/pubnub.js
  33. 0 titanium/{ → 3.1}/mobile/chat-example-app/manifest
  34. 0 titanium/{ → 3.1}/mobile/chat-example-app/tiapp.xml
  35. 0 titanium/{ → 3.1}/mobile/pubnub.js
  36. +84 −0 titanium/3.3/desktop/app.js
  37. +75 −0 titanium/3.3/desktop/index.html
  38. +496 −0 titanium/3.3/desktop/pubnub.js
  39. +119 −0 titanium/3.3/mobile/README
  40. +48 −0 titanium/3.3/mobile/app.js
  41. +23 −0 titanium/3.3/mobile/chat-example-app/.project
  42. +1 −0 titanium/3.3/mobile/chat-example-app/CHANGELOG.txt
  43. +219 −0 titanium/3.3/mobile/chat-example-app/LICENSE
  44. +1 −0 titanium/3.3/mobile/chat-example-app/LICENSE.txt
  45. +18 −0 titanium/3.3/mobile/chat-example-app/README
  46. BIN titanium/3.3/mobile/chat-example-app/Resources/KS_nav_ui.png
  47. BIN titanium/3.3/mobile/chat-example-app/Resources/KS_nav_views.png
  48. BIN titanium/3.3/mobile/chat-example-app/Resources/android/appicon.png
  49. BIN titanium/3.3/mobile/chat-example-app/Resources/android/default.png
  50. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-long-land-hdpi/default.png
  51. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-long-land-ldpi/default.png
  52. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-long-port-hdpi/default.png
  53. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-long-port-ldpi/default.png
  54. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-notlong-land-hdpi/default.png
  55. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-notlong-land-ldpi/default.png
  56. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-notlong-land-mdpi/default.png
  57. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-notlong-port-hdpi/default.png
  58. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-notlong-port-ldpi/default.png
  59. BIN titanium/3.3/mobile/chat-example-app/Resources/android/images/res-notlong-port-mdpi/default.png
  60. +26 −0 titanium/3.3/mobile/chat-example-app/Resources/app.js
  61. BIN titanium/3.3/mobile/chat-example-app/Resources/iphone/Default-Landscape.png
  62. BIN titanium/3.3/mobile/chat-example-app/Resources/iphone/Default-Portrait.png
  63. BIN titanium/3.3/mobile/chat-example-app/Resources/iphone/Default.png
  64. BIN titanium/3.3/mobile/chat-example-app/Resources/iphone/Default@2x.png
  65. BIN titanium/3.3/mobile/chat-example-app/Resources/iphone/appicon.png
  66. +180 −0 titanium/3.3/mobile/chat-example-app/Resources/pubnub-chat.js
  67. +548 −0 titanium/3.3/mobile/chat-example-app/Resources/pubnub.js
  68. +8 −0 titanium/3.3/mobile/chat-example-app/manifest
  69. +41 −0 titanium/3.3/mobile/chat-example-app/tiapp.xml
  70. +548 −0 titanium/3.3/mobile/pubnub.js
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,84 @@
+(function(){
+
+// --
+// -- DOM ELEMENT POINTERS
+// --
+var logger = PUBNUB.$('pubnub-logger')
+, publish_button = PUBNUB.$('publish-button')
+, subscribe_button = PUBNUB.$('subscribe-button')
+, subscribe_channel = PUBNUB.$('subscribe-channel')
+, publish_text = PUBNUB.$('publish-text')
+, connected = PUBNUB.$('pubnub-connected')
+, channel_name = '';
+
+
+// --
+// -- BASIC LOG OUTPUT FUNCTION
+// --
+function log(data) {
+ logger.innerHTML =
+ '\n' + log.line++ + ': ' +
+ JSON.stringify(data) + (
+ channel_name ?
+ ' - from "' + channel_name + '" Channel.' :
+ '' ) + logger.innerHTML;
+}
+log.line = 1;
+
+
+// --
+// -- SEND A MESSAGE FUNCTION
+// --
+function send_message(message) {
+ PUBNUB.publish({
+ channel : channel_name,
+ message : message
+ });
+}
+
+
+// --
+// -- LISTING FOR MESSAGES
+// --
+function listen(channel) {
+ // -- UNSUBSCRIBE FROM PREVIOUS CHANNEL
+ PUBNUB.unsubscribe({ channel : channel_name});
+
+ // -- SAVE NEW CHANNEL NAME
+ channel_name = channel || 'titanium-demo';
+
+ // -- SUBSCRIBE TO NEW CHANNEL
+ PUBNUB.subscribe({
+ channel : channel_name,
+ callback : log
+ });
+
+ // -- UPDATE CONNECTED STATUS
+ connected.innerHTML = 'CONNECTED to "' + channel_name + '"';
+ PUBNUB.css( connected, { color : "green" } );
+}
+
+
+// --
+// -- BIND SUBSCRIBE BUTTON
+// --
+PUBNUB.bind( 'mousedown,touchstart', subscribe_button, function() {
+ listen(subscribe_channel.value);
+} );
+
+
+// --
+// -- BIND PUBLISH BUTTON
+// --
+PUBNUB.bind( 'mousedown,touchstart', publish_button, function() {
+ // -- PUBLISH THE VALUE OF THE TEXTBOX INPUT
+ send_message( publish_text.value || 'EMPTY MESSAGE' );
+} );
+
+
+// --
+// -- GENERAL STARTUP COMPLETE MESSAGE
+// --
+log("Startup Complete");
+
+})();
@@ -0,0 +1,75 @@
+<html>
+<body>
+ <!-- GENERIC VANILLA STYLES -->
+ <style>
+ body, button, input, div {
+ color: #444;
+ font-family: Arial;
+ font-size: 12px;
+ line-height: 14px;
+ margin: 5px;
+ padding: 10px;
+ }
+
+ #pubnub-logger {
+ border: 2px solid #eee;
+ -webkit-box-shadow: 0 0 30px #ff0;
+ -webkit-border-radius: 10px;
+ margin: 20px;
+ padding: 10px;
+ }
+
+ #pubnub-connected {
+ color: red;
+ font-weight: bold;
+ }
+
+ button {
+ width: 150px;
+ }
+
+ input {
+ width: 200px;
+ }
+ </style>
+
+
+ <!-- SUBSCRIBE CHANNEL -->
+ <div>
+ <!-- SUBSCRIBE BUTTON -->
+ <button id=subscribe-button>SUBSCRIBE TO: </button>
+
+ <!-- CHANNEL NAME -->
+ <input id=subscribe-channel value=my-titanium-channel />
+
+ <!-- CONNECTION STATUS -->
+ <span id=pubnub-connected>NOT CONNECTED</span>
+ </div>
+
+
+ <!-- PUBLISH MESSAGE -->
+ <div>
+ <!-- PUBLISH BUTTON -->
+ <button id=publish-button>PUBLISH</button>
+
+ <!-- MESSAGE TEXT TO SEND -->
+ <input id=publish-text value=text-to-send />
+ </div>
+
+
+ <!-- LOG OUTPUT AREA -->
+ <pre id=pubnub-logger>...</pre>
+
+
+ <!-- PUBNUB SETUP -->
+ <div
+ id=pubnub
+ pub-key="demo"
+ sub-key="demo"
+ ssl="off"
+ origin="pubsub.pubnub.com"
+ ></div>
+ <script src="pubnub.js"></script>
+ <script src="app.js"></script>
+</body>
+</html>
Oops, something went wrong.

0 comments on commit fe08348

Please sign in to comment.