aboutsummaryrefslogtreecommitdiffstats
path: root/Resources/friendship
diff options
context:
space:
mode:
authorTeddy Wing2012-06-23 20:21:12 -0400
committerTeddy Wing2012-06-23 20:21:12 -0400
commit4bccc3a0fea17e853b1f172da4d1e47f1df8f25b (patch)
treef6e45e7c8b6160ddc764a261c8cf11dd06ee983f /Resources/friendship
parent4bb9c15e5a38900ce6adff46593967e944fd9450 (diff)
parent21a9c3e2bf812141ee3178b657db51909d8d59df (diff)
downloadLikeFeed-4bccc3a0fea17e853b1f172da4d1e47f1df8f25b.tar.bz2
Merge branch 'master' of github.com:teddywing/LikeFeed
Put facebook stuff in config.js and LoginWindow.js. LoginWindow.js still needs to be completed. Committing so everybody gets new app structure. Conflicts: Resources/app.js
Diffstat (limited to 'Resources/friendship')
-rw-r--r--Resources/friendship/config/config.js5
-rw-r--r--Resources/friendship/friendship.js1
-rw-r--r--Resources/friendship/ui/LoginWindow.js21
-rw-r--r--Resources/friendship/ui/ui.js3
4 files changed, 29 insertions, 1 deletions
diff --git a/Resources/friendship/config/config.js b/Resources/friendship/config/config.js
new file mode 100644
index 0000000..dc86a0e
--- /dev/null
+++ b/Resources/friendship/config/config.js
@@ -0,0 +1,5 @@
+(function() {
+ // Facebook
+ Titanium.Facebook.appid = '258369447595838';
+ Titanium.Facebook.permissions = ['publish_stream'];
+})();
diff --git a/Resources/friendship/friendship.js b/Resources/friendship/friendship.js
index fa00b10..8d3f437 100644
--- a/Resources/friendship/friendship.js
+++ b/Resources/friendship/friendship.js
@@ -5,5 +5,6 @@ var fs = {};
})();
Ti.include(
+ '/friendship/config/config.js',
'/friendship/ui/ui.js'
);
diff --git a/Resources/friendship/ui/LoginWindow.js b/Resources/friendship/ui/LoginWindow.js
new file mode 100644
index 0000000..cbb803b
--- /dev/null
+++ b/Resources/friendship/ui/LoginWindow.js
@@ -0,0 +1,21 @@
+(function() {
+ function createFBLoginButton () {
+ // Don't forget to set your appid and requested permissions, else the login button
+ // won't be effective.
+
+ Titanium.Facebook.addEventListener('login', function(e) {
+ if (e.success) {
+ alert('Logged in');
+ }
+ });
+ Titanium.Facebook.addEventListener('logout', function(e) {
+ alert('Logged out');
+ });
+
+ // add the button. Note that it doesn't need a click event or anything.
+ return Titanium.Facebook.createLoginButton({
+ top: 50,
+ style: 'wide'
+ });
+ };
+})();
diff --git a/Resources/friendship/ui/ui.js b/Resources/friendship/ui/ui.js
index b86383a..f548cfd 100644
--- a/Resources/friendship/ui/ui.js
+++ b/Resources/friendship/ui/ui.js
@@ -4,5 +4,6 @@
Ti.include(
'/friendship/ui/ApplicationWindow.js',
- '/friendship/ui/LikeList.js'
+ '/friendship/ui/LikeList.js',
+ '/friendship/ui/LoginWindow.js'
)