%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /opt/bitnami/apps/moodle/htdocs/course__d9c9c01/format/tiles/amd/build/
Upload File :
Create Path :
Current File : /opt/bitnami/apps/moodle/htdocs/course__d9c9c01/format/tiles/amd/build/browser_storage.min.js

define ("format_tiles/browser_storage",["jquery","format_tiles/browser_storage_set_up"],function(a,b){"use strict";var c,d,e={prefix:"mdl-tiles-",course:"mdl-tiles-course-",lastSection:"-lastSecId",content:"-content",lastUpdated:"-lastUpdated",collapseSecZero:"-collapsesec0",user:"-user-",section:"-sec-",userChoicePrefix:"mdl-tiles-userPrefStorage-"},f,g=function(){return e.course+c+e.user+d+e.lastSection},h=function(a){return e.course+c+e.section+a.toString()+e.user+d+e.content},i=function(a){return e.course+c+e.section+a.toString()+e.user+d+e.lastUpdated},j=function(){return e.course+c+e.user+d+e.collapseSecZero},k=function(a){return 0===a.indexOf(e.prefix)&&a.substr(-e.lastUpdated.length)===e.lastUpdated},l=function storeCourseContent(a,c,d){if(c===void 0||a===void 0){throw new Error("Missing section id")}try{if(d!==void 0&&""!==d&&b.Enabled.session&&!0===b.storageAllowed()){sessionStorage.setItem(h(c),d);sessionStorage.setItem(i(c),Math.round(Date.now()/1e3).toString())}else{sessionStorage.removeItem(h(c));sessionStorage.removeItem(i(c))}}catch(a){require(["core/log"],function(b){b.debug(a)})}},m=function(a){var b=a.split("-");if(k(a)){return{courseId:parseInt(b[b.indexOf("course")+1]),sectionId:parseInt(b[b.indexOf("sec")+1]),userId:parseInt(b[b.indexOf("user")+1]),title:"lastUpdated"}}else{throw new Error("Invalid lastUpdated key")}},n=function(a,b,c){if(b){Object.keys(localStorage).filter(function(a){return 0===a.indexOf(e.prefix)&&0!==a.indexOf(e.userChoicePrefix)}).forEach(function(a){localStorage.removeItem(a)});Object.keys(sessionStorage).filter(function(a){return 0===a.indexOf(e.prefix)}).forEach(function(a){if(k(a)){var b=m(a);l(b.courseId,b.sectionId,"")}})}else{var d=Math.round(Date.now()/1e3)-60*a;Object.keys(sessionStorage).filter(function(a){return 0===a.indexOf(e.prefix)}).forEach(function(b){if(k(b)){var c=m(b);if(sessionStorage.getItem(b)<d||0===a){l(c.courseId,c.sectionId,"")}}});var f=Object.keys(sessionStorage).filter(function(a){return k(a)});if(f.length>c){var g=f.map(function(a){return parseInt(sessionStorage[a])}).sort(),h=g[g.length-c];if(0===c){h=Date.now()}var i;f.filter(function(a){return sessionStorage[a]<h}).forEach(function(a){i=m(a);l(i.courseId,i.sectionId,"")})}}},o=function(){n(0,1,1)},p=function setLastVisitedSection(a){if(a&&b.Enabled.local){localStorage.setItem(g(),a.toString())}else{localStorage.removeItem(g())}};return{init:function init(e,g,h,i,j,k,m){c=e.toString();d=m.toString();f=parseInt(g);b.init(d,k,o);if(0===parseInt(g)){b.setAllowed(!1)}a(document).ready(function(){if(!0!==b.storageAllowed()){n(0,1,0)}if(h){p(i);n(0,1,0);if(b.Enabled.session){l(c,i,"")}a("a.menu-action[data-title=\"switchroleto,moodle\"]").click(function(){n(0,1,0)})}else{var d=a("#page-content");if(0===d.length){d=a("#region-main")}d.on("click",".tile",function(){setTimeout(function(){n(parseInt(j),0,f)},2e3)})}})},storageEnabledSession:function storageEnabledSession(){return b.Enabled.session},storageEnabledLocal:function storageEnabledLocal(){return b.Enabled.local},storagestorageSetUperence:function storagestorageSetUperence(){return b.storageAllowed()},getLastVisitedSection:function getLastVisitedSection(){return b.Enabled.local&&localStorage.getItem(g())},getCourseContent:function getCourseContent(a,b){return sessionStorage.getItem(h(b))},getStoredContentAge:function getStoredContentAge(a,b){var c=parseInt(sessionStorage.getItem(i(b)));if(c){return Math.round(Date.now()/1e3-c)}else{return!1}},setSecZeroCollapseStatus:function setSecZeroCollapseStatus(a){if(b.Enabled.local&&b.storageAllowed()){if("collapsed"===a){localStorage.removeItem(j())}else{localStorage.setItem(j(),"1")}}},getSecZeroCollapseStatus:function getSecZeroCollapseStatus(){return!!localStorage.getItem(j())},storeCourseContent:function storeCourseContent(a,b,c){l(a,b,c)},cleanUpStorage:function cleanUpStorage(){o()},setLastVisitedSection:function setLastVisitedSection(a){if(b.storageAllowed()){p(a)}}}});
//# sourceMappingURL=browser_storage.min.js.map

Zerion Mini Shell 1.0