+ | $title - + |
ENDONE
return $output;
@@ -2195,14 +2640,14 @@ sub course_selection {
my $courseform=''.&Apache::loncommon::selectcourse_link
($formname,'pickcourse','pickdomain','coursedesc','',1,$crstype).'';
- $output .= ''.$allcrs.' '; + $output .= ' '; if ($totcodes > 0) { my $numtitles = @$codetitles; if ($numtitles > 0) { - $output .= ''.&mt('Pick courses by category:').' '; + $output .= ' '; $output .= '
'; } } - $output .= ''.$pickspec.' '.$courseform.' selected. '."\n"; + $output .= + '' + .' '.$courseform.' ' + .&mt('[_1] selected.', + '' + .'') + .' '."\n"; return $output; } @@ -2324,9 +2777,9 @@ sub course_custom_roles { sub resource_info_box { - my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp)=@_; + my ($symb,$onlyfolderflag,$stuvcurrent,$stuvdisp,$divforres)=@_; my $return=''; - if ($stuvcurrent ne '') { + if (($stuvcurrent ne '') || ($divforres)) { $return = ' ';
}
if ($symb) {
@@ -2355,12 +2808,59 @@ sub resource_info_box {
} else {
$return=' ';
}
return $return;
}
+# display_usage
+#
+# Generates a div containing a block, filled to show percentage of current quota used
+#
+# Quotas available for user portfolios, group portfolios, authoring spaces, and course
+# content stored directly within a course (i.e., excluding published content).
+#
+
+sub display_usage {
+ my ($current_disk_usage,$disk_quota,$context) = @_;
+ my $usage = $current_disk_usage/1024;
+ my $quota = $disk_quota/1024;
+ my $percent;
+ if ($disk_quota == 0) {
+ $percent = 100.0;
+ } else {
+ $percent = 100*($current_disk_usage/$disk_quota);
+ }
+ $usage = sprintf("%.2f",$usage);
+ $quota = sprintf("%.2f",$quota);
+ $percent = sprintf("%.0f",$percent);
+ my ($color,$cssclass);
+ if ($percent <= 60) {
+ $color = '#00A000';
+ } elsif ($percent > 60 && $percent < 90) {
+ $color = '#FFD300';
+ $cssclass = 'class="LC_warning"';
+ } elsif( $percent >= 90) {
+ $color = '#FF0000';
+ $cssclass = 'class="LC_error"';
+ }
+ my $prog_width = $percent;
+ if ($prog_width > 100) {
+ $prog_width = 100;
+ }
+ my $display = 'block';
+ if ($context eq 'authoring') {
+ $display = 'inline';
+ }
+ return '
+ '.&mt('No context provided.').' '; } - if ($stuvcurrent ne '') { + if (($stuvcurrent ne '') || ($divforres)) { $return .= ''.&mt('Currently using [_1] of the [_2] available.',$usage.' MB ('.$percent.'%)',$quota.' MB')."\n".
+' ';
+}
+
##############################################
##############################################
@@ -2605,10 +3105,12 @@ sub set_form_elements {
sub file_submissionchk_js {
my ($turninpaths,$multiples) = @_;
- my $overwritewarn = &mt('File(s) you uploaded for your submission will overwrite existing file(s) submitted for this item').'\\n'.
+ my $overwritewarn = &mt('File(s) you uploaded for your submission will overwrite existing file(s) submitted for this item')."\n".
&mt('Continue submission and overwrite the file(s)?');
- my $delfilewarn = &mt('You have indicated you wish to remove some files previously included in your submission.').'\\n'.
+ &js_escape(\$overwritewarn);
+ my $delfilewarn = &mt('You have indicated you wish to remove some files previously included in your submission.')."\n".
&mt('Continue submission with these files removed?');
+ &js_escape(\$delfilewarn);
my ($turninpathtext,$multtext,$arrayindexofjs);
if (ref($turninpaths) eq 'HASH') {
foreach my $key (sort(keys(%{$turninpaths}))) {
@@ -2849,7 +3351,7 @@ ENDSCRIPT
##############################################
sub resize_scrollbox_js {
- my ($context,$tabidstr) = @_;
+ my ($context,$tabidstr,$tid) = @_;
my (%names,$paddingwfrac,$offsetwfrac,$offsetv,$minw,$minv);
if ($context eq 'docs') {
%names = (
@@ -2859,7 +3361,7 @@ sub resize_scrollbox_js {
scroll => 'contentscroll',
boxh => 'contenteditor',
);
- $paddingwfrac = 0.09;
+ $paddingwfrac = 0.09;
$offsetwfrac = 0.015;
$offsetv = 20;
$minw = 250;
@@ -2885,9 +3387,11 @@ window.onresize=callResize;
';
if ($context eq 'docs') {
- $output .= '
-var activeTab;
-';
+ if ($env{'form.active'}) {
+ $output .= "\nvar activeTab = '$env{'form.active'}$tid';\n";
+ } else {
+ $output .= "\nvar activeTab = '';\n";
+ }
}
$output .= <<"FIRST";
@@ -2898,6 +3402,7 @@ function resize_scrollbox(scrollboxname,
var scrolltableid = 'table_'+scrollboxname;
var scrollbox;
var scrolltable;
+ var ismobile = '$env{'browser.mobile'}';
if (document.getElementById("$names{'boxw'}") == null) {
return;
@@ -2934,6 +3439,7 @@ FIRST
}
$output .= <<"SECOND";
var listwchange;
+ var scrollchange;
if (chkw == 1) {
var boxw = document.getElementById("$names{'boxw'}").offsetWidth;
var itemw;
@@ -2945,6 +3451,7 @@ FIRST
var scrollboxw = scrollbox.offsetWidth;
var scrollboxscrollw = scrollbox.scrollWidth;
+ var scrollstart = scrollboxw;
var offsetw = parseInt(vpw * $offsetwfrac);
var paddingw = parseInt(vpw * $paddingwfrac);
@@ -3019,14 +3526,31 @@ PARAMSONE
}
}
+ if (newscrollboxw != scrollboxw) {
+ scrollchange = 1;
+ }
+
if (itemid.offsetWidth != itemwstart) {
listwchange = 1;
}
}
if ((chkh == 1) || (listwchange)) {
- var primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
- var secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
- var crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
+ var itemid = document.getElementById("$names{'item'}");
+ if (itemid != null) {
+ itemh = itemid.offsetHeight;
+ }
+ var primaryheight = 0;
+ if (document.getElementById('LC_nav_bar') != null) {
+ primaryheight = document.getElementById('LC_nav_bar').offsetHeight;
+ }
+ var secondaryheight = 0;
+ if (document.getElementById('LC_secondary_menu') != null) {
+ secondaryheight = document.getElementById('LC_secondary_menu').offsetHeight;
+ }
+ var crumbsheight = 0;
+ if (document.getElementById('LC_breadcrumbs') != null) {
+ crumbsheight = document.getElementById('LC_breadcrumbs').offsetHeight;
+ }
var dccidheight = 0;
if (document.getElementById('dccid') != null) {
dccidheight = document.getElementById('dccid').offsetHeight;
@@ -3041,6 +3565,7 @@ PARAMSONE
var scrollboxheight = scrollbox.offsetHeight;
var scrollboxscrollheight = scrollbox.scrollHeight;
+ var scrollboxh = scrollboxheight;
var minvscrollbox = $minv;
var offsetv = $offsetv;
@@ -3071,6 +3596,13 @@ PARAMSONE
scrollbox.style.height = newscrollheight+"px";
}
}
+ var newscrollboxh = scrollbox.offsetHeight;
+ if (scrollboxh != newscrollboxh) {
+ scrollchange = 1;
+ }
+ }
+ if (ismobile && scrollchange) {
+ \$("#div_$names{'scroll'}").getNiceScroll().onResize();
}
return;
}
@@ -3089,21 +3621,39 @@ THIRD
##############################################
sub javascript_jumpto_resource {
- my $confirm_switch = &mt("Editing requires switching to the resource's home server.").'\n'.
+ my $confirm_switch = &mt("Editing requires switching to the resource's home server.")."\n".
&mt('Switch server?');
+ my $confirm_new_tab = &mt("Editing requires using the resource's home server.")."\n".
+ &mt('Open a new browser tab?');
+ &js_escape(\$confirm_switch);
+ &js_escape(\$confirm_new_tab);
return (<'."\n".
+' '."\n".
+' '."\n".
+'
|
---|