/
var
/
www
/
html
/
lgpd
/
message
/
amd
/
build
/
Upload File
HOME
{"version":3,"sources":["../src/notification_processor.js"],"names":["define","$","SELECTORS","STATE_NONE","STATE_BOTH","STATE_LOGGED_IN","STATE_LOGGED_OFF","NotificationProcessor","element","root","prototype","getName","attr","isLoggedInEnabled","none","find","prop","both","loggedIn","isLoggedOffEnabled","loggedOff"],"mappings":"AAwBAA,OAAM,uCAAC,CAAC,QAAD,CAAD,CAAa,SAASC,CAAT,CAAY,IACvBC,CAAAA,CAAS,CAAG,CACZC,UAAU,CAAE,uBADA,CAEZC,UAAU,CAAE,uBAFA,CAGZC,eAAe,CAAE,2BAHL,CAIZC,gBAAgB,CAAE,4BAJN,CADW,CAavBC,CAAqB,CAAG,SAASC,CAAT,CAAkB,CAC1C,KAAKC,IAAL,CAAYR,CAAC,CAACO,CAAD,CAChB,CAf0B,CAuB3BD,CAAqB,CAACG,SAAtB,CAAgCC,OAAhC,CAA0C,UAAW,CACjD,MAAO,MAAKF,IAAL,CAAUG,IAAV,CAAe,qBAAf,CACV,CAFD,CAUAL,CAAqB,CAACG,SAAtB,CAAgCG,iBAAhC,CAAoD,UAAW,CAC3D,GAAIC,CAAAA,CAAI,CAAG,KAAKL,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACC,UAAzB,EAAqCY,IAArC,CAA0C,OAA1C,CAAX,CAEA,GAAID,CAAI,CAACE,IAAL,CAAU,SAAV,CAAJ,CAA0B,CACtB,QACH,CAL0D,GAOvDC,CAAAA,CAAI,CAAG,KAAKR,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACE,UAAzB,EAAqCW,IAArC,CAA0C,OAA1C,CAPgD,CAQvDG,CAAQ,CAAG,KAAKT,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACG,eAAzB,EAA0CU,IAA1C,CAA+C,OAA/C,CAR4C,CAU3D,MAAOG,CAAAA,CAAQ,CAACF,IAAT,CAAc,SAAd,GAA4BC,CAAI,CAACD,IAAL,CAAU,SAAV,CACtC,CAXD,CAmBAT,CAAqB,CAACG,SAAtB,CAAgCS,kBAAhC,CAAqD,UAAW,CAC5D,GAAIL,CAAAA,CAAI,CAAG,KAAKL,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACC,UAAzB,EAAqCY,IAArC,CAA0C,OAA1C,CAAX,CAEA,GAAID,CAAI,CAACE,IAAL,CAAU,SAAV,CAAJ,CAA0B,CACtB,QACH,CAL2D,GAOxDC,CAAAA,CAAI,CAAG,KAAKR,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACE,UAAzB,EAAqCW,IAArC,CAA0C,OAA1C,CAPiD,CAQxDK,CAAS,CAAG,KAAKX,IAAL,CAAUM,IAAV,CAAeb,CAAS,CAACI,gBAAzB,EAA2CS,IAA3C,CAAgD,OAAhD,CAR4C,CAU5D,MAAOK,CAAAA,CAAS,CAACJ,IAAV,CAAe,SAAf,GAA6BC,CAAI,CAACD,IAAL,CAAU,SAAV,CACvC,CAXD,CAaA,MAAOT,CAAAA,CACV,CAlEK,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 * Represents the notification processor (e.g. email, popup, jabber)\n *\n * @module core_message/notification_processor\n * @class notification_processor\n * @package message\n * @copyright 2016 Ryan Wyllie <ryan@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n var SELECTORS = {\n STATE_NONE: '[data-state=\"none\"]',\n STATE_BOTH: '[data-state=\"both\"]',\n STATE_LOGGED_IN: '[data-state=\"loggedin\"]',\n STATE_LOGGED_OFF: '[data-state=\"loggedoff\"]',\n };\n\n /**\n * Constructor for the notification processor.\n *\n * @param {object} element jQuery object root element of the processor\n */\n var NotificationProcessor = function(element) {\n this.root = $(element);\n };\n\n /**\n * Get the processor name.\n *\n * @method getName\n * @return {string}\n */\n NotificationProcessor.prototype.getName = function() {\n return this.root.attr('data-processor-name');\n };\n\n /**\n * Check if the processor is enabled when the user is logged in.\n *\n * @method isLoggedInEnabled\n * @return {bool}\n */\n NotificationProcessor.prototype.isLoggedInEnabled = function() {\n var none = this.root.find(SELECTORS.STATE_NONE).find('input');\n\n if (none.prop('checked')) {\n return false;\n }\n\n var both = this.root.find(SELECTORS.STATE_BOTH).find('input');\n var loggedIn = this.root.find(SELECTORS.STATE_LOGGED_IN).find('input');\n\n return loggedIn.prop('checked') || both.prop('checked');\n };\n\n /**\n * Check if the processor is enabled when the user is logged out.\n *\n * @method isLoggedOffEnabled\n * @return {bool}\n */\n NotificationProcessor.prototype.isLoggedOffEnabled = function() {\n var none = this.root.find(SELECTORS.STATE_NONE).find('input');\n\n if (none.prop('checked')) {\n return false;\n }\n\n var both = this.root.find(SELECTORS.STATE_BOTH).find('input');\n var loggedOff = this.root.find(SELECTORS.STATE_LOGGED_OFF).find('input');\n\n return loggedOff.prop('checked') || both.prop('checked');\n };\n\n return NotificationProcessor;\n});\n"],"file":"notification_processor.min.js"}