Update types, tests

This commit is contained in:
Francisco Hodge
2021-03-16 00:40:23 -04:00
parent 8ba81892fe
commit cae07749f4
33 changed files with 1392 additions and 957 deletions
+3 -16
View File
@@ -44,7 +44,7 @@
let stdBtnCount = 0;
let fullInput = '';
iterateButtons((button) => {
keyboard.recurseButtons((button) => {
const label = button.getAttribute("data-skbtn");
if(label.includes("{"))
@@ -89,11 +89,11 @@
/**
* Test if function buttons are interactive (have an onclick)
*/
export const testLayoutFctButtons = (callback) => {
export const testLayoutFctButtons = (keyboard, callback) => {
let fctBtnCount = 0;
let fctBtnHasOnclickCount = 0;
iterateButtons((button) => {
keyboard.recurseButtons((button) => {
const label = button.getAttribute("data-skbtn");
if(!label.includes("{") && !label.includes("}"))
@@ -110,19 +110,6 @@
});
}
/**
* Iterates on the keyboard buttons
*/
export const iterateButtons = (callback, selector) => {
const rows = document.body.querySelector(selector || '.simple-keyboard').children;
Array.from(rows).forEach(row => {
Array.from(row.children).forEach((button) => {
callback(button);
});
});
}
/**
* Remove RTL control chars
*/