summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/js/debug/prado.js
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/js/debug/prado.js')
-rw-r--r--framework/Web/Javascripts/js/debug/prado.js136
1 files changed, 54 insertions, 82 deletions
diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js
index 122a5640..a455a0dd 100644
--- a/framework/Web/Javascripts/js/debug/prado.js
+++ b/framework/Web/Javascripts/js/debug/prado.js
@@ -1924,14 +1924,14 @@ if (navigator.appVersion.match(/\bMSIE\b/))
/**
* @class Event extensions.
*/
-Object.extend(Event,
+Object.extend(Event,
{
/**
- * Register a function to be executed when the page is loaded.
- * Note that the page is only loaded if all resources (e.g. images)
+ * Register a function to be executed when the page is loaded.
+ * Note that the page is only loaded if all resources (e.g. images)
* are loaded.
- *
- * Example: Show an alert box with message "Page Loaded!" when the
+ *
+ * Example: Show an alert box with message "Page Loaded!" when the
* page finished loading.
* <code>
* Event.OnLoad(function(){ alert("Page Loaded!"); });
@@ -1939,18 +1939,18 @@ Object.extend(Event,
*
* @param {Function} function to execute when page is loaded.
*/
- OnLoad : function (fn)
+ OnLoad : function (fn)
{
// opera onload is in document, not window
- var w = document.addEventListener &&
+ var w = document.addEventListener &&
!window.addEventListener ? document : window;
Event.observe(w,'load',fn);
},
/**
* @param {Event} a keyboard event
- * @return {Number} the Unicode character code generated by the key
- * that was struck.
+ * @return {Number} the Unicode character code generated by the key
+ * that was struck.
*/
keyCode : function(e)
{
@@ -1959,64 +1959,65 @@ Object.extend(Event,
/**
* @param {String} event type or event name.
- * @return {Boolean} true if event type is of HTMLEvent, false
+ * @return {Boolean} true if event type is of HTMLEvent, false
* otherwise
*/
isHTMLEvent : function(type)
{
- var events = ['abort', 'blur', 'change', 'error', 'focus',
- 'load', 'reset', 'resize', 'scroll', 'select',
+ var events = ['abort', 'blur', 'change', 'error', 'focus',
+ 'load', 'reset', 'resize', 'scroll', 'select',
'submit', 'unload'];
return events.include(type);
},
/**
* @param {String} event type or event name
- * @return {Boolean} true if event type is of MouseEvent,
+ * @return {Boolean} true if event type is of MouseEvent,
* false otherwise
*/
isMouseEvent : function(type)
{
- var events = ['click', 'mousedown', 'mousemove', 'mouseout',
+ var events = ['click', 'mousedown', 'mousemove', 'mouseout',
'mouseover', 'mouseup'];
return events.include(type);
},
/**
- * Dispatch the DOM event of a given <tt>type</tt> on a DOM
- * <tt>element</tt>. Only HTMLEvent and MouseEvent can be
- * dispatched, keyboard events or UIEvent can not be dispatch
+ * Dispatch the DOM event of a given <tt>type</tt> on a DOM
+ * <tt>element</tt>. Only HTMLEvent and MouseEvent can be
+ * dispatched, keyboard events or UIEvent can not be dispatch
* via javascript consistently.
* For the "submit" event the submit() method is called.
* @param {Object} element id string or a DOM element.
* @param {String} event type to dispatch.
*/
- fireEvent : function(element,type)
+ fireEvent : function(element,type,canBubble)
{
+ canBubble = (typeof(canBubble) == undefined) ? true : canBubble;
element = $(element);
if(type == "submit")
return element.submit();
if(document.createEvent)
- {
+ {
if(Event.isHTMLEvent(type))
{
var event = document.createEvent('HTMLEvents');
- event.initEvent(type, true, true);
+ event.initEvent(type, canBubble, true);
}
else if(Event.isMouseEvent(type))
{
- var event = document.createEvent('MouseEvents');
+ var event = document.createEvent('MouseEvents');
if (event.initMouseEvent)
{
- event.initMouseEvent(type,true,true,
- document.defaultView, 1, 0, 0, 0, 0, false,
+ event.initMouseEvent(type,canBubble,true,
+ document.defaultView, 1, 0, 0, 0, 0, false,
false, false, false, 0, null);
}
else
{
// Safari
// TODO we should be initialising other mouse-event related attributes here
- event.initEvent(type, true, true);
+ event.initEvent(type, canBubble, true);
}
}
element.dispatchEvent(event);
@@ -3471,7 +3472,7 @@ Prado.WebUI.DefaultButton.prototype =
if(defaultButton)
{
this.triggered = true;
- $('PRADO_POSTBACK_TARGET').value = this.options.EventTarget;
+ $('PRADO_POSTBACK_TARGET').value = this.options.EventTarget;
Event.fireEvent(defaultButton, this.options['Event']);
Event.stop(ev);
}
@@ -3525,66 +3526,37 @@ Object.extend(Prado.WebUI.TTextHighlighter,
obj.parentNode.className = "copycode";
}
});
-
-
-Prado.WebUI.TRatingList = Class.create();
-Prado.WebUI.TRatingList.prototype =
-{
- selectedIndex : -1,
- initialize : function(options)
+
+Prado.WebUI.TCheckBoxList = Base.extend(
+{
+ constructor : function(options)
{
- this.options = options;
- this.element = $(options['ID']);
- Element.addClassName(this.element,options.cssClass);
- this.radios = document.getElementsByName(options.field);
- for(var i = 0; i<this.radios.length; i++)
+ for(var i = 0; i<options.ItemCount; i++)
{
- Event.observe(this.radios[i].parentNode, "mouseover", this.hover.bindEvent(this,i));
- Event.observe(this.radios[i].parentNode, "mouseout", this.recover.bindEvent(this,i));
- Event.observe(this.radios[i].parentNode, "click", this.click.bindEvent(this, i));
- }
- this.caption = CAPTION();
- this.element.appendChild(this.caption);
- this.selectedIndex = options.selectedIndex;
- this.setRating(this.selectedIndex);
- },
-
- hover : function(ev,index)
- {
- for(var i = 0; i<this.radios.length; i++)
- this.radios[i].parentNode.className = (i<=index) ? "rating_hover" : "";
- this.setCaption(index);
- },
-
- recover : function(ev,index)
- {
- for(var i = 0; i<=index; i++)
- Element.removeClassName(this.radios[i].parentNode, "rating_hover");
- this.setRating(this.selectedIndex);
- },
-
- click : function(ev, index)
- {
- for(var i = 0; i<this.radios.length; i++)
- this.radios[i].checked = (i == index);
- this.selectedIndex = index;
- this.setRating(index);
- if(isFunction(this.options.onChange))
- this.options.onChange(this,index);
- },
-
- setRating: function(index)
- {
- for(var i = 0; i<=index; i++)
- this.radios[i].parentNode.className = "rating_selected";
- this.setCaption(index);
- },
-
- setCaption : function(index)
+ var checkBoxOptions = Object.extend(
+ {
+ ID : options.ListID+"_c"+i,
+ EventTarget : options.ListName+"$c"+i
+ }, options);
+ new Prado.WebUI.TCheckBox(checkBoxOptions);
+ }
+ }
+});
+
+Prado.WebUI.TRadioButtonList = Base.extend(
+{
+ constructor : function(options)
{
- this.caption.innerHTML = index > -1 ?
- this.radios[index].value : this.options.caption;
+ for(var i = 0; i<options.ItemCount; i++)
+ {
+ var radioButtonOptions = Object.extend(
+ {
+ ID : options.ListID+"_c"+i,
+ EventTarget : options.ListName+"$c"+i
+ }, options);
+ new Prado.WebUI.TRadioButton(radioButtonOptions);
+ }
}
-}
+});