HTML-Tag
view release on metacpan or search on metacpan
Explorer 5.5 and greater and with Mozilla Firefox 1.0 and greater. Let
me know if notice tis module works in other browser.
DESCRIPTION
To have an idea of what kind of widgets are currently (1.00) available
let me describe the DATE widget.
This is a date control built with three combo (select) input field. With
these combos you can select day, month and year.
You can also select date by pressing a button that opens a popup
calendar (http://www.dynarch.com/projects/calendar/).
Another way, and this is great for me, is the ability to enter date
directly with keyboard. If you press a key the combobox becomes a
textbox and this give you the possibility to enter date with keyboard
After that, when you post the form, only an hidden field with the date
you set in the visible controls, has sent.
All these layouts (combo/textbox and hidden field) are alway syncronized
tis module works in other browser.
=head1 DESCRIPTION
To have an idea of what kind of widgets are currently (1.00) available let me
describe the DATE widget.
This is a date control built with three combo (select) input field. With these
combos you can select day, month and year.
You can also select date by pressing a button that opens a popup calendar
(http://www.dynarch.com/projects/calendar/).
Another way, and this is great for me, is the ability to enter date directly
with keyboard. If you press a key the combobox becomes a textbox and this give
you the possibility to enter date with keyboard
After that, when you post the form, only an hidden field with the date you set
in the visible controls, has sent.
All these layouts (combo/textbox and hidden field) are alway syncronized to have
extras/datetime_js/html_tag_datetime.js view on Meta::CPAN
var y = cal.date.getFullYear();
var m = cal.date.getMonth(); // integer, 0..11
var d = cal.date.getDate(); // integer, 1..31
var h = cal.date.getHours();
var n = cal.date.getMinutes();
m=m+1;
if (m.toString().length == 1) m = '0' + m;
if (d.toString().length == 1) d = '0' + d;
if (h.toString().length == 1) h = '0' + h;
if (n.toString().length == 1) n = '0' + n;
setDateVisibleElement(_dynarch_popupCalendar.sel.id,d,m,y,h,n);
cal.callCloseHandler();
}
}
// And this gets called when the end-user clicks on the _selected_ date,
// or clicks on the "Close" button. It just hides the calendar without
// destroying it.
function closeHandler(cal) {
cal.hide(); // hide the calendar
_dynarch_popupCalendar = null;
}
// This function shows the calendar under the element having the given id.
// It takes care of catching "mousedown" signals on document and hiding the
// calendar if the click was outside.
function showCalendar(button,id, format, showsTime, showsOtherMonths) {
var el = $(id);
if (_dynarch_popupCalendar != null) {
// we already have some calendar created
_dynarch_popupCalendar.hide(); // so we hide it first.
} else {
// first-time call, create the calendar.
var cal = new Calendar(1, null, selected, closeHandler);
// uncomment the following line to hide the week numbers
// cal.weekNumbers = false;
if (typeof showsTime == "number") {
cal.showsTime = true;
cal.time24 = (showsTime == 24);
}
if (showsOtherMonths) {
cal.showsOtherMonths = true;
}
_dynarch_popupCalendar = cal; // remember it in the global var
cal.setRange(1900, 2070); // min/max year allowed.
cal.create();
}
_dynarch_popupCalendar.setDateFormat(format); // set the specified date format
_dynarch_popupCalendar.parseDate(el.value); // try to parse the text in field
_dynarch_popupCalendar.sel = el; // inform it what input field we use
// the reference element that we pass to showAtElement is the button that
// triggers the calendar. In this example we align the calendar bottom-right
// to the button.
_dynarch_popupCalendar.showAtElement(button, "Br"); // show the calendar
return false;
}
function append_days(element,checked_value) {
var oOption = document.createElement("OPTION");
oOption.value = '';
oOption.text = '';
//oOption.selected = (checked_value == '');
element.options.add(oOption);
extras/datetime_js/jscalendar/ChangeLog view on Meta::CPAN
* calendar.js: workaround IE bug, needed in the Aqua theme
don't hide select elements unless browser is IE or Opera
* lang/calendar-bg.js, lang/calendar-big5-utf8.js, lang/calendar-big5.js, lang/calendar-br.js, lang/calendar-ca.js, lang/calendar-cs-utf8.js, lang/calendar-cs-win.js, lang/calendar-da.js, lang/calendar-de.js, lang/calendar-el.js, lang/calendar-en.js...
updated urls, copyright notices
* doc/reference.tex: updated documentation
* calendar.js, index.html:
renamed the global variable to _dynarch_popupCalendar to avoid name clashes
* multiple-dates.html: start with an empty array
* calendar.js:
fixed bugs in the time selector (12:XX pm was wrongfully understood as 12:XX am)
* calendar.js:
using innerHTML instead of text nodes; works better in Safari and also makes
a smaller, cleaner code
extras/datetime_js/jscalendar/README view on Meta::CPAN
http://www.gnu.org/licenses/lgpl.html
Contents
---------
calendar.js -- the main program file
lang/*.js -- internalization files
*.css -- color themes
cal.html -- example usage file
doc/ -- documentation, in PDF and HTML
simple-1.html -- quick setup examples [popup calendars]
simple-2.html -- quick setup example for flat calendar
calendar.php -- PHP wrapper
test.php -- test file for the PHP wrapper
Homepage
---------
For details and latest versions please refer to calendar
homepage, located on my website:
extras/datetime_js/jscalendar/calendar.js view on Meta::CPAN
ev && cal.callCloseHandler();
}
};
// END: CALENDAR STATIC FUNCTIONS
// BEGIN: CALENDAR OBJECT FUNCTIONS
/**
* This function creates the calendar inside the given parent. If _par is
* null than it creates a popup calendar inside the BODY element. If _par is
* an element, be it BODY, then it creates a non-popup calendar (still
* hidden). Some properties need to be set before calling this function.
*/
Calendar.prototype.create = function (_par) {
var parent = null;
if (! _par) {
// default parent is the document body, in which case we create
// a popup calendar.
parent = document.getElementsByTagName("body")[0];
this.isPopup = true;
} else {
parent = _par;
this.isPopup = false;
}
this.date = this.dateStr ? new Date(this.dateStr) : new Date();
var table = Calendar.createElement("table");
this.table = table;
extras/datetime_js/jscalendar/calendar.js view on Meta::CPAN
for (i = 12; i > 0; --i) {
var yr = Calendar.createElement("div");
yr.className = Calendar.is_ie ? "label-IEfix" : "label";
div.appendChild(yr);
}
this._init(this.firstDayOfWeek, this.date);
parent.appendChild(this.element);
};
/** keyboard navigation, only for popup calendars */
Calendar._keyEvent = function(ev) {
var cal = window._dynarch_popupCalendar;
if (!cal || cal.multiple)
return false;
(Calendar.is_ie) && (ev = window.event);
var act = (Calendar.is_ie || ev.type == "keypress"),
K = ev.keyCode;
if (ev.ctrlKey) {
switch (K) {
case 37: // KEY left
act && Calendar.cellClick(cal._nav_pm);
break;
extras/datetime_js/jscalendar/calendar.js view on Meta::CPAN
this.onClose(this);
}
this.hideShowCovered();
};
/** Removes the calendar object from the DOM tree and destroys it. */
Calendar.prototype.destroy = function () {
var el = this.element.parentNode;
el.removeChild(this.element);
Calendar._C = null;
window._dynarch_popupCalendar = null;
};
/**
* Moves the calendar element to a different section in the DOM tree (changes
* its parent).
*/
Calendar.prototype.reparent = function (new_parent) {
var el = this.element;
el.parentNode.removeChild(el);
new_parent.appendChild(el);
};
// This gets called when the user presses a mouse button anywhere in the
// document, if the calendar is shown. If the click was outside the open
// calendar this function closes it.
Calendar._checkCalendar = function(ev) {
var calendar = window._dynarch_popupCalendar;
if (!calendar) {
return false;
}
var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
for (; el != null && el != calendar.element; el = el.parentNode);
if (el == null) {
// calls closeHandler which should hide the calendar.
window._dynarch_popupCalendar.callCloseHandler();
return Calendar.stopEvent(ev);
}
};
/** Shows the calendar. */
Calendar.prototype.show = function () {
var rows = this.table.getElementsByTagName("tr");
for (var i = rows.length; i > 0;) {
var row = rows[--i];
Calendar.removeClass(row, "rowhilite");
var cells = row.getElementsByTagName("td");
for (var j = cells.length; j > 0;) {
var cell = cells[--j];
Calendar.removeClass(cell, "hilite");
Calendar.removeClass(cell, "active");
}
}
this.element.style.display = "block";
this.hidden = false;
if (this.isPopup) {
window._dynarch_popupCalendar = this;
Calendar.addEvent(document, "keydown", Calendar._keyEvent);
Calendar.addEvent(document, "keypress", Calendar._keyEvent);
Calendar.addEvent(document, "mousedown", Calendar._checkCalendar);
}
this.hideShowCovered();
};
/**
* Hides the calendar. Also removes any "hilite" from the class of any TD
* element.
extras/datetime_js/jscalendar/calendar.js view on Meta::CPAN
d.__msh_oldSetFullYear(y);
if (d.getMonth() != this.getMonth())
this.setDate(28);
this.__msh_oldSetFullYear(y);
};
// END: DATE OBJECT PATCHES
// global object that remembers the calendar
window._dynarch_popupCalendar = null;
extras/datetime_js/jscalendar/calendar_stripped.js view on Meta::CPAN
* The DHTML Calendar, version 1.0 "It is happening again"
*
* Details and latest version at:
* www.dynarch.com/projects/calendar
*
* This script is developed by Dynarch.com. Visit us at www.dynarch.com.
*
* This script is distributed under the GNU Lesser General Public License.
* Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
*/
Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||...
( run in 2.278 seconds using v1.01-cache-2.11-cpan-364913b4093 )