[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonhtmlcommon.pm

raeburn raeburn at source.lon-capa.org
Mon Jul 1 22:29:13 EDT 2024


raeburn		Tue Jul  2 02:29:13 2024 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonhtmlcommon.pm 
  Log:
  - For 2.11
    Backport 1.404, 1.412, 1.413
  
  
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.358.2.20 loncom/interface/lonhtmlcommon.pm:1.358.2.21
--- loncom/interface/lonhtmlcommon.pm:1.358.2.20	Mon Sep 11 14:13:31 2023
+++ loncom/interface/lonhtmlcommon.pm	Tue Jul  2 02:29:13 2024
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common html routines
 #
-# $Id: lonhtmlcommon.pm,v 1.358.2.20 2023/09/11 14:13:31 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.358.2.21 2024/07/02 02:29:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1268,9 +1268,9 @@
 ENDEDITOR
 	}
     $s.=(<<ENDJQUERY);
-<script type="text/javascript" src="/adm/jQuery/js/jquery-3.2.1.min.js"></script>
-<script type="text/javascript" src="/adm/jQuery/js/jquery-ui-1.12.1.custom.min.js"></script>
-<link rel="stylesheet" type="text/css" href="/adm/jQuery/css/smoothness/jquery-ui-1.12.1.custom.min.css" />
+<script type="text/javascript" src="/adm/jQuery/js/jquery-3.7.1.min.js"></script>
+<script type="text/javascript" src="/adm/jQuery/js/jquery-ui-1.13.3.custom.min.js"></script>
+<link rel="stylesheet" type="text/css" href="/adm/jQuery/css/smoothness/jquery-ui-1.13.3.custom.min.css" />
 <script type="text/javascript" src="/adm/jpicker/js/jpicker-1.1.6.min.js" >
 </script>
 <link rel="stylesheet" type="text/css" href="/adm/jpicker/css/jPicker-1.1.6.min.css" />
@@ -1680,7 +1680,7 @@
         $env{'request.uri'}=~m{^/priv/}) { return 1; }
     return if ($env{'request.noversionuri'} eq '/adm/supplemental');
 
-    if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
+    if (($env{'request.noversionuri'} =~ m{^/adm/viewclasslist($|\?)})
         || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
 
         return if ($env{'form.register'});
@@ -1772,13 +1772,19 @@
 document.addEventListener("DOMContentLoaded", (event) => {
     const numresp = document.querySelectorAll("input.LC_numresponse_text");
     if (numresp.length > 0) {
-        numresp.forEach((el) => {
+        Array.from(numresp).forEach((el) => {
             el.addEventListener("paste", (e) => {
                 e.preventDefault();
                 e.stopPropagation();
                 let p = (e.clipboardData || window.clipboardData).getData("text");
                 p.toString();
-                p = p.replace(/\p{Dash}/gu, '-');
+                var regex;
+                try
+                {
+                    regex = new RegExp ("\\p{Dash}", "gu");
+                }
+                catch (e) { regex = new RegExp ("[\\u058A\\u05BE\\u1400\\u1806\\u2010-\\u2015\\u2E3A\\u2E3B\\u2E5D\\u301C\\uFE58\\uFE63\\uFF0D]","g"); }
+                p = p.replace(regex,'-');
                 putInText(p);
             });
         });




More information about the LON-CAPA-cvs mailing list