LocalStorage - Form Fields - Handle Storage PLUGIN Customized

by bizamajig

HTML

<script src="https://raw.github.com/mdp/gibberish-aes/master/src/gibberish-aes.min.js"></script>
<script src="https://raw.github.com/simsalabim/sisyphus/master/sisyphus.min.js"></script>
<script src="//bizamajig.com/include/bizamajig-ui-plugins.min.js"></script>
<script src="//bizamajig.com/include/bizamajig-ui.min.js"></script>
<form onsubmit="validateForm(this, '', false);showProgressWindow('mac_look.htm?ProgressUrl=ScriptLibrary/PU3Progress.asp&amp;UploadId=627333954', 400, 100, this);return document.MM_returnValue;" id="SubParentForm" name="SubParentForm" enctype="multipart/form-data" method="POST" action="/bz-pc-x-insert.asp?primary_doc_group_id=&amp;process_desc=Products&amp;lookup_type_desc=New%20Product&amp;view_by_identifier=&amp;GP_upload=true&amp;UploadId=627333954" class="bz-pc-x-insert">
	<fieldset class="ui_webform_block">
		<h2>
	    Item information
	    </h2>





	    <div class="box-50">






		    <div class="field">
		      <label for="parent_doc_id">Subitem of</label>
				<select id="parent_doc_id" name="parent_doc_id" style="width: 198px; display: none;" class="chzn-done input-undefined">
                	<option value="-1"></option>

                	<option value="212182">ch-hg-00-00-00.00 - Log 1</option>

                	<option value="212182">ch-hg-00-00-00.00 - Log 1</option>

                	<option value="212182">ch-hg-00-00-00.00 - Log 1</option>

				</select><div id="parent_doc_id_chzn" class="chzn-container chzn-container-single chzn-container-single-nosearch" style="width: 198px;" title=""><a tabindex="-1" class="chzn-single" href="javascript:void(0)"><span>ch-hg-00-00-00.00 - Log 1</span><div><b></b></div></a><div style="left: -9000px; width: 196px; top: 25px;" class="chzn-drop"><div class="chzn-search"><input type="text" autocomplete="off" style="width: 170px;" class="input-text"></div><ul class="chzn-results"><li style="" class="active-result" id="parent_doc_id_chzn_o_1">ch-hg-00-00-00.00 - Log 1</li><li style=""...

CSS

.jnotify-container{position:fixed;top:0;left:0;width:100%;z-index:100000;}.jnotify-container .jnotify-notification{position:relative;}.jnotify-container .jnotify-notification .jnotify-background{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#e3f0db;filter:alpha(opacity=90);-moz-opacity:.90;opacity:.90;z-index:1;}.jnotify-container .jnotify-notification a.jnotify-close,.jnotify-container .jnotify-notification a.jnotify-close:link,.jnotify-container .jnotify-notification a.jnotify-close:visited,.jnotify-container .jnotify-notification a.jnotify-close:focus,.jnotify-container .jnotify-notification a.jnotify-close:hover{position:absolute;top:2px;right:5px;padding:0 5px;font:bold 1.4em Arial,Helvetica,sans-serif;line-height:1em;color:#567b1b;text-decoration:none;z-index:3;cursor:pointer;}.jnotify-container .jnotify-notification .jnotify-message{position:relative;z-index:2;padding:20px;text-align:center;color:#567b1b;font:bold 1.4em Arial,Helvetica,sans-serif;line-height:1.2em;}.jnotify-container .jnotify-notification .jnotify-message *{font-size:1em !important;}.jnotify-container .jnotify-notification-error .jnotify-background{background-color:#d79eac;}.jnotify-container .jnotify-notification-error .jnotify-close,.jnotify-container .jnotify-notification-error .jnotify-message{color:#a72947!important;}.jnotify-container .jnotify-notification-warning .jnotify-background{background-color:#fff7d1;}.jnotify-container .jnotify-notification-warning .jnotify-close,.jnotify-container .jnotify-notification-warning .jnotify-message{color:#c2a928!important;}

JavaScript

$.jnotify('SISTA! Know your limits', 5500);
























































/*
$('#message').blur(saveSettings);
loadSettings();
function loadSettings() {
        $('#name').val(localStorage.name);
        $('#message').val(localStorage.message);
}
function saveSettings() {
        localStorage.name = $('#name').val();
        localStorage.message = $('#message').val();
}
*/
//  $('#default').handleStorage({storage:'sessionStorage',aes:true});
    $('form#SubParentForm.bz-pc-x-insert').handleStorage({
        aes: true,
        element_selector_class: '',
        form_class_selector: 'bz-pc-x-insert',
        appID: 'bz-pc-x-insert', // target_form_id
        //interval: 5000, // 5 seconds
        //storage:'cookies' // 'sessionStorage'
        //preCallback: function(){ console.log(this); } // executing a function before the auto-incrementing or form submit event has been called.
        //callback: function(){ console.log(this); } //  executed anytime the save has been called and was successful. Keep in mind that this does take place ever 5 seconds with a default configuration.
        //errCallback: function(){ console.log(this); } // callback gets executed anytime a save was unsuccessful.
    });


 if (false) $('#xxxxxxxxxdefault').sisyphus({
      //$('#form1').sisyphus({
        timeout: 15,
        onSave: function() {
          $.jnotify('Data are saved to Local Storage', 500);
          // kludge on Uniform.js bug
          setTimeout(function(){
//            $.uniform.update('input, select');
          }, 200);
        },
        onRestore: function() {
          $.jnotify('Data are restored from Local Storage', 500);
          // kludge on Uniform.js bug
          setTimeout(function(){
//            $.uniform.update('input, select');
          }, 200);
        },
        onRelease: function() {
          $.jnotify('Data are removed from Local Storage', 'warning', 500);
          // kludge on Uniform.js bug
         ...