Skip to content

Commit

Permalink
Merge pull request paazby#12 from paulyi326/master
Browse files Browse the repository at this point in the history
pics of george and scarlett
  • Loading branch information
paulyi326 committed Jul 21, 2014
2 parents 3636a27 + d7033aa commit 819d93a
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 14 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^0.7.1",
"jquery": "^2.1.1",
"jwt-simple": "^0.2.0",
"socket.io": "^1.0.6"

},
"devDependencies": {
"bower": "^1.3.3",
Expand Down
1 change: 1 addition & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<script src='js/services/database.js'></script>
<script src='js/services/matchLoader.js'></script>
<script src='js/services/eventsOAuth.js'></script>
<script src='js/services/tokenMaker.js'></script>
<script src='js/services/oAuth.js'></script>

<!-- cordova script (this will be a 404 during development) -->
Expand Down
18 changes: 13 additions & 5 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ var app = angular.module('icebreaker', ['ionic', 'openfb']);

app.run(function($ionicPlatform, $rootScope, Database, MatchLoader, Events, $http, $window, $state) {
$ionicPlatform.ready(function() {

$rootScope.initialDatabaseCall = false;
$rootScope.shouldRedirectToPotentialMatches = false;
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)

if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
Expand All @@ -25,9 +25,17 @@ app.run(function($ionicPlatform, $rootScope, Database, MatchLoader, Events, $htt
// and kicks off the signin process if not logged in

// $rootScope.$on('$stateChangeStart', function(event, toState) {
// if (!$rootScope.initialDatabaseCall && $window.localStorage.getItem('jwtToken')) {
// // move database call here
// $rootScope.initialDatabaseCall = true;
// if ($window.localStorage.getItem('jwtToken')) {
// if (!$rootScope.initialDatabaseCall) {
// $rootScope.initialDatabaseCall = true;
// // move database call here
// }

// // if (!$rootScope.shouldRedirectToPotentialMatches) {
// // $rootScope.shouldRedirectToPotentialMatches = true;
// // $state.go('potentialEvents');
// // }

// event.preventDefault();
// }
// });
Expand Down
8 changes: 4 additions & 4 deletions www/js/controllers/PotentialMatchesCtrl.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app.controller('PotentialMatchesCtrl', function($rootScope, $scope, $state, $ionicPopup, Database, $http) {
app.controller('PotentialMatchesCtrl', function($rootScope, $scope, $state, $ionicPopup, Database, $http, TokenMaker) {

$scope.matches = function() {
$state.go('matches');
Expand All @@ -25,12 +25,12 @@ app.controller('PotentialMatchesCtrl', function($rootScope, $scope, $state, $ion
$scope.like = function(index, targetId) {
console.log(targetId);
$http({
method: 'post',
url: "" + targetId,
url: TokenMaker.makeToken() + otherId, // girl
method: 'POST'
}).success(function(){
console.log('hey');
}).error(function(err){
console.log(err);
console.log('err');
});


Expand Down
1 change: 1 addition & 0 deletions www/js/controllers/SignInCtrl.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

app.controller('SignInCtrl', function($scope, OpenFB, $location) {
$scope.signIn = function () {
OpenFB.login().then(function() { // figure out how to get route change working
Expand Down
4 changes: 2 additions & 2 deletions www/js/services/eventsOAuth.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
app.factory('Events', function($http){
app.factory('Events', function($http, TokenMaker){
var Events = {
getEvents: function(){
return $http({
Expand All @@ -8,7 +8,7 @@ app.factory('Events', function($http){
q: 'party',
popular:true,
'venue.city': 'san francisco',
token: ''
token: TokenMaker.eventApi()
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions www/js/services/matchLoader.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
app.factory('MatchLoader', function($http) {
app.factory('MatchLoader', function($http, TokenMaker) {

var matches = [];

var MatchLoader = {

loadAllMatches: function(allMatches) {
return $http({
url: '',
url: 'http://zavadil7.cloudapp.net/allcandidates/' + TokenMaker.makeToken(),
method: "GET"
});
},
Expand Down
2 changes: 1 addition & 1 deletion www/js/services/oAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ var app = angular.module('openfb', []);
// remove the last 4 characters that fb attaches, that we don't want
userToken = userToken.slice(0, -4);
tokenStore.setItem('userToken', userToken);
deferredLogin.resolve();
deferredLogin.resolve();
} else {
deferredLogin.reject();
}
Expand Down

0 comments on commit 819d93a

Please sign in to comment.