version 1.589, 2007/09/26 12:34:19
|
version 1.590, 2007/09/27 15:36:23
|
Line 1074 sub changable_area {
|
Line 1074 sub changable_area {
|
|
|
=pod |
=pod |
|
|
=item * resize_textarea_js |
=item * viewport_geometry_js { |
|
|
emits the needed javascript to resize a textarea to be as big as possible |
|
|
|
creates a function resize_textrea that takes two IDs first should be |
|
the id of the element to resize, second should be the id of a div that |
|
surrounds everything that comes after the textarea, this routine needs |
|
to be attached to the <body> for the onload and onresize events. |
|
|
|
|
Provides javascript object (Geometry) which can provide information about the viewport geometry for the client browser. |
|
|
=cut |
=cut |
|
|
sub resize_textarea_js { |
|
return <<"RESIZE"; |
sub viewport_geometry_js { |
<script type="text/javascript"> |
return <<"GEOMETRY"; |
var Geometry = {}; |
var Geometry = {}; |
function init_geometry() { |
function init_geometry() { |
if (Geometry.init) { return }; |
if (Geometry.init) { return }; |
Geometry.init=1; |
Geometry.init=1; |
if (window.innerHeight) { |
if (window.innerHeight) { |
Geometry.getViewportHeight = function() { return window.innerHeight; }; |
Geometry.getViewportHeight = function() { return window.innerHeight; }; |
Geometry.getHorizontalScroll = function() { return window.pageXOffset; }; |
Geometry.getViewportWidth = function() { return window.innerWidth; }; |
Geometry.getVerticalScroll = function() { return window.pageYOffset; }; |
Geometry.getHorizontalScroll = function() { return window.pageXOffset; }; |
|
Geometry.getVerticalScroll = function() { return window.pageYOffset; }; |
} |
} |
else if (document.documentElement && document.documentElement.clientHeight) { |
else if (document.documentElement && document.documentElement.clientHeight) { |
Geometry.getViewportHeight = |
Geometry.getViewportHeight = |
function() { return document.documentElement.clientHeight; }; |
function() { return document.documentElement.clientHeight; }; |
Geometry.getHorizontalScroll = |
Geometry.getViewportWidth = |
function() { return document.documentElement.scrollLeft; }; |
function() { return document.documentElement.clientWidth; }; |
Geometry.getVerticalScroll = |
|
function() { return document.documentElement.scrollTop; }; |
Geometry.getHorizontalScroll = |
|
function() { return document.documentElement.scrollLeft; }; |
|
Geometry.getVerticalScroll = |
|
function() { return document.documentElement.scrollTop; }; |
} |
} |
else if (document.body.clientHeight) { |
else if (document.body.clientHeight) { |
Geometry.getViewportHeight = |
Geometry.getViewportHeight = |
function() { return document.body.clientHeight; }; |
function() { return document.body.clientHeight; }; |
Geometry.getHorizontalScroll = |
Geometry.getViewportWidth = |
function() { return document.body.scrollLeft; }; |
function() { return document.body.clientWidth; }; |
Geometry.getVerticalScroll = |
Geometry.getHorizontalScroll = |
function() { return document.body.scrollTop; }; |
function() { return document.body.scrollLeft; }; |
|
Geometry.getVerticalScroll = |
|
function() { return document.body.scrollTop; }; |
} |
} |
} |
} |
|
|
|
GEOMETRY |
|
} |
|
|
|
=pod |
|
|
|
=item * viewport_size_js { |
|
|
|
Provides a javascript function to set values of two form elements - width and height (elements are passed in as arguments to the javascript function) to the dimensions of the user's browser window. |
|
|
|
=cut |
|
|
|
sub viewport_size_js { |
|
my $geometry = &viewport_geometry_js(); |
|
return <<"DIMS"; |
|
|
|
$geometry |
|
|
|
function getViewportDims(width,height) { |
|
init_geometry(); |
|
width.value = Geometry.getViewportWidth(); |
|
height.value = Geometry.getViewportHeight(); |
|
return; |
|
} |
|
|
|
DIMS |
|
} |
|
|
|
=pod |
|
|
|
=item * resize_textarea_js |
|
|
|
emits the needed javascript to resize a textarea to be as big as possible |
|
|
|
creates a function resize_textrea that takes two IDs first should be |
|
the id of the element to resize, second should be the id of a div that |
|
surrounds everything that comes after the textarea, this routine needs |
|
to be attached to the <body> for the onload and onresize events. |
|
|
|
|
|
=cut |
|
|
|
sub resize_textarea_js { |
|
my $geometry = &viewport_geometry_js(); |
|
return <<"RESIZE"; |
|
<script type="text/javascript"> |
|
$geometry |
|
|
function getX(element) { |
function getX(element) { |
var x = 0; |
var x = 0; |
while (element) { |
while (element) { |
Line 4921 table.LC_double_column {
|
Line 4968 table.LC_double_column {
|
} |
} |
|
|
table.LC_double_column tr td.LC_left_col { |
table.LC_double_column tr td.LC_left_col { |
top: 2x; |
top: 2px; |
left: 2px; |
left: 2px; |
width: 47%; |
width: 47%; |
vertical-align: top; |
vertical-align: top; |