Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{"version":3,"file":"sessionstorage.min.js","sources":["../src/sessionstorage.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Simple API for set/get to sessionstorage, with cacherev expiration.\n *\n * Session storage will only persist for as long as the browser window\n * stays open.\n *\n * See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage\n *\n * @module     core/sessionstorage\n * @copyright  2017 Ryan Wyllie <ryan@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/config', 'core/storagewrapper'], function(config, StorageWrapper) {\n\n    // Private functions and variables.\n    /** @var {Object} StorageWrapper - Wraps browsers sessionStorage object */\n    var storage = new StorageWrapper(window.sessionStorage);\n\n    return /** @alias module:core/sessionstorage */ {\n        /**\n         * Get a value from session storage. Remember - all values must be strings.\n         *\n         * @method get\n         * @param {string} key The cache key to check.\n         * @return {boolean|string} False if the value is not in the cache, or some other error - a string otherwise.\n         */\n        get: function(key) {\n            return storage.get(key);\n        },\n\n        /**\n         * Set a value to session storage. Remember - all values must be strings.\n         *\n         * @method set\n         * @param {string} key The cache key to set.\n         * @param {string} value The value to set.\n         * @return {boolean} False if the value can't be saved in the cache, or some other error - true otherwise.\n         */\n        set: function(key, value) {\n            return storage.set(key, value);\n        }\n\n    };\n});\n"],"names":["define","config","StorageWrapper","storage","window","sessionStorage","get","key","set","value"],"mappings":";;;;;;;;;;;;;AA4BAA,6BAAO,CAAC,cAAe,wBAAwB,SAASC,OAAQC,oBAIxDC,QAAU,IAAID,eAAeE,OAAOC,sBAEQ,CAQ5CC,IAAK,SAASC,YACHJ,QAAQG,IAAIC,MAWvBC,IAAK,SAASD,IAAKE,cACRN,QAAQK,IAAID,IAAKE"}