%PDF- %PDF-
| Direktori : /opt/bitnami/apps/moodle/htdocs/course__d9c9c01/format/tiles/amd/build/ |
| Current File : /opt/bitnami/apps/moodle/htdocs/course__d9c9c01/format/tiles/amd/build/edit_browser_storage.min.js |
define ("format_tiles/edit_browser_storage",["jquery","format_tiles/browser_storage_set_up"],function(a,b){"use strict";var c={PAGE:"#page",EDITING_COLLAPSE_SECID:"#collapse",EDITING_COLLAPSE_SEC:".collapse-section",EDITING_EXPAND_SEC:".expand-section",EDITING_EXPAND_SECID:"#expand",SECTION_CONTENT:"li.section.main .content",SECTION_MAIN:"li.section.main",SECTION_ID:"#section-"},d,e,f={COURSE_VISIT:"mdl-tiles-editing-last-visit-course-",EDITING_COURSE:"mdl-tiles-editing-course-",SECTION:"-section-",COURSE:"mdl-tiles-course-",LAST_SECTION:"-lastSecId",USER:"-user-",PREFIX:"mdl-tiles-",USER_CHOICE_PREFIX:"mdl-tiles-userPrefStorage-",CONTENT_SUFFIX:"-content",LAST_UPDATED_SUFFIX:"-lastUpdated"},g={OPEN:"1",CLOSED:"0"},h,i=function(a){return f.EDITING_COURSE+d+f.SECTION+a+f.USER+e},j=function getOpenSections(a){if(!a||50<a){a=50}for(var b=[],c,d=1;d<=a;d++){c=sessionStorage.getItem(i(d));if(c===g.OPEN){b.push(d)}}return b},k=function(){return f.COURSE+d+f.USER+e+f.LAST_SECTION},l=function setLastSection(a){if(!a){localStorage.clear(k())}else if(a!==h&&b.storageAllowed){h=a;localStorage.setItem(k(),a.toString())}},m=function getLastSection(){if(!h){h=localStorage.getItem(k())}return h},n=function setSectionStatus(a,c){if(b.storageAllowed&&c){sessionStorage.setItem(i(a),g.OPEN)}else{sessionStorage.removeItem(i(a))}},o=function(){Object.keys(sessionStorage).filter(function(a){return 0===a.indexOf(f.PREFIX)&&(a.indexOf(f.CONTENT_SUFFIX)===a.length-f.CONTENT_SUFFIX.length||a.indexOf(f.LAST_UPDATED_SUFFIX)===a.length-f.LAST_UPDATED_SUFFIX.length)}).forEach(function(a){sessionStorage.removeItem(a)})},p=function(){Object.keys(localStorage).filter(function(a){return 0===a.indexOf(f.PREFIX)&&-1===a.indexOf(f.USER_CHOICE_PREFIX)}).forEach(function(a){localStorage.removeItem(a)});Object.keys(sessionStorage).filter(function(a){return 0===a.indexOf(f.PREFIX)&&-1===a.indexOf(f.USER_CHOICE_PREFIX)}).forEach(function(a){sessionStorage.removeItem(a)})};return{getOpenSections:function getOpenSections(a){return j(a)},init:function init(g,h,j,k,m,q,r){d=h;e=g;if(q){n(q,!0)}a(document).ready(function(){b.init(e,m,p);if(0===parseInt(j)){b.setAllowed(!1);return}o();if(b.storageAllowed()){sessionStorage.setItem(f.COURSE_VISIT+d+f.USER+e,Date.now().toString());if(r){for(var g=1;g<=q;g++){n(g,!1)}}a(c.PAGE).on("click",c.SECTION_CONTENT,function(b){var d=a(b.currentTarget),e=d.closest(c.SECTION_MAIN).attr("data-section");l(e)})}})},getLastSection:function getLastSection(){return m()},setSectionStatus:function setSectionStatus(a,b){return n(a,b)},setLastSection:function setLastSection(a){return l(a)}}});
//# sourceMappingURL=edit_browser_storage.min.js.map