diff options
Diffstat (limited to 'framework/Web/Javascripts')
-rw-r--r-- | framework/Web/Javascripts/extended/event.js | 17 | ||||
-rw-r--r-- | framework/Web/Javascripts/js/compressed/ajax.js | 2 | ||||
-rw-r--r-- | framework/Web/Javascripts/js/compressed/prado.js | 7 | ||||
-rw-r--r-- | framework/Web/Javascripts/js/debug/ajax.js | 2 | ||||
-rw-r--r-- | framework/Web/Javascripts/js/debug/prado.js | 18 | ||||
-rw-r--r-- | framework/Web/Javascripts/js/debug/validator.js | 4 | ||||
-rw-r--r-- | framework/Web/Javascripts/prado/controls.js | 1 | ||||
-rw-r--r-- | framework/Web/Javascripts/prado/validation3.js | 4 |
8 files changed, 39 insertions, 16 deletions
diff --git a/framework/Web/Javascripts/extended/event.js b/framework/Web/Javascripts/extended/event.js index 4fd041d8..e464fa94 100644 --- a/framework/Web/Javascripts/extended/event.js +++ b/framework/Web/Javascripts/extended/event.js @@ -82,10 +82,19 @@ Object.extend(Event, }
else if(Event.isMouseEvent(type))
{
- var event = document.createEvent('MouseEvents');
- event.initMouseEvent(type,true,true,
- document.defaultView, 1, 0, 0, 0, 0, false,
- false, false, false, 0, null);
+ var event = document.createEvent('MouseEvents');
+ if (event.initMouseEvent)
+ {
+ event.initMouseEvent(type,true,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);
+ }
}
element.dispatchEvent(event);
}
diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js index b65892cc..645df359 100644 --- a/framework/Web/Javascripts/js/compressed/ajax.js +++ b/framework/Web/Javascripts/js/compressed/ajax.js @@ -210,7 +210,7 @@ Event.observe(this.element,"keydown",this.handleReturnKey.bind(this));Event.obse {this.options=options;this.baseInitialize(options.ID,options.ResultPanel,options);Object.extend(this.options,{onSuccess:this.onComplete.bind(this)});if(options.AutoPostBack) this.onInit(options);},doCallback:function(event,options) {if(!this.active) -{request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}},onClick:function(event) +{request=new Prado.CallbackRequest(this.options.EventTarget,options);request.dispatch();Event.stop(event);}},onClick:function(event) {var element=Event.findElement(event,'LI');this.index=element.autocompleteIndex;this.selectEntry();this.hide();Event.fireEvent(this.element,"change");},getUpdatedChoices:function() {options=new Array(this.getToken(),"__TAutoComplete_onSuggest__");Prado.Callback(this.options.EventTarget,options,null,this.options);},onComplete:function(request,boundary) {result=Prado.Element.extractContent(request.transport.responseText,boundary);if(typeof(result)=="string"&&result.length>0) diff --git a/framework/Web/Javascripts/js/compressed/prado.js b/framework/Web/Javascripts/js/compressed/prado.js index d9eb1b8e..e565d59a 100644 --- a/framework/Web/Javascripts/js/compressed/prado.js +++ b/framework/Web/Javascripts/js/compressed/prado.js @@ -137,7 +137,10 @@ return element.submit();if(document.createEvent) {if(Event.isHTMLEvent(type)) {var event=document.createEvent('HTMLEvents');event.initEvent(type,true,true);} else if(Event.isMouseEvent(type)) -{var event=document.createEvent('MouseEvents');event.initMouseEvent(type,true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null);} +{var event=document.createEvent('MouseEvents');if(event.initMouseEvent) +{event.initMouseEvent(type,true,true,document.defaultView,1,0,0,0,0,false,false,false,false,0,null);} +else +{event.initEvent(type,true,true);}} element.dispatchEvent(event);} else if(document.createEventObject) {var evObj=document.createEventObject();element.fireEvent('on'+type,evObj);} @@ -377,7 +380,7 @@ Event.observe(this.element,"keydown",this.handleReturnKey.bind(this));Event.obse {this.options=options;this._event=this.triggerEvent.bindEvent(this);Event.observe(options['Panel'],'keydown',this._event);},triggerEvent:function(ev,target) {var enterPressed=Event.keyCode(ev)==Event.KEY_RETURN;var isTextArea=Event.element(ev).tagName.toLowerCase()=="textarea";if(enterPressed&&!isTextArea) {var defaultButton=$(this.options['Target']);if(defaultButton) -{this.triggered=true;Event.fireEvent(defaultButton,this.options['Event']);Event.stop(ev);}}}};Prado.WebUI.TTextHighlighter=Class.create();Prado.WebUI.TTextHighlighter.prototype={initialize:function(id) +{this.triggered=true;$('PRADO_POSTBACK_TARGET').value=this.options.EventTarget;Event.fireEvent(defaultButton,this.options['Event']);Event.stop(ev);}}}};Prado.WebUI.TTextHighlighter=Class.create();Prado.WebUI.TTextHighlighter.prototype={initialize:function(id) {if(!window.clipboardData)return;var options={href:'javascript:;/'+'/copy code to clipboard',onclick:'Prado.WebUI.TTextHighlighter.copy(this)',onmouseover:'Prado.WebUI.TTextHighlighter.hover(this)',onmouseout:'Prado.WebUI.TTextHighlighter.out(this)'} var div=DIV({className:'copycode'},A(options,'Copy Code'));document.write(DIV(null,div).innerHTML);}};Object.extend(Prado.WebUI.TTextHighlighter,{copy:function(obj) {var parent=obj.parentNode.parentNode.parentNode;var text='';for(var i=0;i<parent.childNodes.length;i++) diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js index 61881bf9..3ea8acce 100644 --- a/framework/Web/Javascripts/js/debug/ajax.js +++ b/framework/Web/Javascripts/js/debug/ajax.js @@ -2079,7 +2079,7 @@ Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete, {
if(!this.active)
{
- request = new Prado.CallbackRequest(options.EventTarget, options);
+ request = new Prado.CallbackRequest(this.options.EventTarget, options);
request.dispatch();
Event.stop(event);
}
diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js index ee228240..c890ccdb 100644 --- a/framework/Web/Javascripts/js/debug/prado.js +++ b/framework/Web/Javascripts/js/debug/prado.js @@ -2004,10 +2004,19 @@ Object.extend(Event, }
else if(Event.isMouseEvent(type))
{
- var event = document.createEvent('MouseEvents');
- event.initMouseEvent(type,true,true,
- document.defaultView, 1, 0, 0, 0, 0, false,
- false, false, false, 0, null);
+ var event = document.createEvent('MouseEvents');
+ if (event.initMouseEvent)
+ {
+ event.initMouseEvent(type,true,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);
+ }
}
element.dispatchEvent(event);
}
@@ -3461,6 +3470,7 @@ Prado.WebUI.DefaultButton.prototype = if(defaultButton)
{
this.triggered = true;
+ $('PRADO_POSTBACK_TARGET').value = this.options.EventTarget;
Event.fireEvent(defaultButton, this.options['Event']);
Event.stop(ev);
}
diff --git a/framework/Web/Javascripts/js/debug/validator.js b/framework/Web/Javascripts/js/debug/validator.js index d068900c..dbc180cf 100644 --- a/framework/Web/Javascripts/js/debug/validator.js +++ b/framework/Web/Javascripts/js/debug/validator.js @@ -357,7 +357,7 @@ Prado.WebUI.TValidationSummary.prototype = * options['DisplayMode'] Summary display style, 'BulletList', 'List', 'SingleParagraph'
* options['Refresh'] True to update the summary upon validator state change.
* options['ValidationGroup'] Validation summary group
- * options['Display'] Display mode, 'None', 'Static', 'Dynamic'.
+ * options['Display'] Display mode, 'None', 'Fixed', 'Dynamic'.
* options['ScrollToSummary'] True to scroll to the validation summary upon refresh.
* </code>
*/
@@ -564,7 +564,7 @@ Prado.WebUI.TBaseValidator.prototype = * options['ID']* Validator ID, e.g. span with message
* options['FormID']* HTML form that the validator belongs
* options['ControlToValidate']*HTML form input to validate
- * options['Display'] Display mode, 'None', 'Static', 'Dynamic'
+ * options['Display'] Display mode, 'None', 'Fixed', 'Dynamic'
* options['ErrorMessage'] Validation error message
* options['FocusOnError'] True to focus on validation error
* options['FocusElementID'] Element to focus on error
diff --git a/framework/Web/Javascripts/prado/controls.js b/framework/Web/Javascripts/prado/controls.js index 25e1315b..8595b5fd 100644 --- a/framework/Web/Javascripts/prado/controls.js +++ b/framework/Web/Javascripts/prado/controls.js @@ -220,6 +220,7 @@ Prado.WebUI.DefaultButton.prototype = if(defaultButton)
{
this.triggered = true;
+ $('PRADO_POSTBACK_TARGET').value = this.options.EventTarget;
Event.fireEvent(defaultButton, this.options['Event']);
Event.stop(ev);
}
diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js index f2b3cbb3..4e30b0b2 100644 --- a/framework/Web/Javascripts/prado/validation3.js +++ b/framework/Web/Javascripts/prado/validation3.js @@ -357,7 +357,7 @@ Prado.WebUI.TValidationSummary.prototype = * options['DisplayMode'] Summary display style, 'BulletList', 'List', 'SingleParagraph'
* options['Refresh'] True to update the summary upon validator state change.
* options['ValidationGroup'] Validation summary group
- * options['Display'] Display mode, 'None', 'Static', 'Dynamic'.
+ * options['Display'] Display mode, 'None', 'Fixed', 'Dynamic'.
* options['ScrollToSummary'] True to scroll to the validation summary upon refresh.
* </code>
*/
@@ -564,7 +564,7 @@ Prado.WebUI.TBaseValidator.prototype = * options['ID']* Validator ID, e.g. span with message
* options['FormID']* HTML form that the validator belongs
* options['ControlToValidate']*HTML form input to validate
- * options['Display'] Display mode, 'None', 'Static', 'Dynamic'
+ * options['Display'] Display mode, 'None', 'Fixed', 'Dynamic'
* options['ErrorMessage'] Validation error message
* options['FocusOnError'] True to focus on validation error
* options['FocusElementID'] Element to focus on error
|