--- loncom/interface/loncommon.pm 2007/09/19 06:24:26 1.586 +++ loncom/interface/loncommon.pm 2007/09/26 12:34:19 1.589 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.586 2007/09/19 06:24:26 raeburn Exp $ +# $Id: loncommon.pm,v 1.589 2007/09/26 12:34:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1094,30 +1094,58 @@ function init_geometry() { if (Geometry.init) { return }; Geometry.init=1; if (window.innerHeight) { - Geometry.getViewportHeight = function() { return window.innerHeight; }; + Geometry.getViewportHeight = function() { return window.innerHeight; }; + Geometry.getHorizontalScroll = function() { return window.pageXOffset; }; + Geometry.getVerticalScroll = function() { return window.pageYOffset; }; } else if (document.documentElement && document.documentElement.clientHeight) { Geometry.getViewportHeight = function() { return document.documentElement.clientHeight; }; + Geometry.getHorizontalScroll = + function() { return document.documentElement.scrollLeft; }; + Geometry.getVerticalScroll = + function() { return document.documentElement.scrollTop; }; } else if (document.body.clientHeight) { Geometry.getViewportHeight = function() { return document.body.clientHeight; }; + Geometry.getHorizontalScroll = + function() { return document.body.scrollLeft; }; + Geometry.getVerticalScroll = + function() { return document.body.scrollTop; }; } } +function getX(element) { + var x = 0; + while (element) { + x += element.offsetLeft; + element = element.offsetParent; + } + return x; +} +function getY(element) { + var y = 0; + while (element) { + y += element.offsetTop; + element = element.offsetParent; + } + return y; +} + + function resize_textarea(textarea_id,bottom_id) { init_geometry(); var textarea = document.getElementById(textarea_id); //alert(textarea); - var textarea_top = textarea.offsetTop; + var textarea_top = getY(textarea); var textarea_height = textarea.offsetHeight; var bottom = document.getElementById(bottom_id); - var bottom_top = bottom.offsetTop; + var bottom_top = getY(bottom); var bottom_height = bottom.offsetHeight; var window_height = Geometry.getViewportHeight(); - var fudge = 23; + var fudge = 23; var new_height = window_height-fudge-textarea_top-bottom_height; if (new_height < 300) { new_height = 300; @@ -1332,8 +1360,6 @@ sub domain_select { =over 4 -=cut - =item * multiple_select_form($name,$value,$size,$hash,$order) Returns a string containing a '; + } + } + } } $jscall = "javascript:changed_radio('krb',$in{'formname'});"; if ($authtype eq '') { @@ -1956,6 +1990,14 @@ sub authform_internal{ } if (!$can_assign{'int'}) { return; + } elsif ($authtype eq '') { + if (grep(/^mode$/,(keys(%in)))) { + if ($in{'mode'} eq 'modifycourse') { + if ($authnum == 1) { + $authtype = ''; + } + } + } } $jscall = "javascript:changed_radio('int',$in{'formname'});"; if ($authtype eq '') { @@ -1997,6 +2039,14 @@ sub authform_local{ } if (!$can_assign{'loc'}) { return; + } elsif ($authtype eq '') { + if (grep(/^mode$/,(keys(%in)))) { + if ($in{'mode'} eq 'modifycourse') { + if ($authnum == 1) { + $authtype = ''; + } + } + } } $jscall = "javascript:changed_radio('loc',$in{'formname'});"; if ($authtype eq '') { @@ -2035,6 +2085,14 @@ sub authform_filesystem{ } if (!$can_assign{'fsys'}) { return; + } elsif ($authtype eq '') { + if (grep(/^mode$/,(keys(%in)))) { + if ($in{'mode'} eq 'modifycourse') { + if ($authnum == 1) { + $authtype = ''; + } + } + } } $jscall = "javascript:changed_radio('fsys',$in{'formname'});"; if ($authtype eq '') { @@ -2095,7 +2153,6 @@ sub get_assignable_auth { return ($authnum,%can_assign); } - ############################################################### ## Get Authentication Defaults for Domain ## ############################################################### @@ -4273,13 +4330,13 @@ table.LC_data_table, table.LC_mail_list } table.LC_nested_outer { border: 1px solid #000000; - border-collapse: separate; + border-collapse: collapse; border-spacing: 0px; width: 100%; } table.LC_nested { border: 0px; - border-collapse: separate; + border-collapse: collapse; border-spacing: 0px; width: 100%; } @@ -4331,7 +4388,8 @@ table.LC_nested tr.LC_info_row td { font-size: small; text-align: center; } -table.LC_nested tr.LC_info_row td.LC_left_item { +table.LC_nested tr.LC_info_row td.LC_left_item, +table.LC_nested_outer tr th.LC_left_item { text-align: left; } table.LC_nested td { @@ -4855,6 +4913,27 @@ table.LC_sty_end { background: #FFBBBB; } +table.LC_double_column { + border-width: 0px; + border-collapse: collapse; + width: 100%; + padding: 2px; +} + +table.LC_double_column tr td.LC_left_col { + top: 2x; + left: 2px; + width: 47%; + vertical-align: top; +} + +table.LC_double_column tr td.LC_right_col { + top: 2px; + right: 2px; + width: 47%; + vertical-align: top; +} + END }