Recent JSAN Uploads
http://openjsan.org/
Recent JavaScript Distributions submitted to the JavaScript Archive Network (JSAN)en-usCreative Commons2007-10-01T07:04:13casey@geeknest.comcasey@geeknest.comRecent JSAN Uploadshourly11969-12-31T19:00:01JSANhttp://openjsan.org/images/logo/jsan-logo-rhino.png
http://openjsan.org/
Marshall RochJapaneseHolidays-1.0.3
http://openjsan.org/doc/h/hn/hnakamur/JapaneseHolidays/1.0.3
<pre>NAME
JapanseHolidays - Japanese holidays calculation library
SYNOPSIS
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23));
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23));
DESCRIPTION
This is a library for testing if a date is a Japanese holiday
(precisely, "Shukujitsu" or "Furikae Kyuujitsu") or not. Also you can
get the holiday name written in Japanese.
FUNCTIONS
isHoliday
Tests a specified date is a Japanese holiday or not.
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 29)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30)); // is true because this date is a "furikae kyuujitsu".
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30), false); // is false with passing includesFurikaeKyujitsu to false.
getHolidayName
Returns the holiday name (written in Japanese) for a date if the date is
a holiday, or returns the empty string if the date is not a holiday.
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23)); // is 'ç§åã®æ¥' (<- a holiday name written in Japanese)
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 29)); // is 'æåã®æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30)); // is 'æ¯æ¿ä¼æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30), false); // is '' with passing includesFurikaeKyujitsu to false.
getHolidayAndNames
Returns an array of arrays of dates of holidays and names in a year or
in a month. The first element of the nested array is a date of a
holiday, and the second element is the name of that holiday.
holidays = JapaneseHolidays.getHolidayAndNames(2007, 5 - 1); // holidays in a month
for (i = 0; i < holidays.length; i++) {
date = holidays[i][0];
name = holidays[i][1];
}
// more examples
holidays = JapaneseHolidays.getHolidayAndNames(2007); // holidays in a year
holidays = JapaneseHolidays.getHolidayAndNames(2007, 9 - 1, false); // holidays excluding FurikaeKyuujitsu's.
EXAMPLES
// usage of isHoliday() to prevent computing repeatedly holidays in a month.
year = 2007;
month = 5 - 1;
holidays = JapaneseHolidays.getHolidayAndNames(year, month);
endDate = JapaneseHolidays.getEndDateInMonth(year, month);
for (var d = 1; d < endDate.getDate(); d++) {
dt = new Date(year, month, d);
isH = JapaneseHolidays.isHoliday(dt, undefined, holidays);
name = JapaneseHolidays.getHolidayName(dt, undefined, holidays);
}
CHANGES
ver. 1.0.3
Fixed the calculation of Shunbun days and Shuubun days. The current
version passes the test for years between 1948 and 2030, and is supposed
to be correct until year 2150.
ver. 1.0.2
Added dojo.provide().
ver. 1.0.1
Fixed a bug. Both isHoliday() and getHolidayName() didn't handle dates
having non-zero (that is, not 00:00:00) time part.
ver. 1.0
Initial release.
AUTHOR
Hioraki Nakamura <hnakamur@gmail.com>
COPYRIGHT
This program is licensed under MIT license.
Copyright (C) 2007 Hiroaki Nakamura <hnakamur@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</pre>2007-09-28T18:59:05JapaneseHolidays-1.0.2
http://openjsan.org/doc/h/hn/hnakamur/JapaneseHolidays/1.0.2
<pre>NAME
JapanseHolidays - Japanese holidays calculation library
SYNOPSIS
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23));
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23));
DESCRIPTION
This is a library for testing if a date is a Japanese holiday
(precisely, "Shukujitsu" or "Furikae Kyuujitsu") or not. Also you can
get the holiday name written in Japanese.
FUNCTIONS
isHoliday
Tests a specified date is a Japanese holiday or not.
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 29)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30)); // is true because this date is a "furikae kyuujitsu".
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30), false); // is false with passing includesFurikaeKyujitsu to false.
getHolidayName
Returns the holiday name (written in Japanese) for a date if the date is
a holiday, or returns the empty string if the date is not a holiday.
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23)); // is 'ç§åã®æ¥' (<- a holiday name written in Japanese)
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 29)); // is 'æåã®æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30)); // is 'æ¯æ¿ä¼æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30), false); // is '' with passing includesFurikaeKyujitsu to false.
getHolidayAndNames
Returns an array of arrays of dates of holidays and names in a year or
in a month. The first element of the nested array is a date of a
holiday, and the second element is the name of that holiday.
holidays = JapaneseHolidays.getHolidayAndNames(2007, 5 - 1); // holidays in a month
for (i = 0; i < holidays.length; i++) {
date = holidays[i][0];
name = holidays[i][1];
}
// more examples
holidays = JapaneseHolidays.getHolidayAndNames(2007); // holidays in a year
holidays = JapaneseHolidays.getHolidayAndNames(2007, 9 - 1, false); // holidays excluding FurikaeKyuujitsu's.
EXAMPLES
// usage of isHoliday() to prevend computing repeatedly holidays in a month.
year = 2007;
month = 5 - 1;
holidays = JapaneseHolidays.getHolidayAndNames(year, month);
endDate = JapaneseHolidays.getEndDateInMonth(year, month);
for (var d = 1; d < endDate.getDate(); d++) {
dt = new Date(year, month, d);
isH = JapaneseHolidays.isHoliday(dt, undefined, holidays);
name = JapaneseHolidays.getHolidayName(dt, undefined, holidays);
}
CHANGES
ver. 1.0.2
Added dojo.provide().
ver. 1.0.1
Fixed a bug. Both isHoliday() and getHolidayName() didn't handle dates
having non-zero (that is, not 00:00:00) time part.
ver. 1.0
Initial release.
AUTHOR
Hioraki Nakamura <hnakamur@gmail.com>
COPYRIGHT
This program is licensed under MIT license.
Copyright (C) 2007 Hiroaki Nakamura <hnakamur@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</pre>2007-09-27T18:59:06-Ajax
http://openjsan.org/doc/1/11/111//Ajax
<pre></pre>2007-09-26T18:59:05Ajax-0.11
http://openjsan.org/doc/i/in/ingy/Ajax/0.11
<pre>Simple Javascript Ajax</pre>2007-09-26T00:59:05JapaneseHolidays-1.0.1
http://openjsan.org/doc/h/hn/hnakamur/JapaneseHolidays/1.0.1
<pre>NAME
JapanseHolidays - Japanese holidays calculation library
SYNOPSIS
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23));
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23));
DESCRIPTION
This is a library for testing if a date is a Japanese holiday
(precisely, "Shukujitsu" or "Furikae Kyuujitsu") or not. Also you can
get the holiday name written in Japanese.
FUNCTIONS
isHoliday
Tests a specified date is a Japanese holiday or not.
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 29)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30)); // is true because this date is a "furikae kyuujitsu".
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30), false); // is false with passing includesFurikaeKyujitsu to false.
getHolidayName
Returns the holiday name (written in Japanese) for a date if the date is
a holiday, or returns the empty string if the date is not a holiday.
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23)); // is 'ç§åã®æ¥' (<- a holiday name written in Japanese)
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 29)); // is 'æåã®æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30)); // is 'æ¯æ¿ä¼æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30), false); // is '' with passing includesFurikaeKyujitsu to false.
getHolidayAndNames
Returns an array of arrays of dates of holidays and names in a year or
in a month. The first element of the nested array is a date of a
holiday, and the second element is the name of that holiday.
holidays = JapaneseHolidays.getHolidayAndNames(2007, 5 - 1); // holidays in a month
for (i = 0; i < holidays.length; i++) {
date = holidays[i][0];
name = holidays[i][1];
}
// more examples
holidays = JapaneseHolidays.getHolidayAndNames(2007); // holidays in a year
holidays = JapaneseHolidays.getHolidayAndNames(2007, 9 - 1, false); // holidays excluding FurikaeKyuujitsu's.
EXAMPLES
// usage of isHoliday() to prevend computing repeatedly holidays in a month.
year = 2007;
month = 5 - 1;
holidays = JapaneseHolidays.getHolidayAndNames(year, month);
endDate = JapaneseHolidays.getEndDateInMonth(year, month);
for (var d = 1; d < endDate.getDate(); d++) {
dt = new Date(year, month, d);
isH = JapaneseHolidays.isHoliday(dt, undefined, holidays);
name = JapaneseHolidays.getHolidayName(dt, undefined, holidays);
}
CHANGES
ver. 1.0.1
Fixed a bug. Both isHoliday() and getHolidayName() didn't handle dates
having non-zero (that is, not 00:00:00) time part.
ver. 1.0
Initial release.
AUTHOR
Hioraki Nakamura <hnakamur@gmail.com>
COPYRIGHT
This program is licensed under MIT license.
Copyright (C) 2007 Hiroaki Nakamura <hnakamur@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</pre>2007-09-25T12:59:06JapaneseHolidays-1.0
http://openjsan.org/doc/h/hn/hnakamur/JapaneseHolidays/1.0
<pre> JapanseHolidays - Japanese holidays calculation library
SYNOPSIS
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23));
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23));
DESCRIPTION
This is a library for testing if a date is a Japanese holiday
(precisely, "Shukujitsu" or "Furikae Kyuujitsu") or not. Also you can
get the holiday name written in Japanese.
FUNCTIONS
isHoliday
Tests a specified date is a Japanese holiday or not.
isH = JapaneseHolidays.isHoliday(new Date(2007, 9 - 1, 23)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 29)); // is true
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30)); // is true because this date is a "furikae kyuujitsu".
isH = JapaneseHolidays.isHoliday(new Date(2007, 4 - 1, 30), false); // is false with passing includesFurikaeKyujitsu to false.
getHolidayName
Returns the holiday name (written in Japanese) for a date if the date is
a holiday, or returns the empty string if the date is not a holiday.
name = JapaneseHolidays.getHolidayName(new Date(2007, 9 - 1, 23)); // is 'ç§åã®æ¥' (<- a holiday name written in Japanese)
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 29)); // is 'æåã®æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30)); // is 'æ¯æ¿ä¼æ¥'
name = JapaneseHolidays.getHolidayName(new Date(2007, 4 - 1, 30), false); // is '' with passing includesFurikaeKyujitsu to false.
getHolidayAndNames
Returns an array of arrays of dates of holidays and names in a year or
in a month. The first element of the nested array is a date of a
holiday, and the second element is the name of that holiday.
holidays = JapaneseHolidays.getHolidayAndNames(2007, 5 - 1); // holidays in a month
for (i = 0; i < holidays.length; i++) {
date = holidays[i][0];
name = holidays[i][1];
}
// more examples
holidays = JapaneseHolidays.getHolidayAndNames(2007); // holidays in a year
holidays = JapaneseHolidays.getHolidayAndNames(2007, 9 - 1, false); // holidays excluding FurikaeKyuujitsu's.
EXAMPLES
// usage of isHoliday() to prevend computing repeatedly holidays in a month.
year = 2007;
month = 5 - 1;
holidays = JapaneseHolidays.getHolidayAndNames(year, month);
endDate = JapaneseHolidays.getEndDateInMonth(year, month);
for (var d = 1; d < endDate.getDate(); d++) {
dt = new Date(year, month, d);
isH = JapaneseHolidays.isHoliday(dt, undefined, holidays);
name = JapaneseHolidays.getHolidayName(dt, undefined, holidays);
}
AUTHOR
Hioraki Nakamura <hnakamur@gmail.com>
COPYRIGHT
This program is licensed under MIT license.
Copyright (C) 2007 Hiroaki Nakamura <hnakamur@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</pre>2007-09-24T06:59:05Data.Page-0.02
http://openjsan.org/doc/b/ba/bashi/Data/Page/0.02
<pre>=head1 NAME
Data.Page - Autogenerate useful information for pagination
=head1 SYNOPSIS
var p = new Data.Page(
120, // total entries
10, // entries per page
1 // current page
);
// get pagination info
p.total_entries() // 120
p.entries_per_page() // 10
p.current_page() // 1
p.entries_on_this_page() // 10
p.first_page() // 1
p.last_page() // 12
p.first() // 1
p.last() // 10
p.previous_page() // undefined
p.next_page() // 2
// get items that are included in this page
var items = [ 'item1' .. 'item99' ];
items = p.splice( items ); // [ 'item1' .. 'item10' ]
=head1 DESCRIPTION
By giving minimum parameters, this module auto-calculates all
the neccessary information needed to display pagination, which
we see (and program) alot in a search result page.
Especially useful for client-side AJAX applications.
=head2 Constructor
var page = new Data.Page(
99, // total entries
15, // entries displayed per page
2 // current page number
);
Or, you can set those parameter later:
var page = new Data.Page();
page.total_entries( 99 );
page.entries_per_page( 15 );
page.current_page( 2 );
=head2 Methods
=head3 total_entries()
page.total_entries( 130 ); // setter
page.total_entries(); // getter
Sets/gets the total number of entries in your result set. Ignored if passed a negative value.
=head3 entries_per_page()
page.entries_per_page( 10 ); // setter
page.entries_per_page(); // getter
Sets/gets the total number of entries displayed per page. Ignored if passed a negative value.
=head3 current_page()
page.current_page( 10 ); // setter
page.current_page(); // getter
Sets/gets the total number of entries displayed per page. Ignored if passed a negative value.
=head3 entries_on_this_page()
page.entries_on_this_page(); // 10
// might be different on last page
page.current_page( page.last_page() );
page.entries_on_this_page(); // 7
Gets the number of items displayed in current page. It's usually same as
page.entries_per_page(), but might differ on the last page.
=head3 last_page()
page.last_page(); // 5
Gets the last page number. It's also the "total page count".
=head3 first_page()
page.first_page(); // 1
Gets the first page number, which will always return 1. Counter-part for
page.last_page() method.
=head3 first()
page.first(); // 21
Gets the item number of the first item in current page.
=head3 last()
page.last(); // 30
Gets the item number of the last item in current page.
=head3 previous_page()
page.previous_page(); // 1
Gets the page number of the previous page. Returns "undefined" if called at first page.
=head3 next_page()
page.next_page(); // 2
Gets the page number of the next page. Returns "undefined" if called at last page.
=head3 splice()
var items = [ 'item1' .. 'item99' ];
items = p.splice( items ); // [ 'item1' .. 'item10' ]
By passing an array with items/records for all pages, it will return an array
containing only the items for the current page.
=head3 skipped()
var page = new Data.Page( 50, 10, 3 ); // we're at page 3
page.skipped(); // 20
Returns how many items are skipped as for the current page.
=head1 SEE ALSO
Perl CPAN - Data::Page module
L<http://search.cpan.org/dist/Data-Page/>
=head1 AUTHOR
Toshimasa Ishibashi <F<iandeth99@ybb.ne.jp>>
L<http://iandeth.dyndns.org/>
Original perl code by Leon Brocard - L<http://search.cpan.org/~lbrocard/>
Thank you Leon for a nice work.
=head1 COPYRIGHT
Copyright (c) 2007 Toshimasa Ishibashi. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic license. Or whatever license I choose,
which I will do instead of keeping this documentation like it is.
</pre>2007-09-15T06:59:06Data.Page-0.01
http://openjsan.org/doc/b/ba/bashi/Data/Page/0.01
<pre>=head1 NAME
Data.Page - Autogenerate useful information for pagination
=head1 SYNOPSIS
var p = new Data.Page(
120, // total entries
10, // entries per page
1 // current page
);
// get pagination info
p.total_entries() // 120
p.entries_per_page() // 10
p.current_page() // 1
p.entries_on_this_page() // 10
p.first_page() // 1
p.last_page() // 12
p.first() // 1
p.last() // 10
p.previous_page() // undefined
p.next_page() // 2
// get items that are included in this page
var items = [ 'item1' .. 'item99' ];
items = p.splice( items ); // [ 'item1' .. 'item10' ]
=head1 DESCRIPTION
By giving minimum parameters, this module auto-calculates all
the neccessary information needed to display pagination, which
we see (and program) alot in a search result page.
Especially useful for client-side AJAX applications.
=head2 Constructor
var page = new Data.Page(
99, // total entries
15, // entries displayed per page
2 // current page number
);
Or, you can set those parameter later:
var page = new Data.Page();
page.total_entries( 99 );
page.entries_per_page( 15 );
page.current_page( 2 );
=head2 Methods
=head3 total_entries()
page.total_entries( 130 ); // setter
page.total_entries(); // getter
Sets/gets the total number of entries in your result set. Ignored if passed a negative value.
=head3 entries_per_page()
page.entries_per_page( 10 ); // setter
page.entries_per_page(); // getter
Sets/gets the total number of entries displayed per page. Ignored if passed a negative value.
=head3 current_page()
page.current_page( 10 ); // setter
page.current_page(); // getter
Sets/gets the total number of entries displayed per page. Ignored if passed a negative value.
=head3 entries_on_this_page()
page.entries_on_this_page(); // 10
// might be different on last page
page.current_page( page.last_page() );
page.entries_on_this_page(); // 7
Gets the number of items displayed in current page. It's usually same as
page.entries_per_page(), but might differ on the last page.
=head3 last_page()
page.last_page(); // 5
Gets the last page number. It's also the "total page count".
=head3 first_page()
page.first_page(); // 1
Gets the first page number, which will always return 1. Counter-part for
page.last_page() method.
=head3 first()
page.first(); // 21
Gets the item number of the first item in current page.
=head3 last()
page.last(); // 30
Gets the item number of the last item in current page.
=head3 previous_page()
page.previous_page(); // 1
Gets the page number of the previous page. Returns "undefined" if called at first page.
=head3 next_page()
page.next_page(); // 2
Gets the page number of the next page. Returns "undefined" if called at last page.
=head3 splice()
var items = [ 'item1' .. 'item99' ];
items = p.splice( items ); // [ 'item1' .. 'item10' ]
By passing an array with items/records for all pages, it will return an array
containing only the items for the current page.
=head3 skipped()
var page = new Data.Page( 50, 10, 3 ); // we're at page 3
page.skipped(); // 20
Returns how many items are skipped as for the current page.
=head1 SEE ALSO
Perl CPAN - Data::Page module
L<http://search.cpan.org/dist/Data-Page/>
=head1 AUTHOR
Toshimasa Ishibashi <F<iandeth99@ybb.ne.jp>>
L<http://iandeth.dyndns.org/>
Original perl code by Leon Brocard - L<http://search.cpan.org/~lbrocard/>
Thank you Leon for a nice work.
=head1 COPYRIGHT
Copyright (c) 2007 Toshimasa Ishibashi. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic license. Or whatever license I choose,
which I will do instead of keeping this documentation like it is.
</pre>2007-09-14T12:59:05YAML-0.11
http://openjsan.org/doc/i/in/ingy/YAML/0.11
<pre>YAML Serialization for JavaScript Data</pre>2007-09-14T06:59:06YAML-0.10
http://openjsan.org/doc/i/in/ingy/YAML/0.10
<pre>YAML Serialization for JavaScript Data</pre>2007-09-13T15:51:05Data.FormValidator-0.06
http://openjsan.org/doc/u/un/unrtst/Data/FormValidator/0.06
<pre>NAME
Data.FormValidator - Validate HTML form input based on input profile.
SYNOPSIS
<FORM onSubmit="return myValidate(this);">
...
</FORM>
<SCRIPT LANGUAGE="javascript"><!--
var click_once = 0;
function myValidate (frmObj) {
var goodColor = "#FFFFFF";
var badColor = "#FFFF99";
var profile = new Object();
// define profile ...
// put any extras you'd like in here
if (click_once == 0) {
click_once = 1;
var passed = Data.FormValidator.check_and_report(frmObj, profile, goodColor, badColor);
if (passed) {
return true;
} else {
// reset click_once, so they can re-fillout the form
click_once = 0;
return false;
}
}
}
// --></SCRIPT>
ALTERNATIVELY: the following is a more detailed handling, and is
actually what happens in when the above convenience method,
"check_and_report()", is called.
<FORM onSubmit="return myValidate(this);">
...
</FORM>
<SCRIPT LANGUAGE="javascript"><!--
function myValidate (frmObj) {
var goodColor = "#FFFFFF";
var badColor = "#FFFF99";
var profile = new Object();
// define profile ...
var results = Data.FormValidator.check(frmObj, profile);
// clean up colors from form
results.cleanForm(frmObj, goodColor);
if (! results.success()) {
var error_text = "";
var msgs = results.msgs();
for (field in results.missing_required) {
results.changeStyle(frmObj, field, badColor);
error_text += "Field ["+field+"] is required.\n";
}
for (field in results.missing_dependency) {
for (i in results.missing_dependency[field]) {
var dep = results.missing_dependency[field][i];
results.changeStyle(frmObj, dep, badColor);
error_text += "Marking field ["+field+"] requires field ["+dep+"] also be filled in.\n";
}
}
for (group in results.missing_depgroup) {
var completed = results.missing_depgroup[group]['completed'];
var incomplete = results.missing_depgroup[group]['incomplete'];
for (i in incomplete) {
results.changeStyle(frmObj, incomplete[i], badColor);
}
error_text += "Marking field(s) ["+completed.join(', ')+"] requires field(s) ["+incomplete.join(', ')+"] also be filled in.\n";
}
for (field in results.invalid) {
results.changeStyle(frmObj, field, badColor);
error_text += (msgs[field]) ? "Field ["+field+"] : "+msgs[field] :
"Improperly formatted data in field ["+field+"].";
error_text += "\n";
}
alert("There is a problem with your form.\n\n"+error_text);
return false;
} else {
// do something with results.valid ?
return true;
}
};
// --></SCRIPT>
DESCRIPTION
Data.FormValidator's aim is to bring all the benefits of the perl module
Data::FormValidator over to javascript, using the same input profiles
(they can be dumped into javascript objects using the perl module
Data::JavaScript).
Data.FormValidator lets you define profiles which declare the required
and optional fields and any constraints they might have.
The results are provided as an object which makes it easy to handle
missing and invalid results, return error messages about which
constraints failed, or process the resulting valid data.
TODO
There are many features missing from this library, that are available in
the perl version. The big ones have been marked in the code with the
text "TODO". There are too many things missing to explain them all at
this time, but we've attempted to note below when feature are not
available, work differently, or only exist here.
VALIDATING INPUT
new Data.FormValidator()
Constructor. Currently takes NO options. (TODO: this should optionally
support taking in defaults).
Returns a Data.FormValidator object (referred to from here on out as
"dfv").
dfv.validate(formObject, profile);
***DEPRECATED***
"validate()" provides a deprecated alternative to "check()". It has the
same input syntax, but returns a four element array, containing the
following elements from the "Results" object (the return value of the
"check()" method).
results.valid()
results.missing()
results.validate_invalid()
results.unknown()
See Data::FormValidator, and the following documentation on
"Data.FormValidator.Results" for more info.
dfv.check()
var results = Data.FormValidator.check(formObject, dfv_profile);
"check" is the recommended method to use to validate forms. It returns
it's results as a Data.FormValidator.Results object. A deprecated method
"validate" is also available, returning it's results as an array
described above.
var results = Data.FormValidator.check(formObject, dfv_profile);
Here, "check()" is used as a class method***, and takes two required
parameters. It can also be called as an instance method:
var dfv = new Data.FormValidator();
var results = dfv.check(formObject, dfv_profile);
The first argument is a javascript DOM object pointing to the form to be
validated.
The second argument is a reference to the profile you are validating.
The resulting "results" object can be used to call has_missing(),
has_invalid(), and their ilk.
*** NOTE: "class method" is what it's called on the perl side. Here,
it's an object constructor, which just happens to take care of some
stuff in the Data.FormValidator namespace behind the scenes for you.
Data.FormValidator.check_and_report(formObject, dfv_profile [, goodColor, badColor] )
var success = Data.FormValidator.check_and_report(formObject, dfv_profile);
This is a convenience method. It takes care of calling "check()",
processing the results, building a helpful error message if it erred
out, and reporting the errors to the user (via javascript alert() box).
If "check()" succeeds, it returns "true"; returns "false" on failure.
This is the recommended way to use this library. If you require more
advanced usage, this method can be used as a good starting point to base
your processing upon.
Options:
formObject:
javascript DOM object pointing to the form to be validated.
dfv_profile:
Reference to the profile you are validating.
goodColor (optional):
Hex value of a color to set the form field backgrounds to if the
field is valid.
badColor (optional):
Hex value of a color to set the form field backgrounds to if the
field is invalid.
dfv.load_profiles() (TODO)
dfv._mergeProfiles() (TODO)
dfv._check_profile_syntax() (TODO)
INPUT PROFILE SPECIFICATION
Please see the pod documentation for the perl module
Data::FormValidator.
NOTE: Constraint support is currently limited. This library currently
supports:
* Regular Expression Constraints
Only as quoted strings (eg "/regexp/", not qr/regexp/).
* Built in Constraints
Those offered by Data::FormValidator (see
Data.FormValidator.Constraints below), but NOT the extra
RegExp::Common ones (thought those are on the TODO list now).
The profile spec for this library, is the result of running a perl
"Data::FormValidator" profile through the module Data::JavaScript. You
may construct it by hand, but the specifics of such are outside the
scope of this document. Please read on for some more info.
Data::JavaScript dumps perl data structures out to a javascript
object/array structure.
Here is a very simple input profile in perl:
my $profile = {
optional => [qw( company fax country )],
required => [qw( fullname age phone email address )],
constraints => {
email => { name => "valid_email",
constraint => "/^(([a-z0-9_\\.\\+\\-\\=\\?\\^\\#]){1,64}\\@(([a-z0-9\\-]){1,251}\\.){1,252}[a-z0-9]{2,4})$/i" },
age => { name => "valid_age",
constraint => "/^1?\d?\d$/" },
},
msgs => {
constraints => {
valid_email => "Invalid e-mail address format",
valid_age => "Age entered must be between 0 and 199",
}
},
};
Here is the same profile output by "Data::JavaScript::jsdump()":
var profile = new Object;
profile.constraints = new Object;
profile.constraints.email = new Object;
profile.constraints.email.name = 'valid_email';
profile.constraints.email.constraint = '\/\^\(\(\[a\-z0\-9_\\\.\\\+\\\-\\\=\\\?\\\^\\\#\]\)\{1\,64\}\\\@\(\(\[a\-z0\-9\\\-\]\)\{1\,251\}\\\.\)\{1\,252\}\[a\-z0\-9\]\{2\,4\}\)\012i';
profile.constraints.age = new Object;
profile.constraints.age.name = 'valid_email';
profile.constraints.age.constraint = '\/\^1\?\\d\?\\d\012';
profile.required = new Array;
profile.required[0] = 'fullname';
profile.required[1] = 'phone';
profile.required[2] = 'email';
profile.required[3] = 'address';
profile.optional = new Array;
profile.optional[0] = 'company';
profile.optional[1] = 'fax';
profile.optional[2] = 'country';
profile.msgs = new Object;
profile.msgs.constraints = new Object;
profile.msgs.constraints.valid_email = 'Invalid e\-mail address format';
profile.msgs.constraints.valid_age = 'Age entered must be between 0 and 199';
Your profile may contain anything that the perl module
Data::FormValidator contains, but only a subset of it will be supported
by this library. The following keys are supported.
required
Array of required fields (required means they must not be blank, nor
consist only of spaces). Valid fields listed here will be returned
in the results.valid object.
optional
Array of optional fields (if filled in, constraints placed on these
fields will also be checked). Valid fields listed here will be
returned in the results.valid object, as well as blank ones.
dependencies
dependencies => {
# If cc_no is entered, make cc_type and cc_exp required
"cc_no" => [ qw( cc_type cc_exp ) ],
},
This is for the case where an optional field has other requirements.
The dependent fields can be specified with an array.
dependency_groups
dependency_groups => {
# if either field is filled in, they all become required
password_group => [qw/password password_confirmation/],
}
The key is an arbitrary name you create. The values are arrays of
field names in each group. If any field in the group is filled in,
all fields in the group must be filled in.
constraints
constraints => {
fieldName1 => '/regexp/i',
fieldName2 => { name => 'all_numbers', constraint => '/^\\d+$/' },
fieldName3 => [ { name => 'no_spaces', constraint => '/^\\S*$/' },
{ name => 'word_chars', constraint => '/^\\w+$/' } ],
fieldName4 => 'valid_email',
}
The second and third form above are recommended, as they allow you
to tie the constraint to a custom error message (through the msgs
hash).
We support a very narrow range of constraints options (we do not
support constraint_methods as of yet, nor named closures ( "field =>
email()" ), nor subroutine references, nor compiled
regexps(qr/regexp/) ). The ones listed above will all work, namely,
quoted regexp and quoted named constraints.
msgs
This key is used to define parameters related to formatting error
messages returned to the user.
Please see Data::FormValidator for more detailed information.
The important thing to note is that
A) the constraint must be named. Eg:
profile => {
constraints => {
fieldName => { name => 'someName', constraint => '/\\d+/' },
},
};
B) the msgs hash references the "name =>", not the field name. Eg:
profile => {
msgs => {
constraints => {
someName => "Error message goes here",
},
},
};
The rest is important too, but easy to grasp from the
Data::FormValidator documentation.
NAME
Data.FormValidator.Results - results of form input validation.
SYNOPSIS
var results = Data.FormValidator.check(formObject, dfv_profile);
var msgs = results.msgs();
// Print the name of missing fields
if ( results.has_missing() ) {
for (f in results.missing) {
alert(f + " is missing\n");
}
}
// Print the name of invalid fields
if ( results.has_invalid() ) {
for (f in results.invalid) {
alert(f + " is invalid: " + msgs[f] + "\n");
}
}
// Print unknown fields
if ( results.has_unknown() ) {
for (f in results.unknown) {
alert(f + " is unknown\n");
}
}
// Print valid fields
for (f in results.valid) {
alert(f + " = " + results.valid[f] + "\n");
}
DESCRIPTION
This object is returned by the Data.FormValidator "check" method. It can
be queried for information about the validation results.
RESULTS METHODS
results.success()
This method returns true if there were no invalid or missing fields,
else it returns false.
results.has_missing()
Returns a count of missing fields (zero for none).
results.has_invalid()
Returns a count of invalid fields (zero for none).
results.has_unknown()
Returns a count of unknown fields (zero for none).
results.has_missing_required()
Returns a count of required fields that were missing (zero for none).
results.has_missing_dependency()
Returns a count of dependency fields that were missing (zero for none).
results.has_missing_depgroup()
Returns a count of dependency group fields that were missing (zero for
none).
DATA ACCESSOR STRUCTURES
results.valid
Object data structure.
Access Single element:
results.valid.element
results.valid['element']
Iterate over all valid items:
for (field in results.valid) {
// do something with "field"
}
results.invalid
Object data structure.
Access Single element:
results.invalid.element
results.invalid['element']
Iterate over all valid items:
for (field in results.valid) {
for (i in results.valid[field]) {
var testName = results.valid[field][i];
}
// do something with "field"
}
results.validate_invalid
Array data structure.
Array of Arrays.
First element of each row is the "fieldName". The remainder of the
elements are the test names that failed. Eg.
for (i in results.validate_invalid) {
var fieldName = results.validate_invalid[i];
var failedTests = new Array();
for (var j=1; j<results.validate_invalid.length; j++) {
failedTests[failedTests.length] = results.validate_invalid[j];
}
}
results.missing
Object data structure. Contains all missing fields (those listed in
"required" but not filled in, those listed as a dependency to an
optional field that was filled in, those blank from a dependency group
that had one or more members filled in). There are more specific
missing_* objects you can use to get at each category of missing
individually (NOTE: the more specific ones are NOT available in the perl
version of Data::FormValidator).
Access Single element:
results.missing.element
results.missing['element']
Iterate over all items:
for (field in results.missing) {
// do something with "field"
}
results.missing_required
Object data structure. (NOTE: this property is not available in the perl
version of Data::FormValidator)
Access Single element:
results.missing_required.element
results.missing_required['element']
Iterate over all items:
for (field in results.missing_required) {
// do something with "field"
}
results.missing_dependency
Object data structure. (NOTE: this property is not available in the perl
version of Data::FormValidator)
This data structure is a bit more complex. The first level contains the
"fieldName" which triggered the dependency. As its value, is an array of
dependencies that were not completed. Eg.
for (fieldName in this.missing_dependency) {
// fieldName triggered this dependency
alert("field["+fieldName+"] required the following fields also be completed: "+ this.missing_dependency[fieldName].join(", ") );
}
results.missing_depgroup
Object data structure. (NOTE: this property is not available in the perl
version of Data::FormValidator)
This data structure is a bit more complex. The first level contains the
"dependency group name" that failed the test. It is an object which has
two properties: "completed" and "incomplete". Each of those properties
holds and array of completed and incomplete fields respectively.
Ex.
for (group in results.missing_depgroup) {
var completed = results.missing_depgroup[group]['completed'];
var incomplete = results.missing_depgroup[group]['incomplete'];
for (i in incomplete) {
results.changeStyle(frmObj, incomplete[i], badColor);
}
error_text += "Marking field(s) ["+completed.join(', ')+"] requires field(s) ["+incomplete.join(', ')+"] also be filled in.\n";
}
results.unknown
Object data structure. List of all fields found in the form that are not
listed as required nor optional in the dfv_profile.
Access Single element:
results.unknown.element
results.unknown['element']
Iterate over all items:
for (field in results.unknown) {
// do something with "field"
}
NAME
Data.FormValidator.Constraints - Basic sets of constraints on input
profile.
SYNOPSIS
var constraints = new Data.FormValidator.Constraints();
if (constraints.supported('email')) {
var match;
if (match = constraints.email(value)) {
// match has untainted data that is valid
} else {
// failed test
}
} else {
// constraint is not supported
}
DESCRIPTION
The following built in constraints are provided:
supported
Given a constraint name, returns true if we currently support that,
and false otherwise. This is handy, because code calling built in
constraints does not have to change as we add new ones, as it will
have a bit of introspection to this object.
NOTE: UGLY HACK: I do not know of any methods like "can" for
JavaScript, but that is all that this is really trying to do.
email
Checks if the email LOOKS LIKE an email address. This should be
sufficient 99% of the time.
Look elsewhere if you want something super fancy that matches every
possible variation that is valid in the RFC, or runs out and checks
some MX records.
state_or_province
This one checks if the input correspond to an american state or a
canadian province.
state
This one checks if the input is a valid two letter abbreviation of
an american state.
province
This checks if the input is a two letter canadian province
abbreviation.
zip_or_postcode
This constraints checks if the input is an american zipcode or a
canadian postal code.
postcode
This constraints checks if the input is a valid Canadian postal
code.
zip This input validator checks if the input is a valid american zipcode
: 5 digits followed by an optional mailbox number.
phone
This one checks if the input looks like a phone number, (if it
contains at least 6 digits.)
american_phone
This constraints checks if the number is a possible North American
style of phone number : (XXX) XXX-XXXX. It has to contains 7 or more
digits.
cc_number
TODO: this is currently implemented, but does not work, because
constraint_methods in the profile are not supported. So, because
this method relies on knowing the value of two fields, it will not
work yet.
This constraint references the value of a credit card type field.
constraint_methods => {
cc_no => cc_number({fields => ['cc_type']}),
}
The number is checked only for plausibility, it checks if the number
could be valid for a type of card by checking the checksum and
looking at the number of digits and the number of digits of the
number.
This functions is only good at catching typos. IT DOESN'T CHECK IF
THERE IS AN ACCOUNT ASSOCIATED WITH THE NUMBER.
cc_exp
This one checks if the input is in the format MM/YY or MM/YYYY and
if the MM part is a valid month (1-12) and if that date is not in
the past.
cc_type
This one checks if the input field starts by M(asterCard), V(isa),
A(merican express) or D(iscovery).
ip_address
This checks if the input is formatted like an IP address (v4)
REGEXP::COMMON SUPPORT
(TODO) this is not yet supported. It will require a port of
RegExp::Common over to JavaScript, whish should actually be fairly
trivial.
UTILITY METHODS
results.msgs()
This method returns an object data structure of error messages. The
exact format is determined by parameters in the "msgs" area of the
validation profile, described in the Data::FormValidator documentation.
This method does NOT yet support the optional "controls" parameter.
The data structure returned can be accesses like so:
var msgs = results.msgs();
for (field in results.invalid) {
error_text += msgs[field] + "\n";
}
NOTE: the messages for missing data sets are very bland. You'd be better
off producing your own on the fly in those cases. But, this is quite
helpful with invalid data :-)
results.changeStyle(formObject, fieldName, rgbColor)
This will change the background color of all form elements by the given
name in the given form, to the given color (defaults to #FFFF99).
This is an especially handy method, as you don't have to worry about how
many times the form field "password" shows up on the page, nor even what
type of field it is (ex. changing the background of a select list is
different from a text field), and you can even have mixed types of
fields with the same name.
TODO: create similar method to change the CSS class of the element.
NOTE / TODO: This method doesn't really belong in this namespace, but it
provides a substantial benefit, and the supporting code library is
already here, so it's likely to stick around for a while.
results.cleanForm(formObject, rgbColor)
Changes the background color of every element in the given form to the
given color (defaults to #FFFFFF).
Useful to call prior to processing all the invalid fields.
TODO: create similar method to change the CSS class of the element.
NOTE / TODO: This method doesn't really belong in this namespace, but it
provides a substantial benefit, and the supporting code library is
already here, so it's likely to stick around for a while.
INTERNAL METHODS
The following methods are only noted here so you know of their
existence. They are used internally to the Data.FormValidator.Results
object. If you find them useful for other purposes, feel free to yank
them out and do as you wish (within the bound of the license agreement
of course).
getElementListByName(frmObj, elementName)
Takes the form object, and a form element name Returns an array of
elements, or false if it doesn't exist.
isArray(thisObject)
verify that something is an array
isValidObject(thisObject)
verify that an object exists and is valid
hasSelected(selectObj)
return array of selected item values, or false if nothing was
selected
NOTE: this method has some work around for the broken IE 5, 5.5, and
6. The work arounds currently make all platforms behave less than
perfect, as they currently do not include any browser detection.
TODO: add browser detection.
hasChecked(checkboxObj)
Dispatch off to hasRadioOrCheckbox
hasRadio(radioObj)
Dispatch off to hasRadioOrCheckbox
hasRadioOrCheckbox(thisObj)
return array of selected item values, or false if nothing was
selected
hasMCEText(mceObj)
return array of text values, with empty elements if the field(s) are
blank
hasText(textObj)
return array of text values, with empty elements if the field(s) are
blank
blankText(textObj)
step through a string, and see if it's nothing but blank
fieldType(Obj)
method to determine type of form field. We use this, cause we
support meta types like tinymce.
NOTE: MUST pass in a single form element, not some jacked up
frmObj['field'] thing.
emptyField(frmObj, fieldName)
dispatching function - sends check to appropriate typed check
returns true if the field is empty
getField(frmObj, fieldName)
dispatching function - snags the data for the requested field (all
instances of such named field). NOTE: this always returns an array
DEMO
A live demo is available at the developer site:
<http://formvalidatorjs.berlios.de/>
BUGS
<http://developer.berlios.de/bugs/?group_id=4847>
CONTRIBUTING
This project is hosted by berlios.de (a sourceforge-ish place). Patches,
questions and feedback are welcome.
<http://developer.berlios.de>
SEE ALSO
JSAN listing
<http://www.openjsan.org/doc/u/un/unrtst/Data/FormValidator/>
Data::FormValidator, Data::FormValidator::Results,
Data::FormValidator::Constraints,
Data::FormValidator::ConstraintsFactory, Data::FormValidator::Filters
AUTHOR
Joshua I. Miller <jmiller@purifieddata.net>
COPYRIGHT
Copyright (c) 2005 by CallTech Communications, LLC.
Portions Copyright (c) 1999,2000 iNsu Innovations Inc.
This program is free software; you can redistribute it and/or modify it
under the terms as perl itself.
</pre>2007-09-04T18:59:05Form.Element.Resize-0.05
http://openjsan.org/doc/e/ed/edoardo/Form/Element/Resize/0.05
<pre>NAME
Form.Element.Resize - Unobtrusive javascript class for make a standard
form field resizable with the mouse
SYNOPSIS
<!-- XHTML page -->
<form action="http://host.domain.tld/cgi-bin/script">
<label for="message">Message:</label><br />
<textarea id="message" name="message"></textarea>
</form>
// javascript code
new Form.Element.Resize({ elementId: 'message' });
DESCRIPTION
This nice class implement some methods for add a mouse-driven resize
feature on form fields such as text inputs, textareas and select
controls. Clicking and dragging the borders or the corners of the form
element will resize it while double clicking inside the element will
restore its original dimensions (this does not work with select
elements in Internet Explorer and Firefox). It is also possible to
specify the minimum and maximum width and height allowed when the
element is resized.
Tested under Firefox 2, Internet Explorer 6/7, Opera 9.
METHODS
new()
Class constructor, returns a new Form.Element.Resize object.
Parameters
oProps
Object literal where must be specified the element id on which
activate the resize feature and other optional properties that
overwrites the defaults.
Properties are:
elementId
ID of the element on which enable the resize feature. mandatory!
resizeType
Type of resize, shortcuts are auto, horizontal and vertical
(default is auto).
- auto: resizable borders and corners are set automatically
depending on the form element type. text input and non-multiple
select have only the right border draggable; textarea and multple
select have the right and bottom borders and the bottom-right
corner draggable.
- horizontal: all field types have only the right border draggable.
- vertical: all field types have only the bottom border draggable.
It is also possible to specify each border/corner to activate by
passing an object literal with one or more of the following keys:
n, ne, e, se, s, sw, w, nw
All are initially disabled, so for example, to activate only the
bottom-right corner the property must be initialized like this:
new Form.Element.Resize({ elementId: 'message', resizeType: { se: 1 } });
minWidth
Minimum width allowed for the element. When this value is reached
the horizontal resize stops. By default this property is set to 1.
new Form.Element.Resize({ elementId: 'message', minWidth: 100 });
minHeight
Minimum height allowed for the element. When this value is reached
the vertical resize stops. By default this property is set to 1.
new Form.Element.Resize({ elementId: 'message', minHeight: 50 });
maxWidth
Maximum width allowed for the element. When this value is reached
the horizontal resize stops. By default this property is not set,
so there is not limit to the resize.
new Form.Element.Resize({ elementId: 'message', maxWidth: 400 });
maxHeight
Maximum height allowed for the element. When this value is reached
the vertical resize stops. By default this property is not set, so
there is not limit to the resize.
new Form.Element.Resize({ elementId: 'message', maxHeight: 350 });
containerId
ID of the generated container element, useful for add some CSS
rules on it.
containerClass
Class of the generated container element, useful for add some CSS
rules on it.
EXAMPLES
<!-- you can initialize the class within your XHTML page like this -->
<form action="http://host.domain.tld/cgi-bin/script">
<label for="message">Message:</label><br />
<textarea id="message" name="message"></textarea>
<script type="text/javascript">new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' });</script>
</form>
// or in a more unobtrusive way put the new in an included javascript file.
// be sure to call the new when the page is loaded!
// a cross-browser way may be this
if( document.addEventListener )
{
document.addEventListener(
'load',
function() { new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' }); },
false
);
return true;
}
else if( document.attachEvent )
{
return document.attachEvent(
'onload',
function() { new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' }); }
);
}
SEE ALSO
Official web page at
http://www.sabadelli.it/edoardo/projects/javascript/form.element.resize
JSAN http://openjsan.org/
AUTHOR
Edoardo Sabadelli - http://www.sabadelli.it/edoardo
COPYRIGHT
Copyright (c) 2007 Edoardo Sabadelli. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic license.
</pre>2007-08-14T18:59:05Form.Element.Resize-0.04
http://openjsan.org/doc/e/ed/edoardo/Form/Element/Resize/0.04
<pre>NAME
Form.Element.Resize - Unobtrusive javascript class for make a standard
form field resizable with the mouse
SYNOPSIS
<!-- XHTML page -->
<form action="http://host.domain.tld/cgi-bin/script">
<label for="message">Message:</label><br />
<textarea id="message" name="message"></textarea>
</form>
// javascript code
new Form.Element.Resize({ elementId: 'message' });
DESCRIPTION
This nice class implement some methods for add a mouse-driven resize
feature on form fields such as text inputs, textareas and select
controls. Clicking and dragging the borders or the corners of the form
element will resize it while double clicking inside the element will
restore its original dimensions (this does not work with select
elements in Internet Explorer and Firefox). It is also possible to
specify the maximum width and height allowed when the element is
resized.
Tested under Firefox 2, Internet Explorer 6/7, Opera 9.
METHODS
new()
Class constructor, returns a new Form.Element.Resize object.
Parameters
oProps
Object literal where must be specified the element id on which
activate the resize feature and other optional properties that
overwrites the defaults.
Properties are:
elementId
ID of the element on which enable the resize feature. mandatory!
resizeType
Type of resize, shortcuts are auto, horizontal and vertical
(default is auto).
- auto: resizable borders and corners are set automatically
depending on the form element type. text input and non-multiple
select have only the right border draggable; textarea and multple
select have the right and bottom borders and the bottom-right
corner draggable.
- horizontal: all field types have only the right border draggable.
- vertical: all field types have only the bottom border draggable.
It is also possible to specify each border/corner to activate by
passing an object literal with one or more of the following keys:
n, ne, e, se, s, sw, w, nw
All are initially disabled, so for example, to activate only the
bottom-right corner the property must be initialized like this:
new Form.Element.Resize({ elementId: 'message', resizeType: { se: 1 } });
maxWidth
Maximum width allowed for the element. When this value is reached
the horizontal resize stops. By default this property is not set,
so there is not limit to the resize.
new Form.Element.Resize({ elementId: 'message', maxWidth: 400 });
maxHeight
Maximum height allowed for the element. When this value is reached
the vertical resize stops. By default this property is not set, so
there is not limit to the resize.
new Form.Element.Resize({ elementId: 'message', maxHeight: 350 });
containerId
ID of the generated container element, useful for add some CSS
rules on it.
containerClass
Class of the generated container element, useful for add some CSS
rules on it.
EXAMPLES
<!-- you can initialize the class within your XHTML page like this -->
<form action="http://host.domain.tld/cgi-bin/script">
<label for="message">Message:</label><br />
<textarea id="message" name="message"></textarea>
<script type="text/javascript">new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' });</script>
</form>
// or in a more unobtrusive way put the new in an included javascript file.
// be sure to call the new when the page is loaded!
// a cross-browser way may be this
if( document.addEventListener )
{
document.addEventListener(
'load',
function() { new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' }); },
false
);
return true;
}
else if( document.attachEvent )
{
return document.attachEvent(
'onload',
function() { new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' }); }
);
}
SEE ALSO
Official web page at
http://www.sabadelli.it/edoardo/projects/javascript/form.element.resize
JSAN http://openjsan.org/
AUTHOR
Edoardo Sabadelli - http://www.sabadelli.it/edoardo
COPYRIGHT
Copyright (c) 2007 Edoardo Sabadelli. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic license.
</pre>2007-08-14T00:59:05-Customize_Dropdown_M
http://openjsan.org/doc/t/te/temp304//Customize_Dropdown_M
<pre></pre>2007-08-07T18:59:05Widget.Lightbox-0.10
http://openjsan.org/doc/g/gu/gugod/Widget/Lightbox/0.10
<pre>Widget.Lightbox
Widget.Lightbox is an objective re-implementation of Lightbox JS
(http://www.huddletogether.com/projects/lightbox/). It has several
nice features:
* Requires no extra image files
* Requires no extra CSS files and rules
* Optionally supports script.aculo.us effects library.
* Optionally supports JSAN effects library.
* Works on IE, Firefox, and Safari.
It's loaddable by JSAN, but not necessary. You can install this
library following standard JSAN distribution installation.
Cheers,
Kang-min Liu
</pre>2007-07-31T12:59:04Widget.SortableTable-0.22
http://openjsan.org/doc/a/au/autarch/Widget/SortableTable/0.22
<pre>NAME
Widget.SortableTable - A widget to make a table sortable
SYNOPSIS
DESCRIPTION
Instruments a table so that each of its headers is a clickable link that
resorts the table based on that column.
METHODS
* new Widget.SortableTable( { tableId: "table-id", ... } )
Returns a new "Widget.SortableTable" object for the specified
element.
This method expects an anonymous object as its only parameter. The
only required property for this object is "tableId".
The columns of the table are numbered starting at 0, from left to
right
The object passed to the constructor can have several additional
properties:
* initialSortColumn
If "initialSortColumn" is specified, it tells the widget
what column it should sort the table on when the widget is
created.
By default it does the initial sort of the table on column
0.
* noInitialSort
If this is true, then no initial sort of table is done when
the widget is constructed.
The appropriate even/odd CSS class names will still be added
to each row, but no cells will have their CSS class set to
"w-st-current-sorted-column". See "HOW THE WIDGET ALTERS THE
TABLE" for details about what this means.
* secondarySortColumn
The "secondarySortColumn" parameter specifies which column
the widget should use for secondary sorting. This is
necessary when it tries to sort on a column where some cells
contain identical values. In this case, it will fall back to
sorting those particular rows on the data in the
"secondarySortColumn". You should use a column which
contains unique data in each cell. This defaults to column
0.
Note that when we fall back to to the secondary column we
*always* sort the secondary column in its default direction.
* columnSpecs
The "columnSpecs" property is an array containing
information about each column in the table.
The spec for a single column is an anonymous object which
can contain three properties, "skip", "sort", and
"defaultDir". If "skip" is true, then this column will not
be sortable. The "sort" property may be a custom sort
function for that column, or a type name. See "TYPES AND
SORTING" for more details on what type names are allowed.
Finally, the "defaultDir" property may be either "asc" or
"desc". This specifies which direction the column will be
sorted on by default.
If you want do not want to give a spec for a column you can
use "null" to fill its place in the array.
An example:
var table = new Widget.SortableTable( {
"tableId": "my-table",
"initialSortColumn": 1,
"columnSpecs": [
null, no spec for column 0
{ skip: true }, do not sort column 1
{ sort: "text" }, sort column 2 as text
{ defaultDir: "desc" }, sort column 3 in descending order by default
{ sort: mySortFunc, sort column 4 with a custom function and ...
defaultDir: "desc" }, ... sort in descending order by default
]
} );
* onSortRowCallback
If this option is given, this callback will be called when
the rows are resorted. It will be passed the row and its new
row number (starting at 1) in the table.
This is primarily provided to allow for row numbering:
function renumberRow ( row, idx ) {
row.cells[0].innerHTML = "row number " + idx;
}
Since this class uses "DOM.Ready" to get the table, you can create a
widget object whenever you want during the course of page rendering.
* sortOnColumn(number)
Tells the widget to sort the table on the specified column. If the
widget is not ready (the table is not in the DOM yet), then this
method will simply return.
Tables with One Row
You can create a widget for a table with one row, but sorting will be a
no-op. Creating the widget will still alter the table, but since no
initial sort will be done, its CSS will not be altered.
TYPES AND SORTING
By default, "Widget.SortTable" tries to figure out the type of a column
based on its text contents. It currently recognizes four types of data,
numeric (integer or floating point), currency (a number preceded by "$"
or the Euro symbol), dates in YYYY-MM-DD format, and text.
Text is sorted case-insensitively. Dates are sorted in descending order
by default.
It detects the type by looking at the second cell in the column every
time you sort, so in theory the type it detects could change from sort
to sort. If this is blank for a column, it will assume that the type is
text. If you have blank cells in a column and the data is not text, you
should always specify its type when constructing the "Widget.SortTable"
object.
Empty cells are sorted as being less than non-empty cells for all types.
HOW THE WIDGET ALTERS THE TABLE
When the widget object is first instantiated, it makes a number of
changes to the DOM for the table. It assumes that the first row contains
column headers. For each cell, it takes the contents of the cell,
whatever they may be, and wraps them in a new "<a>" tag. The href for
this tag is "#". The tag has an "onClick" event set which calls
"sortOnColumn()" with the appropriate column number. This tag's class
name is "w-st-resort-column". The "onClick" handler will stop the event
from propogating further.
Note that the addition of this "<a>" tag may have break existing CSS
rules you are using.
The widget will call "sortOnColumn()" as soon as it can in order to
establish an initial sort order for the table, unless you set the
"noInitialSort" constructor parameter to true. If no initial sorting is
done, then there is no current sort-by column, but all the other CSS
changes are still applied.
When the table is sorted, the widget will make a number of changes to
the class names for table elements. The changes are as follows:
* Current sort-by column
All cells in this column will have the "w-st-current-sorted-column"
class added. In addition, the header cell, at the top of the column,
will also have the class "w-st-asc-column-header" or
"w-st-desc-column-header", depending on the current sort order.
* Other column header cells
All other header cells will be given the
"w-st-unsorted-column-header" class.
* Sort-by column changes
When the column upon which the widget is sorting changes, it removes
the "w-st-current-sorted-column" class from the previous sort-by
column. It also removes the "w-st-asc-column-header" or
"w-st-desc-column-header" class from that column's header cell.
* All rows besides the header row
These rows ("<tr>" tags) will be given a class of either
"w-st-odd-row" or "w-st-even-row". The first row below the headers
will be even.
Any class names you originally assigned in your HTML will be left
untouched by the widget.
Current Sort Indicators
This widget does not add any DOM elements to show which column is the
current sort-by column. Instead, you can take advantage of the CSS class
names it uses to get the same effect.
For example, let's start with this HTML for a column header cell:
<th>Name
<img class="none" src="none.png" />
<img class="asc" src="asc.png" />
<img class="desc" src="desc.png" />
</th>
Then in your CSS you can define the following style rules:
img.asc, img.desc {
display: none;
}
th.w-st-current-sorted-column img.none {
display: none;
}
th.w-st-asc-column-header img.asc {
display: inline;
}
th.w-st-desc-column-header img.desc {
display: inline;
}
With these rules, the appropriate image will be displayed simply based
on the class name changes that the widget makes.
AUTHOR
Dave Rolsky, <autarch@urth.org>.
COPYRIGHT
Copyright (c) 2006-2007 Dave Rolsky. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the same terms as the Perl programming language (your choice of
GPL or the Perl Artistic license).
</pre>2007-07-31T00:59:05Function.intervalize-0.01
http://openjsan.org/doc/g/gu/gugod/Function/intervalize/0.01
<pre>Turn a function into interval version.</pre>2007-07-30T18:59:05doctestjs-0.9
http://openjsan.org/doc/i/ia/ianb/doctestjs/0.9
<pre></pre>2007-07-29T18:59:06-templateengine.js
http://openjsan.org/doc/w/we/wezzy//templateengine.js
<pre></pre>2007-05-08T12:59:04Widget.Tooltip-0.02
http://openjsan.org/doc/e/ed/edoardo/Widget/Tooltip/0.02
<pre>NAME
Widget.Tooltip - Unobtrusive javascript class for create and handle
tooltips
SYNOPSIS
<!-- XHTML page -->
<p id="text1">some text...</p>
// javascript code
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text' });
DESCRIPTION
This nice class implements some methods for adding tooltips on document
elements. The tooltip can contain plain text or some XHTML markup. When
the user moves the mouse over the reference element, the tooltip is
shown. By setting some configurable options is possible to control the
tooltip behaviour, by default the tooltip follows the mouse when is
moved, stops and freezes on a left button click, another click will
unlock the tooltip.
Tested under Firefox 2, Internet Explorer 6/7, Opera 9.
METHODS
new()
Class constructor. If the DOM element specified in the elementId
property exists, returns a new Widget.Tooltip object, otherwise returns
the undefined value.
Parameters
oProps
Object literal where must be specified the element id on which add
the tooltip, the tooltip content and other optional properties that
overwrites the defaults.
Properties are:
elementId
ID of the element on which add a tooltip. mandatory!
enableLock
Defines if the tooltip must freeze on the current mouse position by
clicking the reference element (default is 1=enabled, set to 0 to
disable).
enableMove
Defines if the tooltip must follow the mouse pointer when is moved
(default is 1=enabled, set to 0 to disable).
fadeOut
Time expressed in milliseconds after which the tooltip will be
hidden (default 0=disabled).
offsetX
Horizontal distance in pixels from the mouse pointer of the tooltip
top-left corner (default is 16).
offsetY
Vertical distance in pixels from the mouse pointer of the tooltip
top-left corner (default is 16).
tooltipClass
CSS class to assign to the tooltip div element (default is
`tooltip'), useful for adding some make-up to the tooltip.
tooltipContent
Content of the tooltip. Usually some text you want to show. You can
pass also an XHTML string. If nothing is provided, the default text
`Empty tooltip!' is used.
hide()
Hides the tooltip.
move()
Moves the tooltip following the mouse pointer (depending on the
enableMove flag setting).
show()
Shows the tooltip.
toggleLock()
Freezes/unfreezes the tooltip by switching the internal lock flag
(depending on the enableLock flag setting).
EXAMPLES
<!-- you can initialize the class within your XHTML page like this -->
<p id="text1">some text...</p>
<p>an image<br />
<img src="ghost.png" /></p>
<p>you can also have a <a id="anchor1" href="somewhere_else">link</a> within the text on which you want to add a tooltip.</p>
<script type="text/javascript">
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text (fades out in 5 seconds)', fadeout: 5000 });
new Widget.Tooltip({ elementId: 'img1', tooltipContent: 'where is the image?!<br />click <a href="#" onclick="showImage(\'img1\')">here</a>...' });
new Widget.Tooltip({ elementId: 'anchor1', tooltipContent: 'a link must be clickable, so you should set enableLock to 0 on this tooltip!', enableLock: 0 });
</script>
// or in a more unobtrusive way put the new in an included javascript file.
// be sure to call the new when the page is loaded!
// a cross-browser way may be this
if( document.addEventListener )
{
document.addEventListener(
'load',
function() {
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text (fades out in 5 seconds)', fadeout: 5000 });
new Widget.Tooltip({ elementId: 'img1', tooltipContent: 'where is the image?!<br />click <a href="#" onclick="showImage(\'img1\')">here</a>...' });
new Widget.Tooltip({ elementId: 'anchor1', tooltipContent: 'a link must be clickable, so you should set enableLock to 0 on this tooltip!', enableLock: 0 });
},
false
);
return true;
}
else if( document.attachEvent )
{
return document.attachEvent(
'onload',
function() {
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text (fades out in 5 seconds)', fadeout: 5000 });
new Widget.Tooltip({ elementId: 'img1', tooltipContent: 'where is the image?!<br />click <a href="#" onclick="showImage(\'img1\')">here</a>...' });
new Widget.Tooltip({ elementId: 'anchor1', tooltipContent: 'a link must be clickable, so you should set enableLock to 0 on this tooltip!', enableLock: 0 });
}
);
}
SEE ALSO
Official web page at
http://www.sabadelli.it/edoardo/projects/javascript/widget.tooltip
JSAN http://openjsan.org/
AUTHOR
Edoardo Sabadelli - http://www.sabadelli.it/edoardo
COPYRIGHT
Copyright (c) 2007 Edoardo Sabadelli. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic license.
</pre>2007-05-04T12:59:05Widget.Tooltip-0.01
http://openjsan.org/doc/e/ed/edoardo/Widget/Tooltip/0.01
<pre>NAME
Widget.Tooltip - Unobtrusive javascript class for create and handle
tooltips
SYNOPSIS
<!-- XHTML page -->
<p id="text1">some text...</p>
// javascript code
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text' });
DESCRIPTION
This nice class implements some methods for adding tooltips on document
elements. The tooltip can contain plain text or some XHTML markup. When
the user moves the mouse over the reference element, the tooltip is
shown. By setting some configurable options is possible to control the
tooltip behaviour, by default the tooltip follows the mouse when is
moved, stops and freezes on a left button click, another click will
unlock the tooltip.
Tested under Firefox 2, Internet Explorer 6/7, Opera 9.
METHODS
new()
Class constructor, returns a new Widget.Tooltip object.
Parameters
oProps
Object literal where must be specified the element id on which add
the tooltip, the tooltip content and other optional properties that
overwrites the defaults.
Properties are:
elementId
ID of the element on which add a tooltip. mandatory!
enableLock
Defines if the tooltip must freeze on the current mouse position by
clicking the reference element (default is 1=enabled, set to 0 to
disable).
enableMove
Defines if the tooltip must follow the mouse pointer when is moved
(default is 1=enabled, set to 0 to disable).
fadeOut
Time expressed in milliseconds after which the tooltip will be
hidden (default 0=disabled).
offsetX
Horizontal distance in pixels from the mouse pointer of the tooltip
top-left corner (default is 16).
offsetY
Vertical distance in pixels from the mouse pointer of the tooltip
top-left corner (default is 16).
tooltipClass
CSS class to assign to the tooltip div element (default is
`tooltip'), useful for adding some make-up to the tooltip.
tooltipContent
Content of the tooltip. Usually some text you want to show. You can
pass also an XHTML string. If nothing is provided, the default text
`Empty tooltip!' is used.
hide()
Hides the tooltip.
move()
Moves the tooltip following the mouse pointer (depending on the
enableMove flag setting).
show()
Shows the tooltip.
toggleLock()
Freezes/unfreezes the tooltip by switching the internal lock flag
(depending on the enableLock flag setting).
EXAMPLES
<!-- you can initialize the class within your XHTML page like this -->
<p id="text1">some text...</p>
<p>an image<br />
<img src="ghost.png" /></p>
<p>you can also have a <a id="anchor1" href="somewhere_else">link</a> within the text on which you want to add a tooltip.</p>
<script type="text/javascript">
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text (fades out in 5 seconds)', fadeout: 5000 });
new Widget.Tooltip({ elementId: 'img1', tooltipContent: 'where is the image?!<br />click <a href="#" onclick="showImage(\'img1\')">here</a>...' });
new Widget.Tooltip({ elementId: 'anchor1', tooltipContent: 'a link must be clickable, so you should set enableLock to 0 on this tooltip!', enableLock: 0 });
</script>
// or in a more unobtrusive way put the new in an included javascript file.
// be sure to call the new when the page is loaded!
// a cross-browser way may be this
if( document.addEventListener )
{
document.addEventListener(
'load',
function() {
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text (fades out in 5 seconds)', fadeout: 5000 });
new Widget.Tooltip({ elementId: 'img1', tooltipContent: 'where is the image?!<br />click <a href="#" onclick="showImage(\'img1\')">here</a>...' });
new Widget.Tooltip({ elementId: 'anchor1', tooltipContent: 'a link must be clickable, so you should set enableLock to 0 on this tooltip!', enableLock: 0 });
},
false
);
return true;
}
else if( document.attachEvent )
{
return document.attachEvent(
'onload',
function() {
new Widget.Tooltip({ elementId: 'text1', tooltipContent: 'tooltip for some text (fades out in 5 seconds)', fadeout: 5000 });
new Widget.Tooltip({ elementId: 'img1', tooltipContent: 'where is the image?!<br />click <a href="#" onclick="showImage(\'img1\')">here</a>...' });
new Widget.Tooltip({ elementId: 'anchor1', tooltipContent: 'a link must be clickable, so you should set enableLock to 0 on this tooltip!', enableLock: 0 });
}
);
}
SEE ALSO
Official web page at
http://www.sabadelli.it/edoardo/projects/javascript/widget.tooltip
JSAN http://openjsan.org/
AUTHOR
Edoardo Sabadelli - http://www.sabadelli.it/edoardo
COPYRIGHT
Copyright (c) 2007 Edoardo Sabadelli. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic license.
</pre>2007-04-19T12:59:04Asynapse-0.10_01
http://openjsan.org/doc/g/gu/gugod/Asynapse/0.10_01
<pre>Application framework enhancement toolkit.</pre>2007-04-14T00:59:05Widget.Lightbox-0.09
http://openjsan.org/doc/g/gu/gugod/Widget/Lightbox/0.09
<pre>Widget.Lightbox
Widget.Lightbox is an objective re-implementation of Lightbox JS
(http://www.huddletogether.com/projects/lightbox/). It has several
nice features:
* Requires no extra image files
* Requires no extra CSS files and rules
* Optionally supports script.aculo.us effects library.
* Optionally supports JSAN effects library.
* Works on IE, Firefox, and Safari.
It's loaddable by JSAN, but not necessary. You can install this
library following standard JSAN distribution installation.
Cheers,
Kang-min Liu
</pre>2007-03-17T12:59:04Widget.Lightbox-0.08
http://openjsan.org/doc/g/gu/gugod/Widget/Lightbox/0.08
<pre>Widget.Lightbox
Widget.Lightbox is an objective re-implementation of Lightbox JS
(http://www.huddletogether.com/projects/lightbox/). It has several
nice features:
* Requires no extra image files
* Requires no extra CSS files and rules
* Optionally supports script.aculo.us effects library.
* Optionally supports JSAN effects library.
* Works on IE, Firefox, and Safari.
It's loaddable by JSAN, but not necessary. You can install this
library following standard JSAN distribution installation.
Cheers,
Kang-min Liu
</pre>2007-03-09T18:59:05Archive.Tar-0.03
http://openjsan.org/doc/k/ke/kevinj/Archive/Tar/0.03
<pre>Read-only tar extraction in javascript</pre>2007-03-08T00:59:04Archive.Tar-0.02
http://openjsan.org/doc/k/ke/kevinj/Archive/Tar/0.02
<pre>Read-only tar extraction in javascript</pre>2007-03-07T18:59:05Archive.Tar-0.01
http://openjsan.org/doc/k/ke/kevinj/Archive/Tar/0.01
<pre>Read-only tar extraction in javascript</pre>2007-03-07T00:59:05Form.Element.Resize-0.03
http://openjsan.org/doc/e/ed/edoardo/Form/Element/Resize/0.03
<pre>NAME
Form.Element.Resize - Unobtrusive javascript class for make a standard
form field resizable with the mouse
SYNOPSIS
<!-- XHTML page -->
<form action="http://host.domain.tld/cgi-bin/script">
<label for="message">Message:</label><br />
<textarea id="message" name="message"></textarea>
</form>
// javascript code
new Form.Element.Resize({ elementId: 'message' });
DESCRIPTION
This nice class implement some methods for add a mouse-driven resize
feature on form fields such as text inputs, textareas and select
controls. Clicking and dragging the borders or the corners of the form
element will resize it while double clicking inside the element will
restore its original dimensions (this does not work with select elements
in Internet Explorer and Firefox).
Tested under Firefox 2, Internet Explorer 6/7, Opera 9.
METHODS
new()
Class constructor, returns a new Form.Element.Resize object.
Parameters
oProps
Object literal where must be specified the element id on which
activate the resize feature and other optional properties that
overwrites the defaults.
Properties are:
"elementId"
ID of the element on which enable the resize feature. mandatory!
"resizeType"
Type of resize, shortcuts are auto, horizontal and vertical
(default is auto).
- auto: resizable borders and corners are set automatically
depending on the form element type. text input and non-multiple
select have only the right border draggable; textarea and multple
select have the right and bottom borders and the bottom-right
corner draggable.
- horizontal: all field types have only the right border
draggable.
- vertical: all field types have only the bottom border draggable.
It is also possible to specify each border/corner to activate by
passing an object literal with one or more of the following keys:
n, ne, e, se, s, sw, w, nw
All are initially disabled, so for example, to activate only the
bottom-right corner the property must be initialized like this:
new Form.Element.Resize({ elementId: 'message', resizeType: { se: 1 } });
"containerId"
ID of the generated container element, useful for add some CSS
rules on it.
"containerClass"
Class of the generated container element, useful for add some CSS
rules on it.
EXAMPLES
<!-- you can initialize the class within your XHTML page like this -->
<form action="http://host.domain.tld/cgi-bin/script">
<label for="message">Message:</label><br />
<textarea id="message" name="message"></textarea>
<script type="text/javascript">new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' });</script>
</form>
// or in a more unobtrusive way put the new in an included javascript file.
// be sure to call the new when the page is loaded!
// a cross-browser way may be this
if( document.addEventListener )
{
document.addEventListener(
'load',
function() { new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' }); },
false
);
return true;
}
else if( document.attachEvent )
{
return document.attachEvent(
'onload',
function() { new Form.Element.Resize({ elementId: 'message', containerClass: 'resizable' }); }
);
}
SEE ALSO
Official web page at
<http://www.sabadelli.it/edoardo/projects/javascript/form.element.resize
>
JSAN <http://openjsan.org/>
AUTHOR
Edoardo Sabadelli - <http://www.sabadelli.it/edoardo>
COPYRIGHT
Copyright (c) 2007 Edoardo Sabadelli. All rights reserved.
This module is free software; you can redistribute it and/or modify it
under the terms of the Artistic license.
</pre>2007-02-27T12:59:05Data.Dump-0.02
http://openjsan.org/doc/k/ke/kevinj/Data/Dump/0.02
<pre>NAME
Data.Dump - Dump any variable as a string
SYNOPSIS
var obj = new Object;
obj['key'] = 'value';
obj['array'] = new Array("one","two","three");
alert( Dump(obj) )
DESCRIPTION
This module is an implemetation of the Data::Dump perl module in
JavaScript. It provides a "Dump" method which takes a series of
arguments and produces a string that can be later "eval"ed in order to
produce a deep copy of the original variables.
BUGS
Dumping DOM elements will fail
SEE ALSO
"JSAN"
AUTHORS
The "Data.Dump" JavaScript module is written by Kevin Jones
<kevinj@cpan.org>, based on "Data::Dump" by Gisle Aas <gisle@aas.no>,
based on "Data::Dumper" by Gurusamy Sarathy <gsar@umich.edu>.
COPYRIGHT
Copyright 2007 Kevin Jones. Copyright 1998-2000,2003-2004 Gisle Aas.
Copyright 1996-1998 Gurusamy Sarathy.
This program is free software; you can redistribute it and/or modify it
under the terms of the Perl Artistic License
See http://www.perl.com/perl/misc/Artistic.html
</pre>2007-02-27T00:59:08Data.Dump-0.02
http://openjsan.org/doc/k/ke/kevinj/Data/Dump/0.02
<pre>NAME
Data.Dump - Dump any variable as a string
SYNOPSIS
var obj = new Object;
obj['key'] = 'value';
obj['array'] = new Array("one","two","three");
alert( Dump(obj) )
DESCRIPTION
This module is an implemetation of the Data::Dump perl module in
JavaScript. It provides a "Dump" method which takes a series of
arguments and produces a string that can be later "eval"ed in order to
produce a deep copy of the original variables.
BUGS
Dumping DOM elements will fail
SEE ALSO
"JSAN"
AUTHORS
The "Data.Dump" JavaScript module is written by Kevin Jones
<kevinj@cpan.org>, based on "Data::Dump" by Gisle Aas <gisle@aas.no>,
based on "Data::Dumper" by Gurusamy Sarathy <gsar@umich.edu>.
COPYRIGHT
Copyright 2007 Kevin Jones. Copyright 1998-2000,2003-2004 Gisle Aas.
Copyright 1996-1998 Gurusamy Sarathy.
This program is free software; you can redistribute it and/or modify it
under the terms of the Perl Artistic License
See http://www.perl.com/perl/misc/Artistic.html
</pre>2007-02-27T00:59:05