Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Fix JSHint errors and other typos. #35

Merged
merged 7 commits into from
May 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"trailing": true,
"smarttabs": true,
"globals": {
"angular": false
"angular": false,
"ga": false,
"moment": false,
"HeatmapOverlay": false,
"google": false
}
}
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ module.exports = function (grunt) {
'<%= yeoman.app %>/views/{,*//*}*.{html,jade}',
'{.tmp,<%= yeoman.app %>}/styles/{,*//*}*.css',
'{.tmp,<%= yeoman.app %>}/scripts/{,*//*}*.js',
'<%= yeoman.app %>/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}',
'<%= yeoman.app %>/images/{,*//*}*.{png,jpg,jpeg,gif,webp,svg}'
],

options: {
livereload: true
}
Expand Down Expand Up @@ -122,7 +122,7 @@ module.exports = function (grunt) {
'.tmp',
'<%= yeoman.dist %>/views/*',
'<%= yeoman.dist %>/public/*',
'!<%= yeoman.dist %>/public/.git*',
'!<%= yeoman.dist %>/public/.git*'
]
}]
},
Expand Down
76 changes: 39 additions & 37 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ angular.module('gdgxHubApp', [
templateUrl: 'partials/event',
controller: 'EventDetailCtrl',
resolve: {
'MomentTimezone': ['MomentTimezone', function(MomentTimezone) {
'MomentTimezone': ['MomentTimezone', function (MomentTimezone) {
return MomentTimezone.promise;
}]
}
Expand All @@ -86,76 +86,78 @@ angular.module('gdgxHubApp', [
.otherwise({
redirectTo: '/'
});

$locationProvider.html5Mode(true);
})
.run(function ($rootScope, $location, $http, $window, Utilities) {
$rootScope.user = {
authResult: undefined,
auth: false,
};
authResult: undefined,
auth: false
};

$rootScope.toggleMenu = function() {
if($rootScope.menu_toggle) {
$rootScope.menu_toggle = "";
$rootScope.toggleMenu = function () {
if ($rootScope.menuToggle) {
$rootScope.menuToggle = '';
} else {
$rootScope.menu_toggle = "navbar_open";
$rootScope.menuToggle = 'navbar_open';
}
}
};

$rootScope.supportsGeo = $window.navigator.geolocation != undefined;
$rootScope.supportsGeo = $window.navigator.geolocation !== undefined;

if($rootScope.supportsGeo) {
$window.navigator.geolocation.getCurrentPosition(function(position) {
$rootScope.$apply(function() {
$rootScope.position = position;
});
}, function(error) {
console.log(error);
if ($rootScope.supportsGeo) {
$window.navigator.geolocation.getCurrentPosition(function (position) {
$rootScope.$apply(function () {
$rootScope.position = position;
});
}, function (error) {
console.log(error);
});
}

$rootScope.$on('$routeChangeSuccess', function(event) {
$rootScope.$on('$routeChangeSuccess', function () {
ga('send', 'pageview', {'page': $location.path()});
});

$rootScope.$on('event:google-plus-signin-success', function (event,authResult) {
$rootScope.$on('event:google-plus-signin-success', function (event, authResult) {
// Send login to server or save into cookie $rootScope.$apply(function() {

Utilities.decodeJwt(authResult['id_token'], function(claims) {
if(authResult['status']['signed_in']) {
$http.post('/signin', { code: authResult['code'] }).success(function(data) {
Utilities.decodeJwt(authResult.id_token, function (claims) { // jshint ignore:line
if (authResult.status.signed_in) { // jshint ignore:line
$http.post('/signin', {code: authResult.code}).success(function (data) {

if(data.user == claims.sub) {
$http.get('https://www.googleapis.com/plus/v1/people/me?fields=image&key=9MZ8QiVlgHqPrJQXU9I53EiW', { headers: { 'Authorization': "Bearer "+ authResult['access_token']} }).success(function(additional) {
if (data.user === claims.sub) {
$http.get('https://www.googleapis.com/plus/v1/people/me?fields=image&key=9MZ8QiVlgHqPrJQXU9I53EiW', {
headers: {'Authorization': 'Bearer ' + authResult.access_token} // jshint ignore:line
}).success(function (additional) { // jshint ignore:line
$rootScope.user = {
auth: authResult['status']['signed_in'],
auth: authResult.status.signed_in, // jshint ignore:line
authResult: authResult,
image: additional.image.url.replace("sz=50","sz=32"),
email: claims['email'],
userId: claims['sub'],
image: additional.image.url.replace('sz=50', 'sz=32'),
email: claims.email,
userId: claims.sub,
chapters: data.chapters,
organizer: (data.chapters.length > 0)
};
$rootScope.$broadcast("authenticated");
$rootScope.$broadcast('authenticated');
});
} else {
alert("ID Missmatch");
$window.alert('ID Missmatch');
}
});
}
});
});

$rootScope.$on('event:google-plus-signin-failure', function (event,authResult) {
$rootScope.$on('event:google-plus-signin-failure', function (event, authResult) {
// Auth failure or signout detected
console.log("Auth failed");
console.log(authResult["error"]);
$rootScope.$apply(function() {
console.log('Auth failed');
console.log(authResult.error);
$rootScope.$apply(function () {
$rootScope.user = {
authResult: authResult,
auth: false,
auth: false
};
});
});
});
});
4 changes: 2 additions & 2 deletions app/scripts/controllers/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

angular.module('gdgxHubApp')
.controller('AboutCtrl', function ($scope, $http) {
$http.get("https://api.github.com/repos/gdg-x/hub/contributors").success(function(data, status, headers, config) {
$http.get('https://api.github.com/repos/gdg-x/hub/contributors').success(function(data) {
$scope.contributors = data;
});
});
});
Loading