%PDF- %PDF-
| Direktori : /opt/bitnami/apps/moodle/htdocs.backup/message/amd/build/ |
| Current File : /opt/bitnami/apps/moodle/htdocs.backup/message/amd/build/message_popover.min.js.map |
{"version":3,"sources":["../src/message_popover.js"],"names":["define","$","CustomEvents","PubSub","MessageDrawerEvents","SELECTORS","COUNT_CONTAINER","toggleMessageDrawerVisibility","publish","TOGGLE_VISIBILITY","handleDecrementConversationCount","root","countContainer","find","count","parseInt","text","isNaN","addClass","registerEventListeners","events","activate","on","e","data","originalEvent","preventDefault","subscribe","CONVERSATION_READ","CONTACT_REQUEST_ACCEPTED","CONTACT_REQUEST_DECLINED","init"],"mappings":"AAsBAA,OAAM,gCACN,CACI,QADJ,CAEI,gCAFJ,CAGI,aAHJ,CAII,oCAJJ,CADM,CAON,SACIC,CADJ,CAEIC,CAFJ,CAGIC,CAHJ,CAIIC,CAJJ,CAKE,IACMC,CAAAA,CAAS,CAAG,CACZC,eAAe,CAAE,mCADL,CADlB,CAQMC,CAA6B,CAAG,UAAW,CAC3CJ,CAAM,CAACK,OAAP,CAAeJ,CAAmB,CAACK,iBAAnC,CACH,CAVH,CAmBMC,CAAgC,CAAG,SAASC,CAAT,CAAe,CAClD,MAAO,WAAW,IACVC,CAAAA,CAAc,CAAGD,CAAI,CAACE,IAAL,CAAUR,CAAS,CAACC,eAApB,CADP,CAEVQ,CAAK,CAAGC,QAAQ,CAACH,CAAc,CAACI,IAAf,EAAD,CAAwB,EAAxB,CAFN,CAId,GAAIC,KAAK,CAACH,CAAD,CAAT,CAAkB,CACdF,CAAc,CAACM,QAAf,CAAwB,QAAxB,CACH,CAFD,IAEO,IAAI,CAACJ,CAAD,EAAkB,CAAR,CAAAA,CAAd,CAAyB,CAC5BF,CAAc,CAACM,QAAf,CAAwB,QAAxB,CACH,CAFM,IAEA,CACHJ,CAAK,CAAGA,CAAK,CAAG,CAAhB,CACAF,CAAc,CAACI,IAAf,CAAoBF,CAApB,CACH,CACJ,CACJ,CAjCH,CAyCMK,CAAsB,CAAG,SAASR,CAAT,CAAe,CACxCT,CAAY,CAACF,MAAb,CAAoBW,CAApB,CAA0B,CAACT,CAAY,CAACkB,MAAb,CAAoBC,QAArB,CAA1B,EAEAV,CAAI,CAACW,EAAL,CAAQpB,CAAY,CAACkB,MAAb,CAAoBC,QAA5B,CAAsC,SAASE,CAAT,CAAYC,CAAZ,CAAkB,CACpDjB,CAA6B,GAC7BiB,CAAI,CAACC,aAAL,CAAmBC,cAAnB,EACH,CAHD,EAKAvB,CAAM,CAACwB,SAAP,CAAiBvB,CAAmB,CAACwB,iBAArC,CAAwDlB,CAAgC,CAACC,CAAD,CAAxF,EACAR,CAAM,CAACwB,SAAP,CAAiBvB,CAAmB,CAACyB,wBAArC,CAA+DnB,CAAgC,CAACC,CAAD,CAA/F,EACAR,CAAM,CAACwB,SAAP,CAAiBvB,CAAmB,CAAC0B,wBAArC,CAA+DpB,CAAgC,CAACC,CAAD,CAA/F,CACH,CApDH,CAgEE,MAAO,CACHoB,IAAI,CANG,QAAPA,CAAAA,IAAO,CAASpB,CAAT,CAAe,CACtBA,CAAI,CAAGV,CAAC,CAACU,CAAD,CAAR,CACAQ,CAAsB,CAACR,CAAD,CACzB,CAEM,CAGV,CA/EK,CAAN","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 * Controls the message popover in the nav bar.\n *\n * @module core_message/message_popover\n * @copyright 2018 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(\n[\n 'jquery',\n 'core/custom_interaction_events',\n 'core/pubsub',\n 'core_message/message_drawer_events'\n],\nfunction(\n $,\n CustomEvents,\n PubSub,\n MessageDrawerEvents\n) {\n var SELECTORS = {\n COUNT_CONTAINER: '[data-region=\"count-container\"]'\n };\n\n /**\n * Toggle the message drawer visibility.\n */\n var toggleMessageDrawerVisibility = function() {\n PubSub.publish(MessageDrawerEvents.TOGGLE_VISIBILITY);\n };\n\n /**\n * Decrement the unread conversation count in the nav bar if a conversation\n * is read. When there are no unread conversations then hide the counter.\n *\n * @param {Object} root The root element for the popover.\n * @return {Function}\n */\n var handleDecrementConversationCount = function(root) {\n return function() {\n var countContainer = root.find(SELECTORS.COUNT_CONTAINER);\n var count = parseInt(countContainer.text(), 10);\n\n if (isNaN(count)) {\n countContainer.addClass('hidden');\n } else if (!count || count < 2) {\n countContainer.addClass('hidden');\n } else {\n count = count - 1;\n countContainer.text(count);\n }\n };\n };\n\n /**\n * Add events listeners for when the popover icon is clicked and when conversations\n * are read.\n *\n * @param {Object} root The root element for the popover.\n */\n var registerEventListeners = function(root) {\n CustomEvents.define(root, [CustomEvents.events.activate]);\n\n root.on(CustomEvents.events.activate, function(e, data) {\n toggleMessageDrawerVisibility();\n data.originalEvent.preventDefault();\n });\n\n PubSub.subscribe(MessageDrawerEvents.CONVERSATION_READ, handleDecrementConversationCount(root));\n PubSub.subscribe(MessageDrawerEvents.CONTACT_REQUEST_ACCEPTED, handleDecrementConversationCount(root));\n PubSub.subscribe(MessageDrawerEvents.CONTACT_REQUEST_DECLINED, handleDecrementConversationCount(root));\n };\n\n /**\n * Initialise the message popover.\n *\n * @param {Object} root The root element for the popover.\n */\n var init = function(root) {\n root = $(root);\n registerEventListeners(root);\n };\n\n return {\n init: init,\n };\n});\n"],"file":"message_popover.min.js"}