--- loncom/interface/lonhtmlcommon.pm 2007/07/11 20:32:15 1.160
+++ loncom/interface/lonhtmlcommon.pm 2007/09/26 12:42:32 1.163
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.160 2007/07/11 20:32:15 albertel Exp $
+# $Id: lonhtmlcommon.pm,v 1.163 2007/09/26 12:42:32 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1006,7 +1006,12 @@ sub crumbs {
}
my $href_path = &HTML::Entities::encode($path,'<>&"');
&Apache::loncommon::inhibit_menu_check(\$href_path);
- $output.=qq{$dir/};
+ if ($form) {
+ my $href = 'javascript:'.$form.".action='".$href_path."';".$form.'.submit();';
+ $output.=qq{$dir/};
+ } else {
+ $output.=qq{$dir/};
+ }
}
} else {
foreach my $dir (split('/',$uri)) {
@@ -1329,7 +1334,7 @@ returns: nothing
# row2
# row3 ... etc.
# &submit_row(0
-# &end_pickbox()
+# &end_pick_box()
#
# where row1, row 2 etc. are chosen from &role_select_row,&course_select_row,
# &status_select_row and &email_default_row
@@ -1567,7 +1572,6 @@ sub status_select_row {
sub email_default_row {
my ($authtypes,$title,$descrip,$css_class) = @_;
my $output = &row_title($title,$css_class);
- my @rowcols = ('#eeeeee','#dddddd');
$output .= $descrip.
&Apache::loncommon::start_data_table().
&Apache::loncommon::start_data_table_header_row().
@@ -1875,6 +1879,52 @@ END
return $scripttag;
}
+##############################################
+##############################################
+
+# javascript_window_dims
+#
+# Generates javascript to get the dimensions of the user's browser window.
+
+sub javascript_window_dims {
+ my $scripttag .= <<'END';
+function getDimensions(width,height) {
+ width.value = getWindowWidth();
+ height.value = getWindowHeight();
+ return;
+}
+
+function getWindowWidth() {
+ var width = 0;
+ if( document.documentElement && document.documentElement.clientWidth ) {
+ width = document.documentElement.clientWidth;
+ }
+ else if( document.body && document.body.clientWidth ) {
+ width = document.body.clientWidth;
+ }
+ else if( window.innerWidth ) {
+ width = window.innerWidth - 18;
+ }
+ return width;
+}
+
+function getWindowHeight() {
+ var height = 0;
+ if( document.documentElement && document.documentElement.clientHeight ) {
+ height = document.documentElement.clientHeight;
+ }
+ else if( document.body && document.body.clientHeight ) {
+ height = document.body.clientHeight;
+ }
+ else if( window.innerHeight ) {
+ height = window.innerHeight - 18;
+ }
+ return height;
+}
+
+END
+ return $scripttag;
+}
1;
__END__