{"version":3,"sources":["jquery.storage.js"],"names":["$","window","document","map","method","defaults","cookiePrefix","cookieOptions","path","domain","expires","undefined","support","e","key","value","options","extend","this","getItem","returns","JSON","parse","cookie","arr","i","length","setItem","stringify","removeItem","clear","reg","RegExp","opts","split","test","trim","substr","indexOf","jQuery"],"mappings":"CAQE,SAASA,EAAGC,EAAQC,GAClB,YAEAF,GAAEG,KAAK,eAAgB,kBAAmB,SAAUC,GAChD,GAAIC,IACAC,aAAe,YAAcF,EAAS,IACtCG,eACIC,KAAO,IACPC,OAASP,EAASO,OAClBC,QAAW,iBAAmBN,GAAYM,QAAS,KAAQC,QAInE,KACIX,EAAEY,QAAQR,GAAUA,IAAUH,IAA6B,OAAnBA,EAAOG,GACjD,MAAOS,GACLb,EAAEY,QAAQR,IAAU,EAGxBJ,EAAEI,GAAU,SAASU,EAAKC,GACtB,GAAIC,GAAUhB,EAAEiB,UAAWZ,EAAUL,EAAEI,GAAQY,QA4C/C,OA1CAE,MAAKC,QAAU,SAAUL,GACrB,GAAIM,GAAU,SAASN,GACnB,MAAOO,MAAKC,MAAMtB,EAAEY,QAAQR,GAAUH,EAAOG,GAAQe,QAAQL,GAAOd,EAAEuB,OAAOP,EAAQV,aAAeQ,IAExG,IAAkB,gBAARA,GAAkB,MAAOM,GAAQN,EAI3C,KAFA,GAAIU,MACAC,EAAIX,EAAIY,OACND,KAAKD,EAAIC,GAAKL,EAAQN,EAAIW,GAChC,OAAOD,IAGXN,KAAKS,QAAU,SAAUb,EAAKC,GAE1B,MADAA,GAAQM,KAAKO,UAAUb,GAChBf,EAAEY,QAAQR,GAAUH,EAAOG,GAAQuB,QAAQb,EAAKC,GAASf,EAAEuB,OAAOP,EAAQV,aAAeQ,EAAKC,EAAOC,EAAQT,gBAGxHW,KAAKW,WAAa,SAAUf,GACxB,MAAOd,GAAEY,QAAQR,GAAUH,EAAOG,GAAQyB,WAAWf,GAAOd,EAAEuB,OAAOP,EAAQV,aAAeQ,EAAK,KAAMd,EAAEiB,OAAOD,EAAQT,eACpHG,eAIRQ,KAAKY,MAAQ,WACT,GAAG9B,EAAEY,QAAQR,GACT,MAAOH,GAAOG,GAAQ0B,OAEtB,IAAIC,GAAM,GAAIC,QAAO,IAAMhB,EAAQV,aAAc,IAC7C2B,EAAOjC,EAAEiB,OAAOD,EAAQT,eACpBG,YAGLR,GAASqB,QAA8B,KAApBrB,EAASqB,QAC3BvB,EAAEG,IAAID,EAASqB,OAAOW,MAAM,KAAM,SAAUX,GACrCQ,EAAII,KAAKZ,EAASvB,EAAEoC,KAAKb,KACvBvB,EAAEuB,OAAQA,EAAOc,OAAO,EAAEd,EAAOe,QAAQ,MAAO,KAAML,MAOxD,mBAARnB,GACiB,mBAAVC,GAAoC,OAAVA,EAAiBG,KAAKW,WAAWf,GAAOI,KAAKS,QAAQb,EAAKC,GAAWG,KAAKC,QAAQL,GAGvHI,MAGXlB,EAAEI,GAAQY,QAAUX,KAE1BkC,OAAQtC,OAAQC","file":"../jquery.storage.js","sourcesContent":["/*!\n * jquery.storage.js 0.0.3 - https://github.com/yckart/jquery.storage.js\n * The client-side storage for every browser, on any device.\n *\n * Copyright (c) 2012 Yannick Albert (http://yckart.com)\n * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php).\n * 2013/02/10\n **/\n;(function($, window, document) {\n 'use strict';\n\n $.map(['localStorage', 'sessionStorage'], function( method ) {\n var defaults = {\n cookiePrefix : 'fallback:' + method + ':',\n cookieOptions : {\n path : '/',\n domain : document.domain,\n expires : ('localStorage' === method) ? { expires: 365 } : undefined\n }\n };\n\n try {\n $.support[method] = method in window && window[method] !== null;\n } catch (e) {\n $.support[method] = false;\n }\n\n $[method] = function(key, value) {\n var options = $.extend({}, defaults, $[method].options);\n\n this.getItem = function( key ) {\n var returns = function(key){\n return JSON.parse($.support[method] ? window[method].getItem(key) : $.cookie(options.cookiePrefix + key));\n };\n if(typeof key === 'string') return returns(key);\n\n var arr = [],\n i = key.length;\n while(i--) arr[i] = returns(key[i]);\n return arr;\n };\n\n this.setItem = function( key, value ) {\n value = JSON.stringify(value);\n return $.support[method] ? window[method].setItem(key, value) : $.cookie(options.cookiePrefix + key, value, options.cookieOptions);\n };\n\n this.removeItem = function( key ) {\n return $.support[method] ? window[method].removeItem(key) : $.cookie(options.cookiePrefix + key, null, $.extend(options.cookieOptions, {\n expires: -1\n }));\n };\n\n this.clear = function() {\n if($.support[method]) {\n return window[method].clear();\n } else {\n var reg = new RegExp('^' + options.cookiePrefix, ''),\n opts = $.extend(options.cookieOptions, {\n expires: -1\n });\n\n if(document.cookie && document.cookie !== ''){\n $.map(document.cookie.split(';'), function( cookie ){\n if(reg.test(cookie = $.trim(cookie))) {\n $.cookie( cookie.substr(0,cookie.indexOf('=')), null, opts);\n }\n });\n }\n }\n };\n\n if (typeof key !== \"undefined\") {\n return typeof value !== \"undefined\" ? ( value === null ? this.removeItem(key) : this.setItem(key, value) ) : this.getItem(key);\n }\n\n return this;\n };\n\n $[method].options = defaults;\n });\n}(jQuery, window, document));"]}