Skip to content

Commit

Permalink
update dataset saving
Browse files Browse the repository at this point in the history
cmason3 committed Jun 24, 2024
1 parent ee417ee commit 653297f
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js" integrity="sha512-CSBhVREyzHAjAFfBlIBakjoRUKp5h7VSweP0InR/pAJyptH7peuhCsqAI/snV+TwZmXZqoUklpXp6R6wMnYf5Q==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.11.11/dayjs.min.js" integrity="sha512-FwNWaxyfy2XlEINoSnZh1JQ5TRRtGow0D6XcmAWmYCRgvqOUTnzCxPc9uF35u5ZEpirk1uhlPVA19tflhvnW1g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.11.11/plugin/relativeTime.min.js" integrity="sha512-MVzDPmm7QZ8PhEiqJXKz/zw2HJuv61waxb8XXuZMMs9b+an3LoqOqhOEt5Nq3LY1e4Ipbbd/e+AWgERdHlVgaA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="/b01d8365/jinjafx_m.js"></script>
<script src="/ccaef2dc/jinjafx_m.js"></script>
</head>
<body>
<div id="overlay"></div>
18 changes: 10 additions & 8 deletions www/jinjafx_m.js
Original file line number Diff line number Diff line change
@@ -123,10 +123,10 @@ function getStatusText(code) {
};

function select_dataset(e) {
switch_dataset(e.currentTarget.ds_name, true);
switch_dataset(e.currentTarget.ds_name, true, false);
}

function switch_dataset(ds, sflag) {
function switch_dataset(ds, sflag, dflag) {
if (sflag) {
datasets[current_ds][0] = window.cmData.swapDoc(datasets[ds][0]);
datasets[current_ds][1] = window.cmVars.swapDoc(datasets[ds][1]);
@@ -136,9 +136,11 @@ function getStatusText(code) {
window.cmVars.swapDoc(datasets[ds][1]);
}
if (ds != current_ds) {
window.addEventListener('beforeunload', onBeforeUnload);
if (document.getElementById('get_link').value != 'false') {
document.title = 'JinjaFx [unsaved]';
if (dflag) {
window.addEventListener('beforeunload', onBeforeUnload);
if (document.getElementById('get_link').value != 'false') {
document.title = 'JinjaFx [unsaved]';
}
}
dirty = true;
document.getElementById('selected_ds').innerHTML = ds;
@@ -210,7 +212,7 @@ function getStatusText(code) {
//dirty = true;

rebuild_datasets();
switch_dataset(Object.keys(datasets)[0], false);
switch_dataset(Object.keys(datasets)[0], false, true);
fe.focus();
}

@@ -559,7 +561,7 @@ function getStatusText(code) {
dt.global = e(window.cmgVars.getValue().replace(/\t/g, " "));
}

switch_dataset(current_ds, true);
switch_dataset(current_ds, true, false);
Object.keys(datasets).forEach(function(ds) {
dt.datasets[ds] = {};
dt.datasets[ds].data = e(datasets[ds][0].getValue());
@@ -1410,7 +1412,7 @@ function getStatusText(code) {
//}
//dirty = true;
}
switch_dataset(new_ds, true);
switch_dataset(new_ds, true, true);
}
else {
set_status("darkred", "ERROR", "Invalid Data Set Name");

0 comments on commit 653297f

Please sign in to comment.