webdav portal filter + detail view added

This commit is contained in:
vfedosevich 2015-02-18 02:35:32 -08:00
parent 280628e362
commit 51d432fd2e
156 changed files with 32494 additions and 260 deletions

View file

@ -17,7 +17,7 @@ WspDialogs.prototype =
$(dialogId).find('.modal-body').empty();
$(dialogId).find('.modal-body').html(content);
//title replace
//positive button replace
if (positiveButton) {
$(dialogId).find('.modal-footer .positive-button').empty();
$(dialogId).find('.modal-footer .positive-button').text(positiveButton);
@ -39,41 +39,3 @@ WspDialogs.prototype =
}
};
/*
wsp.dialogs = wsp.dialogs || (function () {
var settings = { dialogId: "#confirm-dialog" };
return {
settings: settings,
showConfirmDialog : function (title, content, positiveButton, positiveClickFunction, dialogId) {
dialogId = dialogId || this.settings.dialogId;
//title replace
if (title) {
$(dialogId).find('.modal-title').empty();
$(dialogId).find('.modal-title').text(title);
}
//body replace
$(dialogId).find('.modal-body').empty();
$(dialogId).find('.modal-body').html(content);
//title replace
if (positiveButton) {
$(dialogId).find('.modal-footer .positive-button').empty();
$(dialogId).find('.modal-footer .positive-button').text(positiveButton);
}
//binding click event
$(dialogId).find('.modal-footer .positive-button').unbind('click');
$(dialogId).find('.modal-footer .positive-button').click(positiveClickFunction);
$(dialogId).modal();
},
showProcessDialog: function () {
$('#processDialog').modal();
}
};
})();*/

View file

@ -1,5 +1,6 @@
function WspFileBrowser() {
this.settings = { deletionBlockSelector: ".file-actions-menu .file-deletion", deletionUrl: "files-group-action/delete1" };
this.settings = { deletionBlockSelector: ".file-actions-menu .file-deletion", deletionUrl: "storage/files-group-action/delete" };
this.table = null;
}
WspFileBrowser.prototype = {
@ -43,14 +44,17 @@ WspFileBrowser.prototype = {
wsp.messages.showMessages(model.Messages);
wsp.fileBrowser.clearDeletedItems(model.DeletedFiles);
wsp.fileBrowser.refreshDeletionBlock();
wsp.fileBrowser.refreshDataTable();
wsp.dialogs.hideProcessDialog();
},
error: function(jqXHR, textStatus, errorThrown) {
error: function (jqXHR, textStatus, errorThrown) {
wsp.messages.addErrorMessage(errorThrown);
wsp.fileBrowser.refreshDeletionBlock();
wsp.fileBrowser.refreshDataTable();
wsp.dialogs.hideProcessDialog();
}
});
@ -63,6 +67,7 @@ WspFileBrowser.prototype = {
$('.element-container').has('a[href="' + item + '"]').remove();
});
},
refreshDeletionBlock: function() {
if (this.getSelectedItemsCount() > 0) {
@ -71,6 +76,48 @@ WspFileBrowser.prototype = {
} else {
$(this.settings.deletionBlockSelector).hide();
}
},
initDataTable: function (tableId, ajaxUrl) {
this.table = $(tableId).dataTable({
"ajax": ajaxUrl,
"processing": true,
"serverSide": true,
"columnDefs": [
{
"render": function(data, type, row) {
return '<img class="table-icon" src="' + row.IconHref + '"/>' +
'<a href="' + row.Url + '" ' + (row.IsTargetBlank ? 'target="_blank"' : '') + ' class="file-link processing-dialog" title="' + row.DisplayName + '">' +
row.DisplayName +
'</a>';
},
"targets": 0
},
{
"render": function (data, type, row) {
return row.Type;
},
"targets": 1
},
{
"render": function (data, type, row) {
return row.LastModified;
},
"targets": 2
}
],
"createdRow": function(row, data, index) {
$(row).addClass('element-container');
}
});
$(tableId).removeClass('dataTable');
},
refreshDataTable: function () {
if (this.table != null) {
this.table.fnDraw(false);
}
}
};

View file

@ -14,7 +14,7 @@ var oldResourcesDivHeight = $('#resourcesDiv').height();
function GetResources() {
$.ajax({
type: 'POST',
url: '/show-additional-content',
url: '/storage/show-additional-content',
data: { path: window.location.pathname, resourseRenderCount: $(".element-container").length },
dataType: "html",
success: function (result) {

View file

@ -5,12 +5,11 @@
};
$(document).ready(function () {
$('.processing-dialog').click(function () {
wsp.dialogs.showProcessDialog();
});
$(document).on('click', '.processing-dialog', function (e) {
wsp.dialogs.showProcessDialog();
});
//Toggle file select + Ctrl multiselect
$(document).on('click', '.element-container', function (e) {
if (e.ctrlKey) {
@ -43,6 +42,7 @@ $(document).on('touchstart', '.element-container', function(e) {
//Double click file open
$(document).on('dblclick', '.element-container', function (e) {
wsp.fileBrowser.openItem(this);
wsp.dialogs.showProcessDialog();
});
@ -59,13 +59,14 @@ $(document).on('click', '.file-deletion #delete-button', function (e) {
});
$(document).click(function (event) {
$(document).click(function(event) {
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
wsp.fileBrowser.clearAllSelectedItems();
wsp.fileBrowser.refreshDeletionBlock();
}
})
});
function isMobileDevice() {
return (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
}
}