client: adapted code to use <base> HTML tag
This commit is contained in:
parent
b29bf8b37a
commit
defada45ab
7 changed files with 34 additions and 33 deletions
|
@ -6,7 +6,7 @@
|
||||||
font-family: 'Open Sans';
|
font-family: 'Open Sans';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
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;
|
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 */
|
/* make <body> cover entire viewport */
|
||||||
|
@ -239,7 +239,7 @@ a .access-key
|
||||||
width: 20px
|
width: 20px
|
||||||
height: 20px
|
height: 20px
|
||||||
&.empty
|
&.empty
|
||||||
background-image: url('/img/transparency_grid.png')
|
background-image: url('img/transparency_grid.png')
|
||||||
background-repeat: repeat
|
background-repeat: repeat
|
||||||
background-size: initial
|
background-size: initial
|
||||||
img
|
img
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.post-container
|
.post-container
|
||||||
.post-content.transparency-grid img
|
.post-content.transparency-grid img
|
||||||
background: url('/img/transparency_grid.png')
|
background: url('img/transparency_grid.png')
|
||||||
|
|
||||||
text-align: center
|
text-align: center
|
||||||
.post-content
|
.post-content
|
||||||
|
|
|
@ -9,23 +9,24 @@
|
||||||
<meta name='msapplication-TileColor' content='#ffffff'/>
|
<meta name='msapplication-TileColor' content='#ffffff'/>
|
||||||
<meta name="msapplication-TileImage" content="/img/mstile-150x150.png">
|
<meta name="msapplication-TileImage" content="/img/mstile-150x150.png">
|
||||||
<title>Loading...</title>
|
<title>Loading...</title>
|
||||||
<link href='/css/app.min.css' rel='stylesheet' type='text/css'/>
|
<base href="/"/>
|
||||||
<link href='/css/vendor.min.css' rel='stylesheet' type='text/css'/>
|
<link href='css/app.min.css' rel='stylesheet' type='text/css'/>
|
||||||
<link rel='shortcut icon' type='image/png' href='/img/favicon.png'/>
|
<link href='css/vendor.min.css' rel='stylesheet' type='text/css'/>
|
||||||
<link rel='apple-touch-icon' sizes='180x180' href='/img/apple-touch-icon.png'/>
|
<link rel='shortcut icon' type='image/png' href='img/favicon.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-icon' sizes='180x180' href='img/apple-touch-icon.png'/>
|
||||||
<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-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-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-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-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-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-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-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-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-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-2048x2732.png' media='(min-device-width: 1024px) 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='manifest' href='/manifest.json'/>
|
<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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id='top-navigation-holder'></div>
|
<div id='top-navigation-holder'></div>
|
||||||
<div id='content-holder'></div>
|
<div id='content-holder'></div>
|
||||||
<script type='text/javascript' src='/js/vendor.min.js'></script>
|
<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/app.min.js'></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -256,7 +256,7 @@ class Api extends events.EventTarget {
|
||||||
|
|
||||||
_getFullUrl(url) {
|
_getFullUrl(url) {
|
||||||
const fullUrl =
|
const fullUrl =
|
||||||
('/api/' + url).replace(/([^:])\/+/g, '$1/');
|
('api/' + url).replace(/([^:])\/+/g, '$1/');
|
||||||
const matches = fullUrl.match(/^([^?]*)\??(.*)$/);
|
const matches = fullUrl.match(/^([^?]*)\??(.*)$/);
|
||||||
const baseUrl = matches[1];
|
const baseUrl = matches[1];
|
||||||
const request = matches[2];
|
const request = matches[2];
|
||||||
|
@ -327,7 +327,7 @@ class Api extends events.EventTarget {
|
||||||
let abortFunction = () => {};
|
let abortFunction = () => {};
|
||||||
let returnedPromise = new Promise((resolve, reject) => {
|
let returnedPromise = new Promise((resolve, reject) => {
|
||||||
let uploadPromise = this._rawRequest(
|
let uploadPromise = this._rawRequest(
|
||||||
'/uploads', request.post, {}, {content: file}, options);
|
'uploads', request.post, {}, {content: file}, options);
|
||||||
abortFunction = () => uploadPromise.abort();
|
abortFunction = () => uploadPromise.abort();
|
||||||
return uploadPromise.then(
|
return uploadPromise.then(
|
||||||
response => {
|
response => {
|
||||||
|
|
|
@ -28,7 +28,7 @@ class TopNavigationController {
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateNavigationFromPrivileges() {
|
_updateNavigationFromPrivileges() {
|
||||||
topNavigation.get('account').url = '/user/' + api.userName;
|
topNavigation.get('account').url = 'user/' + api.userName;
|
||||||
topNavigation.get('account').imageUrl =
|
topNavigation.get('account').imageUrl =
|
||||||
api.user ? api.user.avatarUrl : null;
|
api.user ? api.user.avatarUrl : null;
|
||||||
|
|
||||||
|
|
|
@ -76,23 +76,23 @@ class TopNavigation extends events.EventTarget {
|
||||||
|
|
||||||
function _makeTopNavigation() {
|
function _makeTopNavigation() {
|
||||||
const ret = new TopNavigation();
|
const ret = new TopNavigation();
|
||||||
ret.add('home', new TopNavigationItem('H', 'Home', '/'));
|
ret.add('home', new TopNavigationItem('H', 'Home', ''));
|
||||||
ret.add('posts', new TopNavigationItem('P', 'Posts', '/posts'));
|
ret.add('posts', new TopNavigationItem('P', 'Posts', 'posts'));
|
||||||
ret.add('upload', new TopNavigationItem('U', 'Upload', '/upload'));
|
ret.add('upload', new TopNavigationItem('U', 'Upload', 'upload'));
|
||||||
ret.add('comments', new TopNavigationItem('C', 'Comments', '/comments'));
|
ret.add('comments', new TopNavigationItem('C', 'Comments', 'comments'));
|
||||||
ret.add('tags', new TopNavigationItem('T', 'Tags', '/tags'));
|
ret.add('tags', new TopNavigationItem('T', 'Tags', 'tags'));
|
||||||
ret.add('users', new TopNavigationItem('S', 'Users', '/users'));
|
ret.add('users', new TopNavigationItem('S', 'Users', 'users'));
|
||||||
ret.add('account', new TopNavigationItem('A', 'Account', '/user/{me}'));
|
ret.add('account', new TopNavigationItem('A', 'Account', 'user/{me}'));
|
||||||
ret.add('register', new TopNavigationItem('R', 'Register', '/register'));
|
ret.add('register', new TopNavigationItem('R', 'Register', 'register'));
|
||||||
ret.add('login', new TopNavigationItem('L', 'Log in', '/login'));
|
ret.add('login', new TopNavigationItem('L', 'Log in', 'login'));
|
||||||
ret.add('logout', new TopNavigationItem('O', 'Logout', '/logout'));
|
ret.add('logout', new TopNavigationItem('O', 'Logout', 'logout'));
|
||||||
ret.add('help', new TopNavigationItem('E', 'Help', '/help'));
|
ret.add('help', new TopNavigationItem('E', 'Help', 'help'));
|
||||||
ret.add(
|
ret.add(
|
||||||
'settings',
|
'settings',
|
||||||
new TopNavigationItem(
|
new TopNavigationItem(
|
||||||
null,
|
null,
|
||||||
'<i class=\'fa fa-cog\'></i>',
|
'<i class=\'fa fa-cog\'></i>',
|
||||||
'/settings'));
|
'settings'));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ function formatClientLink(...values) {
|
||||||
parts.push(escapeParam(value.toString()));
|
parts.push(escapeParam(value.toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return '/' + parts.join('/');
|
return parts.join('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
Loading…
Reference in a new issue