5 |
aperonnet |
1 |
<html>
|
|
|
2 |
<head>
|
|
|
3 |
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd"-->
|
|
|
4 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
5 |
<title>
|
|
|
6 |
Ext.ux.SwfUploadPanel Example
|
|
|
7 |
</title>
|
|
|
8 |
<link rel="stylesheet" type="text/css" href="ext-all.css">
|
|
|
9 |
<script type="text/javascript" src="ext-base.js">
|
|
|
10 |
</script>
|
|
|
11 |
<script type="text/javascript" src="ext-all.js">
|
|
|
12 |
</script>
|
|
|
13 |
<!-- Files needed for SwfUploaderPanel -->
|
|
|
14 |
<link rel="stylesheet" type="text/css" href="SwfUploadPanel.css">
|
|
|
15 |
<script type="text/javascript" src="SwfUploadPanel/SwfUpload.js">
|
|
|
16 |
</script>
|
|
|
17 |
<script type="text/javascript" src="SwfUploadPanel.js">
|
|
|
18 |
</script>
|
|
|
19 |
<script>
|
|
|
20 |
|
|
|
21 |
Ext.onReady(function() {
|
|
|
22 |
String.prototype.trim = function() {
|
|
|
23 |
return this.replace(/^\s+|\s+$/g,"");
|
|
|
24 |
}
|
|
|
25 |
|
|
|
26 |
// Get SessionId from cookie
|
|
|
27 |
var PHPSESSIDX = null;
|
|
|
28 |
var cookies = document.cookie.split(";");
|
|
|
29 |
Ext.each(cookies, function(cookie) {
|
|
|
30 |
var nvp = cookie.split("=");
|
|
|
31 |
if (nvp[0].trim() == 'PHPSESSID')
|
|
|
32 |
PHPSESSIDX = nvp[1];
|
|
|
33 |
});
|
|
|
34 |
|
|
|
35 |
var uploader = new Ext.ux.SwfUploadPanel({
|
|
|
36 |
title: 'Upload Test'
|
|
|
37 |
, renderTo: 'grid'
|
|
|
38 |
, width: 500
|
|
|
39 |
, height: 300
|
|
|
40 |
// Uploader Params
|
|
|
41 |
, upload_url: 'http://www.silverbiology.com/ext/plugins/SwfUploadPanel/upload_example.php'
|
|
|
42 |
// , upload_url: 'http://localhost/www.silverbiology.com/ext/plugins/SwfUploadPanel/upload_example.php'
|
|
|
43 |
, post_params: { PHPSESSIDX: PHPSESSIDX }
|
|
|
44 |
, debug: true
|
|
|
45 |
, flash_url: "../../ext/plugins/SwfUploadPanel/swfupload_f9.swf"
|
|
|
46 |
// , single_select: true // Select only one file from the FileDialog
|
|
|
47 |
// Custom Params
|
|
|
48 |
, single_file_select: false // Set to true if you only want to select one file from the FileDialog.
|
|
|
49 |
, confirm_delete: false // This will prompt for removing files from queue.
|
|
|
50 |
, remove_completed: false // Remove file from grid after uploaded.
|
|
|
51 |
});
|
|
|
52 |
uploader.on('swfUploadLoaded', function() {
|
|
|
53 |
this.addPostParam( 'Post1', 'example1' );
|
|
|
54 |
});
|
|
|
55 |
|
|
|
56 |
uploader.on('fileUploadComplete', function(panel, file, response) {
|
|
|
57 |
});
|
|
|
58 |
|
|
|
59 |
uploader.on('queueUploadComplete', function() {
|
|
|
60 |
if ( Ext.isGecko ) {
|
|
|
61 |
console.log("Files Finished");
|
|
|
62 |
} else {
|
|
|
63 |
alert("Files Finished");
|
|
|
64 |
}
|
|
|
65 |
});
|
|
|
66 |
|
|
|
67 |
|
|
|
68 |
var btn = new Ext.Button({
|
|
|
69 |
text: 'Launch Sample Uploader'
|
|
|
70 |
, renderTo: 'btn'
|
|
|
71 |
, handler: function() {
|
|
|
72 |
var dlg = new Ext.ux.SwfUploadPanel({
|
|
|
73 |
title: 'Dialog Sample'
|
|
|
74 |
, width: 500
|
|
|
75 |
, height: 300
|
|
|
76 |
, border: false
|
|
|
77 |
|
|
|
78 |
// Uploader Params
|
|
|
79 |
, upload_url: 'http://www.silverbiology.com/ext/plugins/SwfUploadPanel/upload_example.php'
|
|
|
80 |
// , upload_url: 'http://localhost/www.silverbiology.com/ext/plugins/SwfUploadPanel/upload_example.php'
|
|
|
81 |
, post_params: { id: 123}
|
|
|
82 |
, file_types: '*.jpg'
|
|
|
83 |
, file_types_description: 'Image Files'
|
|
|
84 |
, debug: true
|
|
|
85 |
, flash_url: "../../ext/plugins/SwfUploadPanel/swfupload_f9.swf"
|
|
|
86 |
// , single_select: true // Select only one file from the FileDialog
|
|
|
87 |
|
|
|
88 |
// Custom Params
|
|
|
89 |
, single_file_select: false // Set to true if you only want to select one file from the FileDialog.
|
|
|
90 |
, confirm_delete: false // This will prompt for removing files from queue.
|
|
|
91 |
, remove_completed: true // Remove file from grid after uploaded.
|
|
|
92 |
}); // End Dialog
|
|
|
93 |
var win = new Ext.Window({
|
|
|
94 |
title: 'Window'
|
|
|
95 |
, width: 514
|
|
|
96 |
, height: 330
|
|
|
97 |
, resizable: false
|
|
|
98 |
, items: [ dlg ]
|
|
|
99 |
}); // End Window
|
|
|
100 |
|
|
|
101 |
win.show();
|
|
|
102 |
|
|
|
103 |
} // End Btn Handler
|
|
|
104 |
|
|
|
105 |
}); // end Btn
|
|
|
106 |
});
|
|
|
107 |
|
|
|
108 |
</script>
|
|
|
109 |
<style type="text/css">
|
|
|
110 |
<!--.style1 { font-weight: bold}body, td, th { font-family: Arial, Helvetica, sans-serif;}body { margin-left: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px;}.style3 {font-size: 10px; font-style: italic;}-->
|
|
|
111 |
</style>
|
|
|
112 |
</head>
|
|
|
113 |
</html>
|
|
|
114 |
|