--- loncom/interface/loncommon.pm 2022/05/30 00:17:38 1.1382
+++ loncom/interface/loncommon.pm 2025/03/07 02:13:40 1.1469
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1382 2022/05/30 00:17:38 raeburn Exp $
+# $Id: loncommon.pm,v 1.1469 2025/03/07 02:13:40 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -61,7 +61,7 @@ use POSIX qw(strftime mktime);
use Apache::lonmenu();
use Apache::lonenc();
use Apache::lonlocal;
-use Apache::lonnet();
+use Apache::lonnavmaps();
use HTML::Entities;
use Apache::lonhtmlcommon();
use Apache::loncoursedata();
@@ -71,7 +71,9 @@ use Apache::lonuserutils();
use Apache::lonuserstate();
use Apache::courseclassifier();
use LONCAPA qw(:DEFAULT :match);
+use LONCAPA::ltiutils;
use LONCAPA::LWPReq;
+use LONCAPA::map();
use HTTP::Request;
use DateTime::TimeZone;
use DateTime::Locale;
@@ -435,7 +437,7 @@ sub studentbrowser_javascript {
+
+ENDJS
+
+}
+
+=pod
+
+=item * &iframe_wrapper_resizejs()
+
+emits javascript used to handle resizing for a page containing
+an iframe, to ensure that the iframe does not obscure any
+standard LON-CAPA menu items.
+
+=back
+
+=cut
+
+#
+# jQuery to use when iframe is in use and a page resize occurs.
+# This script will ensure that the iframe does not obscure any
+# standard LON-CAPA inline menus (primary, secondary, and/or
+# breadcrumbs and Functions menus. Expects javascript from
+# &iframe_wrapper_headjs() to be in head portion of the web page,
+# e.g., by inclusion in second arg passed to &start_page().
+#
+
+sub iframe_wrapper_resizejs {
+ my $offset = 5;
+ &get_unprocessed_cgi($ENV{'QUERY_STRING'},['inhibitmenu']);
+ if (($env{'form.inhibitmenu'} eq 'yes') || ($env{'form.only_body'})) {
+ $offset = 0;
+ }
+ return &Apache::lonhtmlcommon::scripttag(<
+ENDJS
+ }
$endbodytag=
- "
".
+ "$endbodyjs
".
&mt('Continue').''.
$endbodytag;
}
}
+ if ((ref($args) eq 'HASH') && ($args->{'dashjs'})) {
+ $endbodytag = &Apache::lonhtmlcommon::dash_to_minus_js().$endbodytag;
+ }
return $endbodytag;
}
@@ -6685,7 +7261,6 @@ Inputs: (all optional)
sub standard_css {
my ($function,$domain,$bgcolor) = @_;
$function = &get_users_function() if (!$function);
- my $img = &designparm($function.'.img', $domain);
my $tabbg = &designparm($function.'.tabbg', $domain);
my $font = &designparm($function.'.font', $domain);
my $fontmenu = &designparm($function.'.fontmenu', $domain);
@@ -6738,6 +7313,7 @@ body {
line-height:130%;
font-size:0.83em;
color:$font;
+ background-color: $pgbg_or_bgcolor;
}
a:focus,
@@ -6749,10 +7325,46 @@ form, .inline {
display: inline;
}
+.LC_landmark {
+ margin: 0;
+ padding: 0;
+ border: none;
+}
+
+.LC_visually_hidden:not(:focus):not(:active) {
+ clip-path: inset(50%);
+ height: 1px;
+ overflow: hidden;
+ position: absolute;
+ white-space: nowrap;
+ width: 1px;
+ display: inline;
+}
+
+.LC_heading_2 {
+ font-size: 1.17em;
+}
+
+.LC_heading_3 {
+ font-size: 1.0em;
+}
+
+.LC_menus_content.shown{
+ display: block;
+}
+
+.LC_menus_content.hidden {
+ display: none;
+}
+
.LC_right {
text-align:right;
}
+.LC_center {
+ text-align:center;
+}
+
.LC_middle {
vertical-align:middle;
}
@@ -6769,6 +7381,12 @@ form, .inline {
width:400px;
}
+#LC_collapsible_separator {
+ border: 1px solid black;
+ width: 99.9%;
+ height: 0px;
+}
+
.LC_iframecontainer {
width: 98%;
margin: 0;
@@ -6890,9 +7508,10 @@ div.LC_confirm_box .LC_success img {
padding: 4px;
}
-table.LC_pastsubmission {
+.LC_pastsubmission {
border: 1px solid black;
margin: 2px;
+ padding: 2px;
}
table#LC_menubuttons {
@@ -7146,6 +7765,12 @@ table.LC_nested tr.LC_empty_row td {
table.LC_caption {
}
+caption.LC_caption_prefs {
+ font-weight: normal;
+ text-align: left;
+ padding-bottom: 0.8em;
+}
+
table.LC_nested tr.LC_empty_row td {
padding: 4ex
}
@@ -7316,6 +7941,10 @@ table.LC_data_table tr > td.LC_roles_sel
border-right: 8px solid #11CC55;
}
+table.LC_data_table tr.LC_prefs_row {
+ line-height: 250%;
+}
+
span.LC_current_location {
font-size:larger;
background: $pgbg;
@@ -7389,39 +8018,68 @@ table.LC_parm_overview_restrictions th {
border-color: $pgbg;
}
-table#LC_helpmenu {
- border: none;
- height: 55px;
- border-spacing: 0;
+h1.LC_helpmenu {
+ display: inline;
+ font-size: 100%;
+ font-weight: normal;
+ line-height: 1em;
+ margin: 0;
+ padding: 0;
+ border: 0;
}
-table#LC_helpmenu fieldset legend {
- font-size: larger;
+.LC_helpdesk_headbox {
+ border: 2px groove threedface;
+ padding: 1em;
}
-table#LC_helpmenu_links {
- width: 100%;
- border: 1px solid black;
+h1.LC_helpdesk_legend {
+ float: left;
+ margin: -1.7em 0 0;
+ padding: 0 .5em;
background: $pgbg;
+ font-size: 1em;
+ font-weight: bold;
+}
+
+h1.LC_helpdesk_title {
+ display: inline;
+ font-size: 1em;
+ line-height: 2.5em;
+ margin: 0;
padding: 0;
- border-spacing: 1px;
+ vertical-align: bottom;
}
-table#LC_helpmenu_links tr td {
- padding: 1px;
+.LC_helpdesk_links {
+ border: 1px solid black;
+ padding: 3px;
background: $tabbg;
text-align: center;
font-weight: bold;
+ display: inline;
+ margin-right: -6px;
}
-table#LC_helpmenu_links a:link,
-table#LC_helpmenu_links a:visited,
-table#LC_helpmenu_links a:active {
+.LC_helpdesk_img,
+.LC_helpdesk_text {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ display: inline;
+}
+
+.LC_helpdesk_img a:link,
+.LC_helpdesk_img a:visited,
+.LC_helpdesk_img a:active,
+.LC_helpdesk_text a:link,
+.LC_helpdesk_text a:visited,
+.LC_helpdesk_text a:active {
text-decoration: none;
color: $font;
}
-table#LC_helpmenu_links a:hover {
+div.LC_helpdesk_text a:hover {
text-decoration: underline;
color: $vlink;
}
@@ -7448,7 +8106,7 @@ table.LC_pick_box {
border-spacing: 1px;
}
-table.LC_pick_box td.LC_pick_box_title {
+table.LC_pick_box th.LC_pick_box_title {
background: $sidebg;
font-weight: bold;
text-align: left;
@@ -7651,6 +8309,44 @@ table.LC_prior_tries td {
padding: 6px;
}
+span.LC_prob_status {
+ margin: 5px 0 0 0;
+ padding: 0 5px 0 0;
+ vertical-align: middle;
+}
+
+div.LC_prob_status_outer {
+ display: inline-block;
+ margin: -5px 0 0 0;
+ padding: 0;
+}
+
+div.LC_prob_status_inner {
+ display: inline-block;
+ margin: 0 5px 0 0;
+ padding: 5px;
+}
+
+caption.LC_filesub_status {
+ text-align: left;
+ font-weight: bold;
+}
+
+.LC_mail_actions {
+ float: left;
+ padding: 0;
+ margin: 6px;
+}
+
+.LC_vertical_line {
+ width: 1px;
+ background-color: black;
+ height: 4em;
+ float: left;
+ margin: 0;
+ padding: 0;
+}
+
span.LC_prior_numerical,
span.LC_prior_string,
span.LC_prior_custom,
@@ -7804,6 +8500,10 @@ div.LC_grade_show_user div.LC_Box {
margin-right: 50px;
}
+div.LC_grade_show_user div.LC_Box table tr th {
+ font-weight: normal;
+}
+
div.LC_grade_submissions,
div.LC_grade_message_center,
div.LC_grade_info_links {
@@ -7834,6 +8534,12 @@ table.LC_scantron_action tr th {
font-style:normal;
}
+div.LC_edit_problem_daxe_header {
+ padding: 3px;
+ background: $tabbg;
+ z-index: 100;
+}
+
.LC_edit_problem_header,
div.LC_edit_problem_footer {
font-weight: normal;
@@ -7899,8 +8605,9 @@ img.stift {
vertical-align: middle;
}
-table td.LC_mainmenu_col_fieldset {
- vertical-align: top;
+div.LC_mainmenu {
+ margin: 3px 2px 2px 1px;
+ float: left;
}
div.LC_createcourse {
@@ -7981,6 +8688,12 @@ fieldset {
/* overflow: hidden; */
}
+fieldset#LC_selectuser {
+ margin: -1px 0 0 0;
+ padding: 0;
+ border: 0;
+}
+
article.geogebraweb div {
margin: 0;
}
@@ -8524,6 +9237,10 @@ a#LC_content_toolbar_edittoplevel {
background-image:url(/res/adm/pages/edittoplevel.gif);
}
+a#LC_content_toolbar_printout {
+ background-image:url(/res/adm/pages/printout.gif);
+}
+
ul#LC_toolbar li a:hover {
background-position: bottom center;
}
@@ -8532,7 +9249,7 @@ ul#LC_toolbar {
padding: 0;
margin: 2px;
list-style:none;
- position:relative;
+ display:inline;
background-color:white;
overflow: auto;
}
@@ -8560,6 +9277,13 @@ a.LC_toolbarItem {
background-color:transparent;
}
+.LC_navtools {
+ display: inline-block;
+ padding: 0;
+ margin: 2px;
+ vertical-align: middle;
+}
+
ul.LC_funclist {
margin: 0;
padding: 0.5em 1em 0.5em 0;
@@ -8664,13 +9388,39 @@ pre.LC_wordwrap {
/*
styles used for response display
*/
-div.LC_radiofoil, div.LC_rankfoil {
+div.LC_radiofoil, div.LC_rankfoil, div.LC_optionfoil, div.LC_matchfoil, div.LC_login_links {
margin: .5em 0em .5em 0em;
}
table.LC_itemgroup {
margin-top: 1em;
}
+table.LC_itemgroup tr th {
+ font-weight: normal;
+}
+
+fieldset.LC_webbubbles {
+ margin: 2px 0 0 0;
+ padding: 0;
+ border: 0;
+}
+
+ul.LC_webbubbles {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ text-align: left;
+ float: left;
+}
+
+ul.LC_webbubbles li {
+ line-height: 1.8em;
+ border: 1px solid black;
+ padding: 0 2px 0 5px;
+ margin: 0 0 0 -1px;
+ float: left;
+}
+
/*
styles used by TTH when "Default set of options to pass to tth/m
when converting TeX" in course settings has been set
@@ -8826,7 +9576,13 @@ Inputs: $title - optional title for the
3- whether the side effect should occur
(side effect of setting
$env{'internal.head.redirect'} to the url
- redirected too)
+ redirected to)
+ 4- whether the redirect target should be
+ the opener of the current (pop-up)
+ window (side effect of setting
+ $env{'internal.head.to_opener'} to
+ 1, if true.
+ 5- whether encrypt check should be skipped
domain -> force to color decorate a page for a specific
domain
function -> force usage of a specific rolish color scheme
@@ -8860,7 +9616,7 @@ sub headtag {
$inhibitprint = &print_suppression();
}
- if (!$args->{'frameset'}) {
+ if (!$args->{'frameset'} && !$args->{'switchserver'}) {
$result .= &Apache::lonhtmlcommon::htmlareaheaders();
}
if ($args->{'force_register'} && $env{'request.noversionuri'} !~ m{^/res/adm/pages/}) {
@@ -8868,7 +9624,8 @@ sub headtag {
}
if (!$args->{'no_nav_bar'}
&& !$args->{'only_body'}
- && !$args->{'frameset'}) {
+ && !$args->{'frameset'}
+ && !$args->{'switchserver'}) {
$result .= &help_menu_js($httphost);
$result.=&modal_window();
$result.=&togglebox_script();
@@ -8889,15 +9646,45 @@ sub headtag {
}
}
if (ref($args->{'redirect'})) {
- my ($time,$url,$inhibit_continue) = @{$args->{'redirect'}};
- $url = &Apache::lonenc::check_encrypt($url);
+ my ($time,$url,$inhibit_continue,$to_opener,$skip_enc_check) = @{$args->{'redirect'}};
+ if (!$skip_enc_check) {
+ $url = &Apache::lonenc::check_encrypt($url);
+ }
if (!$inhibit_continue) {
$env{'internal.head.redirect'} = $url;
}
- $result.=<