HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.0.30
System: Linux multiplicar 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64
User: root (0)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /var/www/html/dls/mod/forum/amd/build/posts_list.min.js.map
{"version":3,"file":"posts_list.min.js","sources":["../src/posts_list.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 * This module is the highest level module for the calendar. It is\n * responsible for initialising all of the components required for\n * the calendar to run. It also coordinates the interaction between\n * components by listening for and responding to different events\n * triggered within the calendar UI.\n *\n * @module     mod_forum/posts_list\n * @copyright  2019 Peter Dias\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine([\n        'jquery',\n        'core/templates',\n        'core/notification',\n        'core/pending',\n        'core/yui',\n        'mod_forum/selectors',\n        'mod_forum/inpage_reply',\n    ], function(\n        $,\n        Templates,\n        Notification,\n        Pending,\n        Y,\n        Selectors,\n        InPageReply\n    ) {\n\n    var registerEventListeners = function(root, throttlingwarningmsg) {\n        root.on('click', Selectors.post.inpageReplyLink, function(e) {\n            e.preventDefault();\n            // After adding a reply a url hash is being generated that scrolls (points) to the newly added reply.\n            // The hash being present causes this scrolling behavior to the particular reply to persists even when\n            // another, non-related in-page replay link is being clicked which ultimately causes a bad user experience.\n            // A particular solution for this problem would be changing the browser's history state when a url hash is\n            // present.\n            if (window.location.hash) {\n                // Remove the fragment identifier from the url.\n                var url = window.location.href.split('#')[0];\n                history.pushState({}, document.title, url);\n            }\n            var pending = new Pending('inpage-reply');\n            var currentTarget = $(e.currentTarget).parents(Selectors.post.forumCoreContent);\n            var currentSubject = currentTarget.find(Selectors.post.forumSubject);\n            var currentRoot = $(e.currentTarget).parents(Selectors.post.forumContent);\n            var context = {\n                postid: $(currentRoot).data('post-id'),\n                \"reply_url\": $(e.currentTarget).attr('href'),\n                sesskey: M.cfg.sesskey,\n                parentsubject: currentSubject.data('replySubject'),\n                canreplyprivately: $(e.currentTarget).data('can-reply-privately'),\n                postformat: InPageReply.CONTENT_FORMATS.MOODLE,\n                throttlingwarningmsg: throttlingwarningmsg\n            };\n\n            if (!currentRoot.find(Selectors.post.inpageReplyContent).length) {\n                Templates.render('mod_forum/inpage_reply', context)\n                    .then(function(html, js) {\n                        return Templates.appendNodeContents(currentTarget, html, js);\n                    })\n                    .then(function() {\n                        return currentRoot.find(Selectors.post.inpageReplyContent)\n                            .slideToggle(300, pending.resolve).find('textarea').focus();\n                    })\n                    .then(function() {\n                        // Load formchangechecker module.\n                        Y.use('moodle-core-formchangechecker', () => {\n                            M.core_formchangechecker.init({formid: `inpage-reply-${context.postid}`});\n                        });\n                        return;\n                    })\n                    .fail(Notification.exception);\n            } else {\n                var form = currentRoot.find(Selectors.post.inpageReplyContent);\n                form.slideToggle(300, pending.resolve);\n                if (form.is(':visible')) {\n                    form.find('textarea').focus();\n                }\n            }\n        });\n    };\n\n    return {\n        init: function(root, throttlingwarningmsg) {\n            registerEventListeners(root, throttlingwarningmsg);\n            InPageReply.init(root);\n        }\n    };\n});\n"],"names":["define","$","Templates","Notification","Pending","Y","Selectors","InPageReply","init","root","throttlingwarningmsg","on","post","inpageReplyLink","e","preventDefault","window","location","hash","url","href","split","history","pushState","document","title","pending","currentTarget","parents","forumCoreContent","currentSubject","find","forumSubject","currentRoot","forumContent","context","postid","data","attr","sesskey","M","cfg","parentsubject","canreplyprivately","postformat","CONTENT_FORMATS","MOODLE","inpageReplyContent","length","form","slideToggle","resolve","is","focus","render","then","html","js","appendNodeContents","use","core_formchangechecker","formid","fail","exception","registerEventListeners"],"mappings":";;;;;;;;;;;AA0BAA,8BAAO,CACC,SACA,iBACA,oBACA,eACA,WACA,sBACA,2BACD,SACCC,EACAC,UACAC,aACAC,QACAC,EACAC,UACAC,mBAyDG,CACHC,KAAM,SAASC,KAAMC,uBAvDI,SAASD,KAAMC,sBACxCD,KAAKE,GAAG,QAASL,UAAUM,KAAKC,iBAAiB,SAASC,MACtDA,EAAEC,iBAMEC,OAAOC,SAASC,KAAM,KAElBC,IAAMH,OAAOC,SAASG,KAAKC,MAAM,KAAK,GAC1CC,QAAQC,UAAU,GAAIC,SAASC,MAAON,SAEtCO,QAAU,IAAItB,QAAQ,gBACtBuB,cAAgB1B,EAAEa,EAAEa,eAAeC,QAAQtB,UAAUM,KAAKiB,kBAC1DC,eAAiBH,cAAcI,KAAKzB,UAAUM,KAAKoB,cACnDC,YAAchC,EAAEa,EAAEa,eAAeC,QAAQtB,UAAUM,KAAKsB,cACxDC,QAAU,CACVC,OAAQnC,EAAEgC,aAAaI,KAAK,qBACfpC,EAAEa,EAAEa,eAAeW,KAAK,QACrCC,QAASC,EAAEC,IAAIF,QACfG,cAAeZ,eAAeO,KAAK,gBACnCM,kBAAmB1C,EAAEa,EAAEa,eAAeU,KAAK,uBAC3CO,WAAYrC,YAAYsC,gBAAgBC,OACxCpC,qBAAsBA,yBAGrBuB,YAAYF,KAAKzB,UAAUM,KAAKmC,oBAAoBC,OAiBlD,KACCC,KAAOhB,YAAYF,KAAKzB,UAAUM,KAAKmC,oBAC3CE,KAAKC,YAAY,IAAKxB,QAAQyB,SAC1BF,KAAKG,GAAG,aACRH,KAAKlB,KAAK,YAAYsB,aApB1BnD,UAAUoD,OAAO,yBAA0BnB,SACtCoB,MAAK,SAASC,KAAMC,WACVvD,UAAUwD,mBAAmB/B,cAAe6B,KAAMC,OAE5DF,MAAK,kBACKtB,YAAYF,KAAKzB,UAAUM,KAAKmC,oBAClCG,YAAY,IAAKxB,QAAQyB,SAASpB,KAAK,YAAYsB,WAE3DE,MAAK,WAEFlD,EAAEsD,IAAI,iCAAiC,WACnCnB,EAAEoB,uBAAuBpD,KAAK,CAACqD,8BAAwB1B,QAAQC,gBAItE0B,KAAK3D,aAAa4D,cAa3BC,CAAuBvD,KAAMC,sBAC7BH,YAAYC,KAAKC"}