webpack works now

This commit is contained in:
or-else
2018-10-25 11:19:43 +03:00
parent 765a6e5d84
commit 358f9eb970
12 changed files with 1567 additions and 36015 deletions
+29
View File
@@ -0,0 +1,29 @@
import {KNOWN_HOSTS, DEFAULT_HOST} from '../config.js';
// Detect server address from the URL
function detectServerAddress() {
let host = DEFAULT_HOST;
if (typeof window.location == 'object') {
if (window.location.protocol == 'file:' || window.location.hostname == 'localhost') {
host = KNOWN_HOSTS.local;
} else if (window.location.hostname) {
host = window.location.hostname + (window.location.port ? ':' + window.location.port : '');
}
}
return host;
}
// Detect if the page is served over HTTPS.
function isSecureConnection() {
if (typeof window.location == 'object') {
return window.location.protocol == 'https:';
}
return false;
}
function isLocalHost() {
if (typeof window.location == 'object') {
return window.location.hostname == 'localhost';
}
return false;
}