text: !function(a,b,c,d){"use strict";function e(b){b=a.extend({autoSaveOptions:{}},b||{}),b.propertyNames=["metadata","optionsList"],this.optionsStorageList=[],f.OptionsStorage.call(this,this,b)}var f=b;f.APPLICATION_STORAGE_SPECIFIC="specific",f.APPLICATION_STORAGE_SETTINGS="settings",f.APPLICATION_STORAGE_STATE="state",f.ApplicationStorage=e,f.ApplicationStorage.prototype={osSave:f.OptionsStorage.prototype.save,add:function(a,b){var c=a.optionsStorage?a.optionsStorage:a;c.type=b||f.APPLICATION_STORAGE_SPECIFIC,c&&c.options.id?this.optionsStorageList.push(c):console.log("No optionsStorage or id")},_setOptions:function(c){var d,e=!1;if(a.each(this.optionsStorageList,function(a,b){var f=c.optionsList[b.options.id];return f&&(d=b._getObjectOptions(),b._needToReload(d,f))?(e=!0,!1):void 0}),e){var f=this._getOptionsList();a.each(this.optionsStorageList,function(a,b){var d=b.options.id,e=c.optionsList[d]||f[d];e&&(b.options.storageId?(b._saveOptions(e,"FORCE"),f[d]=null):f[d]=e)}),this.save("RELOAD",{_setMetadataIdList:!1},this.options.metadata,f),b.location.reload(!0)}this.metadata=c.metadata||{},a.each(this.optionsStorageList,function(a,b){var d=c.optionsList[b.options.id];d&&b._setObjectOptions(d)})},_getOptionsList:function(b){b=a.extend({saveSpecific:!0,saveSettings:!0,saveState:!0,_setMetadataIdList:!0},b||{});var c={};return a.each(this.optionsStorageList,function(a,d){(d.type==f.APPLICATION_STORAGE_SPECIFIC&&b.saveSpecific||d.type==f.APPLICATION_STORAGE_SETTINGS&&b.saveSettings||d.type==f.APPLICATION_STORAGE_STATE&&b.saveState)&&(d._apply(d.options.beforeSave,d.options.context),c[d.options.id]=d._getObjectOptions())}),c},load:function(a){this._setOptions(this._loadOptions(a))},save:function(b,c,d,e){if(b+="",c=a.extend({saveSpecific:!0,saveSettings:!0,saveState:!0,_setMetadataIdList:!0},c||{}),this.options.optionsList=e||this._getOptionsList(c),this.options.metadata=d||{},this.options.metadata.id=this.options.metadata.id||""+b,this.options.metadata.dateISOStr=(new Date).toISOString(),c._setMetadataIdList){var f=this._getMetadataIdList(),g=f.indexOf(b);-1==g&&(f.push(b),this._setMetadataIdList(f))}return this.osSave(b)},remove:function(a){a+="",this.rm(this._getStorageId(a));var b=this._getMetadataIdList(),c=b.indexOf(a);c>-1&&(b.splice(c,1),this._setMetadataIdList(b))},loadDefault:function(){return this.load("DEFAULT")},saveDefault:function(a){return this.save("DEFAULT",a)},removeDefault:function(){return this.remove("DEFAULT")},existsDefault:function(){return this.exists("DEFAULT")},_getMetadataIdList:function(){return this.get(this.options.storageId+"_METADATA",[])},_setMetadataIdList:function(a){return this.set(this.options.storageId+"_METADATA",a||this.metadataList)},loadMetadataList:function(){var a,b=this._getMetadataIdList(),c=[];for(a=0;a<b.length;a++)c.push(this._loadOptions(b[a]).metadata);return c},windowLoad:function(){if(this.exists("RELOAD")){var b=this._loadOptions("RELOAD");this.remove("RELOAD"),a.each(this.optionsStorageList,function(a,c){if(c.options.storageId)c.exists("FORCE")&&c.load();else{var d=b.optionsList[c.options.id];d&&c._setObjectOptions(d)}})}else this.options.autoLoad&&this.existsDefault()&&this.loadDefault()},windowUnload:function(){this.options.autoSave&&this.saveDefault(this.options.autoSaveOptions)}},f.ApplicationStorage.prototype=a.extend({},f.OptionsStorage.prototype,f.ApplicationStorage.prototype),a(function(){})}(jQuery,this,document);;!function(a,b,c,d){"use strict";function e(c,d){this.plugin_count=g,this.VERSION="1.0.3",a.extend(this,b.Lockr),this.object=c,this.options=a.extend({id:"",name:"",propertyNames:[],storageId:"",autoLoad:!1,autoSave:!1,reloadOnSave:!1,needToReload:function(){return!0},beforeLoad:null,afterLoad:null,beforeSave:null,afterSave:null,context:c},d||{}),this.addProperty(d.propertyNames);var e=this;a(function(){a(b).on("load",a.proxy(e.windowLoad,e)),a(b).on("unload",a.proxy(e.windowUnload,e))})}var f=b,g=1;f.OptionsStorage=e,f.optionsStorage=function(b,c){return b.optionsStorage=new e(b,c,g++),b=a.extend(b,{osAddProperty:function(){return this.optionsStorage.addProperty.apply(this.optionsStorage,arguments)},osRemoveProperty:function(){return this.optionsStorage.removeProperty.apply(this.optionsStorage,arguments)},osLoad:function(){return this.optionsStorage.load.apply(this.optionsStorage,arguments)},osSave:function(){return this.optionsStorage.save.apply(this.optionsStorage,arguments)},osRemove:function(){return this.optionsStorage.remove.apply(this.optionsStorage,arguments)}})},f.OptionsStorage.prototype={addProperty:function(b){this.options.propertyNames=this.options.propertyNames.concat(a.isArray(b)?b:[b])},removeProperty:function(a){var b,c=this.propertyNames.length;for(b=0;c>b;b++)if(this.propertyNames[b]==a){this.propertyNames.splice(b,1);break}},_apply:function(a){a&&a.apply(this.options.context)},_getStorageId:function(a){return this.options.storageId+(a?"_"+a:"")},_copyOptions:function(a,b){if(a&&b){var c,d,e=this.options.propertyNames.length;for(c=0;e>c;c++)d=this.options.propertyNames[c],a.hasOwnProperty(d)&&(b[d]=a[d])}},_setObjectOptions:function(a){this._copyOptions(a,this.object.options),this._apply(this.options.afterLoad)},_getObjectOptions:function(){this._apply(this.options.beforeSave);var a={};return this._copyOptions(this.object.options,a),a},_loadOptions:function(a){return this.get(this._getStorageId(a))},_saveOptions:function(a,b){if(!this.options.storageId)return!1;var c=this._getStorageId(b);return this.set(c,a),JSON.stringify(a)==JSON.stringify(this.get(c))},_needToReload:function(a,c){if(this.options.reloadOnSave){var d=b.jsondiffpatch.diff(a,c);if(d&&this.options.needToReload(d))return!0}return!1},load:function(a){if(!this.options.storageId)return!1;var b;this._apply(this.options.beforeLoad),this.exists("FORCE")?(b=this._loadOptions("FORCE"),this.remove("FORCE")):b=this._loadOptions(a),this._setObjectOptions(b)},save:function(a,c){if(!this.options.storageId)return!1;var d=this._getObjectOptions(),e=this._loadOptions(a),f=!c&&this._needToReload(e,d),g=this._saveOptions(d,a);return g&&this._apply(this.options.afterSave),g&&f&&b.location.reload(!0),g},remove:function(a){this.rm(this._getStorageId(a))},exists:function(a){return this.get(this._getStorageId(a))!==d},windowLoad:function(){(this.options.autoLoad||this.exists("FORCE"))&&this.load()},windowUnload:function(){this.options.autoSave&&this.save()}},a(function(){})}(jQuery,this,document);;!function(a,b,c,d){"use strict";function e(b){this.plugin_count=g++,this.VERSION="1.0.3",this.options={elements:{},list:[]},b=a.extend(b,{propertyNames:["elements"],afterLoad:function(){a.each(this.options.elements,function(b,c){var d,e=c.split(" "),f=0,g=e.length;for(f=0;g>f;f++)d=e[f],"NOT:"==d.substring(0,4)?a("#"+b).removeClass(d.substring(4)):a("#"+b).addClass(d)});var b=this;a.each(this.options.list,function(a,c){b.optionsStorage._apply(c.afterLoad,c.context)})},beforeSave:function(){function b(a,b){c.options.elements[a]=c.options.elements[a]?c.options.elements[a]+" "+b:b}this.options.elements={};var c=this;a.each(this.options.list,function(d,e){c.optionsStorage._apply(e.beforeSave,e.context);var f=e.classNames.split(" ");a(e.selector).each(function(){var c=a(this).prop("id");if(c)for(var d=0;d<f.length;d++){var g=f[d];a(this).hasClass(g)?b(c,g):e.saveNOTClasss&&b(c,"NOT:"+g)}})})}}),f.optionsStorage(this,b)}var f=b,g=1;f.StateStorage=e,f.StateStorage.prototype={addSelector:function(b){b=a.extend({saveNOTClasss:!0},b||{}),this.options.list.push(b)},load:function(){this.osLoad()},save:function(){this.osSave()}},a(function(){})}(jQuery,this,document);