Fix exports
This commit is contained in:
parent
bc90290959
commit
3ba3e8ce82
2 changed files with 10 additions and 6 deletions
|
|
@ -441,12 +441,16 @@
|
||||||
|
|
||||||
<script type="module" src="js/beango.js?v=1.0.1"></script>
|
<script type="module" src="js/beango.js?v=1.0.1"></script>
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import { toggleConfig, exportSettings, importSettings, resetAllSettings, explodeBeans } from './js/beango.js';
|
import { toggleConfig, exportSettings, importSettings, resetAllSettings, explodeBeans, randomizeBoard, clearMarks, generateBoard, resetSettings } from './js/beango.js';
|
||||||
window.explodeBeans = explodeBeans;
|
window.explodeBeans = explodeBeans;
|
||||||
window.toggleConfig = toggleConfig;
|
window.toggleConfig = toggleConfig;
|
||||||
window.exportSettings = exportSettings;
|
window.exportSettings = exportSettings;
|
||||||
window.importSettings = importSettings;
|
window.importSettings = importSettings;
|
||||||
window.resetAllSettings = resetAllSettings;
|
window.resetAllSettings = resetAllSettings;
|
||||||
|
window.randomizeBoard = randomizeBoard;
|
||||||
|
window.clearMarks = clearMarks;
|
||||||
|
window.generateBoard = generateBoard;
|
||||||
|
window.resetSettings = resetSettings;
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import * as vars from './variables.js';
|
import * as vars from './variables.js';
|
||||||
import { showNotification, hexToRgba, setupInputListener, setupOpacitySliderListener, _restoreOpacitySetting, _restoreColorPickerSetting, _restoreInputSetting } from './utils.js';
|
import { showNotification, hexToRgba, setupInputListener, setupOpacitySliderListener, _restoreOpacitySetting, _restoreColorPickerSetting, _restoreInputSetting, _restoreCheckboxSetting } from './utils.js';
|
||||||
|
|
||||||
let currentItems = []; // Holds the original list of items provided by the user
|
let currentItems = []; // Holds the original list of items provided by the user
|
||||||
let displayedItems = []; // Holds the items currently displayed on the board
|
let displayedItems = []; // Holds the items currently displayed on the board
|
||||||
|
|
@ -570,7 +570,7 @@ function saveBoardState() {
|
||||||
saveBoardBgSettings(); // Save board background settings
|
saveBoardBgSettings(); // Save board background settings
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateBoard() {
|
export function generateBoard() {
|
||||||
const sizeInput = document.getElementById('board-size');
|
const sizeInput = document.getElementById('board-size');
|
||||||
const size = parseInt(sizeInput.value, 10);
|
const size = parseInt(sizeInput.value, 10);
|
||||||
if (isNaN(size) || size < 1) {
|
if (isNaN(size) || size < 1) {
|
||||||
|
|
@ -663,7 +663,7 @@ function generateBoard() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function randomizeBoard() {
|
export function randomizeBoard() {
|
||||||
const storedItemsRaw = localStorage.getItem(vars.LS_CELL_ITEMS);
|
const storedItemsRaw = localStorage.getItem(vars.LS_CELL_ITEMS);
|
||||||
const sizeRaw = localStorage.getItem(vars.LS_BOARD_SIZE);
|
const sizeRaw = localStorage.getItem(vars.LS_BOARD_SIZE);
|
||||||
|
|
||||||
|
|
@ -736,7 +736,7 @@ function selectCell(cell) {
|
||||||
saveBoardState(); // RE-ADD: Save updated marks immediately after click
|
saveBoardState(); // RE-ADD: Save updated marks immediately after click
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearMarks(save = true) {
|
export function clearMarks(save = true) {
|
||||||
const cells = document.querySelectorAll('#bingo-board .bingo-cell');
|
const cells = document.querySelectorAll('#bingo-board .bingo-cell');
|
||||||
cells.forEach(cell => {
|
cells.forEach(cell => {
|
||||||
if (cell.classList.contains('marked')) {
|
if (cell.classList.contains('marked')) {
|
||||||
|
|
@ -767,7 +767,7 @@ function shuffleArray(array) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Function to reset ONLY board content/structure settings ---
|
// --- Function to reset ONLY board content/structure settings ---
|
||||||
function resetSettings() {
|
export function resetSettings() {
|
||||||
// Clear localStorage relevant ONLY to the board structure/content
|
// Clear localStorage relevant ONLY to the board structure/content
|
||||||
localStorage.removeItem(vars.LS_BOARD_SIZE);
|
localStorage.removeItem(vars.LS_BOARD_SIZE);
|
||||||
localStorage.removeItem(vars.LS_CELL_ITEMS); // The items configured for the board (padded/sliced)
|
localStorage.removeItem(vars.LS_CELL_ITEMS); // The items configured for the board (padded/sliced)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue