Initial commit

This commit is contained in:
dredgy committed 2021-10-23 19:59:20 +10:00
commit ba4c9a7d7a
1851 files changed
+1250444

No files matched your search

@@ -0,0 +1,14 @@
let showLoginBox = () => {
showVirtualNumpad('Enter Login Code', 6, true, false, false, authenticate);
};
let authenticate = (input) => {
let login = ajaxSync('/ajax/authenticateClerk', input);
if (login === 'success')
redirect('/floorplan');
else
showLoginBox();
};
$(() => {
showLoginBox();
});
//# sourceMappingURL=dredgepos.authenticate.js.map
@@ -0,0 +1 @@
{"version":3,"file":"dredgepos.authenticate.js","sourceRoot":"","sources":["../ts/dredgepos.authenticate.ts"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAAG,GAAG,EAAE;IACpB,iBAAiB,CAAC,kBAAkB,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;AAC9E,CAAC,CAAA;AAED,IAAK,YAAY,GAAG,CAAC,KAAc,EAAE,EAAE;IACnC,IAAI,KAAK,GAAG,QAAQ,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAA;IACtD,IAAG,KAAK,KAAK,SAAS;QAClB,QAAQ,CAAC,YAAY,CAAC,CAAA;;QAEtB,YAAY,EAAE,CAAA;AACtB,CAAC,CAAA;AAED,CAAC,CAAC,GAAG,EAAE;IACH,YAAY,EAAE,CAAA;AAClB,CAAC,CAAC,CAAA"}
+96
View File
@@ -0,0 +1,96 @@
let Application = {
keyboard: null,
mode: "default",
languageVars: {}
};
/** Parses a language variable. */
let lang = (key, replacements) => {
let finalValue = Application.languageVars[key];
if (!replacements)
return finalValue;
if (typeof replacements === 'string')
replacements = [replacements];
replacements.forEach((replacement, index) => {
let correctIndex = index + 1;
finalValue = finalValue.replace(`[${correctIndex}]`, replacement);
});
return finalValue;
};
/** Check if a variable is defined */
let defined = (variable) => {
return typeof variable !== 'undefined';
};
/** Call an Ajax function asynchronously */
let ajax = (endpoint, data, method = 'POST', successFunction, errorFunction, beforeFunction) => {
data = (data == null) ? data : JSON.stringify(data);
return $.ajax({
url: endpoint,
method: method,
data: data,
success: (response) => {
if (successFunction)
successFunction(JSON.parse(response.data));
},
error: errorFunction,
beforeSend: beforeFunction
});
};
/*
For the flow of the app, synchronous is commonly preferred
though trying to keep it's usage as low as possible.
*/
let ajaxSync = (endpoint, data, method = 'POST') => {
let response = JSON.parse($.ajax({
url: endpoint,
method: method,
data: JSON.stringify(data),
async: false,
}).responseText);
if (response.data) {
response.data = JSON.parse(response.data);
return response.data;
}
return response;
};
/* Redirect to a specific URL */
let redirect = (url) => {
window.location.href = url;
};
let setLanguageVariables = () => {
Application.languageVars = ajaxSync('/ajax/languageVars', null, 'GET');
};
// @ts-ignore
let alert = (message, title = 'Message') => {
let alertBox = $('#alert');
alertBox.css('display', 'flex');
alertBox.data('value', '');
$('#alertHeading').text(title);
$('#alertMessage').text(message);
$('#alertOk').css('display', 'flex');
$('#alertYes').css('display', 'none');
$('#alertNo').css('display', 'none');
};
// @ts-ignore
let confirm = (message, data, title = 'Confirm', submitFunction = (data) => { hideAlerts(); }) => {
let alert = $('#alert');
$(document).on('click', '#alert #alertYes', () => {
submitFunction(data);
hideAlerts();
$(document).off('click', '#alert #alertYes');
});
alert.css('display', 'flex');
$('#alertHeading').html(title);
$('#alertMessage').html(message);
$('#alertOk').css('display', 'none');
$('#alertYes').css('display', 'flex');
$('#alertNo').css('display', 'flex');
};
let hideAlerts = () => {
$('#alert').hide();
};
$(() => {
let doc = $(document);
setLanguageVariables();
doc.on('click', '#alertNo, #alertOk', () => $('#alert').hide());
});
//# sourceMappingURL=dredgepos.core.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"dredgepos.core.js","sourceRoot":"","sources":["../ts/dredgepos.core.ts"],"names":[],"mappings":"AAAK,IAAI,WAAW,GAAsB;IAClC,QAAQ,EAAG,IAAI;IACf,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,EAAE;CACnB,CAAA;AAGD,kCAAkC;AACjC,IAAI,IAAI,GAAG,C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C,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAA;AACtB,CAAC,CAAA;AAEL,CAAC,CAAE,GAAG,EAAE;IACJ,IAAI,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAA;IACrB,oBAAoB,EAAE,CAAA;IAEtB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AACnE,CAAC,CAAC,CAAA"}
+784
View File
@@ -0,0 +1,784 @@
/// <reference path="./typings/konva.d.ts" />
let stage;
let transformer;
let tableLayer;
let editMode = false;
let activeTables = [];
let selectedTable;
let selectedTableNumber;
let currentRoom;
let basis = 1280;
let scale = 1;
let newTable;
let roomName;
//Makes sure canvas always fits inside the div
function getDimensions(parentDiv) {
let tableMap = $('#tableMap');
let outerWidth = parentDiv.outerWidth();
let outerHeight = parentDiv.outerHeight();
let width = outerWidth;
let height = outerWidth;
if (outerWidth >= outerHeight) {
width = outerHeight;
height = outerHeight;
}
tableMap.height(height);
tableMap.width(width);
scale = width / basis;
return { width: width, height: height };
}
function setupTableMap() {
let doc = $(document);
activeTables = ajaxSync('/ajax/getActiveTables/1', null, 'GET');
let dimensions = getDimensions($('#mapContainer'));
roomName = 'Deck & Courtyard';
stage = new Konva.Stage({
container: 'tableMap',
width: dimensions.width,
height: dimensions.height,
});
$('body').on('click', '.editModeButton', () => { toggleEditMode(); });
$('.roomButton').on('click', function () {
roomName = $(this).text();
loadRoom($(this).data('value'));
});
$('.transferTableButton').on('click', function () {
transferModeOn();
});
$('.addDecoration').on('click', function () {
$('#decorator').css('display', 'flex');
});
$('.deleteDecoration').on('click', function () {
deleteDecoration(selectedDecoration);
});
$('.decoratorItem').on('click', function () {
addDecoration(this);
});
$('.changeShapeButton').on('click', function () {
changeTableShape(selectedTableNumber);
});
$('.reserveTableButton').on('click', function () {
if ($(this).text() === lang('reserve_table')) {
reserveTable();
}
else {
unreserveTable();
}
});
$('.addTableButton').on('click', function () {
addTable();
});
$('.deleteTableButton').on('click', function () {
deleteTable();
});
loadRoom(roomToLoad);
}
let updateTableShape = (tableData) => {
return ajaxSync('/ajax/updateTableShape', tableData);
};
//Change the shape of a table in edit mode.
function changeTableShape(tableNumber) {
let tableData = getTableData(tableNumber);
let tableShape = tableData['shape'];
let tableWidth = tableData['width'];
let tableHeight = tableData['height'];
let tableRotation = tableData['rotation'];
let order = ['square', 'rect', 'longrect', 'diamond', 'circle', 'ellipse', 'longellipse'];
if (order.indexOf(tableShape) === -1)
tableShape = 'square';
//What the next shape is
let currentIndex = order.indexOf(tableShape);
let nextIndex = currentIndex + 1;
if (nextIndex > (order.length) - 1)
nextIndex = 0;
let nextShape = order[nextIndex];
switch (nextShape) {
case 'square':
case 'circle':
tableHeight = tableWidth;
tableRotation = 0;
break;
case 'diamond':
tableHeight = tableWidth;
tableRotation = 45;
break;
case 'rect':
case 'ellipse':
tableHeight = tableWidth * 2;
tableRotation = 0;
break;
case 'longrect':
case 'longellipse':
tableRotation = 90;
break;
}
let updateData = {
table_number: tableNumber,
shape: nextShape,
height: tableHeight,
width: tableWidth,
rotation: tableRotation
};
tableData = updateTableShape(updateData);
let tableGroup = stage.find('#' + tableNumber)[0];
transformer.nodes([]);
tableGroup.destroy();
let newTable = createTableElement(tableData);
tableLayer.add(newTable);
stage.draw();
selectTable(tableNumber);
loadRoom(currentRoom, tableNumber);
}
let createTable = (tableData) => {
return ajaxSync('/ajax/createTable', tableData);
};
let tableExists = (tableNumber) => {
return ajaxSync(`/ajax/tableExists/${tableNumber}`);
};
function addTable(tableNumber) {
if (!tableNumber) {
showVirtualNumpad(lang('new_table_number'), 4, false, false, true, addTable);
}
else {
let newTableInfo = {
table_number: tableNumber,
room_id: currentRoom,
default_covers: 2,
width: 200,
height: 200,
rotation: 0,
pos_x: basis / 2,
pos_y: basis / 2,
shape: 'square',
merged_children: '',
previous_state: '',
status: 0,
reservation: 0,
venue_id: 1
};
let newTableData = createTable(newTableInfo);
if (!newTableData.table_number) {
alert(newTableData);
return false;
}
newTable = createTableElement(newTableData);
tableLayer.add(newTable);
tableLayer.draw();
selectTable(tableNumber);
}
}
function selectTable(tableNumber) {
let table = stage.find('#' + tableNumber)[0];
table.fire('click');
}
function deleteTable(tableNumber = 0) {
if (!tableNumber) {
confirm(lang('confirm_delete_table', selectedTableNumber), selectedTableNumber, 'Confirm', deleteTable);
}
else {
if (tableIsOpen(selectedTableNumber)) {
alert(lang('error_delete_existing_table'));
}
else {
ajax(`/ajax/deleteTable/${selectedTableNumber}`, null, 'GET');
let table = stage.find('#' + tableNumber)[0];
transformer.nodes([]);
table.destroy();
tableLayer.draw();
selectedTable = null;
selectedTableNumber = null;
}
}
}
// Rotate a shape around any point.
// shape is a Konva shape
// angleDegrees is the angle to rotate by, in degrees.
// point is an object {x: posX, y: posY}
function rotateAroundPoint(shape, angleDegrees, point) {
let angleRadians = angleDegrees * Math.PI / 180;
// they lied, I did have to use trigonometry
const x = point.x +
(shape.x() - point.x) * Math.cos(angleRadians) -
(shape.y() - point.y) * Math.sin(angleRadians);
const y = point.y +
(shape.x() - point.x) * Math.sin(angleRadians) +
(shape.y() - point.y) * Math.cos(angleRadians);
shape.rotation(shape.rotation() + angleDegrees); // rotate the shape in place
shape.x(x); // move the rotated shape in relation to the rotation point.
shape.y(y);
}
function createDecoration(data, idToSelect = false) {
let draggable = editMode;
var decoration = new Image();
decoration.onload = function () {
var dec = new Konva.Image({
id: data.decoration_id.toString(),
x: data.decoration_pos_x * scale,
y: data.decoration_pos_y * scale,
image: decoration,
offsetX: data.decoration_width * 0.5 * scale,
offsetY: data.decoration_height * 0.5 * scale,
rotation: data.decoration_rotation,
width: data.decoration_width * scale,
height: data.decoration_height * scale,
draggable: draggable,
});
if (editMode && dec.id() === idToSelect) {
transformer.nodes([dec]);
transformer.moveToTop();
}
dec.on('click', function () {
selectDecoration(this);
});
dec.on('tap', function () {
selectDecoration(this);
});
dec.on('dragend', function () {
saveDecTransformation(this);
});
dec.on('transformend', function () {
saveDecTransformation(this);
});
// add the shape to the layer
tableLayer.add(dec);
tableLayer.draw();
dec.moveToBottom();
};
decoration.src = 'images/decorations/' + data.decoration_image;
return decoration;
}
var selectedDecoration = false;
function selectDecoration(decoration) {
if (editMode) {
if ((transformer.nodes().length > 0 && transformer.nodes()[0] != decoration) || transformer.nodes().length == 0) {
resetActiveTable();
transformer.nodes([decoration]);
decoration.moveToTop();
transformer.moveToTop();
selectedDecoration = decoration;
toggleFloorplanControls();
}
else {
transformer.nodes([]);
selectedDecoration = false;
$('.deleteDecoration').css('display', 'none');
}
}
}
function createTableElement(data, selectTable = false) {
// Create container group
let draggable = editMode || newTable === data.table_number;
let table = new Konva.Group({
x: data.pos_x * scale,
y: data.pos_y * scale,
draggable: draggable,
listening: true,
id: data.table_number.toString()
});
let fillColor = 'gray';
if (data.status === 'reserved') {
fillColor = 'lightgreen';
}
if (activeTables.includes(data.table_number)) {
fillColor = 'lightblue';
}
data.width = data.width * scale;
data.height = data.height * scale;
// Create background shape
let shape;
switch (data.shape) {
case "circle": // fall-through
case "ellipse": // fall-through
case "longellipse":
shape = new Konva.Ellipse({
x: 0,
y: 0,
radiusX: data.width * 0.5,
radiusY: data.height * 0.5,
rotation: data.rotation,
fill: fillColor,
stroke: "black",
strokeWidth: 4,
draggable: false,
listening: true
});
break;
default:
shape = new Konva.Rect({
x: 0,
y: 0,
offsetX: data.width * 0.5,
offsetY: data.height * 0.5,
width: data.width,
height: data.height,
rotation: data.rotation,
fill: fillColor,
stroke: "black",
strokeWidth: 4,
draggable: false,
listening: true
});
break;
} // End switch
// Create label
let label = new Konva.Text({
x: data.width * -0.5,
y: data.height * -0.5,
width: data.width,
height: data.height,
text: data.table_number.toString(),
fontSize: 40 * scale,
fill: "black",
align: "center",
verticalAlign: "middle",
draggable: false,
listening: false
});
tableNumber = data.tablenumber;
table.add(shape, label);
table.on('dblclick', function () {
tableNumber = parseInt(getTableNumber(this));
if (!editMode) {
loadScreen('orderScreen', 'table=' + tableNumber);
}
});
table.on('dbltap', function () {
tableNumber = getTableNumber(this);
loadScreen('orderScreen', 'table=' + tableNumber);
});
table.on('dragend', function () {
saveTransformation(table);
});
innerShape = getTableShape(table);
table.on('click', function () {
selectTableShape(this);
});
table.on('tap', function () {
selectTableShape(this);
});
innerShape.on('transformend', function () {
saveTransformation(table);
});
// add the shape to the layer
tableLayer.add(table);
table.moveToTop();
if (tableNumber === selectedTableNumber) {
selectTable = table;
}
if (selectTable) {
if (selectTable === tableNumber) {
table.fire('click');
}
}
return table;
}
function loadRoom(room, selectTable = 0, selectDecoration = false) {
//if (room === currentRoom) return false
ajax(`/ajax/getRoomData/${room}`, null, 'GET', (response) => {
let floorplanDiv = $('#tableMap');
let backgroundImage = response.background_image;
floorplanDiv.css("background-image", `url(images/rooms/${backgroundImage})`);
floorplanDiv.css("background-size", `${width}px ${height}px`);
}, null, null);
$('.roomButton').removeClass('active');
let selector = ".roomButton:contains('" + roomName + "')";
$(selector).addClass('active');
currentRoom = room;
resetActiveTable();
stage.destroy();
stage = new Konva.Stage({
container: 'tableMap',
width: width,
height: height,
});
transformer = new Konva.Transformer({
rotationSnaps: [0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 225, 270, -15, -30, -45, -60, -75, -90, -105, -120, -135, -150, -165, -180, -225, -270, 360, -360],
anchorSize: 40 * scale,
ignoreStroke: true,
centeredScaling: true
});
let tablesAndDecorations = ajaxSync(`/ajax/getTablesAndDecorations/${room}`, null, 'GET');
let decorations = tablesAndDecorations['decorations'];
let tables = tablesAndDecorations['tables'];
tableLayer = new Konva.Layer();
tableLayer.add(transformer);
// Loop data and call the creation method for each decoration/table.
decorations.forEach(itemData => {
createDecoration(itemData, selectDecoration);
});
tables.forEach(itemData => {
tableLayer.add(createTableElement(itemData, selectTable));
});
activeTables = getOpenTables();
stage.add(tableLayer);
}
var mergeMode = false;
var parentMergeTable;
var childMergeTable;
var tableTransferOrigin;
var transferMode = false;
function transferModeOn() {
mergeModeOff();
if (!transferMode) {
tableTransferOrigin = selectedTableNumber;
transferMode = true;
$('.transferTableButton').addClass('active');
$('.transferTableButton').text('Select a table to transfer items to');
}
else {
transferModeOff();
}
}
function transferModeOff() {
transferMode = false;
$('.transferTableButton').removeClass('active');
$('.transferTableButton').text(lang('transfer_table'));
}
let getOpenTables = () => {
return ajaxSync('/ajax/getActiveTables/1', null, 'GET');
};
let transferTableAjax = (origin, destination) => {
ajax(`/ajax/transferTables/${origin}/${destination}`, null, 'GET');
};
function transferTables() {
destination = selectedTableNumber;
origin = tableTransferOrigin;
if (destination !== origin) {
transferTableAjax(origin, destination);
activeTables = getOpenTables();
transferModeOff();
getTableShape(selectedTable).fill('lightblue');
getTableShape(getTableGroup(origin)).fill('gray');
}
else {
alert("Can't transfer a table to itself.");
transferModeOff();
}
}
function mergeModeOn() {
transferModeOff();
if (!mergeMode) {
mergeMode = true;
$('.mergeButton').addClass('active');
$('.mergeButton').text('Select a table to merge with Table ' + selectedTableNumber);
parentMergeTable = selectedTableNumber;
}
else {
mergeModeOff();
}
}
function mergeModeOff() {
mergeMode = false;
$('.mergeButton').removeClass('active');
$('.mergeButton').text(lang('merge_table'));
}
let ajaxMergeTables = (parent, child) => {
return ajaxSync(`/ajax/mergeTables/${parent}/${child}`, null, 'GET');
};
let ajaxUnmergeTable = (parent) => {
return ajaxSync(`/ajax/unmergeTable/${parent}`, null, 'GET');
};
function mergeTables() {
parentMergeTable = parseInt(parentMergeTable);
childMergeTable = parseInt(childMergeTable);
if (childMergeTable !== parentMergeTable) {
let result = ajaxMergeTables(parentMergeTable, childMergeTable);
mergeModeOff();
loadRoom(currentRoom);
newTable = getTableGroup(parentMergeTable);
newTable.draggable(true);
if (tableIsOpen(parentMergeTable)) {
getTableShape(newTable).fill('lightblue');
}
}
else {
alert("Can't merge a table with itself!");
mergeModeOff();
}
}
//When a table is passed (a group of the shape plus the text), returns the number as string.
function getTableNumber(tableGroup) {
textItem = tableGroup.getChildren()[1];
return textItem.getText();
}
function getTableGroup(tableNumber) {
return stage.find('#' + tableNumber)[0];
}
function getTableShape(tableGroup) {
return tableGroup.getChildren()[0];
}
function getReservation(id) {
return ajaxSync('/ajax/getReservation', id);
}
//When a user selects a table.
function selectTableShape(table) {
let tableNumber = getTableNumber(table);
let shape = getTableShape(table);
let strokeColor = shape.stroke();
selectedTable = table;
selectedTableNumber = tableNumber;
if (transferMode)
transferTables();
if (mergeMode) {
childMergeTable = tableNumber;
mergeTables();
}
else {
//If table is not selected
if (strokeColor !== "yellow") {
let tableData = getTableData(selectedTableNumber);
let coverNumberString = lang('covers', tableData.default_covers.toString());
let tableString = '<b>' + lang('activeTable', selectedTableNumber.toString()) + '</b>';
$('.reserveTableButton').text(lang('reserve_table'));
if (tableData.status === 'reserved') {
let reservation = getReservation(tableData.reservation_id);
console.log(reservation);
$('.reserveTableButton').text(lang('unreserve_table'));
if (reservation.reservation_name) {
reservationString = lang('reserved_for', reservation.reservation_name);
}
else {
reservationString = lang('reserved');
}
tableString += '<small>' + reservationString + '</small>';
}
tableString += "<small> (" + coverNumberString + ")</small>";
$('.currentTable').html(tableString);
stage.find('Rect').forEach(function (rect, index) {
rect.stroke("black");
});
stage.find('Ellipse').forEach(function (circ, index) {
circ.stroke("black");
});
shape.stroke("yellow");
toggleEditControls(true);
if (editMode) {
toggleFloorplanControls();
$('.deleteDecoration').css('display', 'none');
transformer.nodes([getTableShape(table)]);
table.moveToTop();
transformer.moveToTop();
}
tableLayer.draw();
//If the table is already selected
}
else {
resetActiveTable();
transformer.nodes([]);
tableLayer.draw();
}
}
}
let getTableData = (tableNumber) => {
return ajaxSync('/ajax/getTableData', tableNumber);
};
let isTableMerged = (tableNumber) => {
let mergeData = getTableData(tableNumber).merged_children;
return mergeData !== "";
};
function resetActiveTable() {
if (!transferMode) {
if (selectedTable) {
getTableShape(selectedTable).stroke('black');
}
selectedTable = null;
selectedTableNumber = "";
toggleFloorplanControls(false, editMode);
toggleEditControls(false);
}
else {
$('.editControls').css('display', 'none');
}
}
function addDecoration(button) {
let insertData = {
decoration_room: currentRoom,
basis: basis,
decoration_image: $(button).data('image')
};
ajaxSync('/ajax/addDecoration', insertData);
$('#decorator').css('display', 'none');
selectedDecoration = false;
loadRoom(currentRoom);
}
function deleteDecoration(decoration) {
ajax('/ajax/deleteDecoration', decoration.id());
$('.deleteDecoration').css('display', 'none');
decoration.destroy();
selectedDecoration = false;
transformer.nodes([]);
}
function saveDecTransformation(decoration) {
let newData = {
decoration_id: decoration.id(),
decoration_pos_x: decoration.x() / scale,
decoration_pos_y: decoration.y() / scale,
decoration_width: parseInt((decoration.scaleX() * decoration.width()) / scale),
decoration_height: parseInt((decoration.scaleY() * decoration.height()) / scale),
decoration_rotation: parseInt(decoration.rotation()),
decoration_image: decodeURIComponent(decoration.image().src),
decoration_room: currentRoom
};
if (editMode) {
idToSelect = decoration.id();
}
ajax('/ajax/updateDecoration', newData);
}
//When a table has been resized, rotated etc.
function saveTransformation(table) {
tableNumber = getTableNumber(table);
shape = getTableShape(table);
newRotation = parseInt(shape.rotation());
newWidth = parseInt(shape.scaleX() * shape.width() / scale);
newHeight = parseInt((shape.scaleY() * shape.height()) / scale);
newXPos = parseInt(table.x() / scale);
newYPos = parseInt(table.y() / scale);
updateData = {
table_number: tableNumber,
rotation: newRotation,
width: newWidth,
height: newHeight,
pos_x: newXPos,
pos_y: newYPos
};
transformTable(updateData);
}
let transformTable = (tableData) => {
return ajax("/ajax/transformTable", tableData);
};
function unmergeTable() {
ajaxUnmergeTable(selectedTableNumber);
loadRoom(currentRoom);
}
function reserveTable(covers) {
if (!covers) {
showVirtualNumpad(lang('how_many_covers'), 2, false, false, true, reserveTable);
}
else {
let table = getTableGroup(selectedTableNumber);
let newReservation = ajaxSync('/ajax/newEmptyReservation', selectedTableNumber);
table.fire('click');
let tableShape = getTableShape(table);
tableShape.fill('lightgreen');
table.draw();
table.fire('click');
completeReservation(newReservation);
}
}
function unreserveTable(input) {
if (!input) {
confirm(lang('confirm_delete_reservation', selectedTableNumber), selectedTableNumber, lang('confirm'), unreserveTable);
}
else {
ajaxSync('/ajax/unreserveTable', input);
hideAlerts();
table = getTableGroup(input);
table.fire('click');
tableShape = getTableShape(table);
tableShape.fill('gray');
table.draw();
table.fire('click');
}
}
function completeReservation(resName) {
if (!resName) {
showVirtualKeyboard(lang('enter_reservation_name'));
}
else {
//callPhpFunction('updateTableMapTable', [selectedTableNumber, 'reservation_name', resName]);
loadRoom(currentRoom, selectedTableNumber);
}
}
function toggleEditMode() {
let editModeButton = $('.editModeButton');
if (editMode === true) {
editMode = false;
loadRoom(currentRoom);
editModeButton.removeClass('active');
editModeButton.html(lang('edit_floorplan'));
toggleFloorplanControls(false);
if (selectedTable)
selectedTable.fire('click');
stage.find('Group').forEach(function (table, index) {
table.draggable(false);
});
}
else {
editMode = true;
stage.find('Group').forEach(function (table, index) {
table.draggable(true);
if (getTableShape(table).stroke() === "yellow") {
table.moveToTop();
transformer.nodes([getTableShape(table)]);
transformer.moveToTop();
}
});
stage.find('Image').forEach(function (img, index) {
img.draggable(true);
});
toggleFloorplanControls();
transformer.moveToTop();
tableLayer.draw();
editModeButton.addClass('active');
editModeButton.html(lang('stop_edit_floorplan'));
}
}
function toggleFloorplanControls(onOrOff = true, subControlsOnly = false) {
if (onOrOff || subControlsOnly) {
$('.floorplanControls').css('visibility', 'visible');
}
else {
$('.floorplanControls').css('visibility', 'hidden');
}
if (selectedTable) {
$('.changeShapeButton').css('visibility', 'visible');
$('.deleteTableButton').css('visibility', 'visible');
}
else {
$('.changeShapeButton').css('visibility', 'hidden');
$('.deleteTableButton').css('visibility', 'hidden');
}
if (selectedDecoration) {
$('.deleteDecoration').css('display', 'flex');
}
else {
$('.deleteDecoration').css('display', 'none');
}
}
let tableIsOpen = (tableNumber) => {
return ajaxSync(`/ajax/tableIsOpen/${tableNumber}`, null, 'GET');
};
function toggleEditControls(onOrOff = true) {
if (onOrOff) {
$('.editControls').css("display", "flex");
if (isTableMerged(selectedTableNumber)) {
$('.mergeControls').css("visibility", "visible");
$('.unmergeButton').css('display', 'flex');
$('.mergeButton').css('display', 'flex');
}
else {
$('.mergeControls').css("visibility", "visible");
$('.mergeButton').css('display', 'flex');
$('.unmergeButton').css('display', 'none');
}
if (tableIsOpen(selectedTableNumber)) {
$('.payTableButton').css('display', 'flex');
$('.viewTableButton').css('display', 'flex');
$('.reserveTableButton').css('display', 'none');
$('.transferTableButton').css('display', 'flex');
}
else {
$('.payTableButton').css('display', 'none');
$('.viewTableButton').css('display', 'none');
$('.reserveTableButton').css('display', 'flex');
$('.transferTableButton').css('display', 'none');
}
}
else {
$('.editControls').css("display", "none");
$('.mergeControls').css("visibility", "hidden");
$('.mergeButton').css("display", "none");
$('.unmergeButton').css("display", "none");
}
}
//# sourceMappingURL=dredgepos.floorplan.js.map
@@ -0,0 +1 @@
{"version":3,"file":"dredgepos.floorplan.js","sourceRoot":"","sources":["../ts/dredgepos.floorplan.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,IAAI,KAAmB,CAAA;AACvB,IAAI,WAA8B,CAAC;AACnC,IAAI,UAAuB,CAAC;AAC5B,IAAI,QAAQ,GAAG,KAAK,CAAC;AACrB,IAAI,YAAY,GAAc,EAAE,CAAC;AACjC,IAAI,aAAqB,CAAC;AAC1B,IAAI,mBAA4B,CAAC;AACjC,IAAI,WAAoB,CAAC;AACzB,IAAI,KAAK,GAAG,IAAI,CAAC;AACjB,IAAI,KAAK,GAAY,CAAC,CAAC;AACvB,IAAI,QAAiB,CAAC;AACtB,IAAI,QAAiB,CAAC;AAEtB,8CAA8C;AAC9C,SAAS,aAAa,CAAC,SAAkB;IACrC,IAAI,QAAQ,GAAG,CAAC,CAAC,WAAW,CAAC,CAAA;IAC7B,IAAI,UAAU,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC;IACxC,IAAI,WAAW,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE1C,IAAI,KAAK,GAAG,UAAU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QAAQ,EAAE,CAAC;YACX,KAAK,EAAE,KAAK,GAAG,CAAC;YAChB,KAAK,EAAE,KAAK,GAAG,CAAC;YAChB,KAAK,EAAE,QAAQ;YACf,eAAe,EAAG,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,CAAC;YACd,Line truncated
+10881
View File
File diff suppressed because it is too large. Load diff
+216
View File
@@ -0,0 +1,216 @@
let showVirtualNumpad = (heading, maxlength = 4, isPassword, allowDecimals = true, allowClose = true, submitFunction) => {
let numpad = $('#virtualNumpad');
let inputBox = $('#virtualNumpadInput');
let closeKeyboardButton = $('.closeKeyboards');
numpad.css('display', 'flex');
let showCloseButton = allowClose ? 'flex' : 'none';
closeKeyboardButton.css('display', showCloseButton);
$('#virtualNumpadHeading').html(heading);
/*
The numpad always submits to a function.
If a function isn't specified, it will submit
to the same function that called it
*/
numpad.data('value', '');
inputBox.text('');
numpad.data('maxlength', maxlength);
numpad.data('submitfunction', submitFunction);
numpad.data('password', isPassword);
numpad.data('allowdecimals', allowDecimals);
$(document).unbind('keyup');
$(document).keyup(e => {
let key = e.key;
switch (key) {
case 'Backspace':
case 'Delete':
key = 'clear';
break;
case 'Enter':
key = 'submit';
break;
}
virtualNumpadInput(key);
});
};
let hideVirtualKeyboard = () => {
let keyboard = $('#virtualKeyboard');
keyboard.hide();
$('#virtualKeyboardHeading').html('');
$(document).unbind('keyup');
};
let hideVirtualNumpad = () => {
let numpad = $('#virtualNumpad');
numpad.css('display', 'none');
$('#virtualNumpadHeading').html('');
$(document).unbind('keyup');
};
let virtualNumpadInput = (input) => {
let inputBox = $('#virtualNumpadInput');
let numpad = $('#virtualNumpad');
let maxlength = numpad.data('maxlength');
let allowDecimals = numpad.data('allowdecimals');
let submitFunction = numpad.data('submitfunction');
let allowedValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'submit', 'clear'];
let currentValue = numpad.data('value').toString();
//Test
if (allowDecimals)
allowedValues.push('.', ',');
let validInput = allowedValues.includes(input);
//If the input is a valid number, decimal point or command.
if (validInput) {
switch (input) {
case 'submit':
hideVirtualNumpad();
let numpadValue = numpad.data('value').length > 0 ? numpad.data('value') : "0";
submitFunction(numpadValue);
break;
case 'clear':
clearNumpadInput();
break;
default:
let newText = currentValue + input;
let isPassword = numpad.data('password');
let length = input.length + inputBox.text().length;
if (length <= maxlength) {
inputBox.append(isPassword ? '*' : input);
numpad.data('value', newText);
}
}
}
};
let clearNumpadInput = () => {
$('#virtualNumpadInput').text("");
$('#virtualNumpad').data('value', '');
};
let setupVirtualNumpad = () => {
$(document).on('click', '.virtualNumpadButton', e => {
virtualNumpadInput($(e.target).data('value').toString());
});
$('.closeKeyboards').on('click', () => {
hideVirtualKeyboard();
hideVirtualNumpad();
});
};
let setupVirtualKeyboard = () => {
Application.keyboard = {
capsLock: false,
shift: false,
layout: 'default'
};
$(document).on('click', '.virtualKeyboardButton', e => {
virtualKeyboardInput($(e.target).data('value'));
});
setKeyboardLayout('default');
};
let showVirtualKeyboard = (heading, maxlength = 32, isPassword = false, submitFunction = () => {
hideVirtualKeyboard();
}) => {
let keyboard = $('#virtualKeyboard');
let inputBox = $('#virtualKeyboardInput');
keyboard.css('display', 'flex');
$('#virtualKeyboardHeading').html(heading);
keyboard.data('value', '');
inputBox.text('');
keyboard.data('maxlength', maxlength);
keyboard.data('password', isPassword);
keyboard.data('submitfunction', submitFunction);
$(document).off('keyup');
$(document).on('keyup', e => {
let key = e.key;
if (key == 'Enter')
key = 'submit';
virtualKeyboardInput(key);
});
};
let virtualKeyboardInput = (input) => {
let inputBox = $('#virtualKeyboardInput');
let keyboard = $('#virtualKeyboard');
let maxlength = keyboard.data('maxlength');
let isPassword = keyboard.data('password');
let length = input.length + inputBox.text().length;
switch (input.toLowerCase()) {
case 'backspace':
case 'delete':
let newText = inputBox.text().slice(0, -1);
inputBox.text(newText);
keyboard.data('value', newText);
break;
case 'submit':
hideVirtualKeyboard();
let submitFunction = keyboard.data('submitfunction');
submitFunction();
break;
case 'shift':
if (Application.keyboard.capsLock)
break;
Application.keyboard.shift = !Application.keyboard.shift;
Application.keyboard.capsLock = false;
setKeyboardLayout('default', Application.keyboard.shift ? 'shift' : '');
break;
case 'capslock':
Application.keyboard.shift = false;
Application.keyboard.capsLock = !Application.keyboard.capsLock;
let capsLockButton = $('[data-value="capslock"]');
capsLockButton.toggleClass('active');
setKeyboardLayout('default', Application.keyboard.capsLock ? 'shift' : '');
break;
case 'space':
input = ' ';
break;
}
//Stops keys such as F5 being pressed.
if (input.length == 1) {
if (Application.keyboard.shift || Application.keyboard.capsLock) {
input = input.toUpperCase();
}
let newText = inputBox.text() + input;
keyboard.data('value', newText);
inputBox.text(newText);
//If shift, reload lowercase
if (Application.keyboard.shift) {
Application.keyboard.shift = false;
setKeyboardLayout('default');
}
}
};
let setKeyboardLayout = (layout, modifier = '') => {
let keyboardLayout = ajaxSync('/languages/english/keyboardLayout.json', null, 'get');
if (modifier != '')
modifier = `_${modifier}`;
$('.virtualKeyboardRow').each((index, row) => {
/*
We start at 1 instead of 0. Makes it easier for non-programmers
and translators making their own language packs
*/
index = index + 1;
let currentRow = keyboardLayout[layout]["row" + index + modifier];
$(row).children('a').each((keyIndex, button) => {
let key = $(button);
let keyValue = currentRow[keyIndex];
/*
KeyText is the text that appears
in the button. KeyData is the value
submitted when the button is pressed.
*/
let keyText = keyValue;
let keyData = keyValue;
key.addClass('posButton');
key.addClass('virtualKeyboardButton');
let pattern = new RegExp(/\[([^)]+)\]/);
let matches = keyValue.match(pattern);
if (matches) {
keyText = keyValue.replace(pattern, '');
keyData = matches[1];
}
key.html(keyText);
//Use attr() as some keys have CSS dependent on data-value
key.attr('data-value', keyData);
key.data('value', keyData);
});
});
};
$(() => {
setupVirtualNumpad();
setupVirtualKeyboard();
});
//# sourceMappingURL=keyboards.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"keyboards.js","sourceRoot":"","sources":["../ts/keyboards.ts"],"names":[],"mappings":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AC,CAAA;IACpC,IAAI,QAAQ,GAAG,CAAC,CAAC,uBAAuB,CAAC,CAAA;IAEzC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAA;IAC/B,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAE1C,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjB,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IACrC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IACrC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAA;IAE/C,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACxB,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;QACxB,IAAI,GAAG,GAAG,CAAC,CAAC,GAAG,CAAA;QACf,IAAI,GAAG,IAAI,OAAO;YACd,GAAG,GAAG,QAAQ,CAAA;QAElB,oBAAoB,CAAC,GAAG,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAEA,IAAI,oBAAoB,GAAG,CAAC,KAAa,EAAE,EAAE;IAC1C,IAAI,QAAQLine truncated
File diff suppressed because it is too large. Load diff
+12
View File
@@ -0,0 +1,12 @@
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Konva=e()}(this,(function(){"use strict";
/*
* Konva JavaScript Framework v8.1.1
* http://konvajs.org/
* Licensed under the MIT
* Date: Thu Jul 01 2021
*
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
*
* @license
*/var t=Math.PI/180;const e="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},i={_global:e,version:"8.1.1",isBrowser:"undefined"!=typeof window&&("[object Window]"==={}.toString.call(window)||"[object global]"==={}.toString.call(window)),isUnminified:/param/.test(function(t){}.toString()),dblClickWindow:400,getAngle:e=>i.angleDeg?e*t:e,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>i.DD.isDragging,isDragReady:()=>!!i.DD.node,document:e.document,_injectGlobal(t){e.Konva=t}},r=t=>{i[t.prototype.getClassName()]=t};i._injectGlobal(i);class a{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new a(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var e=this.m;return{x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}}translate(t,e){return this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e,this}scale(t,e){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e,this}rotate(t){var e=Math.cos(t),i=Math.sin(t),r=this.m[0]*e+this.m[2]*i,a=this.m[1]*e+this.m[3]*i,n=this.m[0]*-i+this.m[2]*e,s=this.m[1]*-i+this.m[3]*e;return this.m[0]=r,this.m[1]=a,this.m[2]=n,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,e){var i=this.m[0]+this.m[2]*e,r=this.m[1]+this.m[3]*e,a=this.m[2]+this.m[0]*t,n=this.m[3]+this.m[1]*t;return this.m[0]=i,this.m[1]=r,this.m[2]=a,this.m[3]=n,this}multiply(t){var e=this.m[0]*t.m[0]+this.m[2]*t.m[1],i=this.m[1]*t.m[0]+this.m[3]*t.m[1],r=this.m[0]*t.m[2]+this.m[2]*t.m[3],a=this.m[1]*t.m[2]+this.m[3]*t.m[3],n=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=e,this.m[1]=i,this.m[2]=r,this.m[3]=a,this.m[4]=n,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),e=this.m[3]*t,i=-this.m[1]*t,r=-this.m[2]*t,a=this.m[0]*t,n=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=e,this.m[1]=i,this.m[2]=r,this.m[3]=a,this.m[4]=n,this.m[5]=s,this}getMatrix(){return this.m}setAbsolutePosition(t,e){var i=this.m[0],r=this.m[1],a=this.m[2],n=this.m[3],s=this.m[4],o=(i*(e-this.m[5])-r*(t-s))/(i*n-r*a),h=(t-s-a*o)/i;return this.translate(h,o)}decompose(){var t=this.m[0],e=this.m[1],i=this.m[2],r=this.m[3],a=t*r-e*i;let n={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=t||0!=e){var s=Math.sqrt(t*t+e*e);n.rotation=e>0?Math.acos(t/s):-Math.acos(t/s),n.scaleX=s,n.scaleY=a/s,n.skewX=(t*i+e*r)/a,n.skewY=0}else if(0!=i||0!=r){var o=Math.sqrt(i*i+r*r);n.rotation=Math.PI/2-(r>0?Math.acos(-i/o):-Math.acos(i/o)),n.scaleX=a/o,n.scaleY=o,n.skewX=0,n.skewY=(t*i+e*r)/a}return n.rotation=c._getRotation(n.rotation),n}}var n=Math.PI/180,s=180/Math.PI,o={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,1Line truncated
+1
View File
@@ -0,0 +1 @@
//# sourceMappingURL=types.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../ts/types.ts"],"names":[],"mappings":""}