{"version":3,"sources":["https:\/\/dl-ice.spbstu.ru\/theme\/mooc\/amd\/src\/course.js"],"names":["define","$","Notice","Str","Ajax","init","action","document","ready","SELECTORS","_obj","strings","BODY","BUTTON_FULLSCREEN","FM_BUTTON","FM_BUTTON_ICON","SECTION_WRAPPER","SECTION_ITEM","SECTION","ACTIVITY","GO_BACK","FOCUS_MODE_CLASS","key","component","fmstatus","initFocusMode","get_strings","then","results","setupFocusMode","initEvents","info","on","toggleFocusMode","changeFMButtonClasses","addClass","removeClass","attr","status","tostr","M","util","set_user_preference"],"mappings":"AAAA,aAEAA,OAAO,CAAC,SAAU,qBAAsB,WAAY,aAAc,SAAUC,EAAGC,EAAQC,EAAKC,GAC1F,MAAO,CACLC,KAAM,SAAcC,GAClBL,EAAEM,UAAUC,MAAM,WAChB,IAWAC,EAYAC,EAGAC,GAfAF,EAAY,CACdG,KAAM,OACNC,kBAAmB,oBACnBC,UAAW,mBACXC,eAAgB,wBAChBC,gBAAiB,wBACjBC,aAAc,qBACdC,QAAS,WACTC,SAAU,YACVC,QAAS,WACTC,iBAAkB,aAKhBV,EAAU,CAAC,CACbW,IAAK,mBACLC,UAAW,eACV,CACDD,IAAK,oBACLC,UAAW,iBARTb,EAAO,CACTc,SAxB4BlB,IAqCzBmB,cAAgB,WACnBtB,EAAIuB,YAAYf,GAASgB,KAAK,SAAUC,GACtCjB,EAAUiB,EAEVlB,EAAKmB,iBAELnB,EAAKoB,gBAITpB,EAAKmB,eAAiB,WAGL,aAFFnB,EAAKc,SAAW,WAAa,eAGxCtB,EAAO6B,KAAKpB,EAAQ,KAQxBD,EAAKoB,WAAa,WAEhB7B,EAAEQ,EAAUK,WAAWkB,GAAG,QAAS,WACjCtB,EAAKuB,qBAITvB,EAAKwB,sBAAwB,SAAU5B,GACtB,aAAXA,IACFL,EAAEQ,EAAUG,MAAMuB,SAAS1B,EAAUY,kBACrCpB,EAAEQ,EAAUK,WAAWqB,SAAS,cAAcC,YAAY,eAC1DnC,EAAEQ,EAAUK,WAAWuB,KAAK,eAAgB,QAC5CpC,EAAEQ,EAAUM,gBAAgBoB,SAAS,eAAeC,YAAY,cAGnD,eAAX9B,IACFL,EAAEQ,EAAUG,MAAMwB,YAAY3B,EAAUY,kBACxCpB,EAAEQ,EAAUK,WAAWsB,YAAY,cAAcD,SAAS,eAC1DlC,EAAEQ,EAAUK,WAAWuB,KAAK,eAAgB,SAC5CpC,EAAEQ,EAAUM,gBAAgBoB,SAAS,aAAaC,YAAY,iBAIlE1B,EAAKuB,gBAAkB,WAErB,GAAIvB,EAAKc,SACP,IAAIlB,EAAS,aACTgC,GAAS,EACTC,EAAQ5B,EAAQ,QAEhBL,EAAS,WACTgC,GAAS,EACTC,EAAQ5B,EAAQ,GAGtBD,EAAKwB,sBAAsB5B,GAE3BI,EAAKc,SAAWc,EAChBE,EAAEC,KAAKC,oBAAoB,oBAAqBhC,EAAKc,UACrDtB,EAAO6B,KAAKQ,IAGP7B,GApGOe","sourcesContent":["\"use strict\";\ndefine(['jquery', 'theme_remui\/notice', 'core\/str', 'core\/ajax'], function($, Notice, Str, Ajax) {\n return {\n init: function(action) {\n $(document).ready(function(){\n var focusmode = FocusMode(action);\n focusmode.initFocusMode();\n });\n }\n };\n\n \/**\n * Main category filters class.\n * @return {Object} Filter object\n *\/\n function FocusMode(fmstatus) {\n\n var SELECTORS = {\n BODY: 'body',\n BUTTON_FULLSCREEN: '#toggleFullscreen',\n FM_BUTTON: '#focusmodebutton',\n FM_BUTTON_ICON: '#focusmodebutton i.fa',\n SECTION_WRAPPER: '.stepprogress-section',\n SECTION_ITEM: '.stepprogress-item',\n SECTION: '.section',\n ACTIVITY: '.activity',\n GO_BACK: '#go-back',\n FOCUS_MODE_CLASS: 'focusmode'\n };\n\n var _obj = {\n fmstatus: fmstatus\n };\n var strings = [\n {\n key: 'focusmodeenabled',\n component: 'theme_remui'\n },\n {\n key: 'focusmodedisabled',\n component: 'theme_remui'\n }\n ];\n \n \/**\n * Initialize focus mode\n *\/\n _obj.initFocusMode = function() {\n Str.get_strings(strings).then(function (results) {\n strings = results;\n _obj.setupFocusMode();\n _obj.initEvents();\n });\n };\n\n _obj.setupFocusMode = function() {\n var action = (_obj.fmstatus) ? \"activate\" : \"deactivate\";\n \n \/\/ _obj.changeFMButtonClasses(action);\n if (action === \"activate\") {\n Notice.info(strings[0]);\n }\n };\n\n \/**\n * Initialize events required for focus mode\n *\/\n _obj.initEvents = function() {\n \/\/ Toggle the Activation\/Deactivate Focus Mode\n $(SELECTORS.FM_BUTTON).on(\"click\", function(){\n _obj.toggleFocusMode();\n });\n };\n\n _obj.changeFMButtonClasses = function(action){\n if (action === \"activate\") {\n $(SELECTORS.BODY).addClass(SELECTORS.FOCUS_MODE_CLASS);\n $(SELECTORS.FM_BUTTON).addClass('btn-danger').removeClass('btn-primary');\n $(SELECTORS.FM_BUTTON).attr('aria-pressed', 'true');\n $(SELECTORS.FM_BUTTON_ICON).addClass('fa-compress').removeClass('fa-expand');\n }\n if (action === \"deactivate\") {\n $(SELECTORS.BODY).removeClass(SELECTORS.FOCUS_MODE_CLASS);\n $(SELECTORS.FM_BUTTON).removeClass('btn-danger').addClass('btn-primary');\n $(SELECTORS.FM_BUTTON).attr('aria-pressed', 'false');\n $(SELECTORS.FM_BUTTON_ICON).addClass('fa-expand').removeClass('fa-compress');\n }\n };\n\n _obj.toggleFocusMode = function(){\n \/\/ var inFocus = $('body').hasClass(SELECTORS.FOCUS_MODE_CLASS);\n if (_obj.fmstatus) {\n var action = \"deactivate\";\n var status = false;\n var tostr = strings[1];\n } else {\n var action = \"activate\";\n var status = true;\n var tostr = strings[0];\n }\n\n _obj.changeFMButtonClasses(action);\n\n _obj.fmstatus = status;\n M.util.set_user_preference('enable_focus_mode', _obj.fmstatus);\n Notice.info(tostr);\n };\n return _obj;\n }\n});\n"],"file":"course.min.js"}