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);
8 Y.on('click', function(e, client_id) {
10 M.core_filepicker.instances[client_id].show();
11 }, '#filepicker-button-js-'+options.client_id, null, options.client_id);
14 M.form_url.callback = function (params) {
15 // Get the first child of type 'input' within the wrapper div associated with the filepicker's id.
16 var urlElement = document.getElementById('url-wrapper-' + params.client_id).getElementsByTagName('input')[0];
17 urlElement.value = params.url;