Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{"version":3,"file":"notification_processor.min.js","sources":["../src/notification_processor.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 * Represents the notification processor (e.g. email, popup, jabber)\n *\n * @module     core_message/notification_processor\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    const SELECTORS = {\n        STATE_INPUTS: '.preference-state input.notification_enabled'\n    };\n\n    /**\n     * Constructor for the notification processor.\n     *\n     * @class\n     * @param {object} element jQuery object root element of the processor\n     */\n    const 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.isEnabled = function() {\n        const enabled = this.root.find(SELECTORS.STATE_INPUTS);\n\n        return enabled.prop('checked');\n    };\n\n    return NotificationProcessor;\n});\n"],"names":["define","$","SELECTORS","NotificationProcessor","element","root","prototype","getName","this","attr","isEnabled","find","prop"],"mappings":";;;;;;;AAsBAA,6CAAO,CAAC,WAAW,SAASC,SAClBC,uBACY,+CASZC,sBAAwB,SAASC,cAC9BC,KAAOJ,EAAEG,iBASlBD,sBAAsBG,UAAUC,QAAU,kBAC/BC,KAAKH,KAAKI,KAAK,wBAS1BN,sBAAsBG,UAAUI,UAAY,kBACxBF,KAAKH,KAAKM,KAAKT,wBAEhBU,KAAK,YAGjBT"}