diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js index 8c7c74030051b99ac9427bc204503f477d54d137..e59ce9cb1c983e67c282369ef0f2f6ddb556f189 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js @@ -1447,15 +1447,15 @@ openbis.prototype.getDownloadUrlForFileForDataSetWithTimeout = function(dataSetC * Creates a session workspace file uploader inside the specified uploaderContainer element and for the default data store. * @method */ -openbis.prototype.createSessionWorkspaceUploader = function(uploaderContainer, oncomplete){ - return this.createSessionWorkspaceUploaderForDataStore(uploaderContainer, null, oncomplete); +openbis.prototype.createSessionWorkspaceUploader = function(uploaderContainer, oncomplete, uploaderSettings){ + return this.createSessionWorkspaceUploaderForDataStore(uploaderContainer, null, oncomplete, uploaderSettings); } /** * Creates a session workspace file uploader inside the specified uploaderContainer element and for the specified data store. * @method */ -openbis.prototype.createSessionWorkspaceUploaderForDataStore = function(uploaderContainer, dataStoreCodeOrNull, oncomplete){ +openbis.prototype.createSessionWorkspaceUploaderForDataStore = function(uploaderContainer, dataStoreCodeOrNull, oncomplete, uploaderSettings){ var uploaderSupported = window.File && window.FileReader && window.XMLHttpRequest; if(!uploaderSupported){ @@ -1474,15 +1474,20 @@ openbis.prototype.createSessionWorkspaceUploaderForDataStore = function(uploader var uploader = new Uploader(); this._internal.getDataStoreUrlForDataStoreCode(dataStoreCodeOrNull, function(dataStoreUrl){ $(uploaderContainer).load(uploaderDirectoryLocation + "/index.html", function(){ - uploader.init({ - smart_mode: true, - chunk_size: 1000*1024, - file_upload_url: dataStoreUrl + "/session_workspace_file_upload", - form_upload_url: dataStoreUrl + "/session_workspace_form_upload", - file_download_url: dataStoreUrl + "/session_workspace_file_download", - oncomplete: oncomplete, - sessionID: $this.getSession() - }); + var finalSettings = { + smart_mode: true, + chunk_size: 1000*1024, + file_upload_url: dataStoreUrl + "/session_workspace_file_upload", + form_upload_url: dataStoreUrl + "/session_workspace_form_upload", + file_download_url: dataStoreUrl + "/session_workspace_file_download", + oncomplete: oncomplete, + sessionID: $this.getSession() + }; + + for(var key in uploaderSettings) { + finalSettings[key] = uploaderSettings[key]; + } + uploader.init(finalSettings); }); }); return uploader; diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/uploader/js/src/upload.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/uploader/js/src/upload.js index d81720c67c9a06c80d60db4a68cda9b0c7f8e4b9..77921f105caf43c82aa5df31e8e84657d3f637a4 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/uploader/js/src/upload.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/uploader/js/src/upload.js @@ -28,7 +28,11 @@ function Uploader() { //file_list_clear_button: "#filelist-clear-button", oncomplete: function(file) { }, chunk_size: 100*1024, - smart_mode: window.File && window.FileReader && window.XMLHttpRequest + smart_mode: window.File && window.FileReader && window.XMLHttpRequest, + main_title_container : "#session-workspace-uploader-main-title", + uploads_title_container : "#session-workspace-uploader-uploads-title", + main_title : "<h2>Session workspace upload</h2>", + uploads_title : "<h2>Uploads</h2>" }; var _this = this; @@ -410,6 +414,10 @@ function Uploader() { //$(settings.file_list_clear_button).click(clearFileList); $("#filedrop-hint").append("<br/>Upload starts immediately after the file selection."); + //Setting titles + $(_this.settings.main_title_container).append(_this.settings.main_title); + $(_this.settings.uploads_title_container).append(_this.settings.uploads_title); + return _this; } }