Index: lams_tool_larsrc/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rf4b1f384bdfc7ff432dcbc130a2cc393780e7237 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision f4b1f384bdfc7ff432dcbc130a2cc393780e7237) +++ lams_tool_larsrc/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision a4bc09633e07b301174911591702607f522c7037) @@ -136,8 +136,10 @@ message.step.of =Step {0} of {1} message.no.reflection.available =No notebook available button.edit =Edit -errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes -error.attachment.executable =The uploaded file is executable, please zip it before uploading. +errors.maxfilesize=Uploaded file exceeded maximum size of {0} +label.upload.info =Uploaded file must not be executable and not exceed size of {0} +error.attachment.executable =The uploaded file can not be an executable. +error.file.type.zip=File must be a zip file. message.alertContentEdit =Warning: One of more learners have accessed this activity. Changing this content will result in learners getting different information. message.warnLockOnFinish =Note: After you click on "Next Activity\u201d, if you come back to this Share Resource, you won\u2019t be able to share new resources. message.activityLocked =The instructor has set this activity not to allow you to view or share any more resources after you have finished it. Index: lams_tool_larsrc/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -rf4b1f384bdfc7ff432dcbc130a2cc393780e7237 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision f4b1f384bdfc7ff432dcbc130a2cc393780e7237) +++ lams_tool_larsrc/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision a4bc09633e07b301174911591702607f522c7037) @@ -136,8 +136,9 @@ message.step.of =Step {0} of {1} message.no.reflection.available =No notebook available button.edit =Edit -errors.maxfilesize =The uploaded file has exceeded the maximum file size limit of {0} bytes -error.attachment.executable =The uploaded file is executable, please zip it before uploading. +errors.maxfilesize=Uploaded file exceeded maximum size of {0} +label.upload.info =Uploaded file must not be executable and not exceed size of {0} +error.attachment.executable =The uploaded file can not be an executable. message.alertContentEdit =Warning: One of more learners have accessed this activity. Changing this content will result in learners getting different information. message.warnLockOnFinish =Note: After you click on "Next Activity\u201d, if you come back to this Share Resource, you won\u2019t be able to share new resources. message.activityLocked =The instructor has set this activity not to allow you to view or share any more resources after you have finished it. Index: lams_tool_larsrc/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u -rb5ab72c783a98abeb08431bafb067ad4b9edf1df -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision b5ab72c783a98abeb08431bafb067ad4b9edf1df) +++ lams_tool_larsrc/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision a4bc09633e07b301174911591702607f522c7037) @@ -123,7 +123,7 @@ }
- + Index: lams_tool_larsrc/web/WEB-INF/tags/FileUpload.tag =================================================================== diff -u --- lams_tool_larsrc/web/WEB-INF/tags/FileUpload.tag (revision 0) +++ lams_tool_larsrc/web/WEB-INF/tags/FileUpload.tag (revision a4bc09633e07b301174911591702607f522c7037) @@ -0,0 +1,84 @@ +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-function" prefix="fn" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> + +<%-- Usually fileFieldname and fileFieldId are the same, but DACO needs them to be different. + If they can be the same, set fileFieldname and fileFieldId will be set to the same. + If you need them different, then define both. + If you define neither, fileFieldname = fileFieldId = "fileSelector" --%> +<%@ attribute name="fileFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileFieldId" required="false" rtexprvalue="true"%> + +<%@ attribute name="fileInputNameFieldname" required="false" rtexprvalue="true"%> +<%@ attribute name="fileInputMessageKey" required="false" rtexprvalue="true"%> + +<%-- Set uploadInfoMessageKey to '-' to NOT show the "not exe and max file size" type message. Leave it blank for the default key label.upload.info --%> +<%@ attribute name="uploadInfoMessageKey" required="false" rtexprvalue="true"%> +<%@ attribute name="maxFileSize" required="true" rtexprvalue="true"%> +<%@ attribute name="tabindex" required="false" rtexprvalue="true"%> + +<%-- Only set if you have more than one file field on the screen (such as DACO) --%> +<%@ attribute name="errorMsgDiv" required="false" rtexprvalue="true"%> +<%@ attribute name="fileButtonBrowse" required="false" rtexprvalue="true"%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ <%-- font-size:inherit needed for Share Resources authoring or the button is too small --%> + + + + +
+ +

