Moved webpacked files
parent
b416037c39
commit
3776cfedb6
|
@ -5,8 +5,9 @@ node_modules
|
|||
config/env/*
|
||||
!config/env/sample.js
|
||||
|
||||
# Minified static files (can be built with `npm run minify`)
|
||||
# Minified or bundled static files (can be built with `npm run minify && npm run build`)
|
||||
static/**/*.min.*
|
||||
static/**/*.bun.*
|
||||
|
||||
# Ignore docs files
|
||||
_gh_pages
|
||||
|
|
|
@ -1,194 +0,0 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 53);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 53:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"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,92 +0,0 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 23);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 23:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
/* global $ */
|
||||
|
||||
// Push footer to bottom on pages with little content
|
||||
function setFooter(){
|
||||
var windowHeight = $(window).height(),
|
||||
footerBottom = $("footer").offset().top + $("footer").height();
|
||||
if (windowHeight > footerBottom){
|
||||
$("footer").css( "margin-top", windowHeight-footerBottom );
|
||||
}
|
||||
}
|
||||
|
||||
// Execute on page load
|
||||
$(function(){ setFooter(); });
|
||||
|
||||
// Execute on window resize
|
||||
$(window).resize(function(){ setFooter(); });
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
|
@ -1,105 +0,0 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 22);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 22:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/* global $ */
|
||||
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
// Open drawer with hamburger
|
||||
$('.hamburger').click(function(){
|
||||
$('.hamburger').toggleClass('is-active');
|
||||
$('nav').toggleClass('visible');
|
||||
});
|
||||
|
||||
// Close drawer after tapping on nav
|
||||
$('nav').click(function(){
|
||||
$('.hamburger').removeClass('is-active');
|
||||
$('nav').removeClass('visible');
|
||||
});
|
||||
|
||||
// Close drawer by tapping outside it
|
||||
$('.wrap, section').click(function(){
|
||||
$('.hamburger').removeClass('is-active');
|
||||
$('nav').removeClass('visible');
|
||||
});
|
||||
|
||||
// Close alerts
|
||||
$('.alert-dismissible .close').click(function() {
|
||||
$(this).parent().slideUp(500);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because it is too large
Load Diff
|
@ -1,195 +0,0 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 52);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 52:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"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');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
File diff suppressed because one or more lines are too long
|
@ -1,231 +0,0 @@
|
|||
/******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId]) {
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
/******/ }
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ i: moduleId,
|
||||
/******/ l: false,
|
||||
/******/ exports: {}
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.l = true;
|
||||
/******/
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
/******/
|
||||
/******/
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
/******/
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
/******/
|
||||
/******/ // define getter function for harmony exports
|
||||
/******/ __webpack_require__.d = function(exports, name, getter) {
|
||||
/******/ if(!__webpack_require__.o(exports, name)) {
|
||||
/******/ Object.defineProperty(exports, name, {
|
||||
/******/ configurable: false,
|
||||
/******/ enumerable: true,
|
||||
/******/ get: getter
|
||||
/******/ });
|
||||
/******/ }
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
||||
/******/ __webpack_require__.n = function(module) {
|
||||
/******/ var getter = module && module.__esModule ?
|
||||
/******/ function getDefault() { return module['default']; } :
|
||||
/******/ function getModuleExports() { return module; };
|
||||
/******/ __webpack_require__.d(getter, 'a', getter);
|
||||
/******/ return getter;
|
||||
/******/ };
|
||||
/******/
|
||||
/******/ // Object.prototype.hasOwnProperty.call
|
||||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
||||
/******/
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
/******/
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(__webpack_require__.s = 54);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ({
|
||||
|
||||
/***/ 54:
|
||||
/***/ (function(module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
/* global location $ */
|
||||
|
||||
// Validate email addresses
|
||||
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,}))$/;
|
||||
return re.test(email);
|
||||
}
|
||||
|
||||
// Replace inputed value with response
|
||||
function replaceFromEndpoint(type, selector, cb) {
|
||||
$.get('/validate?'+type+'='+$(selector).val())
|
||||
.done(function(data){
|
||||
$(selector).val(data);
|
||||
cb();
|
||||
});
|
||||
}
|
||||
|
||||
// On page load
|
||||
$(function(){
|
||||
var slugNotUnique, emailNotUnique;
|
||||
|
||||
// Set timezone in password change link
|
||||
$('#password').attr('href',"/settings/password?tz="+new Date().getTimezoneOffset());
|
||||
|
||||
// Delete account
|
||||
$('#delete').click(function(){
|
||||
if (confirm("Are you sure you want to delete your account? This CANNOT be undone! ")) {
|
||||
window.location.href = "/settings/delete";
|
||||
}
|
||||
});
|
||||
|
||||
function validateForm(input) {
|
||||
|
||||
// Perform basic check, then validate uniqueness
|
||||
basicCheck(function(){ validateUniqueness(input); });
|
||||
|
||||
function basicCheck(cb){
|
||||
var checkedCount = 0;
|
||||
|
||||
// Check slug
|
||||
if (!$('#slug-input').val()){
|
||||
$('#slug-help').show().text("A slug is required. ");
|
||||
$('#submit-group .main').prop('disabled',true).prop('title',"You need to enter a slug. ");
|
||||
if (checkedCount>0) {cb();} else {checkedCount++;}
|
||||
}
|
||||
else {
|
||||
if (!slugNotUnique){ $('#slug-help').hide(); }
|
||||
if (checkedCount>0) {cb();} else {checkedCount++;}
|
||||
}
|
||||
|
||||
// Check email
|
||||
if (!$('#email-input').val()){
|
||||
$('#email-help').show().text("An email is required. ");
|
||||
$('#submit-group .main').prop('disabled',true).prop('title',"You need to enter an email address. ");
|
||||
if (checkedCount>0) {cb();} else {checkedCount++;}
|
||||
}
|
||||
else if (!validateEmail($('#email-input').val())) {
|
||||
$('#email-help').show().text("You must enter a valid email address. ");
|
||||
$('#submit-group .main').prop('disabled',true).prop('title',"You need to enter a valid email address. ");
|
||||
if (checkedCount>0) {cb();} else {checkedCount++;}
|
||||
}
|
||||
else {
|
||||
if (!emailNotUnique){ $('#email-help').hide(); }
|
||||
if (checkedCount>0) {cb();} else {checkedCount++;}
|
||||
}
|
||||
}
|
||||
|
||||
function validateUniqueness(input){
|
||||
|
||||
function recheckBasic(){
|
||||
if ($('#email-help').is(":visible") && $('#email-help').text().substring(0,25)!=="Unable to confirm unique ") {
|
||||
$('#submit-group .main').prop('disabled',true).prop('title',"You need to supply a different email address. ");
|
||||
}
|
||||
else if ($('#slug-help').is(":visible") && $('#slug-help').text().substring(0,25)!=="Unable to confirm unique ") {
|
||||
$('#submit-group .main').prop('disabled',true).prop('title',"You need to supply a different slug. ");
|
||||
}
|
||||
else if ( $('#slug-help').text().substring(0,25)==="Unable to confirm unique " ) {
|
||||
$('#submit-group .main').prop('title',"Unable to confirm unique slug with the server. This might not work... ");
|
||||
}
|
||||
else if ( $('#email-help').text().substring(0,25)==="Unable to confirm unique " ) {
|
||||
$('#submit-group .main').prop('title',"Unable to confirm unique email with the server. This might not work... ");
|
||||
}
|
||||
else {
|
||||
$('#submit-group .main').prop('disabled',false).prop('title',"Click here to save your changes. ");
|
||||
}
|
||||
}
|
||||
|
||||
// Should server be queried for unique values?
|
||||
if (input && $('#'+input+'-input').val()) {
|
||||
if (input==='email' && !validateEmail($('#email-input').val())) {}
|
||||
|
||||
// Query server for unique values
|
||||
else {
|
||||
$.ajax({
|
||||
url: '/validate?'+input+'='+$('#'+input+'-input').val(),
|
||||
type: 'GET',
|
||||
statusCode: {
|
||||
|
||||
// Is unique
|
||||
200: function(){
|
||||
$('#'+input+'-help').hide();
|
||||
if (input==='slug'){ slugNotUnique=false; }
|
||||
else if (input==='email'){ emailNotUnique=false; }
|
||||
recheckBasic();
|
||||
},
|
||||
|
||||
// Isn't unique
|
||||
400: function(){
|
||||
if (input==='slug'){ slugNotUnique=true; }
|
||||
else if (input==='email'){ emailNotUnique=true; }
|
||||
$('#'+input+'-help').show().text("That "+input+" is already in use by another user. ");
|
||||
$('#submit-group .main').prop('disabled',true).prop('title',"You need to supply a different "+input+". ");
|
||||
}
|
||||
|
||||
} })
|
||||
|
||||
// Server error
|
||||
.error( function(){
|
||||
if (input==='slug'){ slugNotUnique=undefined; }
|
||||
else if (input==='email'){ emailNotUnique=undefined; }
|
||||
$('#'+input+'-help').show().text("Unable to confirm unique "+input+". This might not work... ");
|
||||
recheckBasic();
|
||||
});
|
||||
|
||||
} }
|
||||
|
||||
// Nothing changed. Recheck basic validations
|
||||
else { recheckBasic(); }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Input change listeners
|
||||
$('#slug-input').change(function(){
|
||||
if (!$('#slug-input').val()){
|
||||
$('#slug-help').show().text("A slug is required. ");
|
||||
$('#submit-group .main').prop('disabled',true).prop('title',"You need to enter a slug. ");
|
||||
}
|
||||
else {
|
||||
$('#slug-help').hide();
|
||||
replaceFromEndpoint('slugify','#slug-input',function(){
|
||||
validateForm('slug');
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#email-input').change(function(){
|
||||
validateForm('email');
|
||||
});
|
||||
$('#name-input').change(function(){
|
||||
replaceFromEndpoint('xss','#name-input',validateForm);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
/******/ });
|
|
@ -2,15 +2,15 @@ const path = require('path');
|
|||
|
||||
module.exports = {
|
||||
entry: {
|
||||
header: './static/js/src/header.js',
|
||||
footer: './static/js/src/footer.js',
|
||||
map: './static/js/src/map.js',
|
||||
controls: './static/js/src/map-controls.js',
|
||||
settings: './static/js/src/settings.js',
|
||||
password: './static/js/src/password.js'
|
||||
header: './static/js/header.js',
|
||||
footer: './static/js/footer.js',
|
||||
map: './static/js/map.js',
|
||||
controls: './static/js/map-controls.js',
|
||||
settings: './static/js/settings.js',
|
||||
password: './static/js/password.js'
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'static/js/dist')
|
||||
filename: '.[name].bun.js',
|
||||
path: path.resolve(__dirname, 'static/js')
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue