[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm /interface londocs.pm lonfeedback.pm lonmsgdisplay.pm lonsupportreq.pm portfolio.pm /javascriptlib file_upload.js /publisher lonpubdir.pm

raeburn raeburn at source.lon-capa.org
Wed Aug 7 12:08:18 EDT 2019


raeburn		Wed Aug  7 16:08:18 2019 EDT

  Modified files:              
    /loncom/interface	londocs.pm lonfeedback.pm lonmsgdisplay.pm 
                     	lonsupportreq.pm portfolio.pm 
    /loncom/homework	inputtags.pm 
    /loncom/publisher	lonpubdir.pm 
    /loncom/javascriptlib	file_upload.js 
  Log:
  - Prepend LC_ to class name in client-side checking for uploaded file size,
    for purposes of namespacing.
  
  
-------------- next part --------------
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.661 loncom/interface/londocs.pm:1.662
--- loncom/interface/londocs.pm:1.661	Wed Aug  7 15:58:05 2019
+++ loncom/interface/londocs.pm	Wed Aug  7 16:08:04 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.661 2019/08/07 15:58:05 raeburn Exp $
+# $Id: londocs.pm,v 1.662 2019/08/07 16:08:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5967,7 +5967,7 @@
 	my $fileupload=(<<FIUP);
         $quotainfo
 	$lt{'file'}:<br />
-	<input type="file" name="uploaddoc" class="flUpload" size="40" $disabled />
+	<input type="file" name="uploaddoc" class="LC_flUpload" size="40" $disabled />
         <input type="hidden" id="free_space" value="$free_space" />
 FIUP
 
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.380 loncom/interface/lonfeedback.pm:1.381
--- loncom/interface/lonfeedback.pm:1.380	Sat Mar  2 23:40:43 2019
+++ loncom/interface/lonfeedback.pm	Wed Aug  7 16:08:04 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.380 2019/03/02 23:40:43 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.381 2019/08/07 16:08:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2060,7 +2060,7 @@
     } else {
         $r->print(<<END);
 <p>
-$lt{'atta'} $attachmaxtext: <input type="file" name="attachment" class="flUpload" />
+$lt{'atta'} $attachmaxtext: <input type="file" name="attachment" class="LC_flUpload" />
 <input type="hidden" id="free_space" value="131072" />
 </p>
 END
@@ -3560,7 +3560,7 @@
     $r->print('<b>'.$subject.'</b>');
     $r->print(&Apache::lonhtmlcommon::row_closure());
     $r->print(&Apache::lonhtmlcommon::row_title($lt{'adda'}));
-    $r->print('<input type="file" name="addnewattach" class="flUpload" />'
+    $r->print('<input type="file" name="addnewattach" class="LC_flUpload" />'
         .'<input type="hidden" id="free_space" value="131072" />'
         .'<input type="button" name="upload" value="Upload" '
         .'onclick="this.form.submit()" />  '.$attachmaxtext);
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.186 loncom/interface/lonmsgdisplay.pm:1.187
--- loncom/interface/lonmsgdisplay.pm:1.186	Mon Dec 18 23:20:48 2017
+++ loncom/interface/lonmsgdisplay.pm	Wed Aug  7 16:08:04 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.186 2017/12/18 23:20:48 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.187 2019/08/07 16:08:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1417,7 +1417,7 @@
                     );
     if (!$forwarding && !$multiforward) {
         $attachrow = '<tr><td colspan="3"><b>'.$lt{'atta'}.'</b> '.$attachmax{'text'}
-            .': <input type="file" name="attachment" class="flUpload" multiple />'
+            .': <input type="file" name="attachment" class="LC_flUpload" multiple />'
             .'</td></tr>'
             .'<input type="hidden" id="free_space" value="'.$attachmax{'num'}.'" />';
     }
Index: loncom/interface/lonsupportreq.pm
diff -u loncom/interface/lonsupportreq.pm:1.96 loncom/interface/lonsupportreq.pm:1.97
--- loncom/interface/lonsupportreq.pm:1.96	Tue Jul 23 13:58:53 2019
+++ loncom/interface/lonsupportreq.pm	Wed Aug  7 16:08:04 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Helpdesk request form
 #
-# $Id: lonsupportreq.pm,v 1.96 2019/07/23 13:58:53 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.97 2019/08/07 16:08:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -582,7 +582,7 @@
                 }
                 $showmax = ' ('.sprintf("%.2f",$showmax).' '.&mt('MB max.').')';
                 $output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i])
