Converted to SASS
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
let showLoginBox = () => {
|
||||
showVirtualNumpad('Enter Login Code', 6, true, false, false, authenticate);
|
||||
};
|
||||
let showLoginBox = () => showVirtualNumpad('Enter Login Code', 6, true, false, false, authenticate);
|
||||
let authenticate = (input) => {
|
||||
let login = ajaxSync('/ajax/authenticateClerk', input);
|
||||
if (login === 'success')
|
||||
|
||||
@@ -1 +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"}
|
||||
{"version":3,"file":"dredgepos.authenticate.js","sourceRoot":"","sources":["../ts/dredgepos.authenticate.ts"],"names":[],"mappings":"AAAA,IAAI,YAAY,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,kBAAkB,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAA;AAEnG,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"}
|
||||
@@ -35,6 +35,8 @@ const setupFloorplanEvents = () => {
|
||||
};
|
||||
const roomButtonClicked = (e) => {
|
||||
const button = $(e.target);
|
||||
$('.roomButton').removeClass('active');
|
||||
button.addClass('active');
|
||||
const roomId = button.data('value');
|
||||
loadRoom(getRoomById(roomId));
|
||||
};
|
||||
@@ -458,7 +460,7 @@ const setupKonva = () => {
|
||||
if (Floorplan.stage !== null)
|
||||
Floorplan.stage.destroy();
|
||||
Floorplan.stage = new Konva.Stage({
|
||||
container: 'tableMap',
|
||||
container: 'floorplanCanvas',
|
||||
width: dimensions.width,
|
||||
height: dimensions.height,
|
||||
});
|
||||
@@ -620,19 +622,17 @@ const tableTransferred = (tables) => {
|
||||
redrawTable(getTableGroupFromTableNumber(destination.table_number));
|
||||
};
|
||||
const getDimensions = () => {
|
||||
Floorplan.floorplanDiv = $('#tableMap');
|
||||
const parentDiv = $('#mapContainer');
|
||||
Floorplan.floorplanDiv = $('#floorplanCanvas');
|
||||
const parentDiv = $('#floorplanCenterColumn .middleCell');
|
||||
const outerWidth = parentDiv.outerWidth();
|
||||
const outerHeight = parentDiv.outerHeight();
|
||||
let width = outerWidth;
|
||||
let height = outerWidth;
|
||||
if (outerWidth >= outerHeight) {
|
||||
width = outerHeight;
|
||||
height = outerHeight;
|
||||
Floorplan.floorplanDiv.css('height', '100%');
|
||||
}
|
||||
Floorplan.floorplanDiv.height(height);
|
||||
Floorplan.floorplanDiv.width(width);
|
||||
Floorplan.visualScale = width / Floorplan.visualScaleBasis;
|
||||
return { width: width, height: height };
|
||||
else {
|
||||
Floorplan.floorplanDiv.css('width', '100%');
|
||||
}
|
||||
Floorplan.visualScale = Floorplan.floorplanDiv.width() / Floorplan.visualScaleBasis;
|
||||
return { width: Floorplan.floorplanDiv.width(), height: Floorplan.floorplanDiv.height() };
|
||||
};
|
||||
//# sourceMappingURL=dredgepos.floorplan.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -102,9 +102,7 @@ let setupVirtualKeyboard = (keyboardLayouts) => {
|
||||
});
|
||||
setKeyboardLayout('default');
|
||||
};
|
||||
let showVirtualKeyboard = (heading, maxlength = 32, isPassword = false, submitFunction = () => {
|
||||
hideVirtualKeyboard();
|
||||
}) => {
|
||||
let showVirtualKeyboard = (heading, maxlength = 32, isPassword = false, submitFunction = () => { hideVirtualKeyboard(); }) => {
|
||||
let keyboard = $('#virtualKeyboard');
|
||||
let inputBox = $('#virtualKeyboardInput');
|
||||
keyboard.css('display', 'flex');
|
||||
@@ -114,12 +112,13 @@ let showVirtualKeyboard = (heading, maxlength = 32, isPassword = false, submitFu
|
||||
keyboard.data('maxlength', maxlength);
|
||||
keyboard.data('password', isPassword);
|
||||
keyboard.data('submitfunction', submitFunction);
|
||||
$(document).off('keyup');
|
||||
inputBox.trigger('focus');
|
||||
$(document).on('keyup', e => {
|
||||
let key = e.key;
|
||||
if (key == 'Enter')
|
||||
if (key == 'Enter' && inputBox.val().toString().length > 0) {
|
||||
key = 'submit';
|
||||
virtualKeyboardInput(key);
|
||||
virtualKeyboardInput(key);
|
||||
}
|
||||
});
|
||||
};
|
||||
let virtualKeyboardInput = (input) => {
|
||||
@@ -132,13 +131,13 @@ let virtualKeyboardInput = (input) => {
|
||||
case 'backspace':
|
||||
case 'delete':
|
||||
let newText = inputBox.text().slice(0, -1);
|
||||
inputBox.text(newText);
|
||||
inputBox.val(newText);
|
||||
keyboard.data('value', newText);
|
||||
break;
|
||||
case 'submit':
|
||||
hideVirtualKeyboard();
|
||||
let submitFunction = keyboard.data('submitfunction');
|
||||
submitFunction(inputBox.text());
|
||||
submitFunction(inputBox.val());
|
||||
break;
|
||||
case 'shift':
|
||||
if (Application.keyboard.capsLock)
|
||||
@@ -162,15 +161,15 @@ let virtualKeyboardInput = (input) => {
|
||||
if (input.length == 1) {
|
||||
if (Application.keyboard.shift || Application.keyboard.capsLock) {
|
||||
input = input.toUpperCase();
|
||||
//If shift, reload lowercase
|
||||
if (Application.keyboard.shift) {
|
||||
Application.keyboard.shift = false;
|
||||
setKeyboardLayout('default');
|
||||
}
|
||||
}
|
||||
let newText = inputBox.text() + input;
|
||||
let newText = inputBox.val() + input;
|
||||
keyboard.data('value', newText);
|
||||
inputBox.text(newText);
|
||||
//If shift, reload lowercase
|
||||
if (Application.keyboard.shift) {
|
||||
Application.keyboard.shift = false;
|
||||
setKeyboardLayout('default');
|
||||
}
|
||||
inputBox.val(newText);
|
||||
}
|
||||
};
|
||||
let setKeyboardLayout = (layout, modifier = '') => {
|
||||
@@ -184,6 +183,7 @@ let setKeyboardLayout = (layout, modifier = '') => {
|
||||
and translators making their own language packs
|
||||
*/
|
||||
index = index + 1;
|
||||
// @ts-ignore
|
||||
let currentRow = layoutToLoad[`row${index}${modifier}`];
|
||||
$(row).children('a').each((keyIndex, button) => {
|
||||
let key = $(button);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,4 @@
|
||||
let showLoginBox = () => {
|
||||
showVirtualNumpad('Enter Login Code', 6, true, false, false, authenticate)
|
||||
}
|
||||
let showLoginBox = () => showVirtualNumpad('Enter Login Code', 6, true, false, false, authenticate)
|
||||
|
||||
let authenticate = (input : string) => {
|
||||
let login = ajaxSync('/ajax/authenticateClerk', input)
|
||||
|
||||
@@ -72,6 +72,8 @@ const setupFloorplanEvents = () => {
|
||||
|
||||
const roomButtonClicked = (e: Event) => {
|
||||
const button = $(e.target)
|
||||
$('.roomButton').removeClass('active')
|
||||
button.addClass('active')
|
||||
const roomId = button.data('value')
|
||||
loadRoom(getRoomById(roomId))
|
||||
}
|
||||
@@ -600,7 +602,7 @@ const setupKonva = () => {
|
||||
if(Floorplan.stage !== null) Floorplan.stage.destroy()
|
||||
|
||||
Floorplan.stage = new Konva.Stage({
|
||||
container: 'tableMap',
|
||||
container: 'floorplanCanvas',
|
||||
width: dimensions.width,
|
||||
height: dimensions.height,
|
||||
})
|
||||
@@ -802,22 +804,20 @@ const tableTransferred = (tables: Record<"origin"|"destination", table>) => {
|
||||
|
||||
const getDimensions = () => {
|
||||
|
||||
Floorplan.floorplanDiv = $('#tableMap')
|
||||
const parentDiv = $('#mapContainer')
|
||||
Floorplan.floorplanDiv = $('#floorplanCanvas')
|
||||
const parentDiv = $('#floorplanCenterColumn .middleCell')
|
||||
const outerWidth = parentDiv.outerWidth()
|
||||
const outerHeight = parentDiv.outerHeight()
|
||||
|
||||
let width = outerWidth;
|
||||
let height = outerWidth;
|
||||
|
||||
|
||||
if (outerWidth >= outerHeight) {
|
||||
width = outerHeight
|
||||
height = outerHeight
|
||||
Floorplan.floorplanDiv.css('height', '100%')
|
||||
} else {
|
||||
Floorplan.floorplanDiv.css('width','100%')
|
||||
}
|
||||
|
||||
Floorplan.floorplanDiv.height(height)
|
||||
Floorplan.floorplanDiv.width(width)
|
||||
Floorplan.visualScale = width / Floorplan.visualScaleBasis
|
||||
Floorplan.visualScale = Floorplan.floorplanDiv.width() / Floorplan.visualScaleBasis
|
||||
|
||||
return {width: width, height:height}
|
||||
return {width: Floorplan.floorplanDiv.width(), height:Floorplan.floorplanDiv.height()}
|
||||
}
|
||||
@@ -129,9 +129,7 @@ let showVirtualNumpad = (heading: string, maxlength = 4, isPassword: boolean, al
|
||||
setKeyboardLayout('default')
|
||||
}
|
||||
|
||||
let showVirtualKeyboard = (heading: string, maxlength = 32, isPassword = false, submitFunction :Function = () => {
|
||||
hideVirtualKeyboard()
|
||||
}) => {
|
||||
let showVirtualKeyboard = (heading: string, maxlength = 32, isPassword = false, submitFunction :Function = () => {hideVirtualKeyboard()}) => {
|
||||
let keyboard = $('#virtualKeyboard')
|
||||
let inputBox = $('#virtualKeyboardInput')
|
||||
|
||||
@@ -143,14 +141,13 @@ let showVirtualNumpad = (heading: string, maxlength = 4, isPassword: boolean, al
|
||||
keyboard.data('maxlength', maxlength)
|
||||
keyboard.data('password', isPassword)
|
||||
keyboard.data('submitfunction', submitFunction)
|
||||
|
||||
$(document).off('keyup')
|
||||
inputBox.trigger('focus')
|
||||
$(document).on('keyup', e => {
|
||||
let key = e.key
|
||||
if (key == 'Enter')
|
||||
if (key == 'Enter' && inputBox.val().toString().length > 0) {
|
||||
key = 'submit'
|
||||
|
||||
virtualKeyboardInput(key)
|
||||
virtualKeyboardInput(key)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -166,13 +163,13 @@ let showVirtualNumpad = (heading: string, maxlength = 4, isPassword: boolean, al
|
||||
case 'backspace':
|
||||
case 'delete':
|
||||
let newText = inputBox.text().slice(0, -1);
|
||||
inputBox.text(newText)
|
||||
inputBox.val(newText)
|
||||
keyboard.data('value', newText);
|
||||
break;
|
||||
case 'submit':
|
||||
hideVirtualKeyboard();
|
||||
let submitFunction = keyboard.data('submitfunction')
|
||||
submitFunction(inputBox.text());
|
||||
submitFunction(inputBox.val());
|
||||
break;
|
||||
case 'shift':
|
||||
if (Application.keyboard.capsLock) break;
|
||||
@@ -196,17 +193,17 @@ let showVirtualNumpad = (heading: string, maxlength = 4, isPassword: boolean, al
|
||||
if (input.length == 1) {
|
||||
if (Application.keyboard.shift || Application.keyboard.capsLock) {
|
||||
input = input.toUpperCase()
|
||||
|
||||
//If shift, reload lowercase
|
||||
if (Application.keyboard.shift) {
|
||||
Application.keyboard.shift = false
|
||||
setKeyboardLayout('default');
|
||||
}
|
||||
}
|
||||
|
||||
let newText = inputBox.text() + input;
|
||||
let newText = inputBox.val() + input;
|
||||
keyboard.data('value', newText);
|
||||
inputBox.text(newText)
|
||||
|
||||
//If shift, reload lowercase
|
||||
if (Application.keyboard.shift) {
|
||||
Application.keyboard.shift = false
|
||||
setKeyboardLayout('default');
|
||||
}
|
||||
inputBox.val(newText)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user