Uploader.html
4.43 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<html lang="en">
<!---
* CKFinder
* ========
* http://ckfinder.com
* Copyright (C) 2007-2012, CKSource - Frederico Knabben. All rights reserved.
*
* The software, this file and its contents are subject to the CKFinder
* License. Please read the license.txt file before using, installing, copying,
* modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder.
--->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style>
body {
margin: 0px;
overflow:hidden;
padding: 5px 0;
}
#cke_flashupload {
display:block;
z-index:100;
}
</style>
</head>
<body scroll="no">
<div id="cke_flashupload" tabindex="0"></div>
<script language="JavaScript" type="text/javascript">
/**
* Protection against scrolling browser window.
* @param event
*/
function wheel( event ) {
var e = event || window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return false;
}
if( window.addEventListener ) {
window.addEventListener('DOMMouseScroll', wheel, false);
}
else {
window.attachEvent("onscroll", wheel);
}
window.onmousewheel = document.onmousewheel = wheel;
var lang = window.parent.api.lang;
var api = window.parent.api;
var params = {
width : "100%",
height : "100%",
id : "Uploader",
quality : "high",
bgcolor : "#FFFFFF",
name : "Uploader",
wmode : "transparent",
allowScriptAccess :"sameDomain"
};
// flashvars must be encoded due to problems in IE
// http://code.google.com/p/swfobject/issues/detail?id=66
var flashvars = {
layoutDirection : lang.dir,
browseButtonLabel : encodeURIComponent(lang.UploadAddFiles),
totalSizeLabel : encodeURIComponent(lang.UploadTotalSize),
totalFilesLabel : encodeURIComponent(lang.UploadTotalFiles),
clearButtonLabel : encodeURIComponent(lang.UploadClearFiles),
cancelButtonLabel : encodeURIComponent(lang.CancelBtn),
closeButtonLabel : encodeURIComponent(lang.CloseBtn),
uploadButtonLabel : encodeURIComponent(lang.UploadSend),
cancelUploadButtonLabel : encodeURIComponent(lang.UploadCancel),
removeButtonLabel : encodeURIComponent(lang.UploadRemove),
removeTip : encodeURIComponent(lang.UploadRemoveTip),
uploadedLabel : encodeURIComponent(lang.UploadUploaded),
fileTooLargeMsg : encodeURIComponent(lang.Errors[203]),
processingMsg : encodeURIComponent(lang.UploadProcessing),
uploadMaxSize : window.parent.api.config.uploadMaxSize,
uploadCheckImages : window.parent.api.config.uploadCheckImages ? 1 : 0,
isIE : window.parent.CKFinder.env.ie ? 1 : 0
};
var attributes = {};
var swfobject = window.parent.create_swfobject(window, document);
swfobject.embedSWF("flash/Uploader.swf", "cke_flashupload", "100%", "100%", "10.2.0", "", flashvars, params, attributes);
/**
* Functions called by Flash uploader.
*/
function getAllowedExtensions() {
var api = window.parent.api;
return api.getSelectedFolder().getResourceType().allowedExtensions;
}
function getFilterDescription() {
var api = window.parent.api;
return api.getSelectedFolder().type;
}
function getUploadUrl() {
var api = window.parent.api;
return api.getSelectedFolder().getUploadUrl() + "&response_type=txt";
}
function getMaxSize() {
var api = window.parent.api;
return parseInt(api.getSelectedFolder().getResourceType().maxSize, 10);
}
function getLang() {
return window.parent.api.lang;
}
// Name of cookies used as session identifiers and the name to be used in the URL.
// An unfortunate requirement of flash uploader due to infamous cookie bug in Flash.
function getSessionIdentifiers() {
return window.parent.sessionIdentifiers;
}
function getCookies() {
// Loaded via LoadCookies
if ( window.parent.flash_cookies )
return window.parent.flash_cookies;
// document.cookie does not store HttpOnly cookies
var cookie, cookies = {};
if ( window.parent.document.cookie.length ) {
var cookieArray = window.parent.document.cookie.split(';'),
name, eqIndex;
for (var i = cookieArray.length-1; i > 0; i--)
{
cookie = cookieArray[i];
cookie = cookie.replace(/^( )+/g, "");
eqIndex = cookie.indexOf("=");
if (eqIndex > 0)
{
name = cookie.substring(0, eqIndex);
if (name.indexOf("CKFinder_") !== 0)
cookies[cookie.substring(0, eqIndex)] = cookie.substring(eqIndex + 1);
}
}
}
return cookies;
}
function focusDocument() {
setTimeout(function() {document.focus;}, 200);
}
function showFiles(selectedFile) {
var api = window.parent.api;
api.getSelectedFolder().showFiles( selectedFile );
}
</script>
</body>
</html>