diff options
| author | Teddy Wing | 2012-06-23 20:21:12 -0400 | 
|---|---|---|
| committer | Teddy Wing | 2012-06-23 20:21:12 -0400 | 
| commit | 4bccc3a0fea17e853b1f172da4d1e47f1df8f25b (patch) | |
| tree | f6e45e7c8b6160ddc764a261c8cf11dd06ee983f | |
| parent | 4bb9c15e5a38900ce6adff46593967e944fd9450 (diff) | |
| parent | 21a9c3e2bf812141ee3178b657db51909d8d59df (diff) | |
| download | LikeFeed-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
| -rw-r--r-- | Resources/friendship/config/config.js | 5 | ||||
| -rw-r--r-- | Resources/friendship/friendship.js | 1 | ||||
| -rw-r--r-- | Resources/friendship/ui/LoginWindow.js | 21 | ||||
| -rw-r--r-- | Resources/friendship/ui/ui.js | 3 | ||||
| -rw-r--r-- | tiapp.xml | 1 | 
5 files changed, 30 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'  ) @@ -23,6 +23,7 @@      <fullscreen>false</fullscreen>      <navbar-hidden>false</navbar-hidden>      <analytics>true</analytics> +    <property name="ti.facebook.appid">258369447595838</property>      <guid>ccd110bb-8710-4380-ad4a-94d93e18d62a</guid>      <iphone>          <orientations device="iphone"> | 
