CGI-WebToolkit
view release on metacpan or search on metacpan
t/private/javascripts/datepicker.js view on Meta::CPAN
datePicker: true,
timePicker: false,
use24hrs: false,
firstWeekDay: 0,
weekend: [0,6],
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
days: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
}, options || {});
// Make sure first weekday is in the correct range
with (this.options)
if (isNaN(firstWeekDay*1)) firstWeekDay = 0;
else firstWeekDay = firstWeekDay % 7;
this.keysCaptured = false;
this.calendarCont = null;
this.currentDate = this.options.date ? this.options.date : new Date();
this.dayOfWeek = 0;
this.minInterval = 5;
this.selectedDay = null;
this.selectedHour = null;
t/private/javascripts/datepicker.js view on Meta::CPAN
cell.innerHTML = '<i>'+this.tr('Exact minutes')+':</i>';
cell = row.insertCell(1);
cell.className = 'otherminute';
var otherInput = document.createElement('input');
otherInput.type = 'text';
otherInput.maxLength = 2;
otherInput.style.width = '2em';
var inputTimeout = null;
otherInput.onkeyup = function(e) {
if (!isNaN(otherInput.value)) {
this.currentDate.setMinutes(otherInput.value);
this.dateChanged(this.currentDate);
}
}.bindAsEventListener(this);
otherInput.onkeydown = function(e) {
if (e.keyCode == Event.KEY_RETURN)
if (this.options.onSelect) this.options.onSelect(this.currentDate);
}.bindAsEventListener(this);
// Remove event key capture to allow use of arrow keys
otherInput.onfocus = this.releaseKeys.bindAsEventListener(this);
t/private/javascripts/prototype.js view on Meta::CPAN
function indexOf(item, i) {
i || (i = 0);
var length = this.length;
if (i < 0) i = length + i;
for (; i < length; i++)
if (this[i] === item) return i;
return -1;
}
function lastIndexOf(item, i) {
i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
var n = this.slice(0, i).reverse().indexOf(item);
return (n < 0) ? n : i - n - 1;
}
function concat() {
var array = slice.call(this, 0), item;
for (var i = 0, length = arguments.length; i < length; i++) {
item = arguments[i];
if (Object.isArray(item) && !('callee' in item)) {
for (var j = 0, arrayLength = item.length; j < arrayLength; j++)
t/private/javascripts/slider.js view on Meta::CPAN
: document.forms[this.s_form]
? document.forms[this.s_form].elements[this.s_name]
: null;
this.f_setValue(e_input && e_input.value != '' ? e_input.value : null, 1);
this.e_slider.style.visibility = 'visible';
}
function f_sliderSetValue (n_value, b_noInputCheck) {
if (n_value == null)
n_value = this.n_value == null ? this.n_minValue : this.n_value;
if (isNaN(n_value))
return false;
// round to closest multiple if step is specified
if (this.n_step)
n_value = Math.round((n_value - this.n_minValue) / this.n_step) * this.n_step + this.n_minValue;
// smooth out the result
if (n_value % 1)
n_value = Math.round(n_value * 1e5) / 1e5;
if (n_value < this.n_minValue)
n_value = this.n_minValue;
t/private/javascripts/tablekit.js view on Meta::CPAN
TableKit.Sortable.Type.compare = function(a,b) {
return a < b ? -1 : a === b ? 0 : 1;
};
TableKit.Sortable.addSortType(
new TableKit.Sortable.Type('number', {
pattern : /^[-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?/,
normal : function(v) {
// This will grab the first thing that looks like a number from a string, so you can use it to order a column of various srings containing numbers.
v = parseFloat(v.replace(/^.*?([-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?).*$/,"$1"));
return isNaN(v) ? 0 : v;
}}),
new TableKit.Sortable.Type('text',{
normal : function(v) {
return v ? v.toLowerCase() : '';
}}),
new TableKit.Sortable.Type('casesensitivetext',{pattern : /^[A-Z]+$/}),
new TableKit.Sortable.Type('datasize',{
pattern : /^[-+]?[\d]*\.?[\d]+(?:[eE][-+]?[\d]+)?\s?[k|m|g|t]b$/i,
normal : function(v) {
var r = v.match(/^([-+]?[\d]*\.?[\d]+([eE][-+]?[\d]+)?)\s?([k|m|g|t]?b)?/i);
( run in 0.462 second using v1.01-cache-2.11-cpan-4d50c553e7e )