Permalink
Browse files

Only displays the setting adjustment section with multi-file uploader…

…. Hide it at single-file uploader.
  • Loading branch information...
1 parent 9d3b183 commit be14a816adf5d39f1694a6cbac8a367952e86ae8 Cindy Li committed May 5, 2011
Showing with 16 additions and 4 deletions.
  1. +4 −0 css/styles.css
  2. +10 −2 js/uploader.js
  3. +2 −2 uploader.html
View
@@ -48,6 +48,10 @@
border:0 none;
}
+.hide-me {
+ visibility: hidden;
+}
+
fieldset {
border: 1px solid #000000;
}
View
@@ -8,7 +8,7 @@ var demo = demo || {};
var sessionID = Math.random().toString(16).substring(2);
// Load the Uploader's template via AJAX and inject it into this page.
- var templateURLSelector = "../infusion/src/webapp/components/uploader/html/Uploader.html .fl-uploader";
+ var templateURLSelector = "[INFUSION_PATH]/src/webapp/components/uploader/html/Uploader.html .fl-uploader";
var defaultAllowedFileType = "*.gif;*.jpeg;*.jpg;*.png;*.tiff;*.tif";
var defaultFileSizeLimit = "20480";
var defaultfileUploadLimit = 0;
@@ -46,6 +46,15 @@ var demo = demo || {};
}
});
});
+
+ // show the section of adjusting multi-file uploader settings only if the multi-file uploader is presented
+ if (typeof fluid.staticEnvironment.supportsBinaryXHR != 'undefined' ||
+ typeof fluid.staticEnvironment.supportsFormData != 'undefined' ||
+ typeof fluid.staticEnvironment.supportsFlash != 'undefined') {
+ $("#multi-file-uploader-settings").removeClass("hide-me");
+ } else {
+ $("#multi-file-uploader-settings").addClass("hide-me");
+ }
};
$("input").change(function (){
@@ -57,7 +66,6 @@ var demo = demo || {};
fileSizeLimit = (fileSizeLimit === "") ? defaultFileSizeLimit : parseInt(fileSizeLimit);
fileUploadLimit = (fileUploadLimit === "") ? defaultfileUploadLimit : parseInt(fileUploadLimit);
-// alert("file type: "+ allowedFileType+"; file size: "+fileSizeLimit+"; file queue: "+ fileUploadLimit);
instantiateUploader(allowedFileType, fileSizeLimit, fileUploadLimit);
});
View
@@ -50,13 +50,13 @@
<input class="fl-uploader-basic-save" type="submit" value="Save"/>
</form>
- <div>
+ <div id="multi-file-uploader-settings" class="hide-me">
<fieldset>
<legend>Settings for Multi-file Uploader</legend>
<table class="settings-table no-border">
<tr>
<td class="no-border"><label for="file-size-limit">File Size Limit:</label></td>
- <td class="no-border"><input id="file-size-limit" type="text" /> in bytes</td>
+ <td class="no-border"><input id="file-size-limit" type="text" /> in KB</td>
</tr>
<tr>
<td class="no-border"><label for="file-queue-limit">File Queue Limit:</label></td>

0 comments on commit be14a81

Please sign in to comment.