Merge branch 'MDL-51434-master' of git://github.com/jleyva/moodle
[moodle.git] / lib / form / url.js
blobb37f36c957b9894fd368f3a1711b6f38b4536bdd
1 M.form_url = {};
3 M.form_url.init = function(Y, options) {
4     options.formcallback = M.form_url.callback;
5     if (!M.core_filepicker.instances[options.client_id]) {
6         M.core_filepicker.init(Y, options);
7     }
8     Y.on('click', function(e, client_id) {
9         e.preventDefault();
10         M.core_filepicker.instances[client_id].show();
11     }, '#filepicker-button-'+options.client_id, null, options.client_id);
15 M.form_url.callback = function (params) {
16     document.getElementById('id_externalurl').value = params.url;