Index: lams_tool_forum/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rb036e6dd6d2afe9c0e0b9143c9be3af1d53a1e0e -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision b036e6dd6d2afe9c0e0b9143c9be3af1d53a1e0e) +++ lams_tool_forum/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -241,6 +241,7 @@ js.error.validate.posting.number =There is an error with the minimum and/or maximum set for postings. Please check and try again. js.error.validate.reply.number =There is an error with the minimum and/or maximum number of posts per thread. label.topics =Topics +label.authoring.basic.resource.file.input =File #======= End labels: Exported 236 labels for en AU ===== Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java =================================================================== diff -u -r2b40643d409f3d7066e3e9505bc02994a4139542 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 2b40643d409f3d7066e3e9505bc02994a4139542) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -72,9 +72,6 @@ import org.lamsfoundation.lams.tool.forum.web.forms.ForumPedagogicalPlannerForm; import org.lamsfoundation.lams.tool.forum.web.forms.MessageForm; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; -import org.lamsfoundation.lams.util.Configuration; -import org.lamsfoundation.lams.util.ConfigurationKeys; -import org.lamsfoundation.lams.util.FileValidatorUtil; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -189,9 +186,6 @@ forumForm.setContentFolderID(contentFolderID); sessionMap.put(AttributeNames.PARAM_CONTENT_FOLDER_ID, contentFolderID); - sessionMap.put(ForumConstants.ATTR_UPLOAD_MAX_FILE_SIZE, - FileValidatorUtil.formatSize(Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE))); - // get back the topic list and display them on page forumService = getForumManager(); Index: lams_tool_forum/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u -rb5ab72c783a98abeb08431bafb067ad4b9edf1df -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision b5ab72c783a98abeb08431bafb067ad4b9edf1df) +++ lams_tool_forum/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -123,10 +123,10 @@ }
- + - +
Index: lams_tool_forum/web/WEB-INF/tags/FileUpload.tag =================================================================== diff -u --- lams_tool_forum/web/WEB-INF/tags/FileUpload.tag (revision 0) +++ lams_tool_forum/web/WEB-INF/tags/FileUpload.tag (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -0,0 +1,56 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> + +<%@ attribute name="fileFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileInputNameFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileInputMessageKey" required="false" rtexprvalue="true"%> +<%@ attribute name="uploadInfoMessageKey" required="false" rtexprvalue="true"%> +<%@ attribute name="maxFileSize" required="true" rtexprvalue="true"%> +<%@ attribute name="tabindex" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + +
+ <%-- font-size:inherit needed for Share Resources authoring or the button is too small --%> + + + + +
+

${maxFileSize}

+ + + + Index: lams_tool_forum/web/WEB-INF/tags/WaitingSpinner.tag =================================================================== diff -u --- lams_tool_forum/web/WEB-INF/tags/WaitingSpinner.tag (revision 0) +++ lams_tool_forum/web/WEB-INF/tags/WaitingSpinner.tag (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -0,0 +1,17 @@ +<%@ taglib uri="tags-core" prefix="c"%> + +<%@ attribute name="id" required="false" rtexprvalue="true"%> +<%@ attribute name="showInline" required="false" rtexprvalue="true"%> + + + id="${id}" + + + + + + + + + + \ No newline at end of file Index: lams_tool_forum/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u -r1f99d03199a3995cfffe0cb1536c08f0220e88b0 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 1f99d03199a3995cfffe0cb1536c08f0220e88b0) +++ lams_tool_forum/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -529,5 +529,13 @@ CommentsAuthor /WEB-INF/tags/CommentsAuthor.tag + + FileUpload + /WEB-INF/tags/FileUpload.tag + + + WaitingSpinner + /WEB-INF/tags/WaitingSpinner.tag + Index: lams_tool_forum/web/common/tabbedheader.jsp =================================================================== diff -u -r26a0240d04a160036cc15d1adca267cd1e9c42e5 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/common/tabbedheader.jsp (.../tabbedheader.jsp) (revision 26a0240d04a160036cc15d1adca267cd1e9c42e5) +++ lams_tool_forum/web/common/tabbedheader.jsp (.../tabbedheader.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -29,5 +29,6 @@ + Index: lams_tool_forum/web/includes/javascript/learner.js =================================================================== diff -u -rab7c6f0e19391cab714d6a3ed9818c2b1fc27ecc -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/includes/javascript/learner.js (.../learner.js) (revision ab7c6f0e19391cab714d6a3ed9818c2b1fc27ecc) +++ lams_tool_forum/web/includes/javascript/learner.js (.../learner.js) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -19,8 +19,18 @@ if (!isValid) { var warningMsg = warning.replace("{0}", charsMissing); alert(warningMsg); + } else { + var fileSelect = document.getElementById('attachmentFile'); + if ( fileSelect ) { + // Get the selected files from the input. + var files = fileSelect.files; + if (files.length > 0) { + var file = files[0]; + isValid = validateShowErrorNotExecutable(file, LABEL_NOT_ALLOWED_FORMAT, false, EXE_FILE_TYPES) && validateShowErrorFileSize(file, UPLOAD_FILE_MAX_SIZE, LABEL_MAX_FILE_SIZE, false); + } + } } - + return isValid; } @@ -35,6 +45,20 @@ return wordCount; } +function showBusy(targetDiv){ + var div = document.getElementById(targetDiv+"_Busy"); + if(div != null){ + document.getElementById(targetDiv+"_Busy").style.display = ''; + } +} + +function hideBusy(targetDiv){ + var div = document.getElementById(targetDiv+"_Busy"); + if(div != null){ + document.getElementById(targetDiv+"_Busy").style.display = 'none'; + } +} + /* Used by both Reply and Edit */ function disableSubmitButton() { $("#submitButton").attr("disabled", true); Index: lams_tool_forum/web/includes/javascript/message.js =================================================================== diff -u -rc1bc94e82ed876ec01e06173c8e4edfdd024253c -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/includes/javascript/message.js (.../message.js) (revision c1bc94e82ed876ec01e06173c8e4edfdd024253c) +++ lams_tool_forum/web/includes/javascript/message.js (.../message.js) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -30,13 +30,16 @@ } function showBusy(targetDiv){ - if($(targetDiv+"_Busy") != null){ - $(targetDiv+"_Busy").show(); + var div = document.getElementById(targetDiv+"_Busy"); + if(div != null){ + document.getElementById(targetDiv+"_Busy").style.display = ''; } } + function hideBusy(targetDiv){ - if($(targetDiv+"_Busy") != null){ - $(targetDiv+"_Busy").hide(); + var div = document.getElementById(targetDiv+"_Busy"); + if(div != null){ + document.getElementById(targetDiv+"_Busy").style.display = 'none'; } } Index: lams_tool_forum/web/includes/learnerLayout.jsp =================================================================== diff -u -r83b5a46d432747c2a598446f6fe8a163c2d63d8e -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/includes/learnerLayout.jsp (.../learnerLayout.jsp) (revision 83b5a46d432747c2a598446f6fe8a163c2d63d8e) +++ lams_tool_forum/web/includes/learnerLayout.jsp (.../learnerLayout.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -1,7 +1,10 @@ - <%@ include file="/common/taglibs.jsp"%> <%@ taglib uri="tags-tiles" prefix="tiles"%> +<%@ page import="org.lamsfoundation.lams.util.Configuration" %> +<%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys" %> +<%=Configuration.get(ConfigurationKeys.UPLOAD_FILE_MAX_SIZE)%> +<%=Configuration.get(ConfigurationKeys.EXE_EXTENSIONS)%> @@ -28,10 +31,15 @@ + Index: lams_tool_forum/web/jsps/authoring/basic.jsp =================================================================== diff -u -rf4d9fb8cc51c25fecdd0eac1dcf5f5efc916cdf8 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/authoring/basic.jsp (.../basic.jsp) (revision f4d9fb8cc51c25fecdd0eac1dcf5f5efc916cdf8) +++ lams_tool_forum/web/jsps/authoring/basic.jsp (.../basic.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -1,4 +1,9 @@ <%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.util.Configuration" %> +<%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys" %> +<%=Configuration.get(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE)%> +<%=Configuration.get(ConfigurationKeys.EXE_EXTENSIONS)%> + @@ -115,6 +120,19 @@ CKEDITOR.instances[instance].updateElement(); } + var LABEL_MAX_FILE_SIZE = '{0}'; + var LABEL_NOT_ALLOWED_FORMAT = ''; + + var fileSelect = document.getElementById('attachmentFile'); + // Get the selected files from the input. + var files = fileSelect.files; + if (files.length > 0) { + var file = files[0]; + if ( ! validateShowErrorNotExecutable(file, LABEL_NOT_ALLOWED_FORMAT, false, '${EXE_FILE_TYPES}') || ! validateShowErrorFileSize(file, '${UPLOAD_FILE_MAX_SIZE}', LABEL_MAX_FILE_SIZE, false) ) + return false; + } + + showBusy("itemAttachmentArea"); var formData = new FormData(document.getElementById("topicFormId")); $.ajax({ // create an AJAX call... data: formData, @@ -123,7 +141,8 @@ type: $("#topicFormId").attr('method'), url: $("#topicFormId").attr('action'), success: function(data) { - $('#messageArea').html(data); + $('#messageArea').html(data); + hideBusy("itemAttachmentArea"); } }); } @@ -144,6 +163,8 @@ <%@ include file="/jsps/authoring/message/topiclist.jsp"%> + +
');" id="addTopic" class="btn btn-default btn-sm">  Index: lams_tool_forum/web/jsps/authoring/conditionList.jsp =================================================================== diff -u -rbe49e45de128eb0d25eb224ff397590993eccc82 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/authoring/conditionList.jsp (.../conditionList.jsp) (revision be49e45de128eb0d25eb224ff397590993eccc82) +++ lams_tool_forum/web/jsps/authoring/conditionList.jsp (.../conditionList.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -3,9 +3,7 @@
-
- -
+ Index: lams_tool_forum/web/jsps/authoring/message/create.jsp =================================================================== diff -u -r2b40643d409f3d7066e3e9505bc02994a4139542 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/authoring/message/create.jsp (.../create.jsp) (revision 2b40643d409f3d7066e3e9505bc02994a4139542) +++ lams_tool_forum/web/jsps/authoring/message/create.jsp (.../create.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -1,6 +1,10 @@ - <%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.util.Configuration" %> +<%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys" %> +<%@ page import="org.lamsfoundation.lams.util.FileValidatorUtil" %> +<%=FileValidatorUtil.formatSize(Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE))%> + <%@ include file="/common/header.jsp"%> @@ -37,13 +41,9 @@
-
-

- - ${sessionMap.uploadMaxFileSize} - -

+ +
Index: lams_tool_forum/web/jsps/authoring/message/edit.jsp =================================================================== diff -u -rc43a7c4f1389ad2b5fdc526aa736be11ab5ad271 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/authoring/message/edit.jsp (.../edit.jsp) (revision c43a7c4f1389ad2b5fdc526aa736be11ab5ad271) +++ lams_tool_forum/web/jsps/authoring/message/edit.jsp (.../edit.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -1,5 +1,4 @@ - <%@ include file="/common/taglibs.jsp"%> @@ -16,7 +15,7 @@ <%@ include file="/common/messages.jsp"%> - + "> Index: lams_tool_forum/web/jsps/authoring/parts/msgattachment.jsp =================================================================== diff -u -r2b40643d409f3d7066e3e9505bc02994a4139542 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/authoring/parts/msgattachment.jsp (.../msgattachment.jsp) (revision 2b40643d409f3d7066e3e9505bc02994a4139542) +++ lams_tool_forum/web/jsps/authoring/parts/msgattachment.jsp (.../msgattachment.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -1,4 +1,9 @@ <%@ include file="/common/taglibs.jsp"%> +<%@ page import="org.lamsfoundation.lams.util.Configuration" %> +<%@ page import="org.lamsfoundation.lams.util.ConfigurationKeys" %> +<%@ page import="org.lamsfoundation.lams.util.FileValidatorUtil" %> +<%=FileValidatorUtil.formatSize(Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE))%> + @@ -17,20 +22,14 @@ - - - - -

- - ${sessionMap.uploadMaxFileSize} - -

- +
+ + + Index: lams_tool_forum/web/jsps/learning/create.jsp =================================================================== diff -u -rb04acc6d964bc965b30a275c02254df00c5fae2c -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/learning/create.jsp (.../create.jsp) (revision b04acc6d964bc965b30a275c02254df00c5fae2c) +++ lams_tool_forum/web/jsps/learning/create.jsp (.../create.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -4,6 +4,7 @@ function doSubmit() { disableSubmitButton(); if (validateForm()) { + showBusy("itemAttachmentArea"); return true; } enableSubmitButton(); Index: lams_tool_forum/web/jsps/learning/edit.jsp =================================================================== diff -u -rcd8445f5cc34046fc3aad47db4e6f5f1c712ba4f -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/learning/edit.jsp (.../edit.jsp) (revision cd8445f5cc34046fc3aad47db4e6f5f1c712ba4f) +++ lams_tool_forum/web/jsps/learning/edit.jsp (.../edit.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -13,7 +13,6 @@ }); $('#editForm').submit(function() { // catch the form's submit event - disableSubmitButton(); if ( validateForm() ) { @@ -22,6 +21,7 @@ CKEDITOR.instances[instance].updateElement(); } + showBusy("itemAttachmentArea"); var formData = new FormData(this); $.ajax({ // create an AJAX call... @@ -54,6 +54,7 @@ // No valid id? Validation failed! Assume it is the form coming back. $('#edit').html(response); } + hideBusy("itemAttachmentArea"); } }); } // end validateForm() Index: lams_tool_forum/web/jsps/learning/message/topiceditform.jsp =================================================================== diff -u -rbe49e45de128eb0d25eb224ff397590993eccc82 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/learning/message/topiceditform.jsp (.../topiceditform.jsp) (revision be49e45de128eb0d25eb224ff397590993eccc82) +++ lams_tool_forum/web/jsps/learning/message/topiceditform.jsp (.../topiceditform.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -15,7 +15,7 @@
- +
@@ -33,10 +33,12 @@ - +
+ +
Index: lams_tool_forum/web/jsps/learning/message/topicform.jsp =================================================================== diff -u -r2b40643d409f3d7066e3e9505bc02994a4139542 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/learning/message/topicform.jsp (.../topicform.jsp) (revision 2b40643d409f3d7066e3e9505bc02994a4139542) +++ lams_tool_forum/web/jsps/learning/message/topicform.jsp (.../topicform.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -14,12 +14,7 @@

-
-

- - ${sessionMap.uploadMaxFileSize} - -

+
Index: lams_tool_forum/web/jsps/learning/message/topicreplyform.jsp =================================================================== diff -u -r2b40643d409f3d7066e3e9505bc02994a4139542 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/learning/message/topicreplyform.jsp (.../topicreplyform.jsp) (revision 2b40643d409f3d7066e3e9505bc02994a4139542) +++ lams_tool_forum/web/jsps/learning/message/topicreplyform.jsp (.../topicreplyform.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -13,16 +13,11 @@
- - - -

- - ${sessionMap.uploadMaxFileSize} - -

- + +
+ +
Index: lams_tool_forum/web/jsps/learning/reply.jsp =================================================================== diff -u -r5e4e6e4492ec4daa6f456e502d14af196aa9cdd0 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/learning/reply.jsp (.../reply.jsp) (revision 5e4e6e4492ec4daa6f456e502d14af196aa9cdd0) +++ lams_tool_forum/web/jsps/learning/reply.jsp (.../reply.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -22,8 +22,8 @@ CKEDITOR.instances[instance].updateElement(); } + showBusy("itemAttachmentArea"); var formData = new FormData(this); - $.ajax({ // create an AJAX call... data: formData, processData: false, // tell jQuery not to process the data @@ -78,6 +78,7 @@ } // end validateForm() else { enableSubmitButton(); + hideBusy("itemAttachmentArea"); } return false; }); @@ -103,10 +104,10 @@
-
+
<%@ include file="/jsps/learning/message/topicreplyform.jsp"%> -
+
Index: lams_tool_forum/web/jsps/monitoring/summary.jsp =================================================================== diff -u -rc6ad8493ef2064430e8783b28258cc9f223a3844 -r0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2 --- lams_tool_forum/web/jsps/monitoring/summary.jsp (.../summary.jsp) (revision c6ad8493ef2064430e8783b28258cc9f223a3844) +++ lams_tool_forum/web/jsps/monitoring/summary.jsp (.../summary.jsp) (revision 0b0cbd0f4149520b777cd5f085c2c05c43f6f7e2) @@ -158,7 +158,7 @@ - +