Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var createLink = function (text, item, cell, selectedItems) {
var link = $('<a>');
// Calculate path
var path = text.substr(currentPath.length);
var href = text;
if (path === '') {
path = '.';
}
if (currentPath.length > text.length) {
path = '..';
}
if (item.getContentType() === File.TYPE.DIRECTORY) {
href = '#path=' + item.getPath();
link.click(function () {
self.dispatch(new SelectionEvent(item, true));
});
}
var selected = selectedItems.indexOf(item) >= 0;
// Checkbox
var checkbox = $('<input>');
checkbox.attr('type', 'checkbox');
checkbox.prop('checked', selected);
checkbox.click(function () {
var checked = checkbox.prop('checked');
self.dispatch(new SelectionEvent(item, checked));
});
cell.append(checkbox);</a>
var onSelect = function(ev) {
var item = ev.getItem();
if (item.getContentType() !== File.TYPE.DIRECTORY) {
return;
}
fileRenderer.setPath(item.getPath());
client.navigate(item.getRelativePath());
};
$(xml.documentElement).children('D\\:response').each(function(index, response) {
var file = new File(response, rootPath);
if(file.getContentType() === File.TYPE.DIRECTORY) {
folders[file.getPath()] = file;
}
files.addItem(file);
});