1 line
5.2 KiB
Text
1 line
5.2 KiB
Text
|
{"version":3,"sources":["../src/dialogue.js"],"names":["define","Y","dialogue","title","content","afterShow","afterHide","wide","yuiDialogue","parent","use","width","M","core","headerContent","bodyContent","draggable","visible","center","modal","after","e","newVal","soon","centerDialogue","show","prototype","close","hide","destroy","getContent","bodyNode","getDOMNode"],"mappings":"AAwBAA,OAAM,2BAAC,CAAC,UAAD,CAAD,CAAe,SAASC,CAAT,CAAY,CAW7B,GAAIC,CAAAA,CAAQ,CAAG,SAASC,CAAT,CAAgBC,CAAhB,CAAyBC,CAAzB,CAAoCC,CAApC,CAA+CC,CAA/C,CAAqD,CAChE,KAAKC,WAAL,CAAmB,IAAnB,CACA,GAAIC,CAAAA,CAAM,CAAG,IAAb,CAGA,GAAmB,WAAf,QAAOF,CAAAA,CAAX,CAAgC,CAC5BA,CAAI,GACP,CAEDN,CAAC,CAACS,GAAF,CAAM,0BAAN,CAAkC,QAAlC,CAA4C,UAAW,CACnD,GAAIC,CAAAA,CAAK,CAAG,OAAZ,CACA,GAAIJ,CAAJ,CAAU,CACNI,CAAK,CAAG,OACX,CAEDF,CAAM,CAACD,WAAP,CAAqB,GAAII,CAAAA,CAAC,CAACC,IAAF,CAAOX,QAAX,CAAoB,CACrCY,aAAa,CAAEX,CADsB,CAErCY,WAAW,CAAEX,CAFwB,CAGrCY,SAAS,GAH4B,CAIrCC,OAAO,GAJ8B,CAKrCC,MAAM,GAL+B,CAMrCC,KAAK,GANgC,CAOrCR,KAAK,CAAEA,CAP8B,CAApB,CAArB,CAUAF,CAAM,CAACD,WAAP,CAAmBY,KAAnB,CAAyB,eAAzB,CAA0C,SAASC,CAAT,CAAY,CAClD,GAAIA,CAAC,CAACC,MAAN,CAAc,CAGV,GAA0B,WAArB,QAAOjB,CAAAA,CAAZ,CAAwC,CACpCJ,CAAC,CAACsB,IAAF,CAAO,UAAW,CACdlB,CAAS,CAACI,CAAD,CAAT,CACAA,CAAM,CAACD,WAAP,CAAmBgB,cAAnB,EACH,CAHD,CAIH,CACJ,CATD,IASO,CACH,GAA0B,WAArB,QAAOlB,CAAAA,CAAZ,CAAwC,CACpCL,CAAC,CAACsB,IAAF,CAAO,UAAW,CACdjB,CAAS,CAACG,CAAD,CACZ,CAFD,CAGH,CACJ,CACJ,CAjBD,EAmBAA,CAAM,CAACD,WAAP,CAAmBiB,IAAnB,EACH,CApCD,CAqCH,CA9CD,CAmDAvB,CAAQ,CAACwB,SAAT,CAAmBC,KAAnB,CAA2B,UAAW,CAClC,KAAKnB,WAAL,CAAiBoB,IAAjB,GACA,KAAKpB,WAAL,CAAiBqB,OAAjB,EACH,CAHD,CAUA3B,CAAQ,CAACwB,SAAT,CAAmBI,UAAnB,CAAgC,UAAW,CACvC,MAAO,MAAKtB,WAAL,CAAiBuB,QAAjB,CAA0BC,UAA1B,EACV,CAFD,CAIA,MAAO9B,CAAAA,CACV,CA7EK,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 * Wrapper for the YUI M.core.notification class. Allows us to\n * use the YUI version in AMD code until it is replaced.\n *\n * @module mod_customcert/dialogue\n * @package mod_customcert\n * @copyright 2016 Mark Nelson <markn@moodle.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['core/yui'], function(Y) {\n\n /**\n * Constructor\n *\n * @param {String} title Title for the window.\n * @param {String} content The content for the window.\n * @param {function} afterShow Callback executed after the window is opened.\n * @param {function} afterHide Callback executed after the window is closed.\n * @param {Boolean} wide Specify we want an extra wide dialogue (the size is standard, but wider than the default).\n */\n var dialogue = function(title, content, afterShow, afterHide, wide) {\n this.yuiDialogue = null;\n var parent = this;\n\n // Default for wide is false.\n if (typeof wide == 'undefined') {\n wide = false;\n }\n\n Y.use('moodle-core-notification', 'timers', function() {\n var width = '480px';\n if (wide) {\n width = '800px';\n }\n\n parent.yuiDialogue = new M.core.dialogue({\n headerContent: title,\n bodyContent: content,\n draggable: true,\n visible: false,\n center: true,\n modal: true,\n width: width\n });\n\n parent.yuiDialogue.after('visibleChange', function(e) {\n
|