--- loncom/javascriptlib/file_upload.js 2019/08/11 14:16:55 1.3 +++ loncom/javascriptlib/file_upload.js 2023/07/11 22:24:30 1.4 @@ -2,7 +2,7 @@ The LearningOnline Network with CAPA JavaScript functions handling file uploading -$Id: file_upload.js,v 1.3 2019/08/11 14:16:55 raeburn Exp $ +$Id: file_upload.js,v 1.4 2023/07/11 22:24:30 raeburn Exp $ Copyright Michigan State University Board of Trustees @@ -105,6 +105,11 @@ INPUT: The PREFIX is empty unless the resource is within a composite page. + For upload to "IMS upload" in Main Content or "Upload File" in + Supplemental Content in the Course Editor, the SUFFIX is extracted + from the id of the file upload element, by splitting the id on + underscore, and using the second element. + */ function getMaxSize (fileInput,sizeItem) { var maxSize = 0; @@ -118,6 +123,13 @@ function getMaxSize (fileInput,sizeItem) if (found.length == 3) { sizeId = found[1]+sizeItem+'_'+found[2]; } + } else if ($(fileInput).hasClass("LC_uploaddoc")) { + uploadId = $(fileInput).attr('id'); + var re = /^uploaddoc(.+)$/; + var found = uploadId.match(re); + if (found.length == 2) { + sizeId = sizeItem+'_'+found[1]; + } } if ( $("#"+sizeId).length) { if ( $("#"+sizeId).val() > 0) {