client: adapted code to use <base> HTML tag

This commit is contained in:
Shyam Sunder 2018-07-24 00:14:29 -04:00 committed by Marcin Kurczewski
parent b29bf8b37a
commit defada45ab
7 changed files with 34 additions and 33 deletions

View file

@ -6,7 +6,7 @@
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(/fonts/open_sans.woff2) format('woff2');
src: local('Open Sans'), local('OpenSans'), url(fonts/open_sans.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
/* make <body> cover entire viewport */
@ -239,7 +239,7 @@ a .access-key
width: 20px
height: 20px
&.empty
background-image: url('/img/transparency_grid.png')
background-image: url('img/transparency_grid.png')
background-repeat: repeat
background-size: initial
img

View file

@ -1,6 +1,6 @@
.post-container
.post-content.transparency-grid img
background: url('/img/transparency_grid.png')
background: url('img/transparency_grid.png')
text-align: center
.post-content

View file

@ -9,23 +9,24 @@
<meta name='msapplication-TileColor' content='#ffffff'/>
<meta name="msapplication-TileImage" content="/img/mstile-150x150.png">
<title>Loading...</title>
<link href='/css/app.min.css' rel='stylesheet' type='text/css'/>
<link href='/css/vendor.min.css' rel='stylesheet' type='text/css'/>
<link rel='shortcut icon' type='image/png' href='/img/favicon.png'/>
<link rel='apple-touch-icon' sizes='180x180' href='/img/apple-touch-icon.png'/>
<link rel='apple-touch-startup-image' href='/img/apple-touch-startup-image-640x1136.png' media='(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='/img/apple-touch-startup-image-750x1294.png' media='(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='/img/apple-touch-startup-image-1242x2148.png' media='(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='/img/apple-touch-startup-image-1125x2436.png' media='(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='/img/apple-touch-startup-image-1536x2048.png' media='(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='/img/apple-touch-startup-image-1668x2224.png' media='(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='/img/apple-touch-startup-image-2048x2732.png' media='(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='manifest' href='/manifest.json'/>
<base href="/"/>
<link href='css/app.min.css' rel='stylesheet' type='text/css'/>
<link href='css/vendor.min.css' rel='stylesheet' type='text/css'/>
<link rel='shortcut icon' type='image/png' href='img/favicon.png'/>
<link rel='apple-touch-icon' sizes='180x180' href='img/apple-touch-icon.png'/>
<link rel='apple-touch-startup-image' href='img/apple-touch-startup-image-640x1136.png' media='(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='img/apple-touch-startup-image-750x1294.png' media='(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='img/apple-touch-startup-image-1242x2148.png' media='(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='img/apple-touch-startup-image-1125x2436.png' media='(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='img/apple-touch-startup-image-1536x2048.png' media='(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='img/apple-touch-startup-image-1668x2224.png' media='(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='apple-touch-startup-image' href='img/apple-touch-startup-image-2048x2732.png' media='(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)'/>
<link rel='manifest' href='manifest.json'/>
</head>
<body>
<div id='top-navigation-holder'></div>
<div id='content-holder'></div>
<script type='text/javascript' src='/js/vendor.min.js'></script>
<script type='text/javascript' src='/js/app.min.js'></script>
<script type='text/javascript' src='js/vendor.min.js'></script>
<script type='text/javascript' src='js/app.min.js'></script>
</body>
</html>

View file

@ -256,7 +256,7 @@ class Api extends events.EventTarget {
_getFullUrl(url) {
const fullUrl =
('/api/' + url).replace(/([^:])\/+/g, '$1/');
('api/' + url).replace(/([^:])\/+/g, '$1/');
const matches = fullUrl.match(/^([^?]*)\??(.*)$/);
const baseUrl = matches[1];
const request = matches[2];
@ -327,7 +327,7 @@ class Api extends events.EventTarget {
let abortFunction = () => {};
let returnedPromise = new Promise((resolve, reject) => {
let uploadPromise = this._rawRequest(
'/uploads', request.post, {}, {content: file}, options);
'uploads', request.post, {}, {content: file}, options);
abortFunction = () => uploadPromise.abort();
return uploadPromise.then(
response => {

View file

@ -28,7 +28,7 @@ class TopNavigationController {
}
_updateNavigationFromPrivileges() {
topNavigation.get('account').url = '/user/' + api.userName;
topNavigation.get('account').url = 'user/' + api.userName;
topNavigation.get('account').imageUrl =
api.user ? api.user.avatarUrl : null;

View file

@ -76,23 +76,23 @@ class TopNavigation extends events.EventTarget {
function _makeTopNavigation() {
const ret = new TopNavigation();
ret.add('home', new TopNavigationItem('H', 'Home', '/'));
ret.add('posts', new TopNavigationItem('P', 'Posts', '/posts'));
ret.add('upload', new TopNavigationItem('U', 'Upload', '/upload'));
ret.add('comments', new TopNavigationItem('C', 'Comments', '/comments'));
ret.add('tags', new TopNavigationItem('T', 'Tags', '/tags'));
ret.add('users', new TopNavigationItem('S', 'Users', '/users'));
ret.add('account', new TopNavigationItem('A', 'Account', '/user/{me}'));
ret.add('register', new TopNavigationItem('R', 'Register', '/register'));
ret.add('login', new TopNavigationItem('L', 'Log in', '/login'));
ret.add('logout', new TopNavigationItem('O', 'Logout', '/logout'));
ret.add('help', new TopNavigationItem('E', 'Help', '/help'));
ret.add('home', new TopNavigationItem('H', 'Home', ''));
ret.add('posts', new TopNavigationItem('P', 'Posts', 'posts'));
ret.add('upload', new TopNavigationItem('U', 'Upload', 'upload'));
ret.add('comments', new TopNavigationItem('C', 'Comments', 'comments'));
ret.add('tags', new TopNavigationItem('T', 'Tags', 'tags'));
ret.add('users', new TopNavigationItem('S', 'Users', 'users'));
ret.add('account', new TopNavigationItem('A', 'Account', 'user/{me}'));
ret.add('register', new TopNavigationItem('R', 'Register', 'register'));
ret.add('login', new TopNavigationItem('L', 'Log in', 'login'));
ret.add('logout', new TopNavigationItem('O', 'Logout', 'logout'));
ret.add('help', new TopNavigationItem('E', 'Help', 'help'));
ret.add(
'settings',
new TopNavigationItem(
null,
'<i class=\'fa fa-cog\'></i>',
'/settings'));
'settings'));
return ret;
}

View file

@ -51,7 +51,7 @@ function formatClientLink(...values) {
parts.push(escapeParam(value.toString()));
}
}
return '/' + parts.join('/');
return parts.join('/');
}
module.exports = {