Update
This commit is contained in:
99
Server/public/js/components/cookies-dialog.js
Normal file
99
Server/public/js/components/cookies-dialog.js
Normal file
@@ -0,0 +1,99 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, e as element, n as noop, c as add_location, f as attr_dev, g as append_dev, h as detach_dev } from './index-bc9d3868.js';
|
||||
|
||||
/* src\components\cookies-dialog.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\cookies-dialog.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div1;
|
||||
let div0;
|
||||
let p;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div1 = element("div");
|
||||
div0 = element("div");
|
||||
p = element("p");
|
||||
p.textContent = "We use cookies to improve your experience, personalise your content and analyse site usage. By clicking “OK”, you agree to the use of cookies.";
|
||||
this.c = noop;
|
||||
add_location(p, file, 19, 8, 248);
|
||||
add_location(div0, file, 18, 4, 233);
|
||||
attr_dev(div1, "id", "wrapper");
|
||||
add_location(div1, file, 17, 0, 209);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, div1, anchor);
|
||||
append_dev(div1, div0);
|
||||
append_dev(div0, p);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div1);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('cookies-dialog', slots, []);
|
||||
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<cookies-dialog> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
$$self.$capture_state = () => ({ onMount });
|
||||
return [];
|
||||
}
|
||||
|
||||
class Cookies_dialog extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';#wrapper{display:none;position:relative;height:5rem;width:100%;background:white;box-shadow:0 0 0.314rem rgb(187, 187, 187);;}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("cookies-dialog", Cookies_dialog);
|
||||
|
||||
export { Cookies_dialog as default };
|
186
Server/public/js/components/footer-component.js
Normal file
186
Server/public/js/components/footer-component.js
Normal file
@@ -0,0 +1,186 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, e as element, q as space, t as text, B as svg_element, n as noop, c as add_location, f as attr_dev, g as append_dev, u as listen_dev, h as detach_dev } from './index-bc9d3868.js';
|
||||
|
||||
/* src\footer\footer-component.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const file = "src\\footer\\footer-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let footer;
|
||||
let div2;
|
||||
let div1;
|
||||
let div0;
|
||||
let h2;
|
||||
let t1;
|
||||
let p0;
|
||||
let t2;
|
||||
let a;
|
||||
let t4;
|
||||
let button;
|
||||
let svg;
|
||||
let g;
|
||||
let rect;
|
||||
let path;
|
||||
let t5;
|
||||
let p1;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
footer = element("footer");
|
||||
div2 = element("div");
|
||||
div1 = element("div");
|
||||
div0 = element("div");
|
||||
h2 = element("h2");
|
||||
h2.textContent = "CONTACT US";
|
||||
t1 = space();
|
||||
p0 = element("p");
|
||||
t2 = text("Email: ");
|
||||
a = element("a");
|
||||
a.textContent = "test@test";
|
||||
t4 = space();
|
||||
button = element("button");
|
||||
svg = svg_element("svg");
|
||||
g = svg_element("g");
|
||||
rect = svg_element("rect");
|
||||
path = svg_element("path");
|
||||
t5 = space();
|
||||
p1 = element("p");
|
||||
p1.textContent = "© 2023 LibSoc";
|
||||
this.c = noop;
|
||||
add_location(h2, file, 12, 16, 273);
|
||||
attr_dev(a, "href", "mailto:info@chiron.com");
|
||||
add_location(a, file, 13, 26, 320);
|
||||
add_location(p0, file, 13, 16, 310);
|
||||
attr_dev(div0, "id", "contact-us-container");
|
||||
add_location(div0, file, 11, 12, 224);
|
||||
attr_dev(div1, "id", "footer-grid-content-container");
|
||||
attr_dev(div1, "class", "logged");
|
||||
add_location(div1, file, 10, 8, 155);
|
||||
attr_dev(rect, "id", "Rectangle_146");
|
||||
attr_dev(rect, "data-name", "Rectangle 146");
|
||||
attr_dev(rect, "width", "11");
|
||||
attr_dev(rect, "height", "51");
|
||||
attr_dev(rect, "rx", "5.5");
|
||||
attr_dev(rect, "transform", "translate(22 24)");
|
||||
attr_dev(rect, "fill", "var(--pink)");
|
||||
add_location(rect, file, 19, 18, 723);
|
||||
attr_dev(path, "id", "Path_1145");
|
||||
attr_dev(path, "data-name", "Path 1145");
|
||||
attr_dev(path, "d", "M23.814,4.021a5,5,0,0,1,7.372,0l16.134,17.6c2.94,3.207,1.046,10.4-3.686,8.379S28.02,14.081,28.391,13.524,16.544,27.976,11.366,30,4.741,24.828,7.68,21.621Z");
|
||||
attr_dev(path, "fill", "var(--pink)");
|
||||
add_location(path, file, 20, 18, 875);
|
||||
attr_dev(g, "id", "Group_268");
|
||||
attr_dev(g, "data-name", "Group 268");
|
||||
attr_dev(g, "transform", "translate(-6.177 -2.399)");
|
||||
add_location(g, file, 18, 16, 626);
|
||||
attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg");
|
||||
attr_dev(svg, "width", "42.545");
|
||||
attr_dev(svg, "height", "72.601");
|
||||
attr_dev(svg, "viewBox", "0 0 42.545 72.601");
|
||||
add_location(svg, file, 17, 12, 509);
|
||||
attr_dev(button, "id", "footer-up");
|
||||
attr_dev(button, "aria-label", "go up");
|
||||
add_location(button, file, 16, 8, 416);
|
||||
attr_dev(p1, "id", "footer-copyright");
|
||||
add_location(p1, file, 24, 8, 1198);
|
||||
attr_dev(div2, "id", "footer-content-container");
|
||||
add_location(div2, file, 9, 4, 110);
|
||||
add_location(footer, file, 8, 0, 96);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, footer, anchor);
|
||||
append_dev(footer, div2);
|
||||
append_dev(div2, div1);
|
||||
append_dev(div1, div0);
|
||||
append_dev(div0, h2);
|
||||
append_dev(div0, t1);
|
||||
append_dev(div0, p0);
|
||||
append_dev(p0, t2);
|
||||
append_dev(p0, a);
|
||||
append_dev(div2, t4);
|
||||
append_dev(div2, button);
|
||||
append_dev(button, svg);
|
||||
append_dev(svg, g);
|
||||
append_dev(g, rect);
|
||||
append_dev(g, path);
|
||||
append_dev(div2, t5);
|
||||
append_dev(div2, p1);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", /*click_handler*/ ctx[0], false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(footer);
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('footer-component', slots, []);
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<footer-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
const click_handler = () => {
|
||||
location.href = '#';
|
||||
};
|
||||
|
||||
return [click_handler];
|
||||
}
|
||||
|
||||
class Footer_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/footer.css';</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("footer-component", Footer_component);
|
||||
|
||||
export { Footer_component as default };
|
445
Server/public/js/components/index-bc9d3868.js
Normal file
445
Server/public/js/components/index-bc9d3868.js
Normal file
@@ -0,0 +1,445 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
function noop() { }
|
||||
function add_location(element, file, line, column, char) {
|
||||
element.__svelte_meta = {
|
||||
loc: { file, line, column, char }
|
||||
};
|
||||
}
|
||||
function run(fn) {
|
||||
return fn();
|
||||
}
|
||||
function blank_object() {
|
||||
return Object.create(null);
|
||||
}
|
||||
function run_all(fns) {
|
||||
fns.forEach(run);
|
||||
}
|
||||
function is_function(thing) {
|
||||
return typeof thing === 'function';
|
||||
}
|
||||
function safe_not_equal(a, b) {
|
||||
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
||||
}
|
||||
let src_url_equal_anchor;
|
||||
function src_url_equal(element_src, url) {
|
||||
if (!src_url_equal_anchor) {
|
||||
src_url_equal_anchor = document.createElement('a');
|
||||
}
|
||||
src_url_equal_anchor.href = url;
|
||||
return element_src === src_url_equal_anchor.href;
|
||||
}
|
||||
function is_empty(obj) {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
function append(target, node) {
|
||||
target.appendChild(node);
|
||||
}
|
||||
function insert(target, node, anchor) {
|
||||
target.insertBefore(node, anchor || null);
|
||||
}
|
||||
function detach(node) {
|
||||
node.parentNode.removeChild(node);
|
||||
}
|
||||
function destroy_each(iterations, detaching) {
|
||||
for (let i = 0; i < iterations.length; i += 1) {
|
||||
if (iterations[i])
|
||||
iterations[i].d(detaching);
|
||||
}
|
||||
}
|
||||
function element(name) {
|
||||
return document.createElement(name);
|
||||
}
|
||||
function svg_element(name) {
|
||||
return document.createElementNS('http://www.w3.org/2000/svg', name);
|
||||
}
|
||||
function text(data) {
|
||||
return document.createTextNode(data);
|
||||
}
|
||||
function space() {
|
||||
return text(' ');
|
||||
}
|
||||
function listen(node, event, handler, options) {
|
||||
node.addEventListener(event, handler, options);
|
||||
return () => node.removeEventListener(event, handler, options);
|
||||
}
|
||||
function attr(node, attribute, value) {
|
||||
if (value == null)
|
||||
node.removeAttribute(attribute);
|
||||
else if (node.getAttribute(attribute) !== value)
|
||||
node.setAttribute(attribute, value);
|
||||
}
|
||||
function children(element) {
|
||||
return Array.from(element.childNodes);
|
||||
}
|
||||
function set_style(node, key, value, important) {
|
||||
if (value === null) {
|
||||
node.style.removeProperty(key);
|
||||
}
|
||||
else {
|
||||
node.style.setProperty(key, value, important ? 'important' : '');
|
||||
}
|
||||
}
|
||||
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
|
||||
const e = document.createEvent('CustomEvent');
|
||||
e.initCustomEvent(type, bubbles, cancelable, detail);
|
||||
return e;
|
||||
}
|
||||
function attribute_to_object(attributes) {
|
||||
const result = {};
|
||||
for (const attribute of attributes) {
|
||||
result[attribute.name] = attribute.value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
let current_component;
|
||||
function set_current_component(component) {
|
||||
current_component = component;
|
||||
}
|
||||
function get_current_component() {
|
||||
if (!current_component)
|
||||
throw new Error('Function called outside component initialization');
|
||||
return current_component;
|
||||
}
|
||||
/**
|
||||
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
||||
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
||||
* it can be called from an external module).
|
||||
*
|
||||
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-onmount
|
||||
*/
|
||||
function onMount(fn) {
|
||||
get_current_component().$$.on_mount.push(fn);
|
||||
}
|
||||
/**
|
||||
* Associates an arbitrary `context` object with the current component and the specified `key`
|
||||
* and returns that object. The context is then available to children of the component
|
||||
* (including slotted content) with `getContext`.
|
||||
*
|
||||
* Like lifecycle functions, this must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-setcontext
|
||||
*/
|
||||
function setContext(key, context) {
|
||||
get_current_component().$$.context.set(key, context);
|
||||
return context;
|
||||
}
|
||||
/**
|
||||
* Retrieves the context that belongs to the closest parent component with the specified `key`.
|
||||
* Must be called during component initialisation.
|
||||
*
|
||||
* https://svelte.dev/docs#run-time-svelte-getcontext
|
||||
*/
|
||||
function getContext(key) {
|
||||
return get_current_component().$$.context.get(key);
|
||||
}
|
||||
|
||||
const dirty_components = [];
|
||||
const binding_callbacks = [];
|
||||
const render_callbacks = [];
|
||||
const flush_callbacks = [];
|
||||
const resolved_promise = Promise.resolve();
|
||||
let update_scheduled = false;
|
||||
function schedule_update() {
|
||||
if (!update_scheduled) {
|
||||
update_scheduled = true;
|
||||
resolved_promise.then(flush);
|
||||
}
|
||||
}
|
||||
function add_render_callback(fn) {
|
||||
render_callbacks.push(fn);
|
||||
}
|
||||
// flush() calls callbacks in this order:
|
||||
// 1. All beforeUpdate callbacks, in order: parents before children
|
||||
// 2. All bind:this callbacks, in reverse order: children before parents.
|
||||
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
||||
// for afterUpdates called during the initial onMount, which are called in
|
||||
// reverse order: children before parents.
|
||||
// Since callbacks might update component values, which could trigger another
|
||||
// call to flush(), the following steps guard against this:
|
||||
// 1. During beforeUpdate, any updated components will be added to the
|
||||
// dirty_components array and will cause a reentrant call to flush(). Because
|
||||
// the flush index is kept outside the function, the reentrant call will pick
|
||||
// up where the earlier call left off and go through all dirty components. The
|
||||
// current_component value is saved and restored so that the reentrant call will
|
||||
// not interfere with the "parent" flush() call.
|
||||
// 2. bind:this callbacks cannot trigger new flush() calls.
|
||||
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
||||
// callback called a second time; the seen_callbacks set, outside the flush()
|
||||
// function, guarantees this behavior.
|
||||
const seen_callbacks = new Set();
|
||||
let flushidx = 0; // Do *not* move this inside the flush() function
|
||||
function flush() {
|
||||
const saved_component = current_component;
|
||||
do {
|
||||
// first, call beforeUpdate functions
|
||||
// and update components
|
||||
while (flushidx < dirty_components.length) {
|
||||
const component = dirty_components[flushidx];
|
||||
flushidx++;
|
||||
set_current_component(component);
|
||||
update(component.$$);
|
||||
}
|
||||
set_current_component(null);
|
||||
dirty_components.length = 0;
|
||||
flushidx = 0;
|
||||
while (binding_callbacks.length)
|
||||
binding_callbacks.pop()();
|
||||
// then, once components are updated, call
|
||||
// afterUpdate functions. This may cause
|
||||
// subsequent updates...
|
||||
for (let i = 0; i < render_callbacks.length; i += 1) {
|
||||
const callback = render_callbacks[i];
|
||||
if (!seen_callbacks.has(callback)) {
|
||||
// ...so guard against infinite loops
|
||||
seen_callbacks.add(callback);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
render_callbacks.length = 0;
|
||||
} while (dirty_components.length);
|
||||
while (flush_callbacks.length) {
|
||||
flush_callbacks.pop()();
|
||||
}
|
||||
update_scheduled = false;
|
||||
seen_callbacks.clear();
|
||||
set_current_component(saved_component);
|
||||
}
|
||||
function update($$) {
|
||||
if ($$.fragment !== null) {
|
||||
$$.update();
|
||||
run_all($$.before_update);
|
||||
const dirty = $$.dirty;
|
||||
$$.dirty = [-1];
|
||||
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
||||
$$.after_update.forEach(add_render_callback);
|
||||
}
|
||||
}
|
||||
const outroing = new Set();
|
||||
function transition_in(block, local) {
|
||||
if (block && block.i) {
|
||||
outroing.delete(block);
|
||||
block.i(local);
|
||||
}
|
||||
}
|
||||
|
||||
const globals = (typeof window !== 'undefined'
|
||||
? window
|
||||
: typeof globalThis !== 'undefined'
|
||||
? globalThis
|
||||
: global);
|
||||
function mount_component(component, target, anchor, customElement) {
|
||||
const { fragment, after_update } = component.$$;
|
||||
fragment && fragment.m(target, anchor);
|
||||
if (!customElement) {
|
||||
// onMount happens before the initial afterUpdate
|
||||
add_render_callback(() => {
|
||||
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||||
// if the component was destroyed immediately
|
||||
// it will update the `$$.on_destroy` reference to `null`.
|
||||
// the destructured on_destroy may still reference to the old array
|
||||
if (component.$$.on_destroy) {
|
||||
component.$$.on_destroy.push(...new_on_destroy);
|
||||
}
|
||||
else {
|
||||
// Edge case - component was destroyed immediately,
|
||||
// most likely as a result of a binding initialising
|
||||
run_all(new_on_destroy);
|
||||
}
|
||||
component.$$.on_mount = [];
|
||||
});
|
||||
}
|
||||
after_update.forEach(add_render_callback);
|
||||
}
|
||||
function destroy_component(component, detaching) {
|
||||
const $$ = component.$$;
|
||||
if ($$.fragment !== null) {
|
||||
run_all($$.on_destroy);
|
||||
$$.fragment && $$.fragment.d(detaching);
|
||||
// TODO null out other refs, including component.$$ (but need to
|
||||
// preserve final state?)
|
||||
$$.on_destroy = $$.fragment = null;
|
||||
$$.ctx = [];
|
||||
}
|
||||
}
|
||||
function make_dirty(component, i) {
|
||||
if (component.$$.dirty[0] === -1) {
|
||||
dirty_components.push(component);
|
||||
schedule_update();
|
||||
component.$$.dirty.fill(0);
|
||||
}
|
||||
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
|
||||
}
|
||||
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
|
||||
const parent_component = current_component;
|
||||
set_current_component(component);
|
||||
const $$ = component.$$ = {
|
||||
fragment: null,
|
||||
ctx: [],
|
||||
// state
|
||||
props,
|
||||
update: noop,
|
||||
not_equal,
|
||||
bound: blank_object(),
|
||||
// lifecycle
|
||||
on_mount: [],
|
||||
on_destroy: [],
|
||||
on_disconnect: [],
|
||||
before_update: [],
|
||||
after_update: [],
|
||||
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||||
// everything else
|
||||
callbacks: blank_object(),
|
||||
dirty,
|
||||
skip_bound: false,
|
||||
root: options.target || parent_component.$$.root
|
||||
};
|
||||
append_styles && append_styles($$.root);
|
||||
let ready = false;
|
||||
$$.ctx = instance
|
||||
? instance(component, options.props || {}, (i, ret, ...rest) => {
|
||||
const value = rest.length ? rest[0] : ret;
|
||||
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
||||
if (!$$.skip_bound && $$.bound[i])
|
||||
$$.bound[i](value);
|
||||
if (ready)
|
||||
make_dirty(component, i);
|
||||
}
|
||||
return ret;
|
||||
})
|
||||
: [];
|
||||
$$.update();
|
||||
ready = true;
|
||||
run_all($$.before_update);
|
||||
// `false` as a special case of no DOM component
|
||||
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
||||
if (options.target) {
|
||||
if (options.hydrate) {
|
||||
const nodes = children(options.target);
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
$$.fragment && $$.fragment.l(nodes);
|
||||
nodes.forEach(detach);
|
||||
}
|
||||
else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
$$.fragment && $$.fragment.c();
|
||||
}
|
||||
if (options.intro)
|
||||
transition_in(component.$$.fragment);
|
||||
mount_component(component, options.target, options.anchor, options.customElement);
|
||||
flush();
|
||||
}
|
||||
set_current_component(parent_component);
|
||||
}
|
||||
let SvelteElement;
|
||||
if (typeof HTMLElement === 'function') {
|
||||
SvelteElement = class extends HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.attachShadow({ mode: 'open' });
|
||||
}
|
||||
connectedCallback() {
|
||||
const { on_mount } = this.$$;
|
||||
this.$$.on_disconnect = on_mount.map(run).filter(is_function);
|
||||
// @ts-ignore todo: improve typings
|
||||
for (const key in this.$$.slotted) {
|
||||
// @ts-ignore todo: improve typings
|
||||
this.appendChild(this.$$.slotted[key]);
|
||||
}
|
||||
}
|
||||
attributeChangedCallback(attr, _oldValue, newValue) {
|
||||
this[attr] = newValue;
|
||||
}
|
||||
disconnectedCallback() {
|
||||
run_all(this.$$.on_disconnect);
|
||||
}
|
||||
$destroy() {
|
||||
destroy_component(this, 1);
|
||||
this.$destroy = noop;
|
||||
}
|
||||
$on(type, callback) {
|
||||
// TODO should this delegate to addEventListener?
|
||||
if (!is_function(callback)) {
|
||||
return noop;
|
||||
}
|
||||
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
||||
callbacks.push(callback);
|
||||
return () => {
|
||||
const index = callbacks.indexOf(callback);
|
||||
if (index !== -1)
|
||||
callbacks.splice(index, 1);
|
||||
};
|
||||
}
|
||||
$set($$props) {
|
||||
if (this.$$set && !is_empty($$props)) {
|
||||
this.$$.skip_bound = true;
|
||||
this.$$set($$props);
|
||||
this.$$.skip_bound = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function dispatch_dev(type, detail) {
|
||||
document.dispatchEvent(custom_event(type, Object.assign({ version: '3.52.0' }, detail), { bubbles: true }));
|
||||
}
|
||||
function append_dev(target, node) {
|
||||
dispatch_dev('SvelteDOMInsert', { target, node });
|
||||
append(target, node);
|
||||
}
|
||||
function insert_dev(target, node, anchor) {
|
||||
dispatch_dev('SvelteDOMInsert', { target, node, anchor });
|
||||
insert(target, node, anchor);
|
||||
}
|
||||
function detach_dev(node) {
|
||||
dispatch_dev('SvelteDOMRemove', { node });
|
||||
detach(node);
|
||||
}
|
||||
function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
||||
const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
|
||||
if (has_prevent_default)
|
||||
modifiers.push('preventDefault');
|
||||
if (has_stop_propagation)
|
||||
modifiers.push('stopPropagation');
|
||||
dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
|
||||
const dispose = listen(node, event, handler, options);
|
||||
return () => {
|
||||
dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
|
||||
dispose();
|
||||
};
|
||||
}
|
||||
function attr_dev(node, attribute, value) {
|
||||
attr(node, attribute, value);
|
||||
if (value == null)
|
||||
dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });
|
||||
else
|
||||
dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });
|
||||
}
|
||||
function set_data_dev(text, data) {
|
||||
data = '' + data;
|
||||
if (text.wholeText === data)
|
||||
return;
|
||||
dispatch_dev('SvelteDOMSetData', { node: text, data });
|
||||
text.data = data;
|
||||
}
|
||||
function validate_each_argument(arg) {
|
||||
if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
||||
let msg = '{#each} only iterates over array-like objects.';
|
||||
if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
||||
msg += ' You can use a spread to convert this iterable into an array.';
|
||||
}
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
function validate_slots(name, slot, keys) {
|
||||
for (const slot_key of Object.keys(slot)) {
|
||||
if (!~keys.indexOf(slot_key)) {
|
||||
console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { run_all as A, svg_element as B, SvelteElement as S, attribute_to_object as a, insert_dev as b, add_location as c, dispatch_dev as d, element as e, attr_dev as f, append_dev as g, detach_dev as h, init as i, flush as j, validate_each_argument as k, globals as l, destroy_each as m, noop as n, onMount as o, binding_callbacks as p, space as q, set_style as r, safe_not_equal as s, text as t, listen_dev as u, validate_slots as v, set_data_dev as w, getContext as x, setContext as y, src_url_equal as z };
|
93
Server/public/js/components/landing-component.js
Normal file
93
Server/public/js/components/landing-component.js
Normal file
@@ -0,0 +1,93 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, e as element, n as noop, c as add_location, h as detach_dev } from './index-bc9d3868.js';
|
||||
|
||||
/* src\landing-component.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const file = "src\\landing-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let p;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
p = element("p");
|
||||
p.textContent = "I AM A TEXT FOR TESTING";
|
||||
this.c = noop;
|
||||
add_location(p, file, 19, 0, 221);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, p, anchor);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(p);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('landing-component', slots, []);
|
||||
i;
|
||||
|
||||
// Import components
|
||||
// Main code
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<landing-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
class Landing_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("landing-component", Landing_component);
|
||||
|
||||
export { Landing_component as default };
|
362
Server/public/js/components/legend-component.js
Normal file
362
Server/public/js/components/legend-component.js
Normal file
@@ -0,0 +1,362 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, j as flush, s as safe_not_equal, k as validate_each_argument, d as dispatch_dev, v as validate_slots, o as onMount, l as globals, e as element, n as noop, f as attr_dev, c as add_location, h as detach_dev, m as destroy_each, p as binding_callbacks, q as space, t as text, r as set_style, g as append_dev, u as listen_dev, w as set_data_dev } from './index-bc9d3868.js';
|
||||
import { pullLegendData } from '../../../../../../../../../js/predict/charts.js';
|
||||
|
||||
/* src\components\legend-component.svelte generated by Svelte v3.52.0 */
|
||||
|
||||
const { Object: Object_1 } = globals;
|
||||
const file = "src\\components\\legend-component.svelte";
|
||||
|
||||
function get_each_context(ctx, list, i) {
|
||||
const child_ctx = ctx.slice();
|
||||
child_ctx[10] = list[i];
|
||||
child_ctx[11] = list;
|
||||
child_ctx[12] = i;
|
||||
return child_ctx;
|
||||
}
|
||||
|
||||
// (69:4) {#each legendData as item, i}
|
||||
function create_each_block(ctx) {
|
||||
let button;
|
||||
let div;
|
||||
let t0;
|
||||
let span;
|
||||
let t1_value = /*item*/ ctx[10].name + "";
|
||||
let t1;
|
||||
let t2;
|
||||
let i = /*i*/ ctx[12];
|
||||
let mounted;
|
||||
let dispose;
|
||||
const assign_button = () => /*button_binding*/ ctx[6](button, i);
|
||||
const unassign_button = () => /*button_binding*/ ctx[6](null, i);
|
||||
|
||||
function click_handler() {
|
||||
return /*click_handler*/ ctx[7](/*i*/ ctx[12]);
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
button = element("button");
|
||||
div = element("div");
|
||||
t0 = space();
|
||||
span = element("span");
|
||||
t1 = text(t1_value);
|
||||
t2 = space();
|
||||
attr_dev(div, "class", "marker");
|
||||
set_style(div, "background-color", /*item*/ ctx[10].color);
|
||||
add_location(div, file, 70, 12, 1892);
|
||||
add_location(span, file, 71, 12, 1971);
|
||||
add_location(button, file, 69, 8, 1814);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, button, anchor);
|
||||
append_dev(button, div);
|
||||
append_dev(button, t0);
|
||||
append_dev(button, span);
|
||||
append_dev(span, t1);
|
||||
append_dev(button, t2);
|
||||
assign_button();
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", click_handler, false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(new_ctx, dirty) {
|
||||
ctx = new_ctx;
|
||||
|
||||
if (dirty & /*legendData*/ 1) {
|
||||
set_style(div, "background-color", /*item*/ ctx[10].color);
|
||||
}
|
||||
|
||||
if (dirty & /*legendData*/ 1 && t1_value !== (t1_value = /*item*/ ctx[10].name + "")) set_data_dev(t1, t1_value);
|
||||
|
||||
if (i !== /*i*/ ctx[12]) {
|
||||
unassign_button();
|
||||
i = /*i*/ ctx[12];
|
||||
assign_button();
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(button);
|
||||
unassign_button();
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_each_block.name,
|
||||
type: "each",
|
||||
source: "(69:4) {#each legendData as item, i}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div;
|
||||
let each_value = /*legendData*/ ctx[0];
|
||||
validate_each_argument(each_value);
|
||||
let each_blocks = [];
|
||||
|
||||
for (let i = 0; i < each_value.length; i += 1) {
|
||||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div = element("div");
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].c();
|
||||
}
|
||||
|
||||
this.c = noop;
|
||||
attr_dev(div, "class", "legend");
|
||||
add_location(div, file, 67, 0, 1749);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, div, anchor);
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].m(div, null);
|
||||
}
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*buttons, toggleSeries, legendData*/ 7) {
|
||||
each_value = /*legendData*/ ctx[0];
|
||||
validate_each_argument(each_value);
|
||||
let i;
|
||||
|
||||
for (i = 0; i < each_value.length; i += 1) {
|
||||
const child_ctx = get_each_context(ctx, each_value, i);
|
||||
|
||||
if (each_blocks[i]) {
|
||||
each_blocks[i].p(child_ctx, dirty);
|
||||
} else {
|
||||
each_blocks[i] = create_each_block(child_ctx);
|
||||
each_blocks[i].c();
|
||||
each_blocks[i].m(div, null);
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].d(1);
|
||||
}
|
||||
|
||||
each_blocks.length = each_value.length;
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div);
|
||||
destroy_each(each_blocks, detaching);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('legend-component', slots, []);
|
||||
let { option = null } = $$props;
|
||||
let { chart = null } = $$props;
|
||||
let { data = {} } = $$props;
|
||||
|
||||
// Main code
|
||||
let legendData = [];
|
||||
|
||||
let buttons = [];
|
||||
let dataKeys;
|
||||
|
||||
function init() {
|
||||
if (option == null || option == undefined || chart == null || chart == undefined) {
|
||||
setTimeout(init, 100);
|
||||
} else {
|
||||
$$invalidate(0, legendData = pullLegendData(legendData, option));
|
||||
|
||||
for (let obj of legendData) {
|
||||
$$invalidate(3, data[obj.name] = true, data);
|
||||
}
|
||||
|
||||
dataKeys = Object.keys(data);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleSeries(i) {
|
||||
$$invalidate(3, data[dataKeys[i]] = !data[dataKeys[i]], data);
|
||||
let inds = [];
|
||||
let ids = option.series.map(x => x._id);
|
||||
let id = ids[i];
|
||||
|
||||
for (let j = 0; j < ids.length; j++) {
|
||||
if (ids[j] == id) {
|
||||
inds.push(j);
|
||||
}
|
||||
}
|
||||
|
||||
for (let i of inds) {
|
||||
let series = option.series[i];
|
||||
|
||||
if (!series.tooltip.show) {
|
||||
series.lineStyle.opacity = 1;
|
||||
series.itemStyle.opacity = 1;
|
||||
series.tooltip.show = true;
|
||||
$$invalidate(1, buttons[inds[0]].style.opacity = 1, buttons);
|
||||
} else {
|
||||
series.lineStyle.opacity = 0;
|
||||
series.itemStyle.opacity = 0;
|
||||
series.tooltip.show = false;
|
||||
$$invalidate(1, buttons[inds[0]].style.opacity = 0.5, buttons);
|
||||
}
|
||||
}
|
||||
|
||||
chart.setOption(option);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
const writable_props = ['option', 'chart', 'data'];
|
||||
|
||||
Object_1.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<legend-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function button_binding($$value, i) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
buttons[i] = $$value;
|
||||
$$invalidate(1, buttons);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = i => toggleSeries(i);
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('option' in $$props) $$invalidate(4, option = $$props.option);
|
||||
if ('chart' in $$props) $$invalidate(5, chart = $$props.chart);
|
||||
if ('data' in $$props) $$invalidate(3, data = $$props.data);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
pullLegendData,
|
||||
option,
|
||||
chart,
|
||||
data,
|
||||
legendData,
|
||||
buttons,
|
||||
dataKeys,
|
||||
init,
|
||||
toggleSeries
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('option' in $$props) $$invalidate(4, option = $$props.option);
|
||||
if ('chart' in $$props) $$invalidate(5, chart = $$props.chart);
|
||||
if ('data' in $$props) $$invalidate(3, data = $$props.data);
|
||||
if ('legendData' in $$props) $$invalidate(0, legendData = $$props.legendData);
|
||||
if ('buttons' in $$props) $$invalidate(1, buttons = $$props.buttons);
|
||||
if ('dataKeys' in $$props) dataKeys = $$props.dataKeys;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
legendData,
|
||||
buttons,
|
||||
toggleSeries,
|
||||
data,
|
||||
option,
|
||||
chart,
|
||||
button_binding,
|
||||
click_handler
|
||||
];
|
||||
}
|
||||
|
||||
class Legend_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/test-basic.css';button{cursor:pointer}.legend{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1rem}.legend *{font-family:var(--sans-serif)}.marker{position:relative;display:inline-block;margin-right:0.5rem;top:0.1rem;width:1rem;height:1rem;border-radius:1rem}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ option: 4, chart: 5, data: 3 },
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["option", "chart", "data"];
|
||||
}
|
||||
|
||||
get option() {
|
||||
return this.$$.ctx[4];
|
||||
}
|
||||
|
||||
set option(option) {
|
||||
this.$$set({ option });
|
||||
flush();
|
||||
}
|
||||
|
||||
get chart() {
|
||||
return this.$$.ctx[5];
|
||||
}
|
||||
|
||||
set chart(chart) {
|
||||
this.$$set({ chart });
|
||||
flush();
|
||||
}
|
||||
|
||||
get data() {
|
||||
return this.$$.ctx[3];
|
||||
}
|
||||
|
||||
set data(data) {
|
||||
this.$$set({ data });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("legend-component", Legend_component);
|
||||
|
||||
export { Legend_component as default };
|
115
Server/public/js/components/loadscreen-component.js
Normal file
115
Server/public/js/components/loadscreen-component.js
Normal file
@@ -0,0 +1,115 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, e as element, n as noop, f as attr_dev, r as set_style, c as add_location, h as detach_dev, p as binding_callbacks } from './index-bc9d3868.js';
|
||||
|
||||
/* src\components\loadscreen-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\loadscreen-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div = element("div");
|
||||
this.c = noop;
|
||||
attr_dev(div, "id", "loadscreen");
|
||||
set_style(div, "width", "100%");
|
||||
set_style(div, "height", "100%");
|
||||
set_style(div, "background", "white");
|
||||
set_style(div, "position", "absolute");
|
||||
set_style(div, "z-index", "100000");
|
||||
add_location(div, file, 20, 0, 366);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, div, anchor);
|
||||
/*div_binding*/ ctx[1](div);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div);
|
||||
/*div_binding*/ ctx[1](null);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('loadscreen-component', slots, []);
|
||||
let loadscreen;
|
||||
|
||||
onMount(() => {
|
||||
window.addEventListener('load', function () {
|
||||
$$invalidate(0, loadscreen.parentNode.host.style.display = "none", loadscreen);
|
||||
});
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<loadscreen-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function div_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
loadscreen = $$value;
|
||||
$$invalidate(0, loadscreen);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({ onMount, loadscreen });
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('loadscreen' in $$props) $$invalidate(0, loadscreen = $$props.loadscreen);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [loadscreen, div_binding];
|
||||
}
|
||||
|
||||
class Loadscreen_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("loadscreen-component", Loadscreen_component);
|
||||
|
||||
export { Loadscreen_component as default };
|
214
Server/public/js/components/navbar-component.js
Normal file
214
Server/public/js/components/navbar-component.js
Normal file
@@ -0,0 +1,214 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, e as element, q as space, n as noop, z as src_url_equal, f as attr_dev, c as add_location, g as append_dev, u as listen_dev, h as detach_dev, p as binding_callbacks } from './index-bc9d3868.js';
|
||||
|
||||
/* src\navbar\navbar-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\navbar\\navbar-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let header;
|
||||
let a0;
|
||||
let img;
|
||||
let img_src_value;
|
||||
let t0;
|
||||
let span0;
|
||||
let t2;
|
||||
let input;
|
||||
let t3;
|
||||
let label;
|
||||
let span1;
|
||||
let t4;
|
||||
let nav;
|
||||
let ul;
|
||||
let li;
|
||||
let a1;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
header = element("header");
|
||||
a0 = element("a");
|
||||
img = element("img");
|
||||
t0 = space();
|
||||
span0 = element("span");
|
||||
span0.textContent = "LibSoc";
|
||||
t2 = space();
|
||||
input = element("input");
|
||||
t3 = space();
|
||||
label = element("label");
|
||||
span1 = element("span");
|
||||
t4 = space();
|
||||
nav = element("nav");
|
||||
ul = element("ul");
|
||||
li = element("li");
|
||||
a1 = element("a");
|
||||
a1.textContent = "test";
|
||||
this.c = noop;
|
||||
if (!src_url_equal(img.src, img_src_value = "")) attr_dev(img, "src", img_src_value);
|
||||
attr_dev(img, "id", "navbar-logo");
|
||||
attr_dev(img, "alt", "iql logo");
|
||||
add_location(img, file, 37, 8, 810);
|
||||
attr_dev(span0, "id", "navbar-logo-text");
|
||||
add_location(span0, file, 38, 8, 864);
|
||||
attr_dev(a0, "id", "logo-container");
|
||||
attr_dev(a0, "href", "/");
|
||||
add_location(a0, file, 36, 4, 770);
|
||||
attr_dev(input, "type", "checkbox");
|
||||
attr_dev(input, "id", "side-menu");
|
||||
add_location(input, file, 41, 4, 950);
|
||||
attr_dev(span1, "id", "hamb-line");
|
||||
add_location(span1, file, 42, 37, 1073);
|
||||
attr_dev(label, "id", "hamb");
|
||||
attr_dev(label, "for", "side-menu");
|
||||
add_location(label, file, 42, 4, 1040);
|
||||
attr_dev(a1, "href", "/test");
|
||||
add_location(a1, file, 46, 16, 1190);
|
||||
add_location(li, file, 46, 12, 1186);
|
||||
attr_dev(ul, "id", "menu");
|
||||
add_location(ul, file, 45, 8, 1158);
|
||||
attr_dev(nav, "id", "nav");
|
||||
add_location(nav, file, 44, 4, 1134);
|
||||
attr_dev(header, "id", "navbar");
|
||||
add_location(header, file, 34, 0, 706);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, header, anchor);
|
||||
append_dev(header, a0);
|
||||
append_dev(a0, img);
|
||||
append_dev(a0, t0);
|
||||
append_dev(a0, span0);
|
||||
append_dev(header, t2);
|
||||
append_dev(header, input);
|
||||
/*input_binding*/ ctx[3](input);
|
||||
append_dev(header, t3);
|
||||
append_dev(header, label);
|
||||
append_dev(label, span1);
|
||||
append_dev(header, t4);
|
||||
append_dev(header, nav);
|
||||
append_dev(nav, ul);
|
||||
append_dev(ul, li);
|
||||
append_dev(li, a1);
|
||||
/*header_binding*/ ctx[4](header);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(input, "click", /*changeNavbar*/ ctx[2], false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(header);
|
||||
/*input_binding*/ ctx[3](null);
|
||||
/*header_binding*/ ctx[4](null);
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('navbar-component', slots, []);
|
||||
let hambInput;
|
||||
let navbar;
|
||||
|
||||
function changeNavbar() {
|
||||
if (hambInput.checked) {
|
||||
$$invalidate(1, navbar.style.background = "white", navbar);
|
||||
$$invalidate(1, navbar.style.boxShadow = "0 0 0.314rem rgb(187, 187, 187)", navbar);
|
||||
} else {
|
||||
setTimeout(
|
||||
() => {
|
||||
$$invalidate(1, navbar.style.position = "relative", navbar);
|
||||
$$invalidate(1, navbar.style.background = "", navbar);
|
||||
$$invalidate(1, navbar.style.boxShadow = "", navbar);
|
||||
},
|
||||
510
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<navbar-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function input_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
hambInput = $$value;
|
||||
$$invalidate(0, hambInput);
|
||||
});
|
||||
}
|
||||
|
||||
function header_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
navbar = $$value;
|
||||
$$invalidate(1, navbar);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({ onMount, hambInput, navbar, changeNavbar });
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('hambInput' in $$props) $$invalidate(0, hambInput = $$props.hambInput);
|
||||
if ('navbar' in $$props) $$invalidate(1, navbar = $$props.navbar);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [hambInput, navbar, changeNavbar, input_binding, header_binding];
|
||||
}
|
||||
|
||||
class Navbar_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/navbar.css';</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("navbar-component", Navbar_component);
|
||||
|
||||
export { Navbar_component as default };
|
304
Server/public/js/components/pane-aligner.js
Normal file
304
Server/public/js/components/pane-aligner.js
Normal file
@@ -0,0 +1,304 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, x as getContext, o as onMount, y as setContext, e as element, q as space, n as noop, f as attr_dev, c as add_location, g as append_dev, h as detach_dev, p as binding_callbacks } from './index-bc9d3868.js';
|
||||
import { debounce } from '../../../../../../../../../js/libraries/miscTools.js';
|
||||
|
||||
/* src\components\pane-aligner.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\pane-aligner.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div6;
|
||||
let div5;
|
||||
let div2;
|
||||
let div0;
|
||||
let slot0;
|
||||
let t0;
|
||||
let div1;
|
||||
let slot1;
|
||||
let t1;
|
||||
let div3;
|
||||
let slot2;
|
||||
let t2;
|
||||
let div4;
|
||||
let slot3;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div6 = element("div");
|
||||
div5 = element("div");
|
||||
div2 = element("div");
|
||||
div0 = element("div");
|
||||
slot0 = element("slot");
|
||||
t0 = space();
|
||||
div1 = element("div");
|
||||
slot1 = element("slot");
|
||||
t1 = space();
|
||||
div3 = element("div");
|
||||
slot2 = element("slot");
|
||||
t2 = space();
|
||||
div4 = element("div");
|
||||
slot3 = element("slot");
|
||||
this.c = noop;
|
||||
attr_dev(slot0, "name", "sidebar-left");
|
||||
add_location(slot0, file, 74, 16, 2567);
|
||||
attr_dev(div0, "id", "sidebar-left");
|
||||
attr_dev(div0, "class", "pane");
|
||||
add_location(div0, file, 73, 12, 2489);
|
||||
attr_dev(slot1, "name", "sidebar-left2");
|
||||
add_location(slot1, file, 77, 16, 2714);
|
||||
attr_dev(div1, "id", "sidebar-left2");
|
||||
attr_dev(div1, "class", "pane");
|
||||
add_location(div1, file, 76, 12, 2634);
|
||||
attr_dev(div2, "id", "sidebars-left");
|
||||
attr_dev(div2, "class", "sidebar");
|
||||
add_location(div2, file, 72, 8, 2435);
|
||||
attr_dev(slot2, "name", "sidebar-right");
|
||||
add_location(slot2, file, 81, 12, 2879);
|
||||
attr_dev(div3, "id", "sidebar-right");
|
||||
attr_dev(div3, "class", "pane sidebar");
|
||||
add_location(div3, file, 80, 8, 2794);
|
||||
attr_dev(slot3, "name", "main");
|
||||
attr_dev(slot3, "id", "main-slot");
|
||||
add_location(slot3, file, 84, 12, 3007);
|
||||
attr_dev(div4, "id", "main-pane");
|
||||
attr_dev(div4, "class", "pane");
|
||||
add_location(div4, file, 83, 8, 2939);
|
||||
attr_dev(div5, "class", "pane-container");
|
||||
add_location(div5, file, 71, 4, 2397);
|
||||
attr_dev(div6, "id", "root");
|
||||
attr_dev(div6, "class", "pane-centering");
|
||||
add_location(div6, file, 70, 0, 2336);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, div6, anchor);
|
||||
append_dev(div6, div5);
|
||||
append_dev(div5, div2);
|
||||
append_dev(div2, div0);
|
||||
append_dev(div0, slot0);
|
||||
/*div0_binding*/ ctx[5](div0);
|
||||
append_dev(div2, t0);
|
||||
append_dev(div2, div1);
|
||||
append_dev(div1, slot1);
|
||||
/*div1_binding*/ ctx[6](div1);
|
||||
append_dev(div5, t1);
|
||||
append_dev(div5, div3);
|
||||
append_dev(div3, slot2);
|
||||
/*div3_binding*/ ctx[7](div3);
|
||||
append_dev(div5, t2);
|
||||
append_dev(div5, div4);
|
||||
append_dev(div4, slot3);
|
||||
/*div4_binding*/ ctx[8](div4);
|
||||
/*div6_binding*/ ctx[9](div6);
|
||||
},
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div6);
|
||||
/*div0_binding*/ ctx[5](null);
|
||||
/*div1_binding*/ ctx[6](null);
|
||||
/*div3_binding*/ ctx[7](null);
|
||||
/*div4_binding*/ ctx[8](null);
|
||||
/*div6_binding*/ ctx[9](null);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('pane-aligner', slots, []);
|
||||
let root;
|
||||
let mainPane;
|
||||
let sidebarLeft;
|
||||
let sidebarLeft2;
|
||||
let sidebarRight;
|
||||
let parentProps = getContext("alignerParent");
|
||||
|
||||
let switchView = parentProps != undefined
|
||||
? getContext("alignerParent").switchView
|
||||
: undefined;
|
||||
|
||||
let leftReplaced = false;
|
||||
let left2Replaced = false;
|
||||
let rightReplaced = false;
|
||||
let switchViewReplaced = false;
|
||||
|
||||
function adjustSlotted() {
|
||||
if (root.parentNode != null) {
|
||||
let slotted = root.parentNode.host.childNodes;
|
||||
|
||||
if (slotted.length == 0) {
|
||||
setTimeout(adjustSlotted, 50);
|
||||
} else {
|
||||
let changed = false;
|
||||
let html = root.parentNode.innerHTML;
|
||||
|
||||
for (let item of slotted) {
|
||||
if (item.slot == "sidebar-left" && !leftReplaced) {
|
||||
html = html.replace("#sidebar-left{display:none}", "");
|
||||
leftReplaced = true;
|
||||
changed = true;
|
||||
} else if (item.slot == "sidebar-left2" && !left2Replaced) {
|
||||
html = html.replace("#sidebar-left2{display:none}", "");
|
||||
left2Replaced = true;
|
||||
changed = true;
|
||||
} else if (item.slot == "sidebar-right" && !rightReplaced) {
|
||||
html = html.replace("#sidebar-right{display:none;", "#sidebar-right{");
|
||||
rightReplaced = true;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (switchView != undefined && !switchViewReplaced) {
|
||||
html = html.replace("1880px", switchView);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
$$invalidate(0, root.parentNode.innerHTML = html, root);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("resize", debounce(adjustSlotted, 100));
|
||||
|
||||
onMount(() => {
|
||||
adjustSlotted();
|
||||
});
|
||||
|
||||
const writable_props = [];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<pane-aligner> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function div0_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
sidebarLeft = $$value;
|
||||
$$invalidate(2, sidebarLeft);
|
||||
});
|
||||
}
|
||||
|
||||
function div1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
sidebarLeft2 = $$value;
|
||||
$$invalidate(3, sidebarLeft2);
|
||||
});
|
||||
}
|
||||
|
||||
function div3_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
sidebarRight = $$value;
|
||||
$$invalidate(4, sidebarRight);
|
||||
});
|
||||
}
|
||||
|
||||
function div4_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
mainPane = $$value;
|
||||
$$invalidate(1, mainPane);
|
||||
});
|
||||
}
|
||||
|
||||
function div6_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
root = $$value;
|
||||
$$invalidate(0, root);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
getContext,
|
||||
setContext,
|
||||
onMount,
|
||||
debounce,
|
||||
root,
|
||||
mainPane,
|
||||
sidebarLeft,
|
||||
sidebarLeft2,
|
||||
sidebarRight,
|
||||
parentProps,
|
||||
switchView,
|
||||
leftReplaced,
|
||||
left2Replaced,
|
||||
rightReplaced,
|
||||
switchViewReplaced,
|
||||
adjustSlotted
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('root' in $$props) $$invalidate(0, root = $$props.root);
|
||||
if ('mainPane' in $$props) $$invalidate(1, mainPane = $$props.mainPane);
|
||||
if ('sidebarLeft' in $$props) $$invalidate(2, sidebarLeft = $$props.sidebarLeft);
|
||||
if ('sidebarLeft2' in $$props) $$invalidate(3, sidebarLeft2 = $$props.sidebarLeft2);
|
||||
if ('sidebarRight' in $$props) $$invalidate(4, sidebarRight = $$props.sidebarRight);
|
||||
if ('parentProps' in $$props) parentProps = $$props.parentProps;
|
||||
if ('switchView' in $$props) switchView = $$props.switchView;
|
||||
if ('leftReplaced' in $$props) leftReplaced = $$props.leftReplaced;
|
||||
if ('left2Replaced' in $$props) left2Replaced = $$props.left2Replaced;
|
||||
if ('rightReplaced' in $$props) rightReplaced = $$props.rightReplaced;
|
||||
if ('switchViewReplaced' in $$props) switchViewReplaced = $$props.switchViewReplaced;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [
|
||||
root,
|
||||
mainPane,
|
||||
sidebarLeft,
|
||||
sidebarLeft2,
|
||||
sidebarRight,
|
||||
div0_binding,
|
||||
div1_binding,
|
||||
div3_binding,
|
||||
div4_binding,
|
||||
div6_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Pane_aligner extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.pane-container{display:block;margin-left:var(--total-margin-left,0rem)}#root{min-height:var(--min-height,auto)}#main-pane{position:relative;padding-left:var(--padding-left,0rem);padding-right:var(--padding-right,0rem);padding-top:var(--padding-top,0rem);padding-bottom:var(--padding-bottom,0rem);text-align:justify;background:var(--background,white);box-shadow:var(--box-shadow,0 0 0.314rem rgb(187, 187, 187));margin:auto;height:min-content;max-width:var(--width-main,66rem);width:var(--width-main,66rem);z-index:1;overflow-x:var(--overflow-x,hidden)}.sidebar{position:absolute}#sidebars-left{display:flex;flex-direction:column;gap:1rem;margin-left:calc(-1*var(--width-left,22.5rem) - 1rem - 4rem);width:calc(var(--width-left,22.5rem) + 4rem)}#sidebar-left,#sidebar-left2{position:relative;background-color:white;padding:2rem 2rem}#sidebar-left{display:none}#sidebar-left2{display:none}#sidebar-right{display:none;margin-left:calc(var(--width-main,66rem) + 1rem);width:var(--width-right,auto);background-color:white;padding:2rem 2rem}@media only screen and (max-width: 1880px){#main-pane{max-width:initial;width:100%;max-width:var(--width-main,66rem);padding-left:var(--padding-left-mobile,1.8rem);padding-right:var(--padding-right-mobile,1.8rem);padding-top:var(--padding-top-mobile,1.8rem);padding-bottom:var(--padding-bottom-mobile,1.8rem)}#sidebars-left,#sidebar-right{position:relative;margin:auto;margin-top:1rem;margin-bottom:1rem;max-width:var(--width-main,66rem);width:100%}.pane-container{width:95%;justify-items:center;grid-auto-flow:row;margin-left:0}}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("pane-aligner", Pane_aligner);
|
||||
|
||||
export { Pane_aligner as default };
|
593
Server/public/js/components/select-component.js
Normal file
593
Server/public/js/components/select-component.js
Normal file
@@ -0,0 +1,593 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, j as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, k as validate_each_argument, e as element, n as noop, f as attr_dev, c as add_location, h as detach_dev, p as binding_callbacks, t as text, q as space, z as src_url_equal, r as set_style, g as append_dev, u as listen_dev, w as set_data_dev, m as destroy_each } from './index-bc9d3868.js';
|
||||
import { px2rem, getTextWidth, getCanvasFont } from '../../../../../../../../../js/libraries/miscTools.js';
|
||||
|
||||
/* src\components\select-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\select-component.svelte";
|
||||
|
||||
function get_each_context(ctx, list, i) {
|
||||
const child_ctx = ctx.slice();
|
||||
child_ctx[26] = list[i];
|
||||
child_ctx[27] = list;
|
||||
child_ctx[28] = i;
|
||||
return child_ctx;
|
||||
}
|
||||
|
||||
// (135:12) {#each options as option, i}
|
||||
function create_each_block(ctx) {
|
||||
let button;
|
||||
let span;
|
||||
let t0_value = /*option*/ ctx[26] + "";
|
||||
let t0;
|
||||
let t1;
|
||||
let i = /*i*/ ctx[28];
|
||||
let mounted;
|
||||
let dispose;
|
||||
const assign_button = () => /*button_binding_1*/ ctx[14](button, i);
|
||||
const unassign_button = () => /*button_binding_1*/ ctx[14](null, i);
|
||||
|
||||
function click_handler() {
|
||||
return /*click_handler*/ ctx[15](/*i*/ ctx[28]);
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
button = element("button");
|
||||
span = element("span");
|
||||
t0 = text(t0_value);
|
||||
t1 = space();
|
||||
add_location(span, file, 136, 20, 4826);
|
||||
button.value = /*i*/ ctx[28];
|
||||
add_location(button, file, 135, 16, 4715);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, button, anchor);
|
||||
append_dev(button, span);
|
||||
append_dev(span, t0);
|
||||
append_dev(button, t1);
|
||||
assign_button();
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", click_handler, false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(new_ctx, dirty) {
|
||||
ctx = new_ctx;
|
||||
if (dirty & /*options*/ 4 && t0_value !== (t0_value = /*option*/ ctx[26] + "")) set_data_dev(t0, t0_value);
|
||||
|
||||
if (i !== /*i*/ ctx[28]) {
|
||||
unassign_button();
|
||||
i = /*i*/ ctx[28];
|
||||
assign_button();
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(button);
|
||||
unassign_button();
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_each_block.name,
|
||||
type: "each",
|
||||
source: "(135:12) {#each options as option, i}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
// (127:4) {#key key}
|
||||
function create_key_block(ctx) {
|
||||
let button;
|
||||
let div0;
|
||||
let span;
|
||||
let t0_value = (/*value*/ ctx[0] != null ? /*value*/ ctx[0] : "") + "";
|
||||
let t0;
|
||||
let t1;
|
||||
let img;
|
||||
let img_src_value;
|
||||
let t2;
|
||||
let div1;
|
||||
let mounted;
|
||||
let dispose;
|
||||
let each_value = /*options*/ ctx[2];
|
||||
validate_each_argument(each_value);
|
||||
let each_blocks = [];
|
||||
|
||||
for (let i = 0; i < each_value.length; i += 1) {
|
||||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
||||
}
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
button = element("button");
|
||||
div0 = element("div");
|
||||
span = element("span");
|
||||
t0 = text(t0_value);
|
||||
t1 = space();
|
||||
img = element("img");
|
||||
t2 = space();
|
||||
div1 = element("div");
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].c();
|
||||
}
|
||||
|
||||
attr_dev(span, "id", "current-options-span");
|
||||
add_location(span, file, 129, 16, 4359);
|
||||
attr_dev(div0, "id", "current-options-div");
|
||||
add_location(div0, file, 128, 12, 4311);
|
||||
attr_dev(img, "id", "arrow-down");
|
||||
if (!src_url_equal(img.src, img_src_value = "../assets/arrow_down.svg")) attr_dev(img, "src", img_src_value);
|
||||
attr_dev(img, "alt", "arrow down");
|
||||
add_location(img, file, 131, 12, 4484);
|
||||
attr_dev(button, "id", "current-option-button");
|
||||
add_location(button, file, 127, 8, 4202);
|
||||
attr_dev(div1, "id", "options-holder");
|
||||
set_style(div1, "display", "none");
|
||||
add_location(div1, file, 133, 8, 4582);
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, button, anchor);
|
||||
append_dev(button, div0);
|
||||
append_dev(div0, span);
|
||||
append_dev(span, t0);
|
||||
/*span_binding*/ ctx[12](span);
|
||||
append_dev(button, t1);
|
||||
append_dev(button, img);
|
||||
/*button_binding*/ ctx[13](button);
|
||||
insert_dev(target, t2, anchor);
|
||||
insert_dev(target, div1, anchor);
|
||||
|
||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].m(div1, null);
|
||||
}
|
||||
|
||||
/*div1_binding*/ ctx[16](div1);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = listen_dev(button, "click", /*changeVisibility*/ ctx[9], false, false, false);
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(ctx, dirty) {
|
||||
if (dirty & /*value*/ 1 && t0_value !== (t0_value = (/*value*/ ctx[0] != null ? /*value*/ ctx[0] : "") + "")) set_data_dev(t0, t0_value);
|
||||
|
||||
if (dirty & /*optionButtons, changeOption, callback, options*/ 1062) {
|
||||
each_value = /*options*/ ctx[2];
|
||||
validate_each_argument(each_value);
|
||||
let i;
|
||||
|
||||
for (i = 0; i < each_value.length; i += 1) {
|
||||
const child_ctx = get_each_context(ctx, each_value, i);
|
||||
|
||||
if (each_blocks[i]) {
|
||||
each_blocks[i].p(child_ctx, dirty);
|
||||
} else {
|
||||
each_blocks[i] = create_each_block(child_ctx);
|
||||
each_blocks[i].c();
|
||||
each_blocks[i].m(div1, null);
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < each_blocks.length; i += 1) {
|
||||
each_blocks[i].d(1);
|
||||
}
|
||||
|
||||
each_blocks.length = each_value.length;
|
||||
}
|
||||
},
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(button);
|
||||
/*span_binding*/ ctx[12](null);
|
||||
/*button_binding*/ ctx[13](null);
|
||||
if (detaching) detach_dev(t2);
|
||||
if (detaching) detach_dev(div1);
|
||||
destroy_each(each_blocks, detaching);
|
||||
/*div1_binding*/ ctx[16](null);
|
||||
mounted = false;
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_key_block.name,
|
||||
type: "key",
|
||||
source: "(127:4) {#key key}",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let div;
|
||||
let previous_key = /*key*/ ctx[8];
|
||||
let key_block = create_key_block(ctx);
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
div = element("div");
|
||||
key_block.c();
|
||||
this.c = noop;
|
||||
attr_dev(div, "class", "select");
|
||||
add_location(div, file, 125, 0, 4137);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, div, anchor);
|
||||
key_block.m(div, null);
|
||||
/*div_binding*/ ctx[17](div);
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*key*/ 256 && safe_not_equal(previous_key, previous_key = /*key*/ ctx[8])) {
|
||||
key_block.d(1);
|
||||
key_block = create_key_block(ctx);
|
||||
key_block.c();
|
||||
key_block.m(div, null);
|
||||
} else {
|
||||
key_block.p(ctx, dirty);
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(div);
|
||||
key_block.d(detaching);
|
||||
/*div_binding*/ ctx[17](null);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('select-component', slots, []);
|
||||
let { callback = null } = $$props;
|
||||
let { options = [""] } = $$props;
|
||||
let { value = null } = $$props;
|
||||
let { valueindex = null } = $$props;
|
||||
|
||||
// Main code
|
||||
let root = arguments[0];
|
||||
|
||||
let select;
|
||||
let optionsHolder;
|
||||
let optionButtons = [];
|
||||
let currentOption;
|
||||
let currentOptionButton;
|
||||
let init = false;
|
||||
let key = 0;
|
||||
let obs = null;
|
||||
|
||||
function setKeyValue(value, options) {
|
||||
if (value !== null) {
|
||||
if (options.includes(value)) {
|
||||
let index = options.findIndex(element => element == value);
|
||||
$$invalidate(6, currentOption.innerHTML = value, currentOption);
|
||||
$$invalidate(5, optionButtons[index].style.display = "none", optionButtons);
|
||||
$$invalidate(11, valueindex = index);
|
||||
}
|
||||
|
||||
$$invalidate(8, key += 1);
|
||||
}
|
||||
}
|
||||
|
||||
function setKeyIndex(valueindex, options) {
|
||||
if (valueindex != null && options != undefined && options[valueindex] != value) {
|
||||
$$invalidate(0, value = options[valueindex]);
|
||||
$$invalidate(8, key += 1);
|
||||
}
|
||||
}
|
||||
|
||||
function indexToValue(index) {
|
||||
$$invalidate(0, value = options[index]);
|
||||
}
|
||||
|
||||
function changeVisibility() {
|
||||
if (optionsHolder.style.display == "none") {
|
||||
$$invalidate(4, optionsHolder.style.display = "initial", optionsHolder);
|
||||
} else {
|
||||
$$invalidate(4, optionsHolder.style.display = "none", optionsHolder);
|
||||
}
|
||||
}
|
||||
|
||||
function changeOption(index, callback) {
|
||||
$$invalidate(11, valueindex = index);
|
||||
$$invalidate(0, value = options[index]);
|
||||
|
||||
if (callback != undefined && callback != null) {
|
||||
callback(index);
|
||||
}
|
||||
}
|
||||
|
||||
function hideSelect() {
|
||||
$$invalidate(4, optionsHolder.style.display = "none", optionsHolder);
|
||||
}
|
||||
|
||||
function changeOptionsWidth(select, optionsHolder) {
|
||||
let selectWidth;
|
||||
|
||||
if (select != undefined && optionsHolder != undefined) {
|
||||
let selectWidthText = getComputedStyle(select).getPropertyValue('--width');
|
||||
|
||||
if (isNaN(selectWidthText) || selectWidthText == "") {
|
||||
if (obs == null) {
|
||||
obs = new ResizeObserver(() => changeOptionsWidth(select, optionsHolder));
|
||||
obs.observe(currentOptionButton);
|
||||
return;
|
||||
} else {
|
||||
selectWidthText = getComputedStyle(currentOptionButton).getPropertyValue('width');
|
||||
selectWidth = px2rem(parseFloat(selectWidthText.slice(0, selectWidthText.length - 2)));
|
||||
}
|
||||
} else {
|
||||
selectWidth = parseFloat(selectWidthText.slice(0, selectWidthText.length - 2));
|
||||
}
|
||||
|
||||
let spanWidths = [];
|
||||
|
||||
for (let i = 0; i < optionsHolder.children.length; i++) {
|
||||
let span = optionsHolder.children[i].children[0];
|
||||
let spanWidth = getTextWidth(span.innerHTML, getCanvasFont(span));
|
||||
spanWidths.push(spanWidth);
|
||||
}
|
||||
|
||||
let maxOptionsWidth = px2rem(Math.max(...spanWidths));
|
||||
|
||||
if (maxOptionsWidth > selectWidth) {
|
||||
let width = 1.1 * maxOptionsWidth + "rem";
|
||||
optionsHolder.style.width = width;
|
||||
|
||||
for (let i = 0; i < optionsHolder.children.length; i++) {
|
||||
let button = optionsHolder.children[i];
|
||||
button.style.width = width;
|
||||
}
|
||||
|
||||
optionsHolder.style.marginLeft = -(1.1 * maxOptionsWidth - selectWidth) / 2 - 0.05 + "rem";
|
||||
} else {
|
||||
let width = selectWidth + 0.1 + "rem";
|
||||
|
||||
for (let i = 0; i < optionsHolder.children.length; i++) {
|
||||
let button = optionsHolder.children[i];
|
||||
button.style.width = width;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
init = true;
|
||||
root.addEventListener('focusout', hideSelect);
|
||||
});
|
||||
|
||||
const writable_props = ['callback', 'options', 'value', 'valueindex'];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<select-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function span_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
currentOption = $$value;
|
||||
$$invalidate(6, currentOption);
|
||||
});
|
||||
}
|
||||
|
||||
function button_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
currentOptionButton = $$value;
|
||||
$$invalidate(7, currentOptionButton);
|
||||
});
|
||||
}
|
||||
|
||||
function button_binding_1($$value, i) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
optionButtons[i] = $$value;
|
||||
$$invalidate(5, optionButtons);
|
||||
});
|
||||
}
|
||||
|
||||
const click_handler = i => changeOption(i, callback);
|
||||
|
||||
function div1_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
optionsHolder = $$value;
|
||||
$$invalidate(4, optionsHolder);
|
||||
});
|
||||
}
|
||||
|
||||
function div_binding($$value) {
|
||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
||||
select = $$value;
|
||||
$$invalidate(3, select);
|
||||
});
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(1, callback = $$props.callback);
|
||||
if ('options' in $$props) $$invalidate(2, options = $$props.options);
|
||||
if ('value' in $$props) $$invalidate(0, value = $$props.value);
|
||||
if ('valueindex' in $$props) $$invalidate(11, valueindex = $$props.valueindex);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
px2rem,
|
||||
getTextWidth,
|
||||
getCanvasFont,
|
||||
callback,
|
||||
options,
|
||||
value,
|
||||
valueindex,
|
||||
root,
|
||||
select,
|
||||
optionsHolder,
|
||||
optionButtons,
|
||||
currentOption,
|
||||
currentOptionButton,
|
||||
init,
|
||||
key,
|
||||
obs,
|
||||
setKeyValue,
|
||||
setKeyIndex,
|
||||
indexToValue,
|
||||
changeVisibility,
|
||||
changeOption,
|
||||
hideSelect,
|
||||
changeOptionsWidth
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(1, callback = $$props.callback);
|
||||
if ('options' in $$props) $$invalidate(2, options = $$props.options);
|
||||
if ('value' in $$props) $$invalidate(0, value = $$props.value);
|
||||
if ('valueindex' in $$props) $$invalidate(11, valueindex = $$props.valueindex);
|
||||
if ('root' in $$props) root = $$props.root;
|
||||
if ('select' in $$props) $$invalidate(3, select = $$props.select);
|
||||
if ('optionsHolder' in $$props) $$invalidate(4, optionsHolder = $$props.optionsHolder);
|
||||
if ('optionButtons' in $$props) $$invalidate(5, optionButtons = $$props.optionButtons);
|
||||
if ('currentOption' in $$props) $$invalidate(6, currentOption = $$props.currentOption);
|
||||
if ('currentOptionButton' in $$props) $$invalidate(7, currentOptionButton = $$props.currentOptionButton);
|
||||
if ('init' in $$props) init = $$props.init;
|
||||
if ('key' in $$props) $$invalidate(8, key = $$props.key);
|
||||
if ('obs' in $$props) obs = $$props.obs;
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
$$self.$$.update = () => {
|
||||
if ($$self.$$.dirty & /*value, options*/ 5) {
|
||||
setKeyValue(value, options);
|
||||
}
|
||||
|
||||
if ($$self.$$.dirty & /*valueindex, options*/ 2052) {
|
||||
setKeyIndex(valueindex, options);
|
||||
}
|
||||
|
||||
if ($$self.$$.dirty & /*select, optionsHolder*/ 24) {
|
||||
changeOptionsWidth(select, optionsHolder);
|
||||
}
|
||||
};
|
||||
|
||||
return [
|
||||
value,
|
||||
callback,
|
||||
options,
|
||||
select,
|
||||
optionsHolder,
|
||||
optionButtons,
|
||||
currentOption,
|
||||
currentOptionButton,
|
||||
key,
|
||||
changeVisibility,
|
||||
changeOption,
|
||||
valueindex,
|
||||
span_binding,
|
||||
button_binding,
|
||||
button_binding_1,
|
||||
click_handler,
|
||||
div1_binding,
|
||||
div_binding
|
||||
];
|
||||
}
|
||||
|
||||
class Select_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';#current-options-div{position:relative;overflow:hidden;width:calc(100% - 2.5rem);text-align:var(--text-align,left);padding-top:0.5rem}#arrow-down{right:0.5rem;width:1.365rem;position:absolute;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%)}.select{position:relative;margin-top:var(--margin-top,0);width:var(--width);max-width:var(--max-width);height:var(--height,2.75rem);border:var(--border,rgba(0,0,0,var(--opacity,1)) solid);border-width:var(--border-width, 0.063rem);border-radius:var(--border-radius,0.126rem)}.select button{width:var(--width);max-width:var(--max-width)}#current-option-button,#current-option-button *{opacity:var(--opacity,1);font-family:var(--font-family,var(--serif), serif);font-size:var(--font-size, 1.3rem)}.select>:first-child{margin-right:-2.75rem;padding-right:0.0rem}.select span{position:relative;padding-top:0.5rem;white-space:nowrap}#current-option-button{display:flex;width:100%;height:100%;padding-left:0.341rem;font-weight:var(--font-weight,400)}#options-holder{position:absolute;margin-top:calc(-1 * var(--border-width, 0.063rem));background:white;z-index:1;margin-left:-0.05rem;border-radius:var(--border-radius-options,0.126rem)}#options-holder *{font-size:var(--options-font-size, 1.2rem);font-family:var(--font-family,var(--serif), serif)}#options-holder button{display:flex;position:relative;width:var(--width);background:white;font-weight:400;text-align:var(--text-align,left);padding-top:0.341rem;padding-bottom:0.341rem;padding-right:3.515rem;padding-left:0.341rem}#options-holder button:hover{background:#cdcdcd}#options-holder button{border:black solid;border-width:0 var(--border-width-options,var(--border-width, 0.063rem)) 0 var(--border-width-options,var(--border-width, 0.063rem))}#options-holder>:first-child{border-top:black solid var(--border-width-options,var(--border-width, 0.063rem));border-top-left-radius:var(--border-radius-options,0.126rem);border-top-right-radius:var(--border-radius-options,0.126rem)}#options-holder>:last-child{border-bottom:black solid var(--border-width-options,var(--border-width, 0.063rem));border-bottom-left-radius:var(--border-radius-options,0.126rem);border-bottom-right-radius:var(--border-radius-options,0.126rem)}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{
|
||||
callback: 1,
|
||||
options: 2,
|
||||
value: 0,
|
||||
valueindex: 11
|
||||
},
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["callback", "options", "value", "valueindex"];
|
||||
}
|
||||
|
||||
get callback() {
|
||||
return this.$$.ctx[1];
|
||||
}
|
||||
|
||||
set callback(callback) {
|
||||
this.$$set({ callback });
|
||||
flush();
|
||||
}
|
||||
|
||||
get options() {
|
||||
return this.$$.ctx[2];
|
||||
}
|
||||
|
||||
set options(options) {
|
||||
this.$$set({ options });
|
||||
flush();
|
||||
}
|
||||
|
||||
get value() {
|
||||
return this.$$.ctx[0];
|
||||
}
|
||||
|
||||
set value(value) {
|
||||
this.$$set({ value });
|
||||
flush();
|
||||
}
|
||||
|
||||
get valueindex() {
|
||||
return this.$$.ctx[11];
|
||||
}
|
||||
|
||||
set valueindex(valueindex) {
|
||||
this.$$set({ valueindex });
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("select-component", Select_component);
|
||||
|
||||
export { Select_component as default };
|
209
Server/public/js/components/switch-component.js
Normal file
209
Server/public/js/components/switch-component.js
Normal file
@@ -0,0 +1,209 @@
|
||||
|
||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, j as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, e as element, q as space, n as noop, f as attr_dev, c as add_location, g as append_dev, u as listen_dev, h as detach_dev, A as run_all } from './index-bc9d3868.js';
|
||||
import { px2rem, getTextWidth, getCanvasFont } from '../../../../../../../../../js/libraries/miscTools.js';
|
||||
|
||||
/* src\components\switch-component.svelte generated by Svelte v3.52.0 */
|
||||
const file = "src\\components\\switch-component.svelte";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
let label;
|
||||
let input;
|
||||
let t;
|
||||
let span;
|
||||
let mounted;
|
||||
let dispose;
|
||||
|
||||
const block = {
|
||||
c: function create() {
|
||||
label = element("label");
|
||||
input = element("input");
|
||||
t = space();
|
||||
span = element("span");
|
||||
this.c = noop;
|
||||
attr_dev(input, "type", "checkbox");
|
||||
add_location(input, file, 39, 4, 804);
|
||||
attr_dev(span, "class", "switch-span");
|
||||
add_location(span, file, 40, 4, 880);
|
||||
attr_dev(label, "class", "switch");
|
||||
add_location(label, file, 38, 0, 776);
|
||||
},
|
||||
l: function claim(nodes) {
|
||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
||||
},
|
||||
m: function mount(target, anchor) {
|
||||
insert_dev(target, label, anchor);
|
||||
append_dev(label, input);
|
||||
input.checked = /*checked*/ ctx[0];
|
||||
append_dev(label, t);
|
||||
append_dev(label, span);
|
||||
|
||||
if (!mounted) {
|
||||
dispose = [
|
||||
listen_dev(input, "change", /*input_change_handler*/ ctx[4]),
|
||||
listen_dev(input, "click", /*toggleClick*/ ctx[1], false, false, false)
|
||||
];
|
||||
|
||||
mounted = true;
|
||||
}
|
||||
},
|
||||
p: function update(ctx, [dirty]) {
|
||||
if (dirty & /*checked*/ 1) {
|
||||
input.checked = /*checked*/ ctx[0];
|
||||
}
|
||||
},
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: function destroy(detaching) {
|
||||
if (detaching) detach_dev(label);
|
||||
mounted = false;
|
||||
run_all(dispose);
|
||||
}
|
||||
};
|
||||
|
||||
dispatch_dev("SvelteRegisterBlock", {
|
||||
block,
|
||||
id: create_fragment.name,
|
||||
type: "component",
|
||||
source: "",
|
||||
ctx
|
||||
});
|
||||
|
||||
return block;
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let { $$slots: slots = {}, $$scope } = $$props;
|
||||
validate_slots('switch-component', slots, []);
|
||||
let { callback = null } = $$props;
|
||||
let { checked = false } = $$props;
|
||||
|
||||
const toggle = () => {
|
||||
let f = () => {
|
||||
if (callback != null) {
|
||||
$$invalidate(0, checked = !checked);
|
||||
callback();
|
||||
} else {
|
||||
toggle();
|
||||
}
|
||||
};
|
||||
|
||||
setTimeout(f, 100);
|
||||
};
|
||||
|
||||
function toggleClick() {
|
||||
if (callback != null) {
|
||||
$$invalidate(0, checked = !checked);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
|
||||
// Main code
|
||||
onMount(() => {
|
||||
|
||||
});
|
||||
|
||||
const writable_props = ['callback', 'checked'];
|
||||
|
||||
Object.keys($$props).forEach(key => {
|
||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<switch-component> was created with unknown prop '${key}'`);
|
||||
});
|
||||
|
||||
function input_change_handler() {
|
||||
checked = this.checked;
|
||||
$$invalidate(0, checked);
|
||||
}
|
||||
|
||||
$$self.$$set = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(2, callback = $$props.callback);
|
||||
if ('checked' in $$props) $$invalidate(0, checked = $$props.checked);
|
||||
};
|
||||
|
||||
$$self.$capture_state = () => ({
|
||||
onMount,
|
||||
px2rem,
|
||||
getTextWidth,
|
||||
getCanvasFont,
|
||||
callback,
|
||||
checked,
|
||||
toggle,
|
||||
toggleClick
|
||||
});
|
||||
|
||||
$$self.$inject_state = $$props => {
|
||||
if ('callback' in $$props) $$invalidate(2, callback = $$props.callback);
|
||||
if ('checked' in $$props) $$invalidate(0, checked = $$props.checked);
|
||||
};
|
||||
|
||||
if ($$props && "$$inject" in $$props) {
|
||||
$$self.$inject_state($$props.$$inject);
|
||||
}
|
||||
|
||||
return [checked, toggleClick, callback, toggle, input_change_handler];
|
||||
}
|
||||
|
||||
class Switch_component extends SvelteElement {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.switch span{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;border-radius:calc(2* 1.2rem)}.switch span:before{position:absolute;content:"";height:calc(var(--height) - 0.5rem);width:calc(var(--height) - 0.5rem);left:calc(0.3rem);bottom:0.25rem;background-color:white;-webkit-transition:.4s;transition:.4s;border-radius:50%}.switch input:checked+.switch-span{background-color:var(--pink)}.switch input:hover+.switch-span{box-shadow:0 0 0 var(--pink)}.switch input:checked+.switch-span:before{-webkit-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));-ms-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem))}.switch{position:relative;display:inline-block;width:var(--width);height:var(--height)}.switch input{position:absolute;width:var(--width);height:var(--height);opacity:0}</style>`;
|
||||
|
||||
init(
|
||||
this,
|
||||
{
|
||||
target: this.shadowRoot,
|
||||
props: attribute_to_object(this.attributes),
|
||||
customElement: true
|
||||
},
|
||||
instance,
|
||||
create_fragment,
|
||||
safe_not_equal,
|
||||
{ callback: 2, checked: 0, toggle: 3 },
|
||||
null
|
||||
);
|
||||
|
||||
if (options) {
|
||||
if (options.target) {
|
||||
insert_dev(options.target, this, options.anchor);
|
||||
}
|
||||
|
||||
if (options.props) {
|
||||
this.$set(options.props);
|
||||
flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ["callback", "checked", "toggle"];
|
||||
}
|
||||
|
||||
get callback() {
|
||||
return this.$$.ctx[2];
|
||||
}
|
||||
|
||||
set callback(callback) {
|
||||
this.$$set({ callback });
|
||||
flush();
|
||||
}
|
||||
|
||||
get checked() {
|
||||
return this.$$.ctx[0];
|
||||
}
|
||||
|
||||
set checked(checked) {
|
||||
this.$$set({ checked });
|
||||
flush();
|
||||
}
|
||||
|
||||
get toggle() {
|
||||
return this.$$.ctx[3];
|
||||
}
|
||||
|
||||
set toggle(value) {
|
||||
throw new Error("<switch-component>: Cannot set read-only property 'toggle'");
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("switch-component", Switch_component);
|
||||
|
||||
export { Switch_component as default };
|
421
Server/public/js/genie/ansi_up.js
Normal file
421
Server/public/js/genie/ansi_up.js
Normal file
@@ -0,0 +1,421 @@
|
||||
/* ansi_up.js
|
||||
* author : Dru Nelson
|
||||
* license : MIT
|
||||
* http://github.com/drudru/ansi_up
|
||||
*/
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports);
|
||||
} else {
|
||||
// Browser globals
|
||||
var exp = {};
|
||||
factory(exp);
|
||||
root.AnsiUp = exp.default;
|
||||
}
|
||||
}(this, function (exports) {
|
||||
"use strict";
|
||||
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
var PacketKind;
|
||||
(function (PacketKind) {
|
||||
PacketKind[PacketKind["EOS"] = 0] = "EOS";
|
||||
PacketKind[PacketKind["Text"] = 1] = "Text";
|
||||
PacketKind[PacketKind["Incomplete"] = 2] = "Incomplete";
|
||||
PacketKind[PacketKind["ESC"] = 3] = "ESC";
|
||||
PacketKind[PacketKind["Unknown"] = 4] = "Unknown";
|
||||
PacketKind[PacketKind["SGR"] = 5] = "SGR";
|
||||
PacketKind[PacketKind["OSCURL"] = 6] = "OSCURL";
|
||||
})(PacketKind || (PacketKind = {}));
|
||||
var AnsiUp = (function () {
|
||||
function AnsiUp() {
|
||||
this.VERSION = "4.0.3";
|
||||
this.setup_palettes();
|
||||
this._use_classes = false;
|
||||
this._escape_for_html = true;
|
||||
this.bold = false;
|
||||
this.fg = this.bg = null;
|
||||
this._buffer = '';
|
||||
this._url_whitelist = { 'http': 1, 'https': 1 };
|
||||
}
|
||||
Object.defineProperty(AnsiUp.prototype, "use_classes", {
|
||||
get: function () {
|
||||
return this._use_classes;
|
||||
},
|
||||
set: function (arg) {
|
||||
this._use_classes = arg;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(AnsiUp.prototype, "escape_for_html", {
|
||||
get: function () {
|
||||
return this._escape_for_html;
|
||||
},
|
||||
set: function (arg) {
|
||||
this._escape_for_html = arg;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(AnsiUp.prototype, "url_whitelist", {
|
||||
get: function () {
|
||||
return this._url_whitelist;
|
||||
},
|
||||
set: function (arg) {
|
||||
this._url_whitelist = arg;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
AnsiUp.prototype.setup_palettes = function () {
|
||||
var _this = this;
|
||||
this.ansi_colors =
|
||||
[
|
||||
[
|
||||
{ rgb: [0, 0, 0], class_name: "ansi-black" },
|
||||
{ rgb: [187, 0, 0], class_name: "ansi-red" },
|
||||
{ rgb: [0, 187, 0], class_name: "ansi-green" },
|
||||
{ rgb: [187, 187, 0], class_name: "ansi-yellow" },
|
||||
{ rgb: [0, 0, 187], class_name: "ansi-blue" },
|
||||
{ rgb: [187, 0, 187], class_name: "ansi-magenta" },
|
||||
{ rgb: [0, 187, 187], class_name: "ansi-cyan" },
|
||||
{ rgb: [255, 255, 255], class_name: "ansi-white" }
|
||||
],
|
||||
[
|
||||
{ rgb: [85, 85, 85], class_name: "ansi-bright-black" },
|
||||
{ rgb: [255, 85, 85], class_name: "ansi-bright-red" },
|
||||
{ rgb: [0, 255, 0], class_name: "ansi-bright-green" },
|
||||
{ rgb: [255, 255, 85], class_name: "ansi-bright-yellow" },
|
||||
{ rgb: [85, 85, 255], class_name: "ansi-bright-blue" },
|
||||
{ rgb: [255, 85, 255], class_name: "ansi-bright-magenta" },
|
||||
{ rgb: [85, 255, 255], class_name: "ansi-bright-cyan" },
|
||||
{ rgb: [255, 255, 255], class_name: "ansi-bright-white" }
|
||||
]
|
||||
];
|
||||
this.palette_256 = [];
|
||||
this.ansi_colors.forEach(function (palette) {
|
||||
palette.forEach(function (rec) {
|
||||
_this.palette_256.push(rec);
|
||||
});
|
||||
});
|
||||
var levels = [0, 95, 135, 175, 215, 255];
|
||||
for (var r = 0; r < 6; ++r) {
|
||||
for (var g = 0; g < 6; ++g) {
|
||||
for (var b = 0; b < 6; ++b) {
|
||||
var col = { rgb: [levels[r], levels[g], levels[b]], class_name: 'truecolor' };
|
||||
this.palette_256.push(col);
|
||||
}
|
||||
}
|
||||
}
|
||||
var grey_level = 8;
|
||||
for (var i = 0; i < 24; ++i, grey_level += 10) {
|
||||
var gry = { rgb: [grey_level, grey_level, grey_level], class_name: 'truecolor' };
|
||||
this.palette_256.push(gry);
|
||||
}
|
||||
};
|
||||
AnsiUp.prototype.escape_txt_for_html = function (txt) {
|
||||
return txt.replace(/[&<>]/gm, function (str) {
|
||||
if (str === "&")
|
||||
return "&";
|
||||
if (str === "<")
|
||||
return "<";
|
||||
if (str === ">")
|
||||
return ">";
|
||||
});
|
||||
};
|
||||
AnsiUp.prototype.append_buffer = function (txt) {
|
||||
var str = this._buffer + txt;
|
||||
this._buffer = str;
|
||||
};
|
||||
AnsiUp.prototype.get_next_packet = function () {
|
||||
var pkt = {
|
||||
kind: PacketKind.EOS,
|
||||
text: '',
|
||||
url: ''
|
||||
};
|
||||
var len = this._buffer.length;
|
||||
if (len == 0)
|
||||
return pkt;
|
||||
var pos = this._buffer.indexOf("\x1B");
|
||||
if (pos == -1) {
|
||||
pkt.kind = PacketKind.Text;
|
||||
pkt.text = this._buffer;
|
||||
this._buffer = '';
|
||||
return pkt;
|
||||
}
|
||||
if (pos > 0) {
|
||||
pkt.kind = PacketKind.Text;
|
||||
pkt.text = this._buffer.slice(0, pos);
|
||||
this._buffer = this._buffer.slice(pos);
|
||||
return pkt;
|
||||
}
|
||||
if (pos == 0) {
|
||||
if (len == 1) {
|
||||
pkt.kind = PacketKind.Incomplete;
|
||||
return pkt;
|
||||
}
|
||||
var next_char = this._buffer.charAt(1);
|
||||
if ((next_char != '[') && (next_char != ']')) {
|
||||
pkt.kind = PacketKind.ESC;
|
||||
pkt.text = this._buffer.slice(0, 1);
|
||||
this._buffer = this._buffer.slice(1);
|
||||
return pkt;
|
||||
}
|
||||
if (next_char == '[') {
|
||||
if (!this._csi_regex) {
|
||||
this._csi_regex = rgx(__makeTemplateObject(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \u001B[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \u001B[ # CSI\n [ -~]* # anything legal\n ([\0-\u001F:]) # anything illegal\n )\n "], ["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]));
|
||||
}
|
||||
var match = this._buffer.match(this._csi_regex);
|
||||
if (match === null) {
|
||||
pkt.kind = PacketKind.Incomplete;
|
||||
return pkt;
|
||||
}
|
||||
if (match[4]) {
|
||||
pkt.kind = PacketKind.ESC;
|
||||
pkt.text = this._buffer.slice(0, 1);
|
||||
this._buffer = this._buffer.slice(1);
|
||||
return pkt;
|
||||
}
|
||||
if ((match[1] != '') || (match[3] != 'm'))
|
||||
pkt.kind = PacketKind.Unknown;
|
||||
else
|
||||
pkt.kind = PacketKind.SGR;
|
||||
pkt.text = match[2];
|
||||
var rpos = match[0].length;
|
||||
this._buffer = this._buffer.slice(rpos);
|
||||
return pkt;
|
||||
}
|
||||
if (next_char == ']') {
|
||||
if (len < 4) {
|
||||
pkt.kind = PacketKind.Incomplete;
|
||||
return pkt;
|
||||
}
|
||||
if ((this._buffer.charAt(2) != '8')
|
||||
|| (this._buffer.charAt(3) != ';')) {
|
||||
pkt.kind = PacketKind.ESC;
|
||||
pkt.text = this._buffer.slice(0, 1);
|
||||
this._buffer = this._buffer.slice(1);
|
||||
return pkt;
|
||||
}
|
||||
if (!this._osc_st) {
|
||||
this._osc_st = rgxG(__makeTemplateObject(["\n (?: # legal sequence\n (\u001B\\) # ESC | # alternate\n (\u0007) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-\u0006] # anything illegal\n | # alternate\n [\b-\u001A] # anything illegal\n | # alternate\n [\u001C-\u001F] # anything illegal\n )\n "], ["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "]));
|
||||
}
|
||||
this._osc_st.lastIndex = 0;
|
||||
{
|
||||
var match_1 = this._osc_st.exec(this._buffer);
|
||||
if (match_1 === null) {
|
||||
pkt.kind = PacketKind.Incomplete;
|
||||
return pkt;
|
||||
}
|
||||
if (match_1[3]) {
|
||||
pkt.kind = PacketKind.ESC;
|
||||
pkt.text = this._buffer.slice(0, 1);
|
||||
this._buffer = this._buffer.slice(1);
|
||||
return pkt;
|
||||
}
|
||||
}
|
||||
{
|
||||
var match_2 = this._osc_st.exec(this._buffer);
|
||||
if (match_2 === null) {
|
||||
pkt.kind = PacketKind.Incomplete;
|
||||
return pkt;
|
||||
}
|
||||
if (match_2[3]) {
|
||||
pkt.kind = PacketKind.ESC;
|
||||
pkt.text = this._buffer.slice(0, 1);
|
||||
this._buffer = this._buffer.slice(1);
|
||||
return pkt;
|
||||
}
|
||||
}
|
||||
if (!this._osc_regex) {
|
||||
this._osc_regex = rgx(__makeTemplateObject(["\n ^ # beginning of line\n #\n \u001B]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\u001B\\) # ESC | # alternate\n (?:\u0007) # BEL (what xterm did)\n )\n ([!-~]+) # TEXT capture\n \u001B]8;; # OSC Hyperlink End\n (?: # ST\n (?:\u001B\\) # ESC | # alternate\n (?:\u0007) # BEL (what xterm did)\n )\n "], ["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x21-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]));
|
||||
}
|
||||
var match = this._buffer.match(this._osc_regex);
|
||||
if (match === null) {
|
||||
pkt.kind = PacketKind.ESC;
|
||||
pkt.text = this._buffer.slice(0, 1);
|
||||
this._buffer = this._buffer.slice(1);
|
||||
return pkt;
|
||||
}
|
||||
pkt.kind = PacketKind.OSCURL;
|
||||
pkt.url = match[1];
|
||||
pkt.text = match[2];
|
||||
var rpos = match[0].length;
|
||||
this._buffer = this._buffer.slice(rpos);
|
||||
return pkt;
|
||||
}
|
||||
}
|
||||
};
|
||||
AnsiUp.prototype.ansi_to_html = function (txt) {
|
||||
this.append_buffer(txt);
|
||||
var blocks = [];
|
||||
while (true) {
|
||||
var packet = this.get_next_packet();
|
||||
if ((packet.kind == PacketKind.EOS)
|
||||
|| (packet.kind == PacketKind.Incomplete))
|
||||
break;
|
||||
if ((packet.kind == PacketKind.ESC)
|
||||
|| (packet.kind == PacketKind.Unknown))
|
||||
continue;
|
||||
if (packet.kind == PacketKind.Text)
|
||||
blocks.push(this.transform_to_html(this.with_state(packet)));
|
||||
else if (packet.kind == PacketKind.SGR)
|
||||
this.process_ansi(packet);
|
||||
else if (packet.kind == PacketKind.OSCURL)
|
||||
blocks.push(this.process_hyperlink(packet));
|
||||
}
|
||||
return blocks.join("");
|
||||
};
|
||||
AnsiUp.prototype.with_state = function (pkt) {
|
||||
return { bold: this.bold, fg: this.fg, bg: this.bg, text: pkt.text };
|
||||
};
|
||||
AnsiUp.prototype.process_ansi = function (pkt) {
|
||||
var sgr_cmds = pkt.text.split(';');
|
||||
while (sgr_cmds.length > 0) {
|
||||
var sgr_cmd_str = sgr_cmds.shift();
|
||||
var num = parseInt(sgr_cmd_str, 10);
|
||||
if (isNaN(num) || num === 0) {
|
||||
this.fg = this.bg = null;
|
||||
this.bold = false;
|
||||
}
|
||||
else if (num === 1) {
|
||||
this.bold = true;
|
||||
}
|
||||
else if (num === 22) {
|
||||
this.bold = false;
|
||||
}
|
||||
else if (num === 39) {
|
||||
this.fg = null;
|
||||
}
|
||||
else if (num === 49) {
|
||||
this.bg = null;
|
||||
}
|
||||
else if ((num >= 30) && (num < 38)) {
|
||||
this.fg = this.ansi_colors[0][(num - 30)];
|
||||
}
|
||||
else if ((num >= 40) && (num < 48)) {
|
||||
this.bg = this.ansi_colors[0][(num - 40)];
|
||||
}
|
||||
else if ((num >= 90) && (num < 98)) {
|
||||
this.fg = this.ansi_colors[1][(num - 90)];
|
||||
}
|
||||
else if ((num >= 100) && (num < 108)) {
|
||||
this.bg = this.ansi_colors[1][(num - 100)];
|
||||
}
|
||||
else if (num === 38 || num === 48) {
|
||||
if (sgr_cmds.length > 0) {
|
||||
var is_foreground = (num === 38);
|
||||
var mode_cmd = sgr_cmds.shift();
|
||||
if (mode_cmd === '5' && sgr_cmds.length > 0) {
|
||||
var palette_index = parseInt(sgr_cmds.shift(), 10);
|
||||
if (palette_index >= 0 && palette_index <= 255) {
|
||||
if (is_foreground)
|
||||
this.fg = this.palette_256[palette_index];
|
||||
else
|
||||
this.bg = this.palette_256[palette_index];
|
||||
}
|
||||
}
|
||||
if (mode_cmd === '2' && sgr_cmds.length > 2) {
|
||||
var r = parseInt(sgr_cmds.shift(), 10);
|
||||
var g = parseInt(sgr_cmds.shift(), 10);
|
||||
var b = parseInt(sgr_cmds.shift(), 10);
|
||||
if ((r >= 0 && r <= 255) && (g >= 0 && g <= 255) && (b >= 0 && b <= 255)) {
|
||||
var c = { rgb: [r, g, b], class_name: 'truecolor' };
|
||||
if (is_foreground)
|
||||
this.fg = c;
|
||||
else
|
||||
this.bg = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
AnsiUp.prototype.transform_to_html = function (fragment) {
|
||||
var txt = fragment.text;
|
||||
if (txt.length === 0)
|
||||
return txt;
|
||||
if (this._escape_for_html)
|
||||
txt = this.escape_txt_for_html(txt);
|
||||
if (!fragment.bold && fragment.fg === null && fragment.bg === null)
|
||||
return txt;
|
||||
var styles = [];
|
||||
var classes = [];
|
||||
var fg = fragment.fg;
|
||||
var bg = fragment.bg;
|
||||
if (fragment.bold)
|
||||
styles.push('font-weight:bold');
|
||||
if (!this._use_classes) {
|
||||
if (fg)
|
||||
styles.push("color:rgb(" + fg.rgb.join(',') + ")");
|
||||
if (bg)
|
||||
styles.push("background-color:rgb(" + bg.rgb + ")");
|
||||
}
|
||||
else {
|
||||
if (fg) {
|
||||
if (fg.class_name !== 'truecolor') {
|
||||
classes.push(fg.class_name + "-fg");
|
||||
}
|
||||
else {
|
||||
styles.push("color:rgb(" + fg.rgb.join(',') + ")");
|
||||
}
|
||||
}
|
||||
if (bg) {
|
||||
if (bg.class_name !== 'truecolor') {
|
||||
classes.push(bg.class_name + "-bg");
|
||||
}
|
||||
else {
|
||||
styles.push("background-color:rgb(" + bg.rgb.join(',') + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
var class_string = '';
|
||||
var style_string = '';
|
||||
if (classes.length)
|
||||
class_string = " class=\"" + classes.join(' ') + "\"";
|
||||
if (styles.length)
|
||||
style_string = " style=\"" + styles.join(';') + "\"";
|
||||
return "<span" + style_string + class_string + ">" + txt + "</span>";
|
||||
};
|
||||
;
|
||||
AnsiUp.prototype.process_hyperlink = function (pkt) {
|
||||
var parts = pkt.url.split(':');
|
||||
if (parts.length < 1)
|
||||
return '';
|
||||
if (!this._url_whitelist[parts[0]])
|
||||
return '';
|
||||
var result = "<a href=\"" + this.escape_txt_for_html(pkt.url) + "\">" + this.escape_txt_for_html(pkt.text) + "</a>";
|
||||
return result;
|
||||
};
|
||||
return AnsiUp;
|
||||
}());
|
||||
function rgx(tmplObj) {
|
||||
var subst = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
subst[_i - 1] = arguments[_i];
|
||||
}
|
||||
var regexText = tmplObj.raw[0];
|
||||
var wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
|
||||
var txt2 = regexText.replace(wsrgx, '');
|
||||
return new RegExp(txt2);
|
||||
}
|
||||
function rgxG(tmplObj) {
|
||||
var subst = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
subst[_i - 1] = arguments[_i];
|
||||
}
|
||||
var regexText = tmplObj.raw[0];
|
||||
var wsrgx = /^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;
|
||||
var txt2 = regexText.replace(wsrgx, '');
|
||||
return new RegExp(txt2, 'g');
|
||||
}
|
||||
//# sourceMappingURL=ansi_up.js.map
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = AnsiUp;
|
||||
}));
|
1
Server/public/js/genie/ansi_up.js.map
Normal file
1
Server/public/js/genie/ansi_up.js.map
Normal file
File diff suppressed because one or more lines are too long
7
Server/public/js/genie/bootstrap.min.js
vendored
Normal file
7
Server/public/js/genie/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
Server/public/js/genie/jquery.min.js
vendored
Normal file
6
Server/public/js/genie/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
Server/public/js/genie/jquery.min.map
Normal file
1
Server/public/js/genie/jquery.min.map
Normal file
File diff suppressed because one or more lines are too long
4
Server/public/js/genie/prism.js
Normal file
4
Server/public/js/genie/prism.js
Normal file
File diff suppressed because one or more lines are too long
4
Server/public/js/genie/static.js
Normal file
4
Server/public/js/genie/static.js
Normal file
@@ -0,0 +1,4 @@
|
||||
$( document ).ready(function() {
|
||||
var ansi_up = new AnsiUp;
|
||||
$("code.language-julia").html(ansi_up.ansi_to_html( $("code.language-julia").text() ));
|
||||
});
|
35
Server/public/js/libraries/cssTools.js
Normal file
35
Server/public/js/libraries/cssTools.js
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
export default class CssTools {
|
||||
|
||||
static applyCSS(element,id,outerclass,classlisthint) {
|
||||
// Return if no CSS to apply
|
||||
if (classlisthint==null || (outerclass==null && id==null)) {
|
||||
return
|
||||
}
|
||||
|
||||
let outerClassNames = outerclass.split(" ").map(x => "."+x)
|
||||
let outerCssSelectors = [...outerClassNames,"#"+id]
|
||||
|
||||
let styleSheets = document.styleSheets
|
||||
let l = styleSheets.length
|
||||
for (let i=0; i<l; i++) {
|
||||
let sheet = styleSheets[i]
|
||||
let name = sheet.href.split("/").at(-1).split(".")[0]
|
||||
if (name===classlisthint) {
|
||||
for (let outerCss of outerCssSelectors) {
|
||||
for (let rule of sheet.cssRules) {
|
||||
if (rule.selectorText==outerCss) {
|
||||
let styleRule = rule.style
|
||||
let vals = Object.values(styleRule)
|
||||
for (let val of vals) {
|
||||
element.style[val] = styleRule[val]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
146
Server/public/js/libraries/mathTools.js
Normal file
146
Server/public/js/libraries/mathTools.js
Normal file
@@ -0,0 +1,146 @@
|
||||
|
||||
// Broadcast array on array
|
||||
export function bAr(fun,ar1,ar2) {
|
||||
var result = new Array(ar1.length)
|
||||
for (var i = 0;i<ar1.length;i++) {
|
||||
result[i] = fun(ar1[i],ar2[i])
|
||||
}
|
||||
return(result)
|
||||
}
|
||||
|
||||
// Broadcast array on a number
|
||||
export function b(fun,ar1,val) {
|
||||
var result = new Array(ar1.length)
|
||||
for (var i = 0;i<ar1.length;i++) {
|
||||
result[i] = fun(ar1[i],val)
|
||||
}
|
||||
return(result)
|
||||
}
|
||||
|
||||
// Broadcast array on a function
|
||||
export function bFun(fun,ar1) {
|
||||
var result = new Array(ar1.length)
|
||||
for (var i = 0;i<ar1.length;i++) {
|
||||
result[i] = fun(ar1[i])
|
||||
}
|
||||
return(result)
|
||||
}
|
||||
|
||||
export function multiply(num1, num2) {
|
||||
let result = num1 * num2;
|
||||
return result;
|
||||
}
|
||||
|
||||
export function sum(ar) {
|
||||
return ar.reduce((a, b) => a + b, 0)
|
||||
}
|
||||
|
||||
export function prod(ar) {
|
||||
return ar.reduce((a, b) => a * b, 1)
|
||||
}
|
||||
|
||||
export function mean(ar) {
|
||||
return ar.reduce((a, b) => a + b, 0)/ar.length
|
||||
}
|
||||
|
||||
export function median(values){
|
||||
if(values.length ===0) throw new Error("No inputs");
|
||||
|
||||
values.sort(function(a,b){
|
||||
return a-b;
|
||||
});
|
||||
|
||||
var half = Math.floor(values.length / 2);
|
||||
|
||||
if (values.length % 2)
|
||||
return values[half];
|
||||
|
||||
return (values[half - 1] + values[half]) / 2.0;
|
||||
}
|
||||
|
||||
export function range(start,end, step = start<end ? 1 : -1) {
|
||||
var arr = []
|
||||
if (step>0) {
|
||||
for (var i = start; i <= end; i += step) {
|
||||
arr.push(i)
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (var i = start; i >= end; i += step) {
|
||||
arr.push(i)
|
||||
}
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
export function numericallyIntegrate(f, a, b, dx) {
|
||||
|
||||
// calculate the number of trapezoids
|
||||
let n = (b - a) / dx
|
||||
|
||||
// define the variable for area
|
||||
let Area = 0
|
||||
|
||||
//loop to calculate the area of each trapezoid and sum.
|
||||
for (let i = 1; i <= n; i++) {
|
||||
//the x locations of the left and right side of each trapezpoid
|
||||
let x0 = a + (i-1)*dx
|
||||
let x1 = a + i*dx
|
||||
|
||||
// the area of each trapezoid
|
||||
let Ai = dx * (f(x0) + f(x1))/ 2.
|
||||
|
||||
// cumulatively sum the areas
|
||||
Area = Area + Ai
|
||||
|
||||
}
|
||||
return Area
|
||||
}
|
||||
|
||||
const randomNormals = () => {
|
||||
let u1 = 0, u2 = 0;
|
||||
//Convert [0,1) to (0,1)
|
||||
while (u1 === 0) u1 = Math.random();
|
||||
while (u2 === 0) u2 = Math.random();
|
||||
const R = Math.sqrt(-2.0 * Math.log(u1));
|
||||
const Θ = 2.0 * Math.PI * u2;
|
||||
return [R * Math.cos(Θ), R * Math.sin(Θ)];
|
||||
};
|
||||
|
||||
export function randomSkewNormal(ξ, ω, α = 0) {
|
||||
const [u0, v] = randomNormals();
|
||||
if (α === 0) {
|
||||
return ξ + ω * u0;
|
||||
}
|
||||
const 𝛿 = α / Math.sqrt(1 + α * α);
|
||||
const u1 = 𝛿 * u0 + Math.sqrt(1 - 𝛿 * 𝛿) * v;
|
||||
const z = u0 >= 0 ? u1 : -u1;
|
||||
return ξ + ω * z;
|
||||
};
|
||||
|
||||
export function percentile(arr, p) {
|
||||
arr.sort(function(a,b){
|
||||
return a-b;
|
||||
});
|
||||
if (arr.length === 0) return 0;
|
||||
if (typeof p !== 'number') throw new TypeError('p must be a number');
|
||||
if (p <= 0) return arr[0];
|
||||
if (p >= 1) return arr[arr.length - 1];
|
||||
|
||||
var index = (arr.length - 1) * p,
|
||||
lower = Math.floor(index),
|
||||
upper = lower + 1,
|
||||
weight = index % 1;
|
||||
|
||||
if (upper >= arr.length) return arr[lower];
|
||||
return arr[lower] * (1 - weight) + arr[upper] * weight;
|
||||
}
|
||||
|
||||
export function smooth(ar,window) {
|
||||
let windowHalf = window/2
|
||||
let windowHalf1 = Math.floor(windowHalf)
|
||||
let windowHalf2 = Math.ceil(windowHalf)
|
||||
for (let i=windowHalf1;i<ar.length-windowHalf2;i++) {
|
||||
ar[i] = mean(ar.slice(i-windowHalf1,i+windowHalf2))
|
||||
}
|
||||
}
|
112
Server/public/js/libraries/miscTools.js
Normal file
112
Server/public/js/libraries/miscTools.js
Normal file
@@ -0,0 +1,112 @@
|
||||
|
||||
export function isObject(v) {
|
||||
return typeof v === 'object' && !Array.isArray(v) && v !== null
|
||||
}
|
||||
|
||||
// Prevents excessive function calling
|
||||
export function debounce(func, timeout){
|
||||
let timer;
|
||||
return (...args) => {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => { func.apply(this, args); }, timeout)
|
||||
}
|
||||
}
|
||||
|
||||
export function svgFromObject(object) {
|
||||
var objectDoc = object.contentDocument;
|
||||
var svgItem = objectDoc.querySelector("path");
|
||||
return svgItem
|
||||
}
|
||||
|
||||
export function rem2px(rem) {
|
||||
let fontSizeString = window.getComputedStyle(document.getElementsByTagName("html")[0]).getPropertyValue('font-size')
|
||||
let fontSize = parseFloat(fontSizeString.substring(0,fontSizeString.length-2))
|
||||
return fontSize * rem
|
||||
}
|
||||
|
||||
export function px2rem(px) {
|
||||
let fontSizeString = window.getComputedStyle(document.getElementsByTagName("html")[0]).getPropertyValue('font-size')
|
||||
let fontSize = parseFloat(fontSizeString.substring(0,fontSizeString.length-2))
|
||||
return px / fontSize
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses canvas.measureText to compute and return the width of the given text of given font in pixels.
|
||||
*
|
||||
* @param {String} text The text to be rendered.
|
||||
* @param {String} font The css font descriptor that text is to be rendered with (e.g. "bold 14px verdana").
|
||||
*
|
||||
* @see https://stackoverflow.com/questions/118241/calculate-text-width-with-javascript/21015393#21015393
|
||||
*/
|
||||
|
||||
export function getTextWidth(text, font) {
|
||||
// re-use canvas object for better performance
|
||||
const canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
|
||||
const context = canvas.getContext("2d");
|
||||
context.font = font;
|
||||
const metrics = context.measureText(text);
|
||||
return metrics.width;
|
||||
}
|
||||
|
||||
function getCssStyle(element, prop) {
|
||||
return window.getComputedStyle(element, null).getPropertyValue(prop);
|
||||
}
|
||||
|
||||
export function getCanvasFont(el = document.body) {
|
||||
const fontWeight = getCssStyle(el, 'font-weight') || 'normal';
|
||||
const fontSize = getCssStyle(el, 'font-size') || '16px';
|
||||
const fontFamily = getCssStyle(el, 'font-family') || 'Times New Roman';
|
||||
|
||||
return `${fontWeight} ${fontSize} ${fontFamily}`;
|
||||
}
|
||||
|
||||
export function validateAge(event,input,callback) {
|
||||
event.returnValue = false
|
||||
var key
|
||||
if (event.type === 'paste') {
|
||||
key = event.clipboardData.getData('text/plain');
|
||||
}
|
||||
else {
|
||||
// Handle key press
|
||||
key = event.keyCode || event.which;
|
||||
key = String.fromCharCode(key);
|
||||
}
|
||||
let keys = ["0","1","2","3","4","5","6","7","8","9"]
|
||||
if (key in keys) {
|
||||
var val = parseFloat(input.value)
|
||||
if (val>120) {
|
||||
input.value = 120
|
||||
}
|
||||
else {
|
||||
input.value = val
|
||||
}
|
||||
if (callback!=undefined) {
|
||||
callback(input.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function validatePosNumber(event,input,callback,max) {
|
||||
event.returnValue = false
|
||||
var key
|
||||
if (event.type === 'paste') {
|
||||
key = event.clipboardData.getData('text/plain');
|
||||
}
|
||||
else {
|
||||
// Handle key press
|
||||
key = event.data;
|
||||
}
|
||||
let keys = ["0","1","2","3","4","5","6","7","8","9"]
|
||||
if (key in keys) {
|
||||
var val = parseFloat(input.value)
|
||||
if (val>max) {
|
||||
input.value = max
|
||||
}
|
||||
if (callback!=undefined) {
|
||||
callback(input.value)
|
||||
}
|
||||
}
|
||||
else {
|
||||
callback(input.value)
|
||||
}
|
||||
}
|
64
Server/public/js/libraries/serverTools.js
Normal file
64
Server/public/js/libraries/serverTools.js
Normal file
@@ -0,0 +1,64 @@
|
||||
|
||||
// Get data from server
|
||||
export function getData(path,callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.overrideMimeType("application/json");
|
||||
xhr.open('GET', path, true);
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4 && xhr.status == "200") {
|
||||
if (callback !== undefined) {
|
||||
callback(xhr.responseText);
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(null);
|
||||
}
|
||||
|
||||
// Parse JSON from given path into a given variable under a given key
|
||||
export function getJSON(variable,key,path) {
|
||||
getData(path,function(response) {
|
||||
// Parse JSON string into object
|
||||
variable[key] = JSON.parse(response);
|
||||
});
|
||||
}
|
||||
|
||||
export function sendData(route,data,callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", route, true)
|
||||
xhr.setRequestHeader('Content-Type', 'application/json')
|
||||
xhr.onreadystatechange = function() {
|
||||
if(xhr.readyState === XMLHttpRequest.DONE) {
|
||||
var status = xhr.status;
|
||||
if (status === 0 || (status >= 200 && status < 400)) {
|
||||
// The request has been completed successfully
|
||||
if (callback !== undefined) {
|
||||
callback(xhr.responseText)
|
||||
}
|
||||
} else {
|
||||
// Oh no! There has been an error with the request!
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(JSON.stringify(data))
|
||||
}
|
||||
|
||||
export function sendText(route,data,callback) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", route, true)
|
||||
xhr.setRequestHeader('Content-Type', 'text/plain')
|
||||
xhr.onreadystatechange = function() {
|
||||
if(xhr.readyState === XMLHttpRequest.DONE) {
|
||||
var status = xhr.status;
|
||||
if (status === 0 || (status >= 200 && status < 400)) {
|
||||
// The request has been completed successfully
|
||||
if (callback !== undefined) {
|
||||
callback(xhr.responseText)
|
||||
}
|
||||
} else {
|
||||
// Oh no! There has been an error with the request!
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send(data)
|
||||
}
|
||||
|
Reference in New Issue
Block a user