Split dependencies into modules

This commit is contained in:
2023-11-19 01:03:21 +01:00
parent c45a19e6bf
commit f5d193e42b
12 changed files with 38 additions and 496 deletions

View File

@@ -19,6 +19,7 @@
<meta name="msapplication-TileColor" content="#00a300">
<meta name="msapplication-config" content="../src/images/icons/browserconfig.xml?v=GvmqYyKwbb">
<meta name="theme-color" content="#ffffff">
<script type="text/javascript">window.params = [#]params[#];</script>
<script type="text/javascript" src="[#]filepath_js[#]"></script>
<title>Spotty</title>
</head>

View File

@@ -1,13 +1,5 @@
//jQuery
import './jquery.helpers.js';
window.lightbox = require('./lightbox.js');
//Simplebar
import SimpleBar from 'simplebar';
window.SimpleBar = SimpleBar;
import 'simplebar/dist/simplebar.css';
import ResizeObserver from 'resize-observer-polyfill';
window.ResizeObserver = ResizeObserver;
//Common
import { copyArray, getElem, setElem, getDragPosition, copyTextToClipboard } from './common.js';
@@ -17,29 +9,28 @@ window.setElem = setElem;
window.getDragPosition = getDragPosition;
window.copyTextToClipboard = copyTextToClipboard;
import Css from './../styles/spot.scss';
import LogoText from '../images/logo_black.png';
import Logo from '../images/spot-logo-only.svg';
console.log(Logo);
//Masks
import Spot from './spot.js';
import Project from './page.project.js';
import Upload from './page.upload.js';
import Admin from './page.admin.js';
require('./../styles/spot.scss');
//const Upload = () => import('@scripts/page.upload.js');
import LogoText from '../images/logo_black.png';
import Logo from '../images/spot-logo-only.svg';
console.log(Logo);
let oSpot = new Spot(params);
$.get('index.php?a=params').done((e)=>{
let oSpot = new Spot(e.data);
let oProject = new Project(oSpot);
oSpot.addPage('project', oProject);
let oProject = new Project(oSpot);
oSpot.addPage('project', oProject);
let oUpload = new Upload(oSpot);
oSpot.addPage('upload', oUpload);
let oUpload = new Upload(oSpot);
oSpot.addPage('upload', oUpload);
let oAdmin = new Admin(oSpot);
oSpot.addPage('admin', oAdmin);
let oAdmin = new Admin(oSpot);
oSpot.addPage('admin', oAdmin);
oSpot.init();
});
$(() => {oSpot.init();});

View File

@@ -2,10 +2,18 @@
import autosize from 'autosize';
import mousewheel from 'jquery-mousewheel';
import waitforimages from 'jquery.waitforimages';
import lightbox from './lightbox.js';
//Leaflet plugins
import 'leaflet.heightgraph';
//Simplebar
import SimpleBar from 'simplebar';
window.SimpleBar = SimpleBar;
import ResizeObserver from 'resize-observer-polyfill';
window.ResizeObserver = ResizeObserver;
//Leaflet
import 'leaflet';
import 'leaflet-geometryutil';
import 'leaflet.heightgraph';
import './leaflet.helpers';
export default class Project {

View File

@@ -9,7 +9,7 @@ export default class Upload {
this.spot = oSpot;
}
pageInit (asHash) {
pageInit(asHash) {
let asProject = this.spot.vars(['projects', this.spot.vars('default_project_codename')]);
this.spot.tmp('status-box', $('#status'));
if(asProject.editable) {

View File

@@ -9,7 +9,7 @@ $stroke-width-mouse-focus : 1;
$stroke-width-height-focus: 2;
$stroke-width-axis : 2;
@import '../../node_modules/leaflet/dist/leaflet';
@import '../../node_modules/leaflet/dist/leaflet.css';
@import '../../node_modules/leaflet.heightgraph/src/L.Control.Heightgraph.css';
/* Leaflet fixes */

View File

@@ -1,211 +0,0 @@
[data-simplebar] {
position: relative;
flex-direction: column;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
align-items: flex-start;
}
.simplebar-wrapper {
overflow: hidden;
width: inherit;
height: inherit;
max-width: inherit;
max-height: inherit;
}
.simplebar-mask {
direction: inherit;
position: absolute;
overflow: hidden;
padding: 0;
margin: 0;
left: 0;
top: 0;
bottom: 0;
right: 0;
width: auto !important;
height: auto !important;
z-index: 0;
}
.simplebar-offset {
direction: inherit !important;
box-sizing: inherit !important;
resize: none !important;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
padding: 0;
margin: 0;
-webkit-overflow-scrolling: touch;
}
.simplebar-content-wrapper {
direction: inherit;
box-sizing: border-box !important;
position: relative;
display: block;
height: 100%; /* Required for horizontal native scrollbar to not appear if parent is taller than natural height */
width: auto;
max-width: 100%; /* Not required for horizontal scroll to trigger */
max-height: 100%; /* Needed for vertical scroll to trigger */
scrollbar-width: none;
-ms-overflow-style: none;
}
.simplebar-content-wrapper::-webkit-scrollbar,
.simplebar-hide-scrollbar::-webkit-scrollbar {
width: 0;
height: 0;
}
.simplebar-content:before,
.simplebar-content:after {
content: ' ';
display: table;
}
.simplebar-placeholder {
max-height: 100%;
max-width: 100%;
width: 100%;
pointer-events: none;
}
.simplebar-height-auto-observer-wrapper {
box-sizing: inherit !important;
height: 100%;
width: 100%;
max-width: 1px;
position: relative;
float: left;
max-height: 1px;
overflow: hidden;
z-index: -1;
padding: 0;
margin: 0;
pointer-events: none;
flex-grow: inherit;
flex-shrink: 0;
flex-basis: 0;
}
.simplebar-height-auto-observer {
box-sizing: inherit;
display: block;
opacity: 0;
position: absolute;
top: 0;
left: 0;
height: 1000%;
width: 1000%;
min-height: 1px;
min-width: 1px;
overflow: hidden;
pointer-events: none;
z-index: -1;
}
.simplebar-track {
z-index: 1;
position: absolute;
right: 0;
bottom: 0;
pointer-events: none;
overflow: hidden;
}
[data-simplebar].simplebar-dragging .simplebar-content {
pointer-events: none;
user-select: none;
-webkit-user-select: none;
}
[data-simplebar].simplebar-dragging .simplebar-track {
pointer-events: all;
}
.simplebar-scrollbar {
position: absolute;
left: 0;
right: 0;
min-height: 10px;
}
.simplebar-scrollbar:before {
position: absolute;
content: '';
background: black;
border-radius: 7px;
left: 2px;
right: 2px;
opacity: 0;
transition: opacity 0.2s linear;
}
.simplebar-scrollbar.simplebar-visible:before {
/* When hovered, remove all transitions from drag handle */
opacity: 0.5;
transition: opacity 0s linear;
}
.simplebar-track.simplebar-vertical {
top: 0;
width: 11px;
}
.simplebar-track.simplebar-vertical .simplebar-scrollbar:before {
top: 2px;
bottom: 2px;
}
.simplebar-track.simplebar-horizontal {
left: 0;
height: 11px;
}
.simplebar-track.simplebar-horizontal .simplebar-scrollbar:before {
height: 100%;
left: 2px;
right: 2px;
}
.simplebar-track.simplebar-horizontal .simplebar-scrollbar {
right: auto;
left: 0;
top: 2px;
height: 7px;
min-height: 0;
min-width: 10px;
width: auto;
}
/* Rtl support */
[data-simplebar-direction='rtl'] .simplebar-track.simplebar-vertical {
right: auto;
left: 0;
}
.hs-dummy-scrollbar-size {
direction: rtl;
position: fixed;
opacity: 0;
visibility: hidden;
height: 500px;
width: 500px;
overflow-y: hidden;
overflow-x: scroll;
}
.simplebar-hide-scrollbar {
position: fixed;
left: 0;
visibility: hidden;
overflow-y: scroll;
scrollbar-width: none;
-ms-overflow-style: none;
}

View File

@@ -6,6 +6,7 @@
@import 'fa';
@import 'lightbox';
@import 'leaflet';
@import '../../node_modules/simplebar/dist/simplebar.css';
/* Pages Specific CSS */
@import 'page.project';