Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{"version":3,"file":"tool_proxy.min.js","sources":["../src/tool_proxy.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 * Provides an interface for a tool proxy in the Moodle server.\n *\n * @module     mod_lti/tool_proxy\n * @copyright  2015 Ryan Wyllie <ryan@moodle.com>\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n * @since      3.1\n */\ndefine(['core/ajax', 'core/notification'], function(ajax, notification) {\n    return {\n        /**\n         * Get a list of tool types from Moodle for the given\n         * search args.\n         *\n         * See also:\n         * mod/lti/classes/external.php get_tool_types_parameters()\n         *\n         * @method query\n         * @public\n         * @param {Object} args Search parameters\n         * @return {Promise} jQuery Deferred object\n         */\n        query: function(args) {\n            var request = {\n                methodname: 'mod_lti_get_tool_proxies',\n                args: args || {}\n            };\n\n            var promise = ajax.call([request])[0];\n\n            promise.fail(notification.exception);\n\n            return promise;\n        },\n        /**\n         * Delete a tool proxy from Moodle.\n         *\n         * @method delete\n         * @public\n         * @param {Integer} id Tool proxy ID\n         * @return {Promise} jQuery Deferred object\n         */\n        'delete': function(id) {\n            var request = {\n                methodname: 'mod_lti_delete_tool_proxy',\n                args: {\n                    id: id\n                }\n            };\n\n            var promise = ajax.call([request])[0];\n\n            promise.fail(notification.exception);\n\n            return promise;\n        },\n\n        /**\n         * Create a tool proxy in Moodle.\n         *\n         * The promise will fail if the proxy cannot be created, so you must handle the fail result.\n         *\n         * See mod/lti/classes/external.php create_tool_proxy_parameters\n         *\n         * @method create\n         * @public\n         * @param {Object} args Tool proxy properties\n         * @return {Promise} jQuery Deferred object\n         */\n        create: function(args) {\n            var request = {\n                methodname: 'mod_lti_create_tool_proxy',\n                args: args\n            };\n\n            var promise = ajax.call([request])[0];\n\n            return promise;\n        }\n    };\n});\n"],"names":["define","ajax","notification","query","args","request","methodname","promise","call","fail","exception","id","create"],"mappings":";;;;;;;;AAuBAA,4BAAO,CAAC,YAAa,sBAAsB,SAASC,KAAMC,oBAC/C,CAaHC,MAAO,SAASC,UACRC,QAAU,CACVC,WAAY,2BACZF,KAAMA,MAAQ,IAGdG,QAAUN,KAAKO,KAAK,CAACH,UAAU,UAEnCE,QAAQE,KAAKP,aAAaQ,WAEnBH,gBAUD,SAASI,QACXN,QAAU,CACVC,WAAY,4BACZF,KAAM,CACFO,GAAIA,KAIRJ,QAAUN,KAAKO,KAAK,CAACH,UAAU,UAEnCE,QAAQE,KAAKP,aAAaQ,WAEnBH,SAeXK,OAAQ,SAASR,UACTC,QAAU,CACVC,WAAY,4BACZF,KAAMA,aAGIH,KAAKO,KAAK,CAACH,UAAU"}