Skip to content

Commit

Permalink
Version 6.2.0
Browse files Browse the repository at this point in the history
## Version 6.2.0 - September 5, 2018

  - **Added:** New client-side events. Before events: ClientCreating, ClientDeleting, ClientRenaming, ClientCopying,
    ClientMoving, ClientCompressing, ClientExtracting, ClientUploading, ClientDownloading, ClientPreviewing.
    It's possible to stop a file action (and optionally display a message) by canceling the corresponding before event.
    After events: ClientFolderChanged, ClientSelectionChanged, ClientCreated, ClientDeleted, ClientRenamed, ClientCopied,
    ClientMoved, ClientCompressed, ClientExtracted, ClientUploaded. Refer to new "Client-side events" sample and updated
    docs for event handler usage.

  - **Improved:** Document Viewer stability, accuracy for Spreadsheet, Presentation, ProjectManagement and Email
    formats.

  - **Improved:** Updated Media Player.
  • Loading branch information
GleamTech committed Sep 5, 2018
1 parent 9730e43 commit c5e1203
Show file tree
Hide file tree
Showing 72 changed files with 1,779 additions and 288 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using GleamTech.FileUltimate.AspNet.UI;
using Microsoft.AspNetCore.Mvc;

namespace GleamTech.FileUltimateExamples.AspNetCore.CS.Controllers
{
public partial class FileManagerController
{
public IActionResult ClientEvents()
{
var fileManager = new FileManager
{
Width = 800,
Height = 600,
DisplayLanguage = "en",
ClientLoading = "fileManagerLoading",
ClientLoaded = "fileManagerLoaded",
ClientChosen = "fileManagerChosen",
ClientFolderChanged = "fileManagerFolderChanged",
ClientSelectionChanged = "fileManagerSelectionChanged",
ClientCreating = "fileManagerCreating",
ClientCreated = "fileManagerCreated",
ClientDeleting = "fileManagerDeleting",
ClientDeleted = "fileManagerDeleted",
ClientRenaming = "fileManagerRenaming",
ClientRenamed = "fileManagerRenamed",
ClientCopying = "fileManagerCopying",
ClientCopied = "fileManagerCopied",
ClientMoving = "fileManagerMoving",
ClientMoved = "fileManagerMoved",
ClientCompressing = "fileManagerCompressing",
ClientCompressed = "fileManagerCompressed",
ClientExtracting = "fileManagerExtracting",
ClientExtracted = "fileManagerExtracted",
ClientUploading = "fileManagerUploading",
ClientUploaded = "fileManagerUploaded",
ClientDownloading = "fileManagerDownloading",
ClientPreviewing = "fileManagerPreviewing"
};
fileManager.RootFolders.Add(new FileManagerRootFolder
{
Name = "Root Folder 1",
Location = "~/App_Data/RootFolder1"
});
fileManager.RootFolders[0].AccessControls.Add(new FileManagerAccessControl
{
Path = @"\",
AllowedPermissions = FileManagerPermissions.Full
});

return View(fileManager);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class FileManagerController
{
private const string EventLogSessionKey = "EventLog.CS";

public IActionResult Events()
public IActionResult ServerEvents()
{
var fileManager = new FileManager
{
Expand Down
43 changes: 43 additions & 0 deletions Examples/AspNetCore.CS/Descriptions/FileManager/ClientEvents.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FileManager raises client-side before and after events for each file action.
<br /><br />
<b>Before events:</b>
<ul>
<li>ClientLoading</li>
<li>ClientCreating</li>
<li>ClientDeleting</li>
<li>ClientRenaming</li>
<li>ClientCopying</li>
<li>ClientMoving</li>
<li>ClientCompressing</li>
<li>ClientExtracting</li>
<li>ClientUploading</li>
<li>ClientDownloading</li>
<li>ClientPreviewing</li>
</ul>
It's possible to stop a file action (and optionally display a message) by canceling the corresponding before event:
<pre style="font-family:Consolas;font-size:13px;color:black;background:white;"><span style="color:blue;">function</span>&nbsp;sampleCancelEventHandler(sender,&nbsp;e)&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green;">//Canceling&nbsp;a&nbsp;before&nbsp;event&nbsp;(stops&nbsp;the&nbsp;corresponding&nbsp;action):
</span>&nbsp;&nbsp;&nbsp;&nbsp;e.isCanceled&nbsp;=&nbsp;<span style="color:blue;">true</span>;
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green;">//Optionally&nbsp;displaying&nbsp;a&nbsp;message&nbsp;to&nbsp;the&nbsp;user&nbsp;when&nbsp;canceling
</span>&nbsp;&nbsp;&nbsp;&nbsp;e.message&nbsp;=&nbsp;e.eventName&nbsp;+&nbsp;<span style="color:#a31515;">&quot;&nbsp;event&nbsp;is&nbsp;canceled!&quot;</span>;
}
</pre>
<br />
<b>After events:</b>
<ul>
<li>ClientLoaded</li>
<li>ClientChosen</li>
<li>ClientFolderChanged</li>
<li>ClientSelectionChanged</li>
<li>ClientCreated</li>
<li>ClientDeleted</li>
<li>ClientRenamed</li>
<li>ClientCopied</li>
<li>ClientMoved</li>
<li>ClientCompressed</li>
<li>ClientExtracted</li>
<li>ClientUploaded</li>
</ul>
After events can be used to save information about a completed file action.
For instance, the information can be logged on the client-side.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

Control raises before and after events for each file action. Event handlers are attached in code rather than markup.
FileManager raises server-side before and after events for each file action. Event handlers are attached in code rather than markup.
<br /><br />
Before events:
<b>Before events:</b>
<ul>
<li>Expanding</li>
<li>Listing</li>
Expand All @@ -16,7 +15,9 @@
<li>Downloading</li>
<li>Previewing</li>
</ul>
After events:
It's possible to stop a file action (and optionally display a message) by canceling the corresponding before event.
<br /><br />
<b>After events:</b>
<ul>
<li>Expanded</li>
<li>Listed</li>
Expand All @@ -32,6 +33,5 @@
<li>Previewed</li>
<li>Failed</li>
</ul>
It's possible to stop a file action by canceling the corresponding before event.
After events can be used to save information about a completed file action.
For instance, the information can be logged or sent via email.
22 changes: 5 additions & 17 deletions Examples/AspNetCore.CS/Views/FileManager/Chooser.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,14 @@

<html>
<head>
<title>Chooser</title>
<title>File/Folder chooser</title>
@this.RenderHead(Model[0])
<script>
function fileManagerChosen(sender, eventArgs) {
if (eventArgs.IsCanceled) {
alert("Canceled!");
return;
}
function fileManagerChosen(sender, e) {
//Pretty print the chosen info (from event object) when it changes
var json = JSON.stringify(e, null, 2);
var text = "ParentFullPath: " + eventArgs.ParentFullPath;
text += "\nItems: ";
for (var i = 0; i < eventArgs.Items.length; i++) {
var item = eventArgs.Items[i];
text += "\n\tName: " + item.Name;
text += "\n\tFullPath: " + item.FullPath;
text += "\n\tIsfolder: " + item.IsFolder;
text += "\n";
}
alert(text);
alert("Chosen event:\n" + json);
}
</script>
</head>
Expand Down
194 changes: 194 additions & 0 deletions Examples/AspNetCore.CS/Views/FileManager/ClientEvents.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
@using GleamTech.AspNet.Core
@using GleamTech.FileUltimate.AspNet.UI
@model FileManager

<!DOCTYPE html>

<html>
<head>
<title>Client-side events</title>
@this.RenderHead(Model)

<script type="text/javascript">
function fileManagerLoading(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerLoaded(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerChosen(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerFolderChanged(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerSelectionChanged(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerCreating(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerCreated(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerDeleting(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerDeleted(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerRenaming(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerRenamed(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerCopying(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerCopied(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerMoving(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerMoved(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerCompressing(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerCompressed(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerExtracting(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerExtracted(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerUploading(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerUploaded(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerDownloading(sender, e) {
var fileManager = sender;
logEvent(e);
}
function fileManagerPreviewing(sender, e) {
var fileManager = sender;
logEvent(e);
}
function sampleCancelEventHandler(sender, e) {
//Canceling a before event (stops the corresponding action):
e.isCanceled = true;
//Optionally displaying a message to the user when canceling
e.message = e.eventName + " event is canceled!";
}
function logEvent(e) {
var logTextBox = document.getElementById("LogTextBox");
var now = new Date().toLocaleTimeString();
var json = JSON.stringify(e, null, 2);
logTextBox.value += "[" + now + "]" + "\nEvent arguments: " + json + "\n\n";
logTextBox.scrollTop = logTextBox.scrollHeight;
}
function clearLog() {
var logTextBox = document.getElementById("LogTextBox");
logTextBox.value = "";
}
</script>
</head>
<body style="margin: 20px;">
<textarea id="LogTextBox" style="width: 800px; height: 200px; background-color: white; border: 1px solid black"></textarea>
<br /><input type="button" value="Clear" onclick="clearLog();" />
<br /><br />

@this.RenderBody(Model)
</body>
</html>
2 changes: 1 addition & 1 deletion Examples/AspNetCore.CS/Views/FileManager/Display.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<html>
<head>
<title>Display</title>
<title>Displaying control on demand</title>
@this.RenderHead(Model[0])
</head>
<body style="margin: 20px;">
Expand Down
2 changes: 1 addition & 1 deletion Examples/AspNetCore.CS/Views/FileManager/Dynamic.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<html>
<head>
<title>Dynamic</title>
<title>Dynamic folder and permissions</title>
@this.RenderHead(Model)
</head>
<body style="margin: 20px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<html>
<head>
<title>Events</title>
<title>Server-side events</title>
@this.RenderHead(Model)
</head>
<body style="margin: 20px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@model FileManager

@{
ViewBag.Title = "UsingLayout";
ViewBag.Title = "Using MVC layout";
Layout = "~/Views/Shared/_Layout.cshtml";
}

Expand Down
Loading

0 comments on commit c5e1203

Please sign in to comment.