summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/js/compressed/ajax.js
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/js/compressed/ajax.js')
-rw-r--r--framework/Web/Javascripts/js/compressed/ajax.js45
1 files changed, 34 insertions, 11 deletions
diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js
index 79ef1848..e620399f 100644
--- a/framework/Web/Javascripts/js/compressed/ajax.js
+++ b/framework/Web/Javascripts/js/compressed/ajax.js
@@ -214,7 +214,9 @@ this.editField=this.cached_selectTag;if(this.options.loadTextURL)this.loadExtern
{request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}});Prado.WebUI.TActiveButton=Class.extend(Prado.WebUI.CallbackControl);Prado.WebUI.TActiveLinkButton=Class.extend(Prado.WebUI.CallbackControl);Prado.WebUI.TActiveImageButton=Class.extend(Prado.WebUI.TImageButton,{onPostBack:function(event,options)
{this.addXYInput(event,options);request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}});Prado.WebUI.TActiveCheckBox=Class.extend(Prado.WebUI.CallbackControl,{onPostBack:function(event,options)
{request=new Prado.CallbackRequest(options.EventTarget,options);if(request.dispatch()==false)
-Event.stop(event);}});Prado.WebUI.TActiveRadioButton=Class.extend(Prado.WebUI.TActiveCheckBox);Prado.WebUI.TActiveTextBox=Class.extend(Prado.WebUI.TTextBox,{onInit:function(options)
+Event.stop(event);}});Prado.WebUI.TActiveRadioButton=Class.extend(Prado.WebUI.TActiveCheckBox);Prado.WebUI.TActiveCheckBoxList=Base.extend({constructor:function(options)
+{for(var i=0;i<options.ItemCount;i++)
+{var checkBoxOptions=Object.extend({ID:options.ListID+"_c"+i,EventTarget:options.ListName+"$c"+i},options);new Prado.WebUI.TActiveCheckBox(checkBoxOptions);}}});Prado.WebUI.TActiveRadioButtonList=Prado.WebUI.TActiveCheckBoxList;Prado.WebUI.TActiveTextBox=Class.extend(Prado.WebUI.TTextBox,{onInit:function(options)
{if(options['TextMode']!='MultiLine')
Event.observe(this.element,"keydown",this.handleReturnKey.bind(this));Event.observe(this.element,"change",this.doCallback.bindEvent(this,options));},doCallback:function(event,options)
{request=new Prado.CallbackRequest(options.EventTarget,options);request.dispatch();Event.stop(event);}});Prado.WebUI.TAutoComplete=Class.extend(Autocompleter.Base,Prado.WebUI.TActiveTextBox.prototype);Prado.WebUI.TAutoComplete=Class.extend(Prado.WebUI.TAutoComplete,{initialize:function(options)
@@ -228,18 +230,16 @@ this.onInit(options);},doCallback:function(event,options)
this.updateChoices(result);}});Prado.WebUI.TTimeTriggeredCallback=Base.extend({count:0,timeout:0,constructor:function(options)
{this.options=Object.extend({Interval:1,DecayRate:0},options||{})
this.onComplete=this.options.onComplete;Prado.WebUI.TTimeTriggeredCallback.register(this);},startTimer:function()
-{this.options.onComplete=this.onRequestComplete.bind(this);setTimeout(this.onTimerEvent.bind(this),200);},stopTimer:function()
+{this.options.onComplete=this.onRequestComplete.bind(this);this.timer=setTimeout(this.onTimerEvent.bind(this),200);},stopTimer:function()
{(this.onComplete||Prototype.emptyFunction).apply(this,arguments);this.options.onComplete=undefined;clearTimeout(this.timer);this.timer=undefined;this.count=0;},onTimerEvent:function()
{this.options.params=this.timeout/1000;request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.dispatch();},onRequestComplete:function()
{(this.onComplete||Prototype.emptyFunction).apply(this,arguments);this.timer=setTimeout(this.onTimerEvent.bind(this),this.getNewTimeout())},getNewTimeout:function()
{switch(this.options.DecayType)
{case'Exponential':t=(Math.exp(this.options.DecayRate*this.count*this.options.Interval))-1;break;case'Linear':t=this.options.DecayRate*this.count*this.options.Interval;break;case'Quadratic':t=this.options.DecayRate*this.count*this.count*this.options.Interval;break;case'Cubic':t=this.options.DecayRate*this.count*this.count*this.count*this.options.Interval;break;default:t=0;}
this.timeout=(t+this.options.Interval)*1000;this.count++;return parseInt(this.timeout);}},{timers:{},register:function(timer)
-{this.timers[timer.options.ID]=timer;},start:function(id)
-{if(this.timers[id])
-this.timers[id].startTimer();},stop:function(id)
-{if(this.timers[id])
-this.timers[id].stopTimer();}});Prado.WebUI.ActiveListControl=Base.extend({constructor:function(options)
+{Prado.WebUI.TTimeTriggeredCallback.timers[timer.options.ID]=timer;},start:function(id)
+{Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer();},stop:function(id)
+{Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer();}});Prado.WebUI.ActiveListControl=Base.extend({constructor:function(options)
{this.element=$(options.ID);this.options=options;Event.observe(this.element,"change",this.doCallback.bind(this));},doCallback:function(event)
{request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.dispatch();Event.stop(event);}});Prado.WebUI.TActiveDropDownList=Prado.WebUI.ActiveListControl;Prado.WebUI.TActiveListBox=Prado.WebUI.ActiveListControl;Prado.WebUI.TEventTriggeredCallback=Base.extend({constructor:function(options)
{this.options=options;element=$(options['ControlID']);if(element)
@@ -260,9 +260,8 @@ else
this.count=this.count+this.options.Decay;if(this.observing)
this.time=setTimeout(this.checkChanges.bind(this),parseInt(this.options.Interval*1000*this.count));}},doCallback:function(oldValue,newValue)
{request=new Prado.CallbackRequest(this.options.EventTarget,this.options);param={'OldValue':oldValue,'NewValue':newValue};request.setCallbackParameter(param);request.dispatch();}},{timers:{},register:function(timer)
-{this.timers[timer.options.ID]=timer;},stop:function(id)
-{if(this.timers[id])
-this.timers[id].stopObserving();}});Prado.WebUI.TInPlaceTextBox=Base.extend({isSaving:false,isEditing:false,editField:null,constructor:function(options)
+{Prado.WebUI.TValueTriggeredCallback.timers[timer.options.ID]=timer;},stop:function(id)
+{Prado.WebUI.TValueTriggeredCallback.timers[id].stopObserving();}});Prado.WebUI.TInPlaceTextBox=Base.extend({isSaving:false,isEditing:false,editField:null,constructor:function(options)
{this.options=Object.extend({LoadTextFromSource:false,TextMode:'SingleLine'},options||{});this.element=$(this.options.ID);this.initializeListeners();},initializeListeners:function()
{this.onclickListener=this.enterEditMode.bindAsEventListener(this);Event.observe(this.element,'click',this.onclickListener);if(this.options.ExternalControl)
Event.observe($(this.options.ExternalControl),'click',this.onclickListener);},enterEditMode:function(evt)
@@ -303,4 +302,28 @@ this.showLabel();}},onTextChanged:function(text)
{this.isSaving=false;this.isEditing=false;this.showLabel();},onTextChangedSuccess:function(sender,parameter)
{this.isSaving=false;this.isEditing=false;if(this.options.AutoHide)
this.showLabel();this.element.innerHTML=parameter==null?this.editField.value:parameter;this.editField.disabled=false;},onTextChangedFailure:function(sender,parameter)
-{this.editField.disabled=false;this.isSaving=false;this.isEditing=false;}}); \ No newline at end of file
+{this.editField.disabled=false;this.isSaving=false;this.isEditing=false;}});Prado.WebUI.TRatingList=Base.extend({selectedIndex:-1,enabled:true,constructor:function(options)
+{var cap=$(options.CaptionID);this.options=Object.extend({caption:cap?cap.innerHTML:''},options||{});Prado.WebUI.TRatingList.register(this);this._init();this.selectedIndex=options.SelectedIndex;this.setRating(this.selectedIndex);},_init:function(options)
+{Element.addClassName($(this.options.ListID),this.options.Style);var radios=document.getElementsByName(this.options.ListName);this.radios=new Array();var index=0;for(var i=0;i<radios.length;i++)
+{var node=radios[i].parentNode;if(node.tagName.toLowerCase()=='td')
+{this.radios.push(radios[i]);Event.observe(node,"mouseover",this.hover.bindEvent(this,index));Event.observe(node,"mouseout",this.recover.bindEvent(this,index));Event.observe(node,"click",this.click.bindEvent(this,index));index++;Element.addClassName(node,"rating");}}},hover:function(ev,index)
+{if(this.enabled==false)return;for(var i=0;i<this.radios.length;i++)
+{var action=i<=index?'addClassName':'removeClassName'
+Element[action](this.radios[i].parentNode,"rating_hover");}
+this.setCaption(index);},recover:function(ev,index)
+{if(this.enabled==false)return;for(var i=0;i<=index;i++)
+Element.removeClassName(this.radios[i].parentNode,"rating_hover");this.setRating(this.selectedIndex);},click:function(ev,index)
+{if(this.enabled==false)return;for(var i=0;i<this.radios.length;i++)
+this.radios[i].checked=(i==index);this.selectedIndex=index;this.setRating(index);var requestOptions=Object.extend({ID:this.options.ListID+"_c"+index,EventTarget:this.options.ListName+"$c"+index},this.options);var request=new Prado.CallbackRequest(requestOptions.EventTarget,requestOptions);if(request.dispatch()==false)
+Event.stop(ev);},setRating:function(index)
+{for(var i=0;i<this.radios.length;i++)
+{var action=i<=index?'addClassName':'removeClassName'
+Element[action](this.radios[i].parentNode,"rating_selected");}
+this.setCaption(index);},setCaption:function(index)
+{var value=index>-1?this.radios[index].value:this.options.caption;var caption=$(this.options.CaptionID);if(caption)caption.innerHTML=value;$(this.options.ListName).title=value;},setEnabled:function(value)
+{this.enabled=value;for(var i=0;i<this.radios.length;i++)
+{var action=value?'removeClassName':'addClassName'
+Element[action](this.radios[i].parentNode,"rating_disabled");Element.removeClassName(this.radios[i].parentNode,"rating_hover");}}},{ratings:{},register:function(rating)
+{Prado.WebUI.TRatingList.ratings[rating.options.ListID]=rating;},setEnabled:function(id,value)
+{Prado.WebUI.TRatingList.ratings[id].setEnabled(value);},setRating:function(id,value)
+{Prado.WebUI.TRatingList.ratings[id].setRating(value);Prado.WebUI.TRatingList.ratings[id].selectedIndex=value;}}); \ No newline at end of file