Styles.renderStyleClasses(context, fileUpload);
int uploadedSize = 0;
boolean duplicateAllowed = true;//fileUpload.isDuplicateAllowed();
Position popupPosition = fileUpload.getPosition();
List<String> listOfImages = new LinkedList<String>();
String defStopUrl = null;
if (fileUpload.getStopButtonNearProgress()) {
if (stopButton == null) {
defStopUrl = Resources.getURL(context, null, null, DEFAULT_STOP_URL);
listOfImages.add(defStopUrl);
Rendering.renderPreloadImagesScript(context, listOfImages, false);
}
}
Script initScript = new ScriptBuilder().initScript(context, fileUpload, "O$.SingleFileUpload._init",
uploadedSize,
fileUpload.getNotUploadedStatusText(),
fileUpload.getInProgressStatusText(),
fileUpload.getUploadedStatusText(),
fileUpload.getFileSizeLimitErrorText(),
fileUpload.getUnexpectedErrorText(),
fileUpload.getAcceptedFileTypes(),
duplicateAllowed,
clientId + BROWSE_BTN_ID,
addButtonClass,
addButtonOnMouseOverClass,
addButtonOnMouseDownClass,
addButtonOnFocusClass,
addButtonDisabledClass,
fileUpload.isDisabled(),
fileUpload.getTabindex(),
progressBar.getClientId(context),
fileUpload.getStoppedStatusText(),
fileUpload.getStoppingStatusText(),
uniqueId,
Utilities.getFunctionOfEvent(fileUpload.getOnchange()),
Utilities.getFunctionOfEvent(fileUpload.getOnstart()),
Utilities.getFunctionOfEvent(fileUpload.getOnend()),
Utilities.getFunctionOfEvent(fileUpload.getOnfilestart()),
Utilities.getFunctionOfEvent(fileUpload.getOnfileinprogress()),
Utilities.getFunctionOfEvent(fileUpload.getOnfileend()),
Utilities.getFunctionOfEvent(fileUpload.getOnwrongfiletype()),
Utilities.getFunctionOfEvent(fileUpload.getOndirectorydropped()),
dropTargetDragoverClass,
getRender(context, fileUpload),
getExternalDropTargetId(context, fileUpload),
fileUpload.getAcceptedMimeTypes(),
fileUpload.getLayoutMode(),
defStopUrl,
getIconStyle(fileUpload, layoutMode),
fileUpload.getShowInfoAfterUpload(),
fileUpload.getBrowseButtonDuringUpload(),
fileUpload.getStopButtonNearProgress(),
fileUpload.getDirectoryDroppedText(),
fileUpload.getWrongFileTypeText(),
getExternalButtonId(context, fileUpload),
fileUpload.getShowInPopup(),
getPositionedBy(context, fileUpload),
popupPosition.getHorizontalAlignment(),
popupPosition.getVerticalAlignment(),
popupPosition.getHorizontalDistance(),
popupPosition.getVerticalDistance()
);
Rendering.renderInitScript(context, initScript,
Resources.utilJsURL(context),
Resources.jsonJsURL(context),