Your IP : 192.168.165.1


Current Path : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/
Upload File :
Current File : C:/xampp/htdocs/moodle/admin/tool/lp/amd/build/frameworks_datasource.min.js.map

{"version":3,"sources":["../src/frameworks_datasource.js"],"names":["define","$","Ajax","Notification","list","contextId","options","args","context","contextid","extend","call","methodname","processResults","selector","results","each","index","data","push","value","id","label","shortname","idnumber","transport","query","callback","el","onlyVisible","Error","onlyvisible","then","catch","exception"],"mappings":"AAyBAA,OAAM,iCAAC,CAAC,QAAD,CAAW,WAAX,CAAwB,mBAAxB,CAAD,CAA+C,SAASC,CAAT,CAAYC,CAAZ,CAAkBC,CAAlB,CAAgC,CAEjF,MAAiE,CAS7DC,IAAI,CAAE,cAASC,CAAT,CAAoBC,CAApB,CAA6B,CAC/B,GAAIC,CAAAA,CAAI,CAAG,CACHC,OAAO,CAAE,CACLC,SAAS,CAAEJ,CADN,CADN,CAAX,CAMAJ,CAAC,CAACS,MAAF,CAASH,CAAT,CAAkC,WAAnB,QAAOD,CAAAA,CAAP,CAAiC,EAAjC,CAAsCA,CAArD,EACA,MAAOJ,CAAAA,CAAI,CAACS,IAAL,CAAU,CAAC,CACdC,UAAU,CAAE,4CADE,CAEdL,IAAI,CAAEA,CAFQ,CAAD,CAAV,EAGH,CAHG,CAIV,CArB4D,CA8B7DM,cAAc,CAAE,wBAASC,CAAT,CAAmBC,CAAnB,CAA4B,CACxC,GAAIT,CAAAA,CAAO,CAAG,EAAd,CACAL,CAAC,CAACe,IAAF,CAAOD,CAAP,CAAgB,SAASE,CAAT,CAAgBC,CAAhB,CAAsB,CAClCZ,CAAO,CAACa,IAAR,CAAa,CACTC,KAAK,CAAEF,CAAI,CAACG,EADH,CAETC,KAAK,CAAEJ,CAAI,CAACK,SAAL,CAAiB,GAAjB,CAAuBL,CAAI,CAACM,QAF1B,CAAb,CAIH,CALD,EAMA,MAAOlB,CAAAA,CACV,CAvC4D,CAiD7DmB,SAAS,CAAE,mBAASX,CAAT,CAAmBY,CAAnB,CAA0BC,CAA1B,CAAoC,CAC3C,GAAIC,CAAAA,CAAE,CAAG3B,CAAC,CAACa,CAAD,CAAV,CACIT,CAAS,CAAGuB,CAAE,CAACV,IAAH,CAAQ,WAAR,CADhB,CAEIW,CAAW,CAAGD,CAAE,CAACV,IAAH,CAAQ,aAAR,CAFlB,CAIA,GAAI,CAACb,CAAL,CAAgB,CACZ,KAAM,IAAIyB,CAAAA,KAAJ,CAAU,+CAAiDhB,CAA3D,CACT,CACD,KAAKV,IAAL,CAAUC,CAAV,CAAqB,CACjBqB,KAAK,CAAEA,CADU,CAEjBK,WAAW,CAAEF,CAFI,CAArB,EAGGG,IAHH,CAGQL,CAHR,EAGkBM,KAHlB,CAGwB9B,CAAY,CAAC+B,SAHrC,CAIH,CA7D4D,CAgEpE,CAlEK,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 * Frameworks datasource.\n *\n * This module is compatible with core/form-autocomplete.\n *\n * @package    tool_lpmigrate\n * @copyright  2016 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/notification'], function($, Ajax, Notification) {\n\n    return /** @alias module:tool_lpmigrate/frameworks_datasource */ {\n\n        /**\n         * List frameworks.\n         *\n         * @param {Number} contextId The context ID.\n         * @param {Object} options Additional parameters to pass to the external function.\n         * @return {Promise}\n         */\n        list: function(contextId, options) {\n            var args = {\n                    context: {\n                        contextid: contextId\n                    }\n                };\n\n            $.extend(args, typeof options === 'undefined' ? {} : options);\n            return Ajax.call([{\n                methodname: 'core_competency_list_competency_frameworks',\n                args: args\n            }])[0];\n        },\n\n        /**\n         * Process the results for auto complete elements.\n         *\n         * @param {String} selector The selector of the auto complete element.\n         * @param {Array} results An array or results.\n         * @return {Array} New array of results.\n         */\n        processResults: function(selector, results) {\n            var options = [];\n            $.each(results, function(index, data) {\n                options.push({\n                    value: data.id,\n                    label: data.shortname + ' ' + data.idnumber\n                });\n            });\n            return options;\n        },\n\n        /**\n         * Source of data for Ajax element.\n         *\n         * @param {String} selector The selector of the auto complete element.\n         * @param {String} query The query string.\n         * @param {Function} callback A callback function receiving an array of results.\n         */\n        /* eslint-disable promise/no-callback-in-promise */\n        transport: function(selector, query, callback) {\n            var el = $(selector),\n                contextId = el.data('contextid'),\n                onlyVisible = el.data('onlyvisible');\n\n            if (!contextId) {\n                throw new Error('The attribute data-contextid is required on ' + selector);\n            }\n            this.list(contextId, {\n                query: query,\n                onlyvisible: onlyVisible,\n            }).then(callback).catch(Notification.exception);\n        }\n    };\n\n});\n"],"file":"frameworks_datasource.min.js"}