version 1.408, 2022/10/27 20:08:16
|
version 1.416, 2025/02/14 22:42:05
|
Line 231 sub dependencycheck_js {
|
Line 231 sub dependencycheck_js {
|
$link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'); |
$link = '/adm/dependencies?symb='.&HTML::Entities::encode($symb,'<>&"'); |
} elsif ($folderpath) { |
} elsif ($folderpath) { |
$link = '/adm/dependencies?folderpath='.&HTML::Entities::encode($folderpath,'<>&"'); |
$link = '/adm/dependencies?folderpath='.&HTML::Entities::encode($folderpath,'<>&"'); |
$url = $uri; |
$url = $uri; |
} elsif ($uri =~ m{^/public/$match_domain/$match_courseid/syllabus$}) { |
} elsif ($uri =~ m{^/public/$match_domain/$match_courseid/syllabus$}) { |
$link = '/adm/dependencies'; |
$link = '/adm/dependencies'; |
} |
} |
$link .= (($link=~/\?/)?'&':'?').'title='. |
$link .= (($link=~/\?/)?'&':'?').'title='. |
&HTML::Entities::encode($title,'<>&"'); |
&HTML::Entities::encode($title,'<>&"'); |
if ($url) { |
if ($url) { |
$link .= '&url='.&HTML::Entities::encode($url,'<>&"'); |
$link .= '&url='.&HTML::Entities::encode($url,'<>&"'); |
} |
} |
|
&js_escape(\$link); |
return <<ENDJS; |
return <<ENDJS; |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 1316 sub htmlareaheaders {
|
Line 1317 sub htmlareaheaders {
|
ENDEDITOR |
ENDEDITOR |
} |
} |
$s.=(<<ENDJQUERY); |
$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-3.7.1.min.js"></script> |
<script type="text/javascript" src="/adm/jQuery/js/jquery-ui-1.12.1.custom.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.12.1.custom.min.css" /> |
<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 type="text/javascript" src="/adm/jpicker/js/jpicker-1.1.6.min.js" > |
</script> |
</script> |
<link rel="stylesheet" type="text/css" href="/adm/jpicker/css/jPicker-1.1.6.min.css" /> |
<link rel="stylesheet" type="text/css" href="/adm/jpicker/css/jPicker-1.1.6.min.css" /> |
Line 1737 sub show_return_link {
|
Line 1738 sub show_return_link {
|
unless ($env{'request.course.id'}) { return 0; } |
unless ($env{'request.course.id'}) { return 0; } |
if ($env{'request.noversionuri'}=~m{^/priv/} || |
if ($env{'request.noversionuri'}=~m{^/priv/} || |
$env{'request.uri'}=~m{^/priv/}) { return 1; } |
$env{'request.uri'}=~m{^/priv/}) { return 1; } |
return if ($env{'request.noversionuri'} eq '/adm/supplemental'); |
return if (($env{'request.noversionuri'} eq '/adm/supplemental') && |
|
($env{'form.folder'} ne 'supplemental')); |
|
return if (($env{'form.folderpath'} ne '') && |
|
(($env{'request.noversionuri'} =~ m{^/adm/$match_domain/$match_username/aboutme$}) || |
|
($env{'request.noversionuri'} =~ m{^/public/$match_domain/$match_courseid/syllabus$}))); |
return if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') && |
return if (($env{'course.'.$env{'request.course.id'}.'.type'} eq 'Placement') && |
(!$env{'request.role.adv'})); |
(!$env{'request.role.adv'})); |
if (($env{'request.noversionuri'} =~ m{^/adm/viewclasslist($|\?)}) |
if (($env{'request.noversionuri'} =~ m{^/adm/viewclasslist($|\?)}) |
Line 1745 sub show_return_link {
|
Line 1750 sub show_return_link {
|
|
|
return if ($env{'form.register'}); |
return if ($env{'form.register'}); |
} |
} |
|
if ((($env{'request.symb'} ne '') || ($env{'form.folderpath'} ne '')) && |
|
($env{'request.noversionuri'} =~m{^/adm/coursedocs/showdoc/uploaded/($match_domain)/($match_courseid)/(docs|supplemental)/})) { |
|
my ($cdom,$cnum,$area) = ($1,$2,$3); |
|
if (($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom) && |
|
($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum)) { |
|
if (($env{'request.symb'}) && ($area eq 'docs')) { |
|
my ($map,$resid,$url) = &Apache::lonnet::decode_symb($env{'request.symb'}); |
|
return if ($env{'request.noversionuri'} eq '/adm/coursedocs/showdoc/'.$url); |
|
} elsif (($env{'form.folderpath'}) && ($area eq 'supplemental')) { |
|
return; |
|
} |
|
} |
|
} |
return (($env{'request.noversionuri'}=~m{^/(res|public)/} && |
return (($env{'request.noversionuri'}=~m{^/(res|public)/} && |
$env{'request.symb'} eq '') |
$env{'request.symb'} eq '') |
|| |
|| |
Line 1813 clientTime = (new Date()).getTime();
|
Line 1831 clientTime = (new Date()).getTime();
|
END |
END |
} |
} |
|
|
|
## |
|
# Client-side javascript to convert any dashes in text pasted |
|
# into textbox(es) for numericalresponse item(s) to a standard |
|
# minus, i.e., - . Calls to dash_to_minus_js() in end_problem() |
|
# and in loncommon::endbodytag() for a .page (arg: dashjs => 1) |
|
# |
|
# Will apply to any input tag with class: LC_numresponse_text. |
|
# Currently set in start_textline for numericalresponse items. |
|
# |
|
|
|
sub dash_to_minus_js { |
|
return <<'ENDJS'; |
|
|
|
<script type="text/javascript"> |
|
//<![CDATA[ |
|
//<!-- BEGIN LON-CAPA Internal |
|
document.addEventListener("DOMContentLoaded", (event) => { |
|
const numresp = document.querySelectorAll("input.LC_numresponse_text"); |
|
if (numresp.length > 0) { |
|
Array.from(numresp).forEach((el) => { |
|
el.addEventListener("paste", (e) => { |
|
e.preventDefault(); |
|
e.stopPropagation(); |
|
let p = (e.clipboardData || window.clipboardData).getData("text"); |
|
p.toString(); |
|
var regex; |
|
try |
|
{ |
|
regex = new RegExp ("\\p{Dash}", "gu"); |
|
} |
|
catch (e) { regex = new RegExp ("[\\u058A\\u05BE\\u1400\\u1806\\u2010-\\u2015\\u2212\\u2E3A\\u2E3B\\u2E5D\\u301C\\uFE58\\uFE63\\uFF0D]","g"); } |
|
p = p.replace(regex,'-'); |
|
putInText(p); |
|
}); |
|
}); |
|
} |
|
const putInText = (newText, el = document.activeElement) => { |
|
const [start, end] = [el.selectionStart, el.selectionEnd]; |
|
el.setRangeText(newText, start, end, 'end'); |
|
} |
|
}); |
|
// END LON-CAPA Internal --> |
|
//]]> |
|
</script> |
|
|
|
ENDJS |
|
} |
|
|
############################################################ |
############################################################ |
############################################################ |
############################################################ |
|
|
Line 1849 boolean, controls whether to include a l
|
Line 1915 boolean, controls whether to include a l
|
|
|
if 'nohelp' don't include the orange help link |
if 'nohelp' don't include the orange help link |
|
|
=item $css_class |
=item $crumbs_style |
|
|
optional name for the class to apply to the table for CSS |
optional style attribute for div containing breadcrumbs |
|
unless called from docs_breadcrumbs |
|
|
=item $no_mt |
=item $no_mt |
|
|
Line 1909 returns: nothing
|
Line 1976 returns: nothing
|
my %tools = (); |
my %tools = (); |
|
|
sub breadcrumbs { |
sub breadcrumbs { |
my ($component,$component_help,$menulink,$helplink,$css_class,$no_mt, |
my ($component,$component_help,$menulink,$helplink,$crumbs_style,$no_mt, |
$CourseBreadcrumbs,$topic_help,$topic_help_text,$links_target) = @_; |
$CourseBreadcrumbs,$topic_help,$topic_help_text,$links_target) = @_; |
# |
# |
$css_class ||= 'LC_breadcrumbs'; |
|
|
|
# Make the faq and bug data cascade |
# Make the faq and bug data cascade |
my $faq = ''; |
my $faq = ''; |
my $bug = ''; |
my $bug = ''; |
Line 2015 returns: nothing
|
Line 2080 returns: nothing
|
|
|
if ($lasttext ne '') { |
if ($lasttext ne '') { |
$links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', |
$links .= &htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1', |
$lasttext), {title => $lasttext}); |
$lasttext)); |
} |
} |
|
|
my $icons = ''; |
my $icons = ''; |
Line 2067 returns: nothing
|
Line 2132 returns: nothing
|
} |
} |
if (($links ne '') || ($nav_and_tools)) { |
if (($links ne '') || ($nav_and_tools)) { |
&render_tools(\$links); |
&render_tools(\$links); |
$links = &htmltag('div', $links, |
unless ($CourseBreadcrumbs) { |
{ id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ; |
my $args = { id => 'LC_breadcrumbs' }; |
|
if ($crumbs_style ne '') { |
|
$args->{'style'} = $crumbs_style; |
|
} |
|
$links = &htmltag('div', $links, $args); |
|
} |
} |
} |
my $adv_tools = 0; |
my $adv_tools = 0; |
if (ref($tools{'advtools'}) eq 'ARRAY') { |
if (ref($tools{'advtools'}) eq 'ARRAY') { |
Line 2085 returns: nothing
|
Line 2155 returns: nothing
|
|
|
# Return the breadcrumb's line |
# Return the breadcrumb's line |
|
|
|
my $labeltext = &HTML::Entities::encode(&mt('Links for navigation and information')); |
|
return '<div class="LC_landmark" role="navigation" aria-label="'.$labeltext.'">'.$links.'</div>'; |
return "$links"; |
|
} |
} |
|
|
sub clear_breadcrumbs { |
sub clear_breadcrumbs { |
Line 2307 sub docs_breadcrumbs {
|
Line 2376 sub docs_breadcrumbs {
|
$plain=~s/\>\;\s*$//; |
$plain=~s/\>\;\s*$//; |
} |
} |
my $menulink = 0; |
my $menulink = 0; |
if (!$allowed && !$contenteditor) { |
if (!$allowed && !$contenteditor && !$supplementalflag) { |
$menulink = 1; |
$menulink = 1; |
} |
} |
if ($checklinkprot) { |
if ($checklinkprot) { |
Line 2420 END
|
Line 2489 END
|
} |
} |
|
|
sub row_title { |
sub row_title { |
my ($title,$css_title_class,$css_value_class, $css_value_furtherAttributes) = @_; |
my ($title,$css_title_class,$css_value_class,$css_value_furtherAttributes) = @_; |
$row_count[0]++; |
$row_count[0]++; |
my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row'; |
my $css_class = ($row_count[0] % 2)?'LC_odd_row':'LC_even_row'; |
$css_title_class ||= 'LC_pick_box_title'; |
$css_title_class ||= 'LC_pick_box_title'; |
Line 2433 sub row_title {
|
Line 2502 sub row_title {
|
} |
} |
my $output = <<"ENDONE"; |
my $output = <<"ENDONE"; |
<tr class="LC_pick_box_row" $css_value_furtherAttributes> |
<tr class="LC_pick_box_row" $css_value_furtherAttributes> |
<td $css_title_class> |
<th $css_title_class> |
$title |
$title |
</td> |
</th> |
<td class="$css_value_class $css_class"> |
<td class="$css_value_class $css_class"> |
ENDONE |
ENDONE |
return $output; |
return $output; |