CGI-WebToolkit
view release on metacpan or search on metacpan
t/private/javascripts/datepicker.js view on Meta::CPAN
this.options.currentFormat = this.options.timeFormat;
else
this.options.currentFormat = this.options.dateFormat;
// this.options.currentFormat = this.options.timePicker ? this.options.dateTimeFormat : this.options.dateFormat;
this.options.date = DateFormat.parseFormat(this.element.value, this.options.currentFormat);
// Lazy load to avoid excessive CPU usage with lots of controls on one page
this.datepicker = null;
this.originalValue = null;
this.hideTimeout = null;
if (this.options.icon) {
var cont = new Element('div', {'style': 'position: relative;'});
this.element.parentNode.replaceChild(cont, this.element);
cont.appendChild(this.element);
this.icon = new Element('img', {'src': this.options.icon, 'title': this.tr('Open calendar'), 'className': 'inputExtension'});
var padding = this.options.padding;
if (!padding) {
t/private/javascripts/datepicker.js view on Meta::CPAN
this.hidePickerListener = this.delayedHide.bindAsEventListener(this);
Event.observe(this.element, 'keydown', this.keyHandler.bindAsEventListener(this));
Event.observe(document, 'keydown', this.docKeyHandler.bindAsEventListener(this));
this.pickerActive = false;
},
tr: function(str) {
return this.i18n.tr(str);
},
delayedHide: function(e) {
this.hideTimeout = setTimeout(this.hide.bind(this), 100);
},
pickerClicked: function() {
if (this.hideTimeout) {
clearTimeout(this.hideTimeout);
this.hideTimeout = null;
}
if (this.handlers.onClick)
this.handlers.onClick();
},
datePicked: function(date) {
this.element.value = DateFormat.format(date, this.options.currentFormat);
this.element.focus();
this.hide();
if (this.handlers.onSelect)
this.handlers.onSelect(date);
if (this.element.onchange)
this.element.onchange();
},
dateHover: function(date) {
if (this.hideTimeout) {
clearTimeout(this.hideTimeout);
this.hideTimeout = null;
}
if (this.pickerActive) {
this.element.value = DateFormat.format(date, this.options.currentFormat);
if (this.handlers.onHover)
this.handlers.onHover(date);
}
},
togglePicker: function(e) {
if (this.pickerActive) {
this.element.value = this.originalValue;
t/private/javascripts/datepicker.js view on Meta::CPAN
cell.style.textAlign = 'right';
cell.colSpan = 5;
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);
t/private/javascripts/jscolor.js view on Meta::CPAN
leaveStyle = 1<<1,
leavePad = 1<<2,
leaveSld = 1<<3
// target
jscolor.addEvent(target, 'focus', function() {
if(THIS.pickerOnfocus) THIS.showPicker()
})
jscolor.addEvent(target, 'blur', function() {
if(!abortBlur) {
setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false }, 0)
} else {
abortBlur = false
}
})
// valueElement
if(valueElement) {
var updateField = function() {
THIS.fromString(valueElement.value, leaveValue)
}
t/private/javascripts/prototype.js view on Meta::CPAN
var __method = this, args = slice.call(arguments, 0);
return function() {
var a = merge(args, arguments);
return __method.apply(this, a);
}
}
function delay(timeout) {
var __method = this, args = slice.call(arguments, 1);
timeout = timeout * 1000
return window.setTimeout(function() {
return __method.apply(__method, args);
}, timeout);
}
function defer() {
var args = update([0.01], arguments);
return this.delay.apply(this, args);
}
function wrap(wrapper) {
t/private/javascripts/prototype.js view on Meta::CPAN
this.start();
},
start: function() {
this.options.onComplete = this.updateComplete.bind(this);
this.onTimerEvent();
},
stop: function() {
this.updater.options.onComplete = undefined;
clearTimeout(this.timer);
(this.onComplete || Prototype.emptyFunction).apply(this, arguments);
},
updateComplete: function(response) {
if (this.options.decay) {
this.decay = (response.responseText == this.lastText ?
this.decay * this.options.decay : 1);
this.lastText = response.responseText;
}
t/private/javascripts/prototype.js view on Meta::CPAN
})();
(function() {
/* Support for the DOMContentLoaded event is based on work by Dan Webb,
Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
var timer;
function fireContentLoadedEvent() {
if (document.loaded) return;
if (timer) window.clearTimeout(timer);
document.loaded = true;
document.fire('dom:loaded');
}
function checkReadyState() {
if (document.readyState === 'complete') {
document.stopObserving('readystatechange', checkReadyState);
fireContentLoadedEvent();
}
}
( run in 0.237 second using v1.01-cache-2.11-cpan-4d50c553e7e )