${maxFileSize}

+
+ + + + Index: lams_tool_larsrc/web/WEB-INF/tags/WaitingSpinner.tag =================================================================== diff -u --- lams_tool_larsrc/web/WEB-INF/tags/WaitingSpinner.tag (revision 0) +++ lams_tool_larsrc/web/WEB-INF/tags/WaitingSpinner.tag (revision a4bc09633e07b301174911591702607f522c7037) @@ -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_larsrc/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u -r1f99d03199a3995cfffe0cb1536c08f0220e88b0 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 1f99d03199a3995cfffe0cb1536c08f0220e88b0) +++ lams_tool_larsrc/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision a4bc09633e07b301174911591702607f522c7037) @@ -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_larsrc/web/includes/javascript/rsrcresourceitem.js =================================================================== diff -u -r33c08844653d1db1980b7a57cd4d22f28e948167 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/includes/javascript/rsrcresourceitem.js (.../rsrcresourceitem.js) (revision 33c08844653d1db1980b7a57cd4d22f28e948167) +++ lams_tool_larsrc/web/includes/javascript/rsrcresourceitem.js (.../rsrcresourceitem.js) (revision a4bc09633e07b301174911591702607f522c7037) @@ -109,7 +109,8 @@ document.getElementById("instructionList").value = $("#instructionForm").serialize(); var formData = new FormData(document.getElementById("resourceItemForm")); - + showBusy(instructionTargetDiv); + // after submit, it direct to itemlist.jsp, // then refresh "basic tab" resource list and close this window. $.ajax({ // create an AJAX call... Index: lams_tool_larsrc/web/pages/authoring/parts/addfile.jsp =================================================================== diff -u -r73f88e6a635cb095a73df2b86fd67d6a2e6e1301 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/authoring/parts/addfile.jsp (.../addfile.jsp) (revision 73f88e6a635cb095a73df2b86fd67d6a2e6e1301) +++ lams_tool_larsrc/web/pages/authoring/parts/addfile.jsp (.../addfile.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -2,27 +2,40 @@ <%@ 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" %> <%=Configuration.get(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE)%> +<%=FileValidatorUtil.formatSize(Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE))%> +<%=Configuration.get(ConfigurationKeys.EXE_EXTENSIONS)%> - <%@ include file="addheader.jsp"%> + <%@ include file="addheader.jsp"%> @@ -68,7 +88,8 @@ <%@ include file="/pages/authoring/parts/itemattachment.jsp"%> - + +
Index: lams_tool_larsrc/web/pages/authoring/parts/addheader.jsp =================================================================== diff -u -r33c08844653d1db1980b7a57cd4d22f28e948167 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/authoring/parts/addheader.jsp (.../addheader.jsp) (revision 33c08844653d1db1980b7a57cd4d22f28e948167) +++ lams_tool_larsrc/web/pages/authoring/parts/addheader.jsp (.../addheader.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -9,9 +9,10 @@ - + + @@ -79,8 +89,9 @@ <%@ include file="/pages/authoring/parts/itemattachment.jsp"%> - + + Index: lams_tool_larsrc/web/pages/authoring/parts/addwebsite.jsp =================================================================== diff -u -r73f88e6a635cb095a73df2b86fd67d6a2e6e1301 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/authoring/parts/addwebsite.jsp (.../addwebsite.jsp) (revision 73f88e6a635cb095a73df2b86fd67d6a2e6e1301) +++ lams_tool_larsrc/web/pages/authoring/parts/addwebsite.jsp (.../addwebsite.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -2,7 +2,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" %> <%=Configuration.get(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE)%> +<%=FileValidatorUtil.formatSize(Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_LARGE_MAX_SIZE))%> @@ -18,10 +20,11 @@ return this.optional(element) || (element.files[0].type == 'application/zip') }); - $.validator.addMethod('filesize', function (value, element, param) { - return this.optional(element) || (element.files[0].size <= param) - }, '{0}'); - + $.validator.addMethod('validateSize', function (value, element, param) { + return validateFileSize(element.files[0], param); + }, '${UPLOAD_FILE_MAX_SIZE_AS_USER_STRING}'); + + $( "#resourceItemForm" ).validate({ ignore: [], errorClass: "text-danger", @@ -30,7 +33,7 @@ file: { required: true, fileType: true, - filesize: UPLOAD_FILE_LARGE_MAX_SIZE, + validateSize: UPLOAD_FILE_LARGE_MAX_SIZE, }, title: { required: true @@ -39,12 +42,19 @@ messages : { file : { required : ' ', - fileType: 'File type incorrect?' + fileType: '' }, title : { required : ' ' } - } + }, + errorPlacement: function(error, element) { + if (element.hasClass("fileUpload")) { + error.insertAfter(element.parent()); + } else { + error.insertAfter(element); + } + } }); @@ -80,8 +90,9 @@ <%@ include file="/pages/authoring/parts/itemattachment.jsp"%> - + + Index: lams_tool_larsrc/web/pages/authoring/parts/instructions.jsp =================================================================== diff -u -rc43a7c4f1389ad2b5fdc526aa736be11ab5ad271 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/authoring/parts/instructions.jsp (.../instructions.jsp) (revision c43a7c4f1389ad2b5fdc526aa736be11ab5ad271) +++ lams_tool_larsrc/web/pages/authoring/parts/instructions.jsp (.../instructions.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -8,8 +8,6 @@ - - @@ -37,7 +35,9 @@
- + + +   Index: lams_tool_larsrc/web/pages/authoring/parts/itemattachment.jsp =================================================================== diff -u -r73f88e6a635cb095a73df2b86fd67d6a2e6e1301 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/authoring/parts/itemattachment.jsp (.../itemattachment.jsp) (revision 73f88e6a635cb095a73df2b86fd67d6a2e6e1301) +++ lams_tool_larsrc/web/pages/authoring/parts/itemattachment.jsp (.../itemattachment.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -1,34 +1,12 @@ <%@ include file="/common/taglibs.jsp"%> +   - -
- - - - - -
- - - +
Index: lams_tool_larsrc/web/pages/authoring/parts/itemlist.jsp =================================================================== diff -u -rb3fe40cd67fc779a6eee8320fadc3a489565a557 -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision b3fe40cd67fc779a6eee8320fadc3a489565a557) +++ lams_tool_larsrc/web/pages/authoring/parts/itemlist.jsp (.../itemlist.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -5,7 +5,7 @@
- +
Index: lams_tool_larsrc/web/pages/learning/addfile.jsp =================================================================== diff -u -r7ed5fbd3fe8ae436e1a4376f59cd23392a6f389f -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/learning/addfile.jsp (.../addfile.jsp) (revision 7ed5fbd3fe8ae436e1a4376f59cd23392a6f389f) +++ lams_tool_larsrc/web/pages/learning/addfile.jsp (.../addfile.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -1,7 +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" %> <%=Configuration.get(ConfigurationKeys.UPLOAD_FILE_MAX_SIZE)%> +<%=FileValidatorUtil.formatSize(Configuration.getAsInt(ConfigurationKeys.UPLOAD_FILE_MAX_SIZE))%> +<%=Configuration.get(ConfigurationKeys.EXE_EXTENSIONS)%>
@@ -23,34 +26,14 @@
-
- - - - - -
+ - -
+
@@ -63,17 +46,19 @@ Index: lams_tool_larsrc/web/pages/learning/learning.jsp =================================================================== diff -u -r7ed5fbd3fe8ae436e1a4376f59cd23392a6f389f -ra4bc09633e07b301174911591702607f522c7037 --- lams_tool_larsrc/web/pages/learning/learning.jsp (.../learning.jsp) (revision 7ed5fbd3fe8ae436e1a4376f59cd23392a6f389f) +++ lams_tool_larsrc/web/pages/learning/learning.jsp (.../learning.jsp) (revision a4bc09633e07b301174911591702607f522c7037) @@ -23,18 +23,20 @@ - - + +