init() is called when we need to upload pictures to the server.
var init = function()
{
//Create JavaScript object that will embed Image Uploader to the page.
var iu = this.iu = new ImageUploaderWriter(this.name, 800, 500);
if (Ext.isIE == true)
{
// Configure installation
//var ip = this.ip = new InstallationProgressExtender(iu);
//ip.setProgressHtml("Loading Picture Uploader ...");
//ip.setProgressImageUrl();
//ip.setCommonHtml();
//ip.setBeforeIE6XPSP2ProgressHtml();
//ip.setIE6XPSP2ProgressHtml();
//ip.setIE7ProgressHtml();
//ip.setIE8ProgressHtml();
//ip.setProgressCssClass();
iu.activeXControlEnabled = true;
//For ActiveX control full path to CAB file (including file name) should be specified.
iu.activeXControlCodeBase = "../../js/Aurigma/ImageUploader6.1/ImageUploader6.cab";
iu.activeXControlVersion = "6,1,4,0";
iu.javaAppletEnabled = false;
}
else
{
//For Java applet only path to directory with JAR files should be specified (without file name).
iu.javaAppletJarFileName = "ImageUploader6.jar";
iu.javaAppletCodeBase = "../../js/Aurigma/ImageUploader6.1/";
iu.javaAppletCached = true;
iu.javaAppletVersion = "6.1.4.0";
iu.activeXControlEnabled = false;
}
iu.addParam("ShowDebugWindow", "true");
iu.addParam("SilentMode", "false");
iu.fullPageLoadListenerName="_PictureUpload_initComplete_";
iu.addEventListener("BeforeUpload", "PhotoUpload_beforeUpload");
iu.addEventListener("AfterUpload", "PhotoUpload_afterUpload");
// iu.addEventListener("InitComplete", "_PictureUpload_initComplete_");
// ...the user goes to another folder
iu.addEventListener("FolderChange", "photoUpload_setStatusText");
// ...the number of items selected for upload is chaned
iu.addEventListener("UploadFileCountChange", "photoUpload_setStatusText");
...
}
On a separate file, loaded during page initialization ...
var PhotoUpload_beforeUpload = function()
{
...
}
var PhotoUpload_afterUpload = function(html)
{
window.location.reload();
}