WebEditor/src/editor.html
Matthew Welch f9f50cd562 Added confirmations when opening/closing files
If current file has unsaved changes it will ask for permission before opening or closing
2021-01-25 20:49:41 -08:00

138 lines
4.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Web Editor</title>
<link rel="stylesheet" href="../third_party/css/bootstrap.min.css">
<link rel="stylesheet" href="../third_party/fontawesome/css/all.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container-fluid">
<nav class="nav nav-tabs text-nowrap flex-nowrap"></nav>
<div class="row">
<div id="details" class="col-3">
<div class="mb-3">
<label class="form-label">Tab Name</label>
<input type="text" class="form-control" id="detail-tab-name">
</div>
<div class="mb-1">
<label class="form-label">Table Name</label>
<input type="text" class="form-control" id="detail-table-name">
</div>
<div class="mb-3">
<label class="form-label">Table Description</label>
<textarea class="form-control" id="detail-table-description"></textarea>
</div>
<div class="mb-3">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id="detail-table-hidden">
Table Hidden
</label>
</div>
</div>
<hr/>
<div class="mb-1">
<label class="form-label">Column Name</label>
<input type="text" class="form-control" id="detail-column-name">
</div>
<div class="mb-1">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id="detail-column-selectable">
Column Selectable
</label>
</div>
</div>
<div class="mb-3">
<div class="form-check">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" id="detail-column-sortable">
Column Sortable
</label>
</div>
</div>
<hr/>
<div class="mb-3">
<label class="form-label">Cell Text</label>
<textarea class="form-control" id="detail-cell-text"></textarea>
</div>
<div>
<button id="position-edit" class="btn btn-secondary" data-bs-toggle=tooltip" data-bs-placement=bottom" title="move columns, rows, and tables">Start Edit Position</button>
</div>
</div>
<div id="tables" class="col-9 tab-content"></div>
</div>
</div>
<div class="modal fade" id="delete-table" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h5>Are you sure that you want to delete the table?</h5>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">No, keep table</button>
<button id="confirm-delete-table" type="button" class="btn btn-danger" data-bs-dismiss="modal">Yes, delete table</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="open-file" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h5>Are you sure that you want to open a file? You will lose unsaved data.</h5>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">No, stay here</button>
<button id="confirm-open-file" type="button" class="btn btn-danger" data-bs-dismiss="modal">Yes, open file</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="start-new" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h5>Are you sure that you want to start a new file? You will lose unsaved data.</h5>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">No, stay here</button>
<button id="confirm-start-new" type="button" class="btn btn-danger" data-bs-dismiss="modal">Yes, start new</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="quit" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h5>Are you sure that you want to quit? You will lose unsaved data.</h5>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">No, stay open</button>
<button id="confirm-quit" type="button" class="btn btn-danger" data-bs-dismiss="modal">Yes, quit</button>
</div>
</div>
</div>
</div>
<script>
if (typeof module === 'object') {
window.module = module;
module = undefined;
}
</script>
<script src="../third_party/js/bootstrap.bundle.min.js"></script>
<script>if (window.module) module = window.module;</script>
<script>
require("./../build/js/editor.js");
</script>
</body>
</html>