Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{"version":3,"file":"message_drawer_view_contact.min.js","sources":["../src/message_drawer_view_contact.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 * Controls the contact page in the message drawer.\n *\n * @module     core_message/message_drawer_view_contact\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/str',\n    'core/templates'\n],\nfunction(\n    $,\n    Str,\n    Templates\n) {\n\n    var SELECTORS = {\n        CONTENT_CONTAINER: '[data-region=\"content-container\"]'\n    };\n\n    var TEMPLATES = {\n        CONTENT: 'core_message/message_drawer_view_contact_body_content'\n    };\n\n    /**\n     * Get the content container of the contact view container.\n     *\n     * @param {Object} root Contact container element.\n     * @returns {Object} jQuery object\n     */\n    var getContentContainer = function(root) {\n        return root.find(SELECTORS.CONTENT_CONTAINER);\n    };\n\n    /**\n     * Render the contact profile in the content container.\n     *\n     * @param {Object} root Contact container element.\n     * @param {Object} profile Contact profile details.\n     * @returns {Object} jQuery promise\n     */\n    var render = function(root, profile) {\n        return Templates.render(TEMPLATES.CONTENT, profile)\n            .then(function(html) {\n                getContentContainer(root).append(html);\n                return html;\n            });\n    };\n\n    /**\n     * Setup the contact page.\n     *\n     * @param {string} namespace The route namespace.\n     * @param {Object} header Contact header element.\n     * @param {Object} body Contact body container element.\n     * @param {Object} footer Contact footer container element.\n     * @param {Object} contact The contact object.\n     * @returns {Object} jQuery promise\n     */\n    var show = function(namespace, header, body, footer, contact) {\n        var root = $(body);\n\n        getContentContainer(root).empty();\n        return render(root, contact);\n    };\n\n    /**\n     * String describing this page used for aria-labels.\n     *\n     * @param {Object} root Contact container element.\n     * @param {Object} contact The contact object.\n     * @return {Object} jQuery promise\n     */\n    var description = function(root, contact) {\n        return Str.get_string('messagedrawerviewcontact', 'core_message', contact.fullname);\n    };\n\n    return {\n        show: show,\n        description: description\n    };\n});\n"],"names":["define","$","Str","Templates","SELECTORS","TEMPLATES","getContentContainer","root","find","show","namespace","header","body","footer","contact","empty","profile","render","then","html","append","description","get_string","fullname"],"mappings":";;;;;;;AAsBAA,kDACA,CACI,SACA,WACA,mBAEJ,SACIC,EACAC,IACAC,eAGIC,4BACmB,oCAGnBC,kBACS,wDASTC,oBAAsB,SAASC,aACxBA,KAAKC,KAAKJ,oCA8Cd,CACHK,KAnBO,SAASC,UAAWC,OAAQC,KAAMC,OAAQC,aAC7CP,KAAON,EAAEW,aAEbN,oBAAoBC,MAAMQ,QArBjB,SAASR,KAAMS,gBACjBb,UAAUc,OAAOZ,kBAAmBW,SACtCE,MAAK,SAASC,aACXb,oBAAoBC,MAAMa,OAAOD,MAC1BA,QAkBRF,CAAOV,KAAMO,UAgBpBO,YANc,SAASd,KAAMO,gBACtBZ,IAAIoB,WAAW,2BAA4B,eAAgBR,QAAQS"}