Chat's updates for security, db and workflow
Security and workflow regressions / regression (push) Has been cancelled

This commit is contained in:
2026-10-20 06:45:30 -04:00
parent 02223083f6
commit 1e63076123
116 changed files with 3252 additions and 2932 deletions
+9 -83
View File
@@ -1,84 +1,10 @@
// =====================
// Auto Save and Restore
// =====================
var $sessionStorage = JSON.parse(sessionStorage.getItem("ATLHOUSINGREPORT") || "{}");
// -------------------
// Save Changed Inputs
// -------------------
$(".autosave").on("change", function (e) {
switch (e.target.type) {
case "text" :
$sessionStorage[e.target.name] = $(this).val();
break;
case "radio" :
$sessionStorage[e.target.name] = $(this).val();
break;
case "checkbox" :
$sessionStorage[e.target.name] = $(this).prop("checked");
break;
case "select-one" :
$sessionStorage[e.target.name] = $(this).val();
break;
case "hidden" :
$sessionStorage[e.target.name] = $(this).val();
break;
default :
$sessionStorage[e.target.name] = $(this).val();
break;
}
sessionStorage.setItem("HOMESTEAD", JSON.stringify($sessionStorage));
$(function(){
const application=$('#APPLICATION_MNEMONIC').val();if(!application)return;
const key=application+':autosave:'+window.location.pathname;
let saved={};try{saved=JSON.parse(sessionStorage.getItem(key)||'{}');}catch(error){sessionStorage.removeItem(key);}
$('.autosave').filter(':not([type="password"]):not([type="hidden"])').each(function(){
if(Object.prototype.hasOwnProperty.call(saved,this.name)){
if(this.type==='checkbox')$(this).prop('checked',!!saved[this.name]);else $(this).val(saved[this.name]);
}
}).on('change',function(){saved[this.name]=this.type==='checkbox'?this.checked:$(this).val();sessionStorage.setItem(key,JSON.stringify(saved));});
});
// ----------------
// Initalize Inputs
// ----------------
$.each($sessionStorage, function (name, value) {
var $input = $(":input").filter("[name=" + name + "]");
if ($input.length > 0) {
switch ($input.prop("type")) {
case "text" :
$input.val(value);
break;
case "radio" :
$input.filter("[value=" + value + "]").prop("checked", true);
break;
case "checkbox" :
$input.prop("checked", value);
break;
case "select-one" :
$input.val(value);
break;
case "hidden" :
$input.val(value);
break;
default :
$input.val(value);
break;
}
}
});
// ------------------
// Save preset Inputs
// ------------------
$("input[type=radio]:checked").trigger("change");