Sindbad~EG File Manager

Current Path : /var/www/html/ch.sumar.com.py/cursos/theme/snap/amd/build/
Upload File :
Current File : /var/www/html/ch.sumar.com.py/cursos/theme/snap/amd/build/pm_course_cards.min.js.map

{"version":3,"file":"pm_course_cards.min.js","sources":["../src/pm_course_cards.js"],"sourcesContent":["/**\n * 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 * @package\n * @copyright Copyright (c) 2016 Open LMS (https://www.openlms.net)\n * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n/**\n * Personal menu course cards.\n */\ndefine(['jquery', 'core/log', 'core/templates', 'theme_snap/pm_course_favorites',\n    'theme_snap/model_view', 'theme_snap/ajax_notification', 'theme_snap/util',\n    'theme_snap/appear'],\n    function($, log, templates, courseFavorites, mview, ajaxNotify, util, appear) {\n\n        var CourseCards = function() {\n\n            var self = this;\n\n            /**\n             * Apply course information to courses in personal menu.\n             *\n             * @param {Array} crsinfo\n             */\n            this.applyCourseInfo = function(crsinfo) {\n                // Pre-load template or it will get loaded multiple times with a detriment on performance.\n                templates.render('theme_snap/course_cards', [])\n                    .done(function() {\n                        for (var i in crsinfo) {\n                            var info = crsinfo[i];\n                            log.debug('applying course data for courseid ' + info.course);\n                            var cardEl = $('.coursecard[data-courseid=\"' + info.course + '\"]');\n                            mview(cardEl, 'theme_snap/course_cards');\n                            $(cardEl).trigger('modelUpdate', info);\n                        }\n                    });\n            };\n\n            /**\n             * Request courseids.\n             * @param {number[]} courseids\n             */\n            this.reqCourseInfo = function(courseids) {\n                if (courseids.length === 0) {\n                    return;\n                }\n                // Get course info via ajax.\n                var courseiddata = 'courseids=' + courseids.join(',');\n                var courseInfoKey = M.cfg.sesskey + 'coursecard';\n                log.debug(\"fetching course data\");\n                $.ajax({\n                    type: \"GET\",\n                    async: true,\n                    url: M.cfg.wwwroot + '/theme/snap/rest.php?action=get_courseinfo&contextid=' + M.cfg.context,\n                    data: courseiddata,\n                    success: function(data) {\n                        ajaxNotify.ifErrorShowBestMsg(data).done(function(errorShown) {\n                            if (errorShown) {\n                                return;\n                            } else {\n                                // No errors, apply course info.\n                                if (data.info) {\n                                    log.debug('fetched coursedata', data.info);\n                                    if (util.supportsSessionStorage()) {\n                                        window.sessionStorage[courseInfoKey] = JSON.stringify(data.info);\n                                    }\n                                    self.applyCourseInfo(data.info);\n                                } else {\n                                    log.warn('fetched coursedata with error: JSON data object is missing info property', data);\n                                }\n                            }\n                        });\n                    }\n                });\n            };\n\n            /**\n             * Get course ids from cards.\n             * @returns {Array}\n             */\n            this.getCourseIds = function() {\n                var courseIds = [];\n                $('.coursecard').each(function() {\n                    courseIds.push($(this).attr('data-courseid'));\n                });\n                return courseIds;\n            };\n\n            this.applyAppearForImages = function() {\n                appear(document.body).on('appear', '.coursecard', function(e, appeared) {\n                    appeared.each(function() {\n                        var imgurl = $(this).data('image-url');\n                        if (imgurl !== undefined) {\n                            var card = $(this);\n                            // We use a fake image element to track the loading of the image so we can insert the\n                            // background image once the image is loaded. If we didn't do this then we'd see a flicker\n                            // from the course card gradient to the main brand colour before the image loaded.\n                            $('<img src=\"' + imgurl.trim() + '\" />').on('load', function() {\n                                $(card).css('background-image', 'url(' + imgurl.trim() + ')');\n                            });\n                        }\n                    });\n                });\n\n                /**\n                 * Detect when animation is completed.\n                 * https://davidwalsh.name/css-animation-callback\n                 * @returns {string}\n                 */\n                function whichAnimationEvent() {\n                    var t;\n                    var el = document.createElement('fakeelement');\n                    var res = 'Animationend';\n                    var animations = {\n                        'Animation': 'Animationend',\n                        'OAnimation': 'oAnimationEnd',\n                        'MozAnimation': 'Animationend',\n                        'WebkitAnimation': 'webkitAnimationEnd'\n                    };\n\n                    for (t in animations) {\n                        if (el.style[t] !== undefined) {\n                            res = animations[t];\n                            break;\n                        }\n                    }\n                    return res; // Adding a default return value.\n                }\n\n                // When the course archive navigation elements are clicked we need to force appear to check for\n                // newly visible course cards.\n                $('#snap-pm-courses .nav-tabs .nav-link').on('click', function() {\n                    var selector = $(this).attr('href');\n                    // Note, appear does not play nicely with CSS animations so we are waiting for the animation to\n                    // complete before we force appear to check for newly visible cards.\n                    $(selector)[0].addEventListener(whichAnimationEvent(), function() {\n                        $.force_appear();\n                    }, false);\n                });\n\n                // Appear configuration - start loading images when they are out of the view port by 100px.\n                var appearConf = {appeartopoffset: 100, appearleftoffset: 100};\n                $('.coursecard').appear(appearConf);\n                appear.force_appear();\n            };\n\n            /**\n             * Initialising function.\n             */\n            this.init = function() {\n                $(document).ready(function() {\n                    courseFavorites();\n\n                    // Load course information via ajax.\n                    var courseIds = self.getCourseIds();\n                    var courseInfoKey = M.cfg.sesskey + 'coursecard';\n                    if (courseIds.length > 0) {\n                        self.applyAppearForImages();\n                        // OK - lets see if we have grades/progress in session storage.\n                        if (util.supportsSessionStorage() && window.sessionStorage[courseInfoKey]) {\n                            var courseinfo = JSON.parse(window.sessionStorage[courseInfoKey]);\n                            self.applyCourseInfo(courseinfo);\n                        } else {\n                            // Only make AJAX request on document ready if the session storage isn't populated.\n                            self.reqCourseInfo(courseIds);\n                        }\n                    }\n                });\n\n                // Personal menu course card clickable.\n                $(document).on('click', '.coursecard[data-href]', function(e) {\n                    var trigger = $(e.target),\n                        hreftarget = '_self';\n                    // Excludes any clicks in the card deeplinks.\n                    if (!$(trigger).closest('a').length) {\n                        window.open($(this).data('href'), hreftarget);\n                        e.preventDefault();\n                    }\n                });\n            };\n\n        };\n\n        return new CourseCards();\n    }\n);\n"],"names":["define","$","log","templates","courseFavorites","mview","ajaxNotify","util","appear","self","this","applyCourseInfo","crsinfo","render","done","i","info","debug","course","cardEl","trigger","reqCourseInfo","courseids","length","courseiddata","join","courseInfoKey","M","cfg","sesskey","ajax","type","async","url","wwwroot","context","data","success","ifErrorShowBestMsg","errorShown","supportsSessionStorage","window","sessionStorage","JSON","stringify","warn","getCourseIds","courseIds","each","push","attr","applyAppearForImages","document","body","on","e","appeared","imgurl","undefined","card","trim","css","selector","addEventListener","t","el","createElement","res","animations","style","whichAnimationEvent","force_appear","appeartopoffset","appearleftoffset","init","ready","courseinfo","parse","target","closest","open","preventDefault"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwBAA,oCAAO,CAAC,SAAU,WAAY,iBAAkB,iCAC5C,wBAAyB,+BAAgC,kBACzD,sBACA,SAASC,EAAGC,IAAKC,UAAWC,gBAAiBC,MAAOC,WAAYC,KAAMC,eA0K3D,IAxKW,eAEVC,KAAOC,UAONC,gBAAkB,SAASC,SAE5BT,UAAUU,OAAO,0BAA2B,IACvCC,MAAK,eACG,IAAIC,KAAKH,QAAS,KACfI,KAAOJ,QAAQG,GACnBb,IAAIe,MAAM,qCAAuCD,KAAKE,YAClDC,OAASlB,EAAE,8BAAgCe,KAAKE,OAAS,MAC7Db,MAAMc,OAAQ,2BACdlB,EAAEkB,QAAQC,QAAQ,cAAeJ,gBAS5CK,cAAgB,SAASC,cACD,IAArBA,UAAUC,YAIVC,aAAe,aAAeF,UAAUG,KAAK,KAC7CC,cAAgBC,EAAEC,IAAIC,QAAU,aACpC3B,IAAIe,MAAM,wBACVhB,EAAE6B,KAAK,CACHC,KAAM,MACNC,OAAO,EACPC,IAAKN,EAAEC,IAAIM,QAAU,wDAA0DP,EAAEC,IAAIO,QACrFC,KAAMZ,aACNa,QAAS,SAASD,MACd9B,WAAWgC,mBAAmBF,MAAMtB,MAAK,SAASyB,YAC1CA,aAIIH,KAAKpB,MACLd,IAAIe,MAAM,qBAAsBmB,KAAKpB,MACjCT,KAAKiC,2BACLC,OAAOC,eAAehB,eAAiBiB,KAAKC,UA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