forked from GleamTech/FileUltimate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClientEvents.html
43 lines (42 loc) · 1.66 KB
/
ClientEvents.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FileManager raises client-side before and after events for each file action.
<br /><br />
<b>Before events:</b>
<ul>
<li>Loading</li>
<li>Creating</li>
<li>Deleting</li>
<li>Renaming</li>
<li>Copying</li>
<li>Moving</li>
<li>Compressing</li>
<li>Extracting</li>
<li>Uploading</li>
<li>Downloading</li>
<li>Previewing</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> sampleCancelEventHandler(sender, e) {
<span style="color:green;">//Optionally displaying a message to the user when canceling
</span> e.cancelMessage = e.eventName + <span style="color:#a31515;">" event is canceled!"</span>;
<span style="color:green;">//Canceling a before event (stops the corresponding action):
</span> <span style="color:blue;">return</span> <span style="color:blue;">false</span>;
}
</pre>
<br />
<b>After events:</b>
<ul>
<li>Loaded</li>
<li>Chosen</li>
<li>FolderChanged</li>
<li>SelectionChanged</li>
<li>Created</li>
<li>Deleted</li>
<li>Renamed</li>
<li>Copied</li>
<li>Moved</li>
<li>Compressed</li>
<li>Extracted</li>
<li>Uploaded</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.