2026-10-20 06:45:30 -04:00
|
|
|
$(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));});
|
2026-10-18 17:01:36 +00:00
|
|
|
});
|