;(function($) { "use strict"; $.Browser = { defaults: { title: 'Choose Directory', url: sbRoot + '/browser/', autocompleteURL: sbRoot + '/browser/complete', includeFiles: 0 } }; var fileBrowserDialog, currentBrowserPath, currentRequest = null; function browse(path, endpoint, includeFiles) { if (currentBrowserPath == path) { return; } currentBrowserPath = path; if (currentRequest) { currentRequest.abort(); } fileBrowserDialog.dialog('option', 'dialogClass', 'browserDialog busy'); currentRequest = $.getJSON(endpoint, { path: path, includeFiles: includeFiles }, function (data) { fileBrowserDialog.empty(); var first_val = data[0]; var i = 0; var list, link = null; data = $.grep(data, function (value) { return i++ != 0; }); $('

').text(first_val.current_path).appendTo(fileBrowserDialog); list = $('