Your IP : 216.73.216.95


Current Path : /var/www/ljmtc/cbt/admin/tool/dataprivacy/amd/build/
Upload File :
Current File : /var/www/ljmtc/cbt/admin/tool/dataprivacy/amd/build/form-user-selector.min.js.map

{"version":3,"sources":["../src/form-user-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","users","each","index","user","push","value","id","label","_label","transport","query","success","failure","promise","call","methodname","args","then","promises","i","render","when","apply","arguments","fail"],"mappings":"AAyBAA,OAAM,uCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAgE,CAE5DC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAK,CAAG,EAAZ,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCH,CAAK,CAACI,IAAN,CAAW,CACPC,KAAK,CAAEF,CAAI,CAACG,EADL,CAEPC,KAAK,CAAEJ,CAAI,CAACK,MAFL,CAAX,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAX2D,CAa5DS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAO,CAEDlB,CAAI,CAACmB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,4BADK,CAEjBC,IAAI,CAAE,CACFN,KAAK,CAAEA,CADL,CAFW,CAAD,CAAV,CAFV,CASAG,CAAO,CAAC,CAAD,CAAP,CAAWI,IAAX,CAAgB,SAASlB,CAAT,CAAkB,CAC9B,GAAImB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIAzB,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCe,CAAQ,CAACd,IAAT,CAAcR,CAAS,CAACwB,MAAV,CAAiB,gDAAjB,CAAmEjB,CAAnE,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAAC2B,IAAF,CAAOC,KAAP,CAAa5B,CAAC,CAAC2B,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAID,CAAAA,CAAI,CAAGO,SAAX,CACA7B,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAsB,CAClCA,CAAI,CAACK,MAAL,CAAcQ,CAAI,CAACG,CAAD,CAAlB,CACAA,CAAC,EACJ,CAHD,EAIAR,CAAO,CAACZ,CAAD,CAEV,CARM,CAUV,CApBD,EAoBGyB,IApBH,CAoBQZ,CApBR,CAqBH,CA5C2D,CAgDnE,CAlDK,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 * Potential user selector module.\n *\n * @module     tool_dataprivacy/form-user-selector\n * @class      form-user-selector\n * @package    tool_dataprivacy\n * @copyright  2018 Jun Pataleta\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\ndefine(['jquery', 'core/ajax', 'core/templates'], function($, Ajax, Templates) {\n\n    return /** @alias module:tool_dataprivacy/form-user-selector */ {\n\n        processResults: function(selector, results) {\n            var users = [];\n            $.each(results, function(index, user) {\n                users.push({\n                    value: user.id,\n                    label: user._label\n                });\n            });\n            return users;\n        },\n\n        transport: function(selector, query, success, failure) {\n            var promise;\n\n            promise = Ajax.call([{\n                methodname: 'tool_dataprivacy_get_users',\n                args: {\n                    query: query\n                }\n            }]);\n\n            promise[0].then(function(results) {\n                var promises = [],\n                    i = 0;\n\n                // Render the label.\n                $.each(results, function(index, user) {\n                    promises.push(Templates.render('tool_dataprivacy/form-user-selector-suggestion', user));\n                });\n\n                // Apply the label to the results.\n                return $.when.apply($.when, promises).then(function() {\n                    var args = arguments;\n                    $.each(results, function(index, user) {\n                        user._label = args[i];\n                        i++;\n                    });\n                    success(results);\n                    return;\n                });\n\n            }).fail(failure);\n        }\n\n    };\n\n});\n"],"file":"form-user-selector.min.js"}