webdav portal css fixes
This commit is contained in:
parent
227f0c99cc
commit
7e76b087b4
7 changed files with 145 additions and 121 deletions
|
@ -35,6 +35,10 @@ namespace WebsitePanel.WebDavPortal
|
||||||
"~/Scripts/appScripts/wsp.js"
|
"~/Scripts/appScripts/wsp.js"
|
||||||
));
|
));
|
||||||
|
|
||||||
|
bundles.Add(new ScriptBundle("~/bundles/appScripts-webdav").Include(
|
||||||
|
"~/Scripts/appScripts/wsp-webdav.js"
|
||||||
|
));
|
||||||
|
|
||||||
bundles.Add(new ScriptBundle("~/bundles/bigIconsScripts").Include(
|
bundles.Add(new ScriptBundle("~/bundles/bigIconsScripts").Include(
|
||||||
"~/Scripts/appScripts/recalculateResourseHeight.js"
|
"~/Scripts/appScripts/recalculateResourseHeight.js"
|
||||||
));
|
));
|
||||||
|
|
|
@ -346,6 +346,10 @@ tr.selected-file {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#filenameForm input {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
/* Theme Mods */
|
/* Theme Mods */
|
||||||
|
|
||||||
input,div{border-radius:0px!important;}
|
input,div{border-radius:0px!important;}
|
||||||
|
|
|
@ -10,7 +10,8 @@
|
||||||
return textItemExist;
|
return textItemExist;
|
||||||
} ,
|
} ,
|
||||||
createNewItemDialogId: "#createNewItemDialog",
|
createNewItemDialogId: "#createNewItemDialog",
|
||||||
createNewItemButtonId: "#create-button"
|
createNewItemButtonId: "#create-button",
|
||||||
|
createNewItemTitleId: '#create-dalog-label'
|
||||||
};
|
};
|
||||||
this.itemsTable = null;
|
this.itemsTable = null;
|
||||||
this.searchTable = null;
|
this.searchTable = null;
|
||||||
|
@ -281,12 +282,14 @@ WspFileBrowser.prototype = {
|
||||||
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||||
},
|
},
|
||||||
|
|
||||||
showCreateNewItemDialog: function (extension, target) {
|
showCreateNewItemDialog: function (extension, target, title) {
|
||||||
$(this.settings.createNewItemButtonId).data('extension', extension);
|
$(this.settings.createNewItemButtonId).data('extension', extension);
|
||||||
$(this.settings.createNewItemButtonId).data('target', target);
|
$(this.settings.createNewItemButtonId).data('target', target);
|
||||||
|
|
||||||
$(this.settings.createNewItemDialogId + " input").val("");
|
$(this.settings.createNewItemDialogId + " input").val("");
|
||||||
|
|
||||||
|
$(this.settings.createNewItemTitleId).text($(this.settings.createNewItemTitleId).data('title') + " " + title);
|
||||||
|
|
||||||
$(this.settings.createNewItemDialogId).modal();
|
$(this.settings.createNewItemDialogId).modal();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1 +1,124 @@
|
||||||
|
//Toggle file select + Ctrl multiselect
|
||||||
|
$(document).on('click', '.element-container', function (e) {
|
||||||
|
if (e.ctrlKey) {
|
||||||
|
$(this).toggleClass("selected-file");
|
||||||
|
} else {
|
||||||
|
|
||||||
|
wsp.fileBrowser.clearAllSelectedItems();
|
||||||
|
|
||||||
|
wsp.fileBrowser.selectItem(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wsp.fileBrowser.refreshDeletionBlock();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('touchstart', '.element-container', function (e) {
|
||||||
|
var now = new Date().getTime();
|
||||||
|
var lastTouch = $(this).data('lastTouch') || now + 1;
|
||||||
|
var delta = now - lastTouch;
|
||||||
|
|
||||||
|
if (delta < 300 && delta > 0) {
|
||||||
|
wsp.fileBrowser.openItem(this);
|
||||||
|
$(this).data('lastTouch', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this).data('lastTouch', now);
|
||||||
|
});
|
||||||
|
|
||||||
|
//Double click file open
|
||||||
|
$(document).on('dblclick', '.element-container', function (e) {
|
||||||
|
wsp.fileBrowser.openItem(this);
|
||||||
|
|
||||||
|
var links = $(this).find('.file-link');
|
||||||
|
|
||||||
|
if (links.length != 0 && $(links[0]).hasClass('processing-dialog')) {
|
||||||
|
wsp.dialogs.showProcessDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//Delete button click
|
||||||
|
$(document).on('click', '.file-deletion #delete-button', function (e) {
|
||||||
|
var dialogId = $(this).data('target');
|
||||||
|
var buttonText = $(this).data('target-positive-button-text');
|
||||||
|
var content = $(this).data('target-content');
|
||||||
|
var title = $(this).data('target-title-text');
|
||||||
|
|
||||||
|
content = jQuery.validator.format(content, wsp.fileBrowser.getSelectedItemsCount());
|
||||||
|
|
||||||
|
wsp.dialogs.showConfirmDialog(title, content, buttonText, wsp.fileBrowser.deleteSelectedItems, dialogId);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(document).click(function (event) {
|
||||||
|
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
|
||||||
|
wsp.fileBrowser.clearAllSelectedItems();
|
||||||
|
wsp.fileBrowser.refreshDeletionBlock();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#drag-and-drop-area').click(function (e) {
|
||||||
|
$('#file-input').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#drag-and-drop-area #file-input').click(function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$("#create-button").click(function (e) {
|
||||||
|
|
||||||
|
if ($('#filenameForm').valid()) {
|
||||||
|
|
||||||
|
var fileName = $('#createNewItemDialog #filename').val() + $(this).data('extension');
|
||||||
|
|
||||||
|
$(this).attr('href', $(this).data('href') + '/' + fileName);
|
||||||
|
|
||||||
|
$(this).attr('target', $(this).data('target'));
|
||||||
|
|
||||||
|
wsp.fileBrowser.hideCreateNewItemDialog();
|
||||||
|
//;
|
||||||
|
} else {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
$('#filenameForm').validate({
|
||||||
|
onkeyup: false,
|
||||||
|
onclick: false,
|
||||||
|
async: false,
|
||||||
|
rules: {
|
||||||
|
filename: {
|
||||||
|
required: true,
|
||||||
|
synchronousRemote: wsp.fileBrowser.uniqueFileNameFieldRule("#filename")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
filename: {
|
||||||
|
synchronousRemote: wsp.fileBrowser.settings.textItemExist
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#filename').keydown(function (event) {
|
||||||
|
if (event.keyCode == 13) {
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(".create-new-item li a").click(function () {
|
||||||
|
|
||||||
|
$("#filenameForm").clearValidation();
|
||||||
|
|
||||||
|
wsp.fileBrowser.showCreateNewItemDialog($(this).data('extension'), $(this).data('target'), $(this).text());
|
||||||
|
|
||||||
|
$("#filename").focus();
|
||||||
|
});
|
||||||
|
|
|
@ -10,94 +10,6 @@ $(document).on('click', '.processing-dialog', function (e) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//Toggle file select + Ctrl multiselect
|
|
||||||
$(document).on('click', '.element-container', function (e) {
|
|
||||||
if (e.ctrlKey) {
|
|
||||||
$(this).toggleClass("selected-file");
|
|
||||||
} else {
|
|
||||||
|
|
||||||
wsp.fileBrowser.clearAllSelectedItems();
|
|
||||||
|
|
||||||
wsp.fileBrowser.selectItem(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
wsp.fileBrowser.refreshDeletionBlock();
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on('touchstart', '.element-container', function(e) {
|
|
||||||
var now = new Date().getTime();
|
|
||||||
var lastTouch = $(this).data('lastTouch') || now + 1;
|
|
||||||
var delta = now - lastTouch;
|
|
||||||
|
|
||||||
if (delta < 300 && delta > 0) {
|
|
||||||
wsp.fileBrowser.openItem(this);
|
|
||||||
$(this).data('lastTouch', 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this).data('lastTouch', now);
|
|
||||||
});
|
|
||||||
|
|
||||||
//Double click file open
|
|
||||||
$(document).on('dblclick', '.element-container', function (e) {
|
|
||||||
wsp.fileBrowser.openItem(this);
|
|
||||||
|
|
||||||
var links = $(this).find('.file-link');
|
|
||||||
|
|
||||||
if (links.length != 0 && $(links[0]).hasClass('processing-dialog')) {
|
|
||||||
wsp.dialogs.showProcessDialog();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
//Delete button click
|
|
||||||
$(document).on('click', '.file-deletion #delete-button', function (e) {
|
|
||||||
var dialogId = $(this).data('target');
|
|
||||||
var buttonText = $(this).data('target-positive-button-text');
|
|
||||||
var content = $(this).data('target-content');
|
|
||||||
var title = $(this).data('target-title-text');
|
|
||||||
|
|
||||||
content = jQuery.validator.format(content, wsp.fileBrowser.getSelectedItemsCount());
|
|
||||||
|
|
||||||
wsp.dialogs.showConfirmDialog(title, content, buttonText, wsp.fileBrowser.deleteSelectedItems, dialogId);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$(document).click(function(event) {
|
|
||||||
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
|
|
||||||
wsp.fileBrowser.clearAllSelectedItems();
|
|
||||||
wsp.fileBrowser.refreshDeletionBlock();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#drag-and-drop-area').click(function (e) {
|
|
||||||
$('#file-input').click();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#drag-and-drop-area #file-input').click(function (e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#create-button").click(function (e) {
|
|
||||||
|
|
||||||
if ($('#filenameForm').valid()) {
|
|
||||||
|
|
||||||
var fileName = $('#createNewItemDialog #filename').val() + $(this).data('extension');
|
|
||||||
|
|
||||||
$(this).attr('href', $(this).data('href') + '/' + fileName);
|
|
||||||
|
|
||||||
$(this).attr('target', $(this).data('target'));
|
|
||||||
|
|
||||||
wsp.fileBrowser.hideCreateNewItemDialog();
|
|
||||||
//;
|
|
||||||
} else {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.fn.clearValidation = function () { var v = $(this).validate(); $('[name]', this).each(function () { v.successList.push(this); v.showErrors(); }); v.resetForm(); v.reset(); $(this).find('.form-group').removeClass('has-error'); };
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
//bootstrap jquery validate styles fix
|
//bootstrap jquery validate styles fix
|
||||||
$.validator.setDefaults({
|
$.validator.setDefaults({
|
||||||
|
@ -172,36 +84,10 @@ $(document).ready(function() {
|
||||||
}, param));
|
}, param));
|
||||||
return valid;
|
return valid;
|
||||||
}, "Please fix this field.");
|
}, "Please fix this field.");
|
||||||
|
|
||||||
|
|
||||||
$('#filenameForm').validate({
|
|
||||||
onkeyup: false,
|
|
||||||
onclick: false,
|
|
||||||
async: false,
|
|
||||||
rules: {
|
|
||||||
filename: {
|
|
||||||
required: true,
|
|
||||||
synchronousRemote: wsp.fileBrowser.uniqueFileNameFieldRule("#filename")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
messages: {
|
|
||||||
filename: {
|
|
||||||
synchronousRemote: wsp.fileBrowser.settings.textItemExist
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(".create-new-item li a").click(function () {
|
$.fn.clearValidation = function () { var v = $(this).validate(); $('[name]', this).each(function () { v.successList.push(this); v.showErrors(); }); v.resetForm(); v.reset(); $(this).find('.form-group').removeClass('has-error'); };
|
||||||
|
|
||||||
$("#filenameForm").clearValidation();
|
|
||||||
|
|
||||||
wsp.fileBrowser.showCreateNewItemDialog($(this).data('extension'), $(this).data('target'));
|
|
||||||
|
|
||||||
$("#filename").focus();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function isMobileDevice() {
|
function isMobileDevice() {
|
||||||
|
|
|
@ -25,6 +25,7 @@ else
|
||||||
|
|
||||||
|
|
||||||
@section scripts{
|
@section scripts{
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
wsp.fileBrowser.setSettings({
|
wsp.fileBrowser.setSettings({
|
||||||
deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)",
|
deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)",
|
||||||
|
@ -32,6 +33,8 @@ else
|
||||||
textItemExist: "@UI.ItemExist." });
|
textItemExist: "@UI.ItemExist." });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@Scripts.Render("~/bundles/appScripts-webdav")
|
||||||
|
|
||||||
@if (Model.UserSettings.WebDavViewType == FolderViewTypes.BigIcons)
|
@if (Model.UserSettings.WebDavViewType == FolderViewTypes.BigIcons)
|
||||||
{
|
{
|
||||||
@Scripts.Render("~/bundles/bigIconsScripts")
|
@Scripts.Render("~/bundles/bigIconsScripts")
|
||||||
|
@ -62,7 +65,7 @@ else
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
<h4 class="modal-title" id="confirm-dalog-label">@UI.Create</h4>
|
<h4 class="modal-title" id="create-dalog-label" data-title="@UI.Create">@UI.Create</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
|
@ -24,5 +24,6 @@
|
||||||
wsp.fileBrowser.initSearchDataTable('#search-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)', '@Model.SearchValue');
|
wsp.fileBrowser.initSearchDataTable('#search-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)', '@Model.SearchValue');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@Scripts.Render("~/bundles/appScripts-webdav")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue