'.$$codetitles[0].' '."\n". ' '.$$codetitles[$i].' | ';
@@ -2363,9 +2767,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 = ''."\n". ' ';
}
if ($symb) {
@@ -2394,7 +2798,7 @@ sub resource_info_box {
} else {
$return=' ';
}
return $return;
@@ -2409,9 +2813,9 @@ sub resource_info_box {
#
sub display_usage {
- my ($current_disk_usage,$disk_quota) = @_;
- my $usage = $current_disk_usage/1000;
- my $quota = $disk_quota/1000;
+ 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;
@@ -2435,9 +2839,13 @@ sub display_usage {
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".
-' '."\n".
+ '.&mt('Currently using [_1] of the [_2] available.',$usage.' MB ('.$percent.'%)',$quota.' MB')."\n".
+' ';
@@ -2687,10 +3095,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}))) {
@@ -2931,7 +3341,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 = (
@@ -2941,7 +3351,7 @@ sub resize_scrollbox_js {
scroll => 'contentscroll',
boxh => 'contenteditor',
);
- $paddingwfrac = 0.09;
+ $paddingwfrac = 0.09;
$offsetwfrac = 0.015;
$offsetv = 20;
$minw = 250;
@@ -2967,9 +3377,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";
@@ -2980,6 +3392,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;
@@ -3016,6 +3429,7 @@ FIRST
}
$output .= <<"SECOND";
var listwchange;
+ var scrollchange;
if (chkw == 1) {
var boxw = document.getElementById("$names{'boxw'}").offsetWidth;
var itemw;
@@ -3027,6 +3441,7 @@ FIRST
var scrollboxw = scrollbox.offsetWidth;
var scrollboxscrollw = scrollbox.scrollWidth;
+ var scrollstart = scrollboxw;
var offsetw = parseInt(vpw * $offsetwfrac);
var paddingw = parseInt(vpw * $paddingwfrac);
@@ -3101,17 +3516,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;
+ 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 = document.getElementById('LC_breadcrumbs').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;
@@ -3126,6 +3555,7 @@ PARAMSONE
var scrollboxheight = scrollbox.offsetHeight;
var scrollboxscrollheight = scrollbox.scrollHeight;
+ var scrollboxh = scrollboxheight;
var minvscrollbox = $minv;
var offsetv = $offsetv;
@@ -3156,6 +3586,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;
}
@@ -3174,21 +3611,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".
'
|