Current Path : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/ |
Current File : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/form-cohort-selector.min.js.map |
{"version":3,"sources":["../src/form-cohort-selector.js"],"names":["define","$","Ajax","Templates","processResults","selector","results","cohorts","each","index","cohort","push","value","id","label","_label","transport","query","success","failure","promise","contextid","parseInt","data","includes","call","methodname","args","context","then","promises","i","render","when","apply","arguments","catch"],"mappings":"AAyBAA,OAAM,gCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,gBAAxB,CAAD,CAA4C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAA6B,CAE3E,MAAyD,CAErDC,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIC,CAAAA,CAAO,CAAG,EAAd,CACAN,CAAC,CAACO,IAAF,CAAOF,CAAP,CAAgB,SAASG,CAAT,CAAgBC,CAAhB,CAAwB,CACpCH,CAAO,CAACI,IAAR,CAAa,CACTC,KAAK,CAAEF,CAAM,CAACG,EADL,CAETC,KAAK,CAAEJ,CAAM,CAACK,MAFL,CAAb,CAIH,CALD,EAMA,MAAOR,CAAAA,CACV,CAXoD,CAarDS,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAmCC,CAAnC,CAA4C,CACnD,GAAIC,CAAAA,CAAJ,CACIC,CAAS,CAAGC,QAAQ,CAACrB,CAAC,CAACI,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,WAAjB,CAAD,CAAgC,EAAhC,CADxB,CAEIC,CAAQ,CAAGvB,CAAC,CAACI,CAAD,CAAD,CAAYkB,IAAZ,CAAiB,UAAjB,CAFf,CAIAH,CAAO,CAAGlB,CAAI,CAACuB,IAAL,CAAU,CAAC,CACjBC,UAAU,CAAE,wBADK,CAEjBC,IAAI,CAAE,CACFV,KAAK,CAAEA,CADL,CAEFW,OAAO,CAAE,CAACP,SAAS,CAAEA,CAAZ,CAFP,CAGFG,QAAQ,CAAEA,CAHR,CAFW,CAAD,CAAV,CAAV,CAQAJ,CAAO,CAAC,CAAD,CAAP,CAAWS,IAAX,CAAgB,SAASvB,CAAT,CAAkB,CAC9B,GAAIwB,CAAAA,CAAQ,CAAG,EAAf,CACIC,CAAC,CAAG,CADR,CAIA9B,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,OAAf,CAAwB,SAASE,CAAT,CAAgBC,CAAhB,CAAwB,CAC5CoB,CAAQ,CAACnB,IAAT,CAAcR,CAAS,CAAC6B,MAAV,CAAiB,yCAAjB,CAA4DtB,CAA5D,CAAd,CACH,CAFD,EAKA,MAAOT,CAAAA,CAAC,CAACgC,IAAF,CAAOC,KAAP,CAAajC,CAAC,CAACgC,IAAf,CAAqBH,CAArB,EAA+BD,IAA/B,CAAoC,UAAW,CAClD,GAAIF,CAAAA,CAAI,CAAGQ,SAAX,CACAlC,CAAC,CAACO,IAAF,CAAOF,CAAO,CAACC,OAAf,CAAwB,SAASE,CAAT,CAAgBC,CAAhB,CAAwB,CAC5CA,CAAM,CAACK,MAAP,CAAgBY,CAAI,CAACI,CAAD,CAApB,CACAA,CAAC,EACJ,CAHD,EAIAb,CAAO,CAACZ,CAAO,CAACC,OAAT,CAEV,CARM,CAUV,CApBD,EAoBG6B,KApBH,CAoBSjB,CApBT,CAqBH,CA/CoD,CAmD5D,CArDK,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 * Cohort selector module.\n *\n * @module tool_lp/form-cohort-selector\n * @class form-cohort-selector\n * @package tool_lp\n * @copyright 2015 Frédéric Massart - FMCorz.net\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_lp/form-cohort-selector */ {\n\n processResults: function(selector, results) {\n var cohorts = [];\n $.each(results, function(index, cohort) {\n cohorts.push({\n value: cohort.id,\n label: cohort._label\n });\n });\n return cohorts;\n },\n\n transport: function(selector, query, success, failure) {\n var promise,\n contextid = parseInt($(selector).data('contextid'), 10),\n includes = $(selector).data('includes');\n\n promise = Ajax.call([{\n methodname: 'tool_lp_search_cohorts',\n args: {\n query: query,\n context: {contextid: contextid},\n includes: includes\n }\n }]);\n promise[0].then(function(results) {\n var promises = [],\n i = 0;\n\n // Render the label.\n $.each(results.cohorts, function(index, cohort) {\n promises.push(Templates.render('tool_lp/form-cohort-selector-suggestion', cohort));\n });\n\n // Apply the label to the results.\n return $.when.apply($.when, promises).then(function() {\n var args = arguments;\n $.each(results.cohorts, function(index, cohort) {\n cohort._label = args[i];\n i++;\n });\n success(results.cohorts);\n return;\n });\n\n }).catch(failure);\n }\n\n };\n\n});\n"],"file":"form-cohort-selector.min.js"}