#100 Webpacked CSS
parent
9d9dc66cf0
commit
f57101c18f
|
@ -1,4 +1,7 @@
|
||||||
{
|
{
|
||||||
"verbose": true,
|
"verbose": true,
|
||||||
"ext": "html, js, json, css"
|
"ext": "html, js, json, css",
|
||||||
|
"events": {
|
||||||
|
"start": "npm run build"
|
||||||
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -37,7 +37,9 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.0.2",
|
"chai": "^4.0.2",
|
||||||
"chai-http": "^3.0.0",
|
"chai-http": "^3.0.0",
|
||||||
|
"css-loader": "^0.28.4",
|
||||||
"nodemon": "^1.11.0",
|
"nodemon": "^1.11.0",
|
||||||
|
"style-loader": "^0.18.2",
|
||||||
"supertest": "^3.0.0",
|
"supertest": "^3.0.0",
|
||||||
"webpack": "^3.0.0"
|
"webpack": "^3.0.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -126,43 +126,3 @@ main {
|
||||||
height: 18px;
|
height: 18px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Control buttons */
|
|
||||||
#controls {
|
|
||||||
width: 100vw;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 50px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
}
|
|
||||||
#controls .btn {
|
|
||||||
z-index: 50;
|
|
||||||
background: #222;
|
|
||||||
height: 10vh;
|
|
||||||
padding: 2vh 0;
|
|
||||||
}
|
|
||||||
#controls .btn .fa {
|
|
||||||
margin: 0 2vw;
|
|
||||||
}
|
|
||||||
#controls .btn:hover {
|
|
||||||
background: #333;
|
|
||||||
}
|
|
||||||
#controls .btn.set, #controls .btn.clear {
|
|
||||||
width: 30vw;
|
|
||||||
}
|
|
||||||
#controls .btn.track {
|
|
||||||
width: 35vw;
|
|
||||||
}
|
|
||||||
@media (max-width:250px) {
|
|
||||||
#controls .btn { font-size:.8em; }
|
|
||||||
}
|
|
||||||
@media (min-width:250px) and (max-width:350px) {
|
|
||||||
#controls .btn { font-size:1em; }
|
|
||||||
}
|
|
||||||
@media (min-width:350px) and (max-width:450px) {
|
|
||||||
#controls .btn { font-size:1.15em; }
|
|
||||||
}
|
|
||||||
@media (min-width:450px) {
|
|
||||||
#controls .btn { font-size:1.3em; }
|
|
||||||
}
|
|
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/* global $ */
|
/* global $ */
|
||||||
|
|
||||||
|
import css from '../css/footer.css';
|
||||||
|
|
||||||
// Push footer to bottom on pages with little content
|
// Push footer to bottom on pages with little content
|
||||||
function setFooter(){
|
function setFooter(){
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
/* global $ */
|
/* global $ */
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
import css from '../css/header.css';
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
// Open drawer with hamburger
|
// Open drawer with hamburger
|
||||||
|
|
|
@ -1,119 +0,0 @@
|
||||||
'use strict';
|
|
||||||
/* global navigator $ socket userid token mapuser toggleMaps */
|
|
||||||
|
|
||||||
$(function(){
|
|
||||||
var wpid, newloc;
|
|
||||||
|
|
||||||
// Set location
|
|
||||||
$('#set-loc').click(function(){
|
|
||||||
if (!userid===mapuser._id){ alert('You are not logged in! '); }
|
|
||||||
else { if (!navigator.geolocation){ alert('Geolocation not enabled. '); }
|
|
||||||
|
|
||||||
else { navigator.geolocation.getCurrentPosition(
|
|
||||||
|
|
||||||
// Success callback
|
|
||||||
function(pos){
|
|
||||||
var newloc = {
|
|
||||||
ts: Date.now(),
|
|
||||||
tok: token,
|
|
||||||
usr: userid,
|
|
||||||
lat: pos.coords.latitude,
|
|
||||||
lon: pos.coords.longitude,
|
|
||||||
spd: (pos.coords.speed||0)
|
|
||||||
};
|
|
||||||
socket.emit('set', newloc);
|
|
||||||
toggleMaps(newloc);
|
|
||||||
console.log('⚜ Set location:',newloc.lat+", "+newloc.lon);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Error callback
|
|
||||||
function(err) {
|
|
||||||
alert("Unable to set location.");
|
|
||||||
console.error('❌️',err.message);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Options
|
|
||||||
{ enableHighAccuracy:true }
|
|
||||||
|
|
||||||
); } }
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Track location
|
|
||||||
$('#track-loc').click(function(){
|
|
||||||
if (!userid===mapuser._id) { alert('You are not logged in! '); }
|
|
||||||
else {
|
|
||||||
|
|
||||||
// Start tracking
|
|
||||||
if (!wpid) {
|
|
||||||
if (!navigator.geolocation) { alert('Unable to track location. '); }
|
|
||||||
else {
|
|
||||||
$('#track-loc').html('<i class="fa fa-crosshairs fa-spin"></i>Stop').prop('title',"Click here to stop tracking your location. ");
|
|
||||||
wpid = navigator.geolocation.watchPosition(
|
|
||||||
|
|
||||||
// Success callback
|
|
||||||
function(pos) {
|
|
||||||
newloc = {
|
|
||||||
ts: Date.now(),
|
|
||||||
tok: token,
|
|
||||||
usr: userid,
|
|
||||||
lat: pos.coords.latitude,
|
|
||||||
lon: pos.coords.longitude,
|
|
||||||
spd: (pos.coords.speed||0)
|
|
||||||
}; socket.emit('set',newloc);
|
|
||||||
toggleMaps(newloc);
|
|
||||||
console.log('⚜ Set location:',newloc.lat+", "+newloc.lon);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Error callback
|
|
||||||
function(err){
|
|
||||||
alert("Unable to track location.");
|
|
||||||
console.error(err.message);
|
|
||||||
},
|
|
||||||
|
|
||||||
// Options
|
|
||||||
{ enableHighAccuracy:true }
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Stop tracking
|
|
||||||
else {
|
|
||||||
$('#track-loc').html('<i class="fa fa-crosshairs"></i>Track').prop('title',"Click here to track your location. ");
|
|
||||||
navigator.geolocation.clearWatch(wpid);
|
|
||||||
wpid = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Clear location
|
|
||||||
$('#clear-loc').click(function(){
|
|
||||||
if (!userid===mapuser._id) { alert('You are not logged in! '); }
|
|
||||||
else {
|
|
||||||
// Stop tracking
|
|
||||||
if (wpid) {
|
|
||||||
$('#track-loc').html('<i class="fa fa-crosshairs"></i>Track');
|
|
||||||
navigator.geolocation.clearWatch(wpid);
|
|
||||||
wpid = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clear location
|
|
||||||
newloc = {
|
|
||||||
ts: Date.now(),
|
|
||||||
tok: token,
|
|
||||||
usr: userid,
|
|
||||||
lat:0, lon:0, spd:0
|
|
||||||
}; socket.emit('set',newloc);
|
|
||||||
|
|
||||||
// Turn off map
|
|
||||||
toggleMaps(newloc);
|
|
||||||
console.log('⚜ Cleared location');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
|
@ -1,6 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/* global mapuser userid disp noHeader mapKey */
|
/* global mapuser userid disp noHeader mapKey */
|
||||||
|
|
||||||
|
import css from '../css/map.css';
|
||||||
|
|
||||||
// Webpack imports
|
// Webpack imports
|
||||||
import io from 'socket.io-client';
|
import io from 'socket.io-client';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
/* global location $ */
|
/* global location $ */
|
||||||
|
|
||||||
|
import css from '../css/settings.css';
|
||||||
|
|
||||||
// Validate email addresses
|
// Validate email addresses
|
||||||
function validateEmail(email) {
|
function validateEmail(email) {
|
||||||
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{% extends 'templates/base.html' %}
|
{% extends 'templates/base.html' %}
|
||||||
{% block title %}{{super()}} | Admin{% endblock %}
|
{% block title %}{{super()}} | Admin{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block javascript %}
|
||||||
{{ super() }}
|
{{super()}}
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.table.min.css">
|
<script type="application/javascript" src="/static/js/.table.bun.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
|
@ -3,9 +3,12 @@
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.form.min.css">
|
<script type="application/javascript" src='https://www.google.com/recaptcha/api.js'></script>
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.contact.min.css">
|
{% endblock %}
|
||||||
<script src='https://www.google.com/recaptcha/api.js'></script>
|
{% block javascript %}
|
||||||
|
{{super()}}
|
||||||
|
<script type="application/javascript" src="/static/js/.form.bun.js"></script>
|
||||||
|
<script type="application/javascript" src="/static/js/.contact.bun.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
@ -26,13 +29,3 @@
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascript %}
|
|
||||||
{{super()}}
|
|
||||||
<script type="application/javascript">
|
|
||||||
/* global $ */
|
|
||||||
function onSubmit() {
|
|
||||||
$('#contact-form').submit();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{% extends 'templates/base.html' %}
|
{% extends 'templates/base.html' %}
|
||||||
{% block title %}{{super()}} | Reset Password{% endblock %}
|
{% block title %}{{super()}} | Reset Password{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block javascript %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.form.min.css">
|
<script type="application/javascript" src="/static/js/.form.bun.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% extends 'templates/base.html' %}
|
{% extends 'templates/base.html' %}
|
||||||
{% block head %}
|
{% block javascript %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
<link href="/static/css/.index.min.css" rel="stylesheet">
|
<script type="application/javascript" src="/static/js/.index.bun.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{% extends 'templates/base.html' %}
|
{% extends 'templates/base.html' %}
|
||||||
{% block title %}{{ super() }} | Login{% endblock %}
|
{% block title %}{{super()}} | Login{% endblock %}
|
||||||
{% block head %}
|
|
||||||
|
{% block javascript %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.form.min.css">
|
<script type="application/javascript" src="/static/js/.form.bun.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.login.min.css">
|
<script type="application/javascript" src="/static/js/.login.bun.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
@ -70,24 +71,3 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascript %}
|
|
||||||
<script type="application/javascript">
|
|
||||||
/* global $ */
|
|
||||||
|
|
||||||
// On page load
|
|
||||||
$(function(){
|
|
||||||
|
|
||||||
// On clocking 'show'
|
|
||||||
$('#show').click(function(){
|
|
||||||
if ($('#password').attr('type')==="password") {
|
|
||||||
$('#password').attr('type','text');
|
|
||||||
} else {
|
|
||||||
$('#password').attr('type','password');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
|
|
@ -3,9 +3,8 @@
|
||||||
|
|
||||||
{% block head %}
|
{% block head %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
<link href="/static/css/.map.min.css" rel="stylesheet">
|
|
||||||
<style>/* These styles include values passed from to the template from the server. Other styles are in map.css */
|
<style>/* These styles include values passed from to the template from the server. Other styles are in map.css */
|
||||||
{% if noHeader!='0' %} main { top:0; } {% endif %}
|
{% if noHeader!='0' %} main { top: 0 !important; } {% endif %}
|
||||||
|
|
||||||
{% if mapuser.settings.showStreetview and disp!='0' and disp!='1' %}
|
{% if mapuser.settings.showStreetview and disp!='0' and disp!='1' %}
|
||||||
/* show both */
|
/* show both */
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
{% extends 'templates/base.html' %}
|
{% extends 'templates/base.html' %}
|
||||||
{% block title %}{{super()}} | Set Password{% endblock %}
|
{% block title %}{{super()}} | Set Password{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block javascript %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.form.min.css">
|
<script type="application/javascript" src="/static/js/.form.bun.js"></script>
|
||||||
|
<script type="application/javascript" src="/static/js/.password.bun.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
@ -50,8 +51,3 @@
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascript %}
|
|
||||||
{{super()}}
|
|
||||||
<script type="application/javascript" src="/static/js/.password.bun.js"></script>
|
|
||||||
{% endblock %}
|
|
|
@ -1,10 +1,10 @@
|
||||||
{% extends 'templates/base.html' %}
|
{% extends 'templates/base.html' %}
|
||||||
{% block title %}{{super()}} | Settings{% endblock %}
|
{% block title %}{{super()}} | Settings{% endblock %}
|
||||||
|
|
||||||
{% block head %}
|
{% block javascript %}
|
||||||
{{super()}}
|
{{super()}}
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.form.min.css">
|
<script type="application/javascript" src="/static/js/.form.bun.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.settings.min.css">
|
<script type="application/javascript" src="/static/js/.settings.bun.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
@ -147,8 +147,3 @@
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block javascript %}
|
|
||||||
{{super()}}
|
|
||||||
<script type="application/javascript" src="/static/js/.settings.bun.js"></script>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
|
@ -41,15 +41,12 @@
|
||||||
<link rel="icon apple-touch-icon" sizes="228x228" type="image/png" href="/static/img/icon/by/228.png">
|
<link rel="icon apple-touch-icon" sizes="228x228" type="image/png" href="/static/img/icon/by/228.png">
|
||||||
<link rel="apple-touch-icon-precomposed" type="image/png" href="/static/img/icon/by/152.png">
|
<link rel="apple-touch-icon-precomposed" type="image/png" href="/static/img/icon/by/152.png">
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="/static/css/.base.min.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
|
||||||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,600">
|
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:300,600">
|
||||||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Merriweather:300,700">
|
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Merriweather:300,700">
|
||||||
<script type="application/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
|
<script type="application/javascript" src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% if not noHeader %}<link href="/static/css/.header.min.css" rel="stylesheet">{% endif %}
|
|
||||||
{% if not noFooter %}<link href="/static/css/.footer.min.css" rel="stylesheet">{% endif %}
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -61,19 +58,7 @@
|
||||||
|
|
||||||
<!-- Javascript -->
|
<!-- Javascript -->
|
||||||
{% block javascript %}
|
{% block javascript %}
|
||||||
<script>
|
<script type="application/javascript" src="/static/js/.base.bun.js"></script>
|
||||||
|
|
||||||
// Google analytics
|
|
||||||
(function(t,r,a,c,m,o,n){t['GoogleAnalyticsObject']=m;t[m]=t[m]||function(){
|
|
||||||
(t[m].q=t[m].q||[]).push(arguments);},t[m].l=1*new Date();o=r.createElement(a),
|
|
||||||
n=r.getElementsByTagName(a)[0];o.async=1;o.src=c;n.parentNode.insertBefore(o,n);
|
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
||||||
/* global ga */
|
|
||||||
ga('create','UA-44266909-3','auto');
|
|
||||||
ga('require','linkid');
|
|
||||||
ga('send','pageview');
|
|
||||||
|
|
||||||
</script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,16 +1,43 @@
|
||||||
const path = require('path');
|
const path = require('path'),
|
||||||
|
webpack = require('webpack');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
|
// Javascript files to be bundled
|
||||||
entry: {
|
entry: {
|
||||||
|
base: './static/js/base.js',
|
||||||
header: './static/js/header.js',
|
header: './static/js/header.js',
|
||||||
footer: './static/js/footer.js',
|
footer: './static/js/footer.js',
|
||||||
|
index: './static/js/index.js',
|
||||||
|
table: './static/js/table.js',
|
||||||
|
form: './static/js/form.js',
|
||||||
|
contact: './static/js/contact.js',
|
||||||
|
login: './static/js/login.js',
|
||||||
map: './static/js/map.js',
|
map: './static/js/map.js',
|
||||||
controls: './static/js/map-controls.js',
|
controls: './static/js/controls.js',
|
||||||
settings: './static/js/settings.js',
|
settings: './static/js/settings.js',
|
||||||
password: './static/js/password.js'
|
password: './static/js/password.js'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Output format
|
||||||
output: {
|
output: {
|
||||||
filename: '.[name].bun.js',
|
filename: '.[name].bun.js',
|
||||||
path: path.resolve(__dirname, 'static/js')
|
path: path.resolve(__dirname, 'static/js')
|
||||||
|
},
|
||||||
|
|
||||||
|
// Optimization
|
||||||
|
// plugins: [
|
||||||
|
// new webpack.optimize.UglifyJsPlugin({minimize: true})
|
||||||
|
// ],
|
||||||
|
|
||||||
|
// Load CSS into bundles
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.css$/,
|
||||||
|
use: [ 'style-loader', 'css-loader' ]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
Loading…
Reference in New Issue