-                    .' <input type="file" name="screenshot" class="flUpload" size="20" />'
+                    .' <input type="file" name="screenshot" class="LC_flUpload" size="20" />'
                     .'<input type="hidden" id="free_space" value="'.$max.'" />'
                     .'<br />'."\n".$html_lt{'uplf'}.$showmax."\n"
                     .&Apache::lonhtmlcommon::row_closure();
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.259 loncom/interface/portfolio.pm:1.260
--- loncom/interface/portfolio.pm:1.259	Sat Aug 12 01:32:14 2017
+++ loncom/interface/portfolio.pm	Wed Aug  7 16:08:04 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.259 2017/08/12 01:32:14 raeburn Exp $
+# $Id: portfolio.pm,v 1.260 2019/08/07 16:08:04 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -121,7 +121,7 @@
                  .'<fieldset>'
                  .'<legend>'.$lt{'upload_label'}.'</legend>'
                  .$groupitem 
-                 .'<input name="uploaddoc" type="file" class="flUpload" />'
+                 .'<input name="uploaddoc" type="file" class="LC_flUpload" />'
                  .'<input type="hidden" id="free_space" value="'.$free_space.'" />'
                  .'<input type="hidden" name="currentpath" value="'.$current_path.'" />'
                  .'<input type="hidden" name="action" value="'.$env{"form.action"}.'" />'
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.345 loncom/homework/inputtags.pm:1.346
--- loncom/homework/inputtags.pm:1.345	Mon Mar 18 20:18:27 2019
+++ loncom/homework/inputtags.pm	Wed Aug  7 16:08:09 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.345 2019/03/18 20:18:27 raeburn Exp $
+# $Id: inputtags.pm,v 1.346 2019/08/07 16:08:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -671,7 +671,7 @@
         my $free_space = $maxfilesize * 1048576;
         $result .= &mt('Submit a file: (only one file per submission)').
             ' <br /><input type="file" size="50" name="HWFILE'.$jspart.'_'.$id.
-            '" id="HWFILE'.$jspart.'_'.$id.'" class="flUpload" /><br />'.
+            '" id="HWFILE'.$jspart.'_'.$id.'" class="LC_flUpload" /><br />'.
             '<input type="hidden" id="free_space" value="'.$free_space.'" /><br />'
         }
     if ( $which eq 'both') {
Index: loncom/publisher/lonpubdir.pm
diff -u loncom/publisher/lonpubdir.pm:1.170 loncom/publisher/lonpubdir.pm:1.171
--- loncom/publisher/lonpubdir.pm:1.170	Wed Nov 30 18:38:48 2016
+++ loncom/publisher/lonpubdir.pm	Wed Aug  7 16:08:13 2019
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Authoring Space Directory Lister
 #
-# $Id: lonpubdir.pm,v 1.170 2016/11/30 18:38:48 damieng Exp $
+# $Id: lonpubdir.pm,v 1.171 2019/08/07 16:08:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -586,7 +586,7 @@
       <fieldset>
         <legend>$lt{'updc'}</legend>
         <input type="hidden" name="filename" value="/priv$thisdisfn/" />
-        <input type="file" name="upfile" class="flUpload testclass" size="20" />
+        <input type="file" name="upfile" class="LC_flUpload testclass" size="20" />
         <input type="hidden" id="free_space" value=$free_space />
         <input type="button" value="$lt{'uplo'}"  onclick="checkUpload(this.form)" />
       </fieldset>
Index: loncom/javascriptlib/file_upload.js
diff -u loncom/javascriptlib/file_upload.js:1.1 loncom/javascriptlib/file_upload.js:1.2
--- loncom/javascriptlib/file_upload.js:1.1	Thu Jun 18 20:19:18 2015
+++ loncom/javascriptlib/file_upload.js	Wed Aug  7 16:08:17 2019
@@ -2,7 +2,7 @@
 The LearningOnline Network with CAPA
 JavaScript functions handling file uploading
 
-$Id: file_upload.js,v 1.1 2015/06/18 20:19:18 musolffc Exp $
+$Id: file_upload.js,v 1.2 2019/08/07 16:08:17 raeburn Exp $
 
 Copyright Michigan State University Board of Trustees
 
@@ -36,8 +36,8 @@
 
 INPUT:
     fileInput -
-        <input type="file" class="flUpload" />
-        Using the class "flUpload" is needed to use the event handlers below.
+        <input type="file" class="LC_flUpload" />
+        Using the class "LC_flUpload" is needed to use the event handlers below.
     maxSize -
         Maximum upload size in bytes.  It is usually calculated from quota and 
         disk usage.
@@ -77,9 +77,9 @@
 
 /*
 This block adds event listeners to file upload elements.  It looks for input
-elements with class="flUpload".
+elements with class="LC_flUpload".
 
-    <input type="file" class="flUpload" />
+    <input type="file" class="LC_flUpload" />
 
 It also looks for a hidden element with id="free_space" that contains the maximum
 upload size.
@@ -91,7 +91,7 @@
 */
 $( document ).ready(function() {
     var maxSize = $( "#free_space" ).val();
-    var upload_elements = $( ".flUpload" );
+    var upload_elements = $( ".LC_flUpload" );
     for (var i=0; i<upload_elements.length; i++) {
         upload_elements[i].addEventListener( "change", function(){
             checkUploadSize(this, maxSize);


More information about the LON-CAPA-cvs mailing list