diff --git a/bower.json b/bower.json index 3f4eee4a3f..2d62dbefef 100644 --- a/bower.json +++ b/bower.json @@ -45,10 +45,10 @@ "angular-ui-router": "~0.2.13" }, "devDependencies": { - "angular-mocks": "1.3.3" + "angular-mocks": "1.3.9" }, "resolutions": { - "angular": "1.3.3", + "angular": "1.3.9", "jquery": ">=1.9.0" } } diff --git a/public/js/static.js b/public/js/static.js index 8f88fb3551..0078b62243 100644 --- a/public/js/static.js +++ b/public/js/static.js @@ -7,8 +7,15 @@ window.habitrpg = angular.module('habitrpg', ['chieffancypants.loadingBar', 'ui. .constant("MOBILE_APP", false) .controller("RootCtrl", ['$scope', '$location', '$modal', '$http', function($scope, $location, $modal, $http){ - // must be #?memberId=xx, see https://github.com/angular/angular.js/issues/7239 var memberId = $location.search()['memberId']; + + // TODO Adding legacy support, remove this after 2/15/2015 or so + // angular@1.3.3 has bug, requires /#?memberId=x instead of ?memberId=x (https://github.com/angular/angular.js/issues/7239) + if (!memberId) { + memberId = /#\?memberId\=(.+)/.exec($location.$$absUrl); + if (memberId) memberId = memberId[memberId.length-1]; + } + if (memberId) { $http.get('/api/v2/members/'+memberId).success(function(data, status, headers, config){ $scope.profile = data; diff --git a/src/controllers/groups.js b/src/controllers/groups.js index 4c7b37c919..c3a93e047e 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -309,12 +309,12 @@ api.flagChatMessage = function(req, res, next){ {name: "REPORTER_USERNAME", content: user.profile.name}, {name: "REPORTER_UUID", content: user._id}, {name: "REPORTER_EMAIL", content: user.auth.local ? user.auth.local.email : ((user.auth.facebook && user.auth.facebook.emails && user.auth.facebook.emails[0]) ? user.auth.facebook.emails[0].value : null)}, - {name: "REPORTER_MODAL_URL", content: "https://habitrpg.com/static/front/#?memberId=" + user._id}, + {name: "REPORTER_MODAL_URL", content: "https://habitrpg.com/static/front?memberId=" + user._id}, {name: "AUTHOR_USERNAME", content: message.user}, {name: "AUTHOR_UUID", content: message.uuid}, {name: "AUTHOR_EMAIL", content: author.auth.local ? author.auth.local.email : ((author.auth.facebook && author.auth.facebook.emails && author.auth.facebook.emails[0]) ? author.auth.facebook.emails[0].value : null)}, - {name: "AUTHOR_MODAL_URL", content: "https://habitrpg.com/static/front/#?memberId=" + message.uuid}, + {name: "AUTHOR_MODAL_URL", content: "https://habitrpg.com/static/front?memberId=" + message.uuid}, {name: "GROUP_NAME", content: group.name}, {name: "GROUP_TYPE", content: group.type}, diff --git a/src/routes/apiv2.coffee b/src/routes/apiv2.coffee index 6c93e3ba42..39d4523a75 100644 --- a/src/routes/apiv2.coffee +++ b/src/routes/apiv2.coffee @@ -607,7 +607,7 @@ module.exports = (swagger, v2) -> path: '/members/{uuid}' description: "Get a member." parameters: [path('uuid','Member ID','string')] - middleware: [auth.auth, i18n.getUserLanguage] + middleware: [i18n.getUserLanguage] # removed auth.auth, so anon users can view shared avatars action: members.getMember "/members/{uuid}/message": spec: diff --git a/views/shared/header/avatar.jade b/views/shared/header/avatar.jade index 75692866ff..e338b19fcf 100644 --- a/views/shared/header/avatar.jade +++ b/views/shared/header/avatar.jade @@ -7,7 +7,7 @@ mixin avatar(opts) .character-sprites - .addthis_native_toolbox(ng-if='profile._id==user._id', data-url="#{env.BASE_URL}/static/front/#?memberId={{profile._id}}", data-title="Check out my HabitRPG progress!") + .addthis_native_toolbox(ng-if='profile._id==user._id', data-url="#{env.BASE_URL}/static/front?memberId={{profile._id}}", data-title="Check out my HabitRPG progress!") // Mount Body if !opts.minimal