-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcjfilebrowser.html
126 lines (108 loc) · 4.48 KB
/
cjfilebrowser.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- ****************************************************************************
CJ File Browser HTML Layout
Author: Doug Jones
http://www.cjboco.com/
For further information on this and other projects, please visit the
Creative Juices Bo. Co. website at www.cjboco.com.
**************************************************************************** -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<title>CJ File Browser</title>
<link rel="shortcut icon" href="assets/images/favicon.ico" />
<link rel="stylesheet" type="text/css" href="assets/css/cj.file_browser.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/icons.css" media="all" />
<link rel="stylesheet" type="text/css" href="assets/css/smoothness/jquery-ui-1.7.2.custom.css" media="all" />
</head>
<body>
<div id="CJFileBrowser" class="ui-widget" data-popup="1"></div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<script src="assets/js/date.format.js"></script>
<script><!--
(function ($) {
'use strict';
var c = new Date(),
QueryString = function () {
var query_string = {},
query = window.location.search.substring(1),
vars = query.split('&'),
pair, arr;
for (var i = 0; i < vars.length; i++) {
pair = vars[i].split('=');
if (query_string[pair[0]] === undefined) {
query_string[pair[0]] = window.decodeURIComponent(pair[1]);
} else if (typeof query_string[pair[0]] === 'string') {
arr = [query_string[pair[0]], pair[1]];
query_string[pair[0]] = arr;
} else {
query_string[pair[0]].push(window.decodeURIComponent(pair[1]));
}
}
return query_string;
}();
$.getScript('assets/js/cj.file_browser.js?c=' + c.getTime(), function () {
// make sure jQuery and support plug-ins are present
if (typeof dateFormat !== undefined && $.cjFileBrowser) {
$('#CJFileBrowser').cjFileBrowser({
actions: ['navigateDirectory', 'createDirectory', 'deleteDirectory', 'fileDelete', 'fileUpload', 'dropUpload', 'fileSelect'],
baseRelPath: QueryString.assetsUrl || QueryString.baseRelPath ? [QueryString.assetsUrl || QueryString.baseRelPath] : ['/'],
baseAbsPath: [],
fileExts: QueryString.fileExts || '*',
maxSize: parseInt(QueryString.maxSize, 10) || 1500,
maxWidth: parseInt(QueryString.maxWidth, 10) || 600,
maxHeight: parseInt(QueryString.maxHeight, 10) || 800,
showImgPreview: QueryString.showImgPreview ? Boolean(QueryString.showImgPreview) : true,
engine: 'coldfusion8',
handler: 'handler.cfc',
timeOut: 900, // 15 minutes
callBack: function (fileObj) {
/*
fileObj : {
attr: ""
date: "August 20, 2015 12:22:07"
dir: "/images/"
ext: "PNG"
fullpath: "C:\home\wwwroot\images\myfile.png"
height: 100
mime: "image/png"
name: "myfile.png"
size: 15000
type: "FILE"
width: 100
}
*/
if (typeof fileObj === 'object') {
if (QueryString.isTMCE && QueryString.isTMCE == "false") {
console.log(parent);
if ($.isFunction(parent.fileSelectCallback)) {
parent.fileSelectCallback.call(null, fileObj.dir + fileObj.name);
}
} else if ( parent.tinymce.majorVersion < 4 ) {
// tinymce 3.X
parent.tinymce.activeEditor.windowManager.params.fileSelectCallback(fileObj.dir + fileObj.name);
parent.tinymce.activeEditor.windowManager.close( parent.tinymce.activeEditor.windowManager.params.mce_window_id );
} else {
// tinymce 4.X
parent.tinymce.activeEditor.windowManager.getParams().fileSelectCallback(fileObj.dir + fileObj.name);
parent.tinymce.activeEditor.windowManager.close();
}
} else {
throw ('Problems reading file selection object.');
}
}
});
} else {
// jQuery wasn't included while loading the HTML page.
throw ('You must have jQuery and all the required plugins installed in order to use CJ File Browser.');
}
});
}(jQuery));
//-->
</script>
</body>
</html>