Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
fix(core): Remove the <base> tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
0x24a537r9 authored and mleanos committed Oct 10, 2016
1 parent 0ea8cec commit aebaf2f
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 38 deletions.
4 changes: 2 additions & 2 deletions modules/articles/client/config/articles.client.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
})
.state('articles.list', {
url: '',
templateUrl: 'modules/articles/client/views/list-articles.client.view.html',
templateUrl: '/modules/articles/client/views/list-articles.client.view.html',
controller: 'ArticlesListController',
controllerAs: 'vm',
data: {
Expand All @@ -25,7 +25,7 @@
})
.state('articles.view', {
url: '/:articleId',
templateUrl: 'modules/articles/client/views/view-article.client.view.html',
templateUrl: '/modules/articles/client/views/view-article.client.view.html',
controller: 'ArticlesController',
controllerAs: 'vm',
resolve: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ArticlesService.$inject = ['$resource', '$log'];

function ArticlesService($resource, $log) {
var Article = $resource('api/articles/:articleId', {
var Article = $resource('/api/articles/:articleId', {
articleId: '@_id'
}, {
update: {
Expand Down
6 changes: 3 additions & 3 deletions modules/articles/tests/client/articles.client.routes.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

beforeEach(inject(function ($controller, $state, $templateCache) {
viewstate = $state.get('articles.view');
$templateCache.put('modules/articles/client/views/view-article.client.view.html', '');
$templateCache.put('/modules/articles/client/views/view-article.client.view.html', '');

// create mock article
mockArticle = new ArticlesService({
Expand Down Expand Up @@ -104,7 +104,7 @@
});

it('Should have templateUrl', function () {
expect(viewstate.templateUrl).toBe('modules/articles/client/views/view-article.client.view.html');
expect(viewstate.templateUrl).toBe('/modules/articles/client/views/view-article.client.view.html');
});
});

Expand All @@ -119,7 +119,7 @@
$rootScope.$digest();

expect($location.path()).toBe('/articles');
expect($state.current.templateUrl).toBe('modules/articles/client/views/list-articles.client.view.html');
expect($state.current.templateUrl).toBe('/modules/articles/client/views/list-articles.client.view.html');
}));
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

it('should send a GET request and return all articles', inject(function (ArticlesService) {
// Set POST response
$httpBackend.expectGET('api/articles').respond(mockArticleList);
$httpBackend.expectGET('/api/articles').respond(mockArticleList);


$httpBackend.flush();
Expand Down
2 changes: 1 addition & 1 deletion modules/chat/client/config/chat.client.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$stateProvider
.state('chat', {
url: '/chat',
templateUrl: 'modules/chat/client/views/chat.client.view.html',
templateUrl: '/modules/chat/client/views/chat.client.view.html',
controller: 'ChatController',
controllerAs: 'vm',
data: {
Expand Down
2 changes: 1 addition & 1 deletion modules/chat/client/views/chat.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h1>Chat Example</h1>
<!-- List all messages -->
<li class="col-xs-12 col-md-offset-4 col-md-4 chat-message" ng-repeat="message in vm.messages">
<small class="pull-right text-muted" ng-bind="message.created | date:'mediumTime'"></small>
<img ng-src="{{message.profileImageURL}}" alt="{{message.username}}" class="pull-left chat-profile-image" />
<img ng-src="/{{message.profileImageURL}}" alt="{{message.username}}" class="pull-left chat-profile-image" />
<div class="pull-left chat-message-details">
<strong ng-bind="message.username"></strong>
<br>
Expand Down
5 changes: 4 additions & 1 deletion modules/core/client/app/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
bootstrapConfig.$inject = ['$compileProvider', '$locationProvider', '$httpProvider', '$logProvider'];

function bootstrapConfig($compileProvider, $locationProvider, $httpProvider, $logProvider) {
$locationProvider.html5Mode(true).hashPrefix('!');
$locationProvider.html5Mode({
enabled: true,
requireBase: false
}).hashPrefix('!');

$httpProvider.interceptors.push('authInterceptor');

Expand Down
8 changes: 4 additions & 4 deletions modules/core/client/config/core.client.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
$stateProvider
.state('home', {
url: '/',
templateUrl: 'modules/core/client/views/home.client.view.html',
templateUrl: '/modules/core/client/views/home.client.view.html',
controller: 'HomeController',
controllerAs: 'vm'
})
.state('not-found', {
url: '/not-found',
templateUrl: 'modules/core/client/views/404.client.view.html',
templateUrl: '/modules/core/client/views/404.client.view.html',
controller: 'ErrorController',
controllerAs: 'vm',
params: {
Expand All @@ -50,7 +50,7 @@
})
.state('bad-request', {
url: '/bad-request',
templateUrl: 'modules/core/client/views/400.client.view.html',
templateUrl: '/modules/core/client/views/400.client.view.html',
controller: 'ErrorController',
controllerAs: 'vm',
params: {
Expand All @@ -65,7 +65,7 @@
})
.state('forbidden', {
url: '/forbidden',
templateUrl: 'modules/core/client/views/403.client.view.html',
templateUrl: '/modules/core/client/views/403.client.view.html',
data: {
ignoreState: true,
pageTitle: 'Forbidden'
Expand Down
2 changes: 1 addition & 1 deletion modules/core/client/views/header.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<ul class="nav navbar-nav navbar-right" ng-show="vm.authentication.user">
<li class="dropdown" uib-dropdown>
<a class="dropdown-toggle user-header-dropdown-toggle" uib-dropdown-toggle role="button">
<img ng-src="{{vm.authentication.user.profileImageURL}}" alt="{{vm.authentication.user.displayName}}" class="header-profile-image" />
<img ng-src="/{{vm.authentication.user.profileImageURL}}" alt="{{vm.authentication.user.displayName}}" class="header-profile-image" />
<span ng-bind="vm.authentication.user.displayName"></span> <b class="caret"></b>
</a>
<ul class="dropdown-menu" role="menu">
Expand Down
2 changes: 1 addition & 1 deletion modules/core/client/views/home.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="jumbotron text-center">
<div class="row">
<div class="col-md-6 col-md-offset-3 col-sm-6 col-sm-offset-3 col-xs-12">
<img alt="MEAN.JS" class="img-responsive text-center" src="modules/core/client/img/brand/logo.png" />
<img alt="MEAN.JS" class="img-responsive text-center" src="/modules/core/client/img/brand/logo.png" />
</div>
</div>
<br>
Expand Down
7 changes: 3 additions & 4 deletions modules/core/server/views/layout.server.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
<base href="/">
<title page-title></title>
<meta name="description" content="{{description}}">
<meta name="fragment" content="!">
Expand All @@ -29,10 +28,10 @@
<meta name="twitter:image" content="{{logo}}">

<!-- Fav Icon -->
<link href="{{favicon}}" rel="shortcut icon" type="image/x-icon">
<link href="/{{favicon}}" rel="shortcut icon" type="image/x-icon">

<!-- Application CSS Files -->
{{#each cssFiles}}<link rel="stylesheet" href="{{this}}">{{/each}}
{{#each cssFiles}}<link rel="stylesheet" href="/{{this}}">{{/each}}
</head>

<body class="ng-cloak">
Expand Down Expand Up @@ -64,7 +63,7 @@
<script type="text/javascript" src="/socket.io/socket.io.js"></script>

<!--Application JavaScript Files-->
{{#each jsFiles}}<script type="text/javascript" src="{{this}}"></script>{{/each}}
{{#each jsFiles}}<script type="text/javascript" src="/{{this}}"></script>{{/each}}

<!--owasp config sync-->
<script type="text/javascript">
Expand Down
6 changes: 3 additions & 3 deletions modules/users/client/config/users-admin.client.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$stateProvider
.state('admin.users', {
url: '/users',
templateUrl: 'modules/users/client/views/admin/list-users.client.view.html',
templateUrl: '/modules/users/client/views/admin/list-users.client.view.html',
controller: 'UserListController',
controllerAs: 'vm',
data: {
Expand All @@ -21,7 +21,7 @@
})
.state('admin.user', {
url: '/users/:userId',
templateUrl: 'modules/users/client/views/admin/view-user.client.view.html',
templateUrl: '/modules/users/client/views/admin/view-user.client.view.html',
controller: 'UserController',
controllerAs: 'vm',
resolve: {
Expand All @@ -33,7 +33,7 @@
})
.state('admin.user-edit', {
url: '/users/:userId/edit',
templateUrl: 'modules/users/client/views/admin/edit-user.client.view.html',
templateUrl: '/modules/users/client/views/admin/edit-user.client.view.html',
controller: 'UserController',
controllerAs: 'vm',
resolve: {
Expand Down
24 changes: 12 additions & 12 deletions modules/users/client/config/users.client.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.state('settings', {
abstract: true,
url: '/settings',
templateUrl: 'modules/users/client/views/settings/settings.client.view.html',
templateUrl: '/modules/users/client/views/settings/settings.client.view.html',
controller: 'SettingsController',
controllerAs: 'vm',
data: {
Expand All @@ -23,7 +23,7 @@
})
.state('settings.profile', {
url: '/profile',
templateUrl: 'modules/users/client/views/settings/edit-profile.client.view.html',
templateUrl: '/modules/users/client/views/settings/edit-profile.client.view.html',
controller: 'EditProfileController',
controllerAs: 'vm',
data: {
Expand All @@ -32,7 +32,7 @@
})
.state('settings.password', {
url: '/password',
templateUrl: 'modules/users/client/views/settings/change-password.client.view.html',
templateUrl: '/modules/users/client/views/settings/change-password.client.view.html',
controller: 'ChangePasswordController',
controllerAs: 'vm',
data: {
Expand All @@ -41,7 +41,7 @@
})
.state('settings.accounts', {
url: '/accounts',
templateUrl: 'modules/users/client/views/settings/manage-social-accounts.client.view.html',
templateUrl: '/modules/users/client/views/settings/manage-social-accounts.client.view.html',
controller: 'SocialAccountsController',
controllerAs: 'vm',
data: {
Expand All @@ -50,7 +50,7 @@
})
.state('settings.picture', {
url: '/picture',
templateUrl: 'modules/users/client/views/settings/change-profile-picture.client.view.html',
templateUrl: '/modules/users/client/views/settings/change-profile-picture.client.view.html',
controller: 'ChangeProfilePictureController',
controllerAs: 'vm',
data: {
Expand All @@ -60,13 +60,13 @@
.state('authentication', {
abstract: true,
url: '/authentication',
templateUrl: 'modules/users/client/views/authentication/authentication.client.view.html',
templateUrl: '/modules/users/client/views/authentication/authentication.client.view.html',
controller: 'AuthenticationController',
controllerAs: 'vm'
})
.state('authentication.signup', {
url: '/signup',
templateUrl: 'modules/users/client/views/authentication/signup.client.view.html',
templateUrl: '/modules/users/client/views/authentication/signup.client.view.html',
controller: 'AuthenticationController',
controllerAs: 'vm',
data: {
Expand All @@ -75,7 +75,7 @@
})
.state('authentication.signin', {
url: '/signin?err',
templateUrl: 'modules/users/client/views/authentication/signin.client.view.html',
templateUrl: '/modules/users/client/views/authentication/signin.client.view.html',
controller: 'AuthenticationController',
controllerAs: 'vm',
data: {
Expand All @@ -89,7 +89,7 @@
})
.state('password.forgot', {
url: '/forgot',
templateUrl: 'modules/users/client/views/password/forgot-password.client.view.html',
templateUrl: '/modules/users/client/views/password/forgot-password.client.view.html',
controller: 'PasswordController',
controllerAs: 'vm',
data: {
Expand All @@ -103,21 +103,21 @@
})
.state('password.reset.invalid', {
url: '/invalid',
templateUrl: 'modules/users/client/views/password/reset-password-invalid.client.view.html',
templateUrl: '/modules/users/client/views/password/reset-password-invalid.client.view.html',
data: {
pageTitle: 'Password reset invalid'
}
})
.state('password.reset.success', {
url: '/success',
templateUrl: 'modules/users/client/views/password/reset-password-success.client.view.html',
templateUrl: '/modules/users/client/views/password/reset-password-success.client.view.html',
data: {
pageTitle: 'Password reset success'
}
})
.state('password.reset.form', {
url: '/:token',
templateUrl: 'modules/users/client/views/password/reset-password.client.view.html',
templateUrl: '/modules/users/client/views/password/reset-password.client.view.html',
controller: 'PasswordController',
controllerAs: 'vm',
data: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
vm.upload = function (dataUrl, name) {

Upload.upload({
url: 'api/users/picture',
url: '/api/users/picture',
data: {
newProfilePicture: Upload.dataUrltoBlob(dataUrl, name)
}
Expand Down
4 changes: 2 additions & 2 deletions modules/users/client/services/users.client.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
UsersService.$inject = ['$resource'];

function UsersService($resource) {
var Users = $resource('api/users', {}, {
var Users = $resource('/api/users', {}, {
update: {
method: 'PUT'
},
Expand Down Expand Up @@ -78,7 +78,7 @@
AdminService.$inject = ['$resource'];

function AdminService($resource) {
return $resource('api/users/:userId', {
return $resource('/api/users/:userId', {
userId: '@_id'
}, {
update: {
Expand Down

0 comments on commit aebaf2f

Please sign in to comment.