summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/source/prado/controls
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Web/Javascripts/source/prado/controls')
-rw-r--r--framework/Web/Javascripts/source/prado/controls/controls.js32
-rw-r--r--framework/Web/Javascripts/source/prado/controls/htmlarea.js18
-rw-r--r--framework/Web/Javascripts/source/prado/controls/htmlarea4.js10
-rw-r--r--framework/Web/Javascripts/source/prado/controls/slider.js84
-rw-r--r--framework/Web/Javascripts/source/prado/controls/tabpanel.js6
5 files changed, 75 insertions, 75 deletions
diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js
index 0f0b01f4..fa01e2e2 100644
--- a/framework/Web/Javascripts/source/prado/controls/controls.js
+++ b/framework/Web/Javascripts/source/prado/controls/controls.js
@@ -60,11 +60,11 @@ Prado.WebUI.Control = jQuery.klass({
// from the old wrapper to this new one (which then could live on, while the old
// one could get destroyed), or to copy the new, changed options to the old wrapper,
// (which could then left intact to keep working, while this new wrapper could be
- // disposed of by exiting its initialization without installing any handlers or
+ // disposed of by exiting its initialization without installing any handlers or
// leaving any references to it)
//
- // for now this method is simply deinitializing and deregistering the old wrapper,
+ // for now this method is simply deinitializing and deregistering the old wrapper,
// and then registering the new wrapper for the control id
if (oldwrapper.deinitialize)
@@ -74,7 +74,7 @@ Prado.WebUI.Control = jQuery.klass({
},
/**
- * Registers an event observer which will be automatically disposed of when the wrapper
+ * Registers an event observer which will be automatically disposed of when the wrapper
* is deregistered
* @param element DOM element reference or id to attach the event handler to
* @param string event name to observe
@@ -99,7 +99,7 @@ Prado.WebUI.Control = jQuery.klass({
var e = { _element: element, _eventName: eventName, _handler: handler };
var idx = -1;
for(var i=0;i<this.observers.length;i++)
- {
+ {
var o = this.observers[i];
if ((o._element===element) && (o._eventName===eventName) && (o._handler===handler))
{
@@ -109,7 +109,7 @@ Prado.WebUI.Control = jQuery.klass({
}
return idx;
},
-
+
/**
* Degisters an event observer from the list of automatically disposed handlers
@@ -133,11 +133,11 @@ Prado.WebUI.Control = jQuery.klass({
* wrapper hasn't been destroyed in the meantime
* @param code function or code snippet to execute
* @param int number of milliseconds to wait before executing
- * @return int unique ID that can be used to cancel the scheduled execution
+ * @return int unique ID that can be used to cancel the scheduled execution
*/
setTimeout: function(func, delay)
{
- if (!jQuery.isFunction(func))
+ if (!jQuery.isFunction(func))
{
var expr = func;
func = function() { return eval(expr); }
@@ -209,11 +209,11 @@ Prado.WebUI.Control = jQuery.klass({
this.onDone();
// automatically stop all intervals
- while (this.intervals.length>0)
+ while (this.intervals.length>0)
window.clearInterval(this.intervals.pop());
// automatically deregister all installed observers
- while (this.observers.length>0)
+ while (this.observers.length>0)
{
var e = this.observers.pop();
jQuery(e._element).unbind(e._eventName, e._handler);
@@ -235,7 +235,7 @@ Prado.WebUI.PostBackControl = jQuery.klass(Prado.WebUI.Control, {
{
this._elementOnClick = null;
- if (!this.element)
+ if (!this.element)
debugger; // element not found
else
{
@@ -284,7 +284,7 @@ Prado.WebUI.TImageMap = jQuery.klass(Prado.WebUI.PostBackControl);
* TImageButton client-side behaviour. With validation, Firefox needs
* to capture the x,y point of the clicked image in hidden form fields.
*/
-Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl,
+Prado.WebUI.TImageButton = jQuery.klass(Prado.WebUI.PostBackControl,
{
/**
* Override parent onPostBack function, tried to add hidden forms
@@ -351,7 +351,7 @@ Prado.WebUI.TRadioButton = jQuery.klass(Prado.WebUI.PostBackControl,
{
initialize : function($super, options)
{
- this.element = $("#" + options['ID']).get(0);
+ this.element = jQuery("#" + options['ID']).get(0);
if(this.element)
{
if(!this.element.checked)
@@ -386,14 +386,14 @@ Prado.WebUI.TTextBox = jQuery.klass(Prado.WebUI.PostBackControl,
{
if(this.options['AutoPostBack']==true)
{
- $(target).trigger( "change" );
+ jQuery(target).trigger( "change" );
e.stopPropagation();
}
else
{
if(this.options['CausesValidation'] && typeof(Prado.Validation) != "undefined")
{
- if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], $(this.options['ID'])))
+ if(!Prado.Validation.validate(this.options['FormID'], this.options['ValidationGroup'], jQuery(this.options['ID'])))
return e.stopPropagation();
}
}
@@ -432,10 +432,10 @@ Prado.WebUI.DefaultButton = jQuery.klass(Prado.WebUI.Control,
var isTextArea = ev.target.tagName.toLowerCase() == "textarea";
var isHyperLink = ev.target.tagName.toLowerCase() == "a" && ev.target.hasAttribute("href");
var isValidButton = ev.target.tagName.toLowerCase() == "input" && ev.target.type.toLowerCase() == "submit";
-
+
if(enterPressed && !isTextArea && !isValidButton && !isHyperLink)
{
- var defaultButton = $('#'+this.options['Target']);
+ var defaultButton = jQuery('#'+this.options['Target']);
if(defaultButton)
{
this.triggered = true;
diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea.js b/framework/Web/Javascripts/source/prado/controls/htmlarea.js
index 819e853c..7bf820ab 100644
--- a/framework/Web/Javascripts/source/prado/controls/htmlarea.js
+++ b/framework/Web/Javascripts/source/prado/controls/htmlarea.js
@@ -1,6 +1,6 @@
/*
- *
+ *
* HtmlArea (tinyMCE) wrapper
*
* @author Gabor Berczi <gabor.berczi@devworx.hu>
@@ -24,7 +24,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control,
this.registerInstance();
},
-
+
registerInstance: function()
@@ -38,7 +38,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control,
{
// we're in a callback
// try it again in some time, as tinyMCE is most likely still loading
- this.setTimeout(this.registerInstance.bind(this), 50);
+ this.setTimeout(this.registerInstance.bind(this), 50);
return;
}
throw "TinyMCE libraries must be loaded first";
@@ -62,7 +62,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control,
}
}
},
-
+
compressedScriptsLoaded: function()
{
Prado.WebUI.THtmlArea.tinyMCELoadState = 255;
@@ -119,14 +119,14 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control,
if (prev)
try
{
- tinyMCE.execCommand('mceFocus', false, this.ID);
+ tinyMCE.execCommand('mceFocus', false, this.ID);
// when removed, tinyMCE restores its content to the textarea. If the textarea content has been
// updated in this same callback, it will be overwritten with the old content. Workaround this.
- var curtext = $('#'+this.ID).get(0).value;
+ var curtext = jQuery('#'+this.ID).get(0).value;
tinyMCE.execCommand('mceRemoveControl', false, this.ID);
- $('#'+this.ID).get(0).value = curtext;
+ jQuery('#'+this.ID).get(0).value = curtext;
}
- catch (e)
+ catch (e)
{
// suppress error here in case editor can't be properly removed
// (happens when <textarea> has been removed from DOM tree without deinitialzing the tinyMCE editor first)
@@ -139,7 +139,7 @@ Prado.WebUI.THtmlArea = jQuery.klass(Prado.WebUI.Control,
}
});
-jQuery.extend(Prado.WebUI.THtmlArea,
+jQuery.extend(Prado.WebUI.THtmlArea,
{
pendingRegistrations : [],
tinyMCELoadState : 0
diff --git a/framework/Web/Javascripts/source/prado/controls/htmlarea4.js b/framework/Web/Javascripts/source/prado/controls/htmlarea4.js
index 418a6e19..64a78176 100644
--- a/framework/Web/Javascripts/source/prado/controls/htmlarea4.js
+++ b/framework/Web/Javascripts/source/prado/controls/htmlarea4.js
@@ -1,6 +1,6 @@
/*
- *
+ *
* HtmlArea (tinyMCE 4) wrapper
*
* @author Gabor Berczi <gabor.berczi@devworx.hu>
@@ -39,14 +39,14 @@ Prado.WebUI.THtmlArea4 = jQuery.klass(Prado.WebUI.Control,
if (prev)
try
{
- tinyMCE.execCommand('mceFocus', false, this.ID);
+ tinyMCE.execCommand('mceFocus', false, this.ID);
// when removed, tinyMCE restores its content to the textarea. If the textarea content has been
// updated in this same callback, it will be overwritten with the old content. Workaround this.
- // var curtext = $(this.ID).html();
+ // var curtext = jQuery(this.ID).html();
tinyMCE.execCommand('mceRemoveControl', false, this.ID);
- // $(this.ID).html(curtext);
+ // jQuery(this.ID).html(curtext);
}
- catch (e)
+ catch (e)
{
// suppress error here in case editor can't be properly removed
// (happens when <textarea> has been removed from DOM tree without deinitialzing the tinyMCE editor first)
diff --git a/framework/Web/Javascripts/source/prado/controls/slider.js b/framework/Web/Javascripts/source/prado/controls/slider.js
index 28d7d4ac..e18fde84 100644
--- a/framework/Web/Javascripts/source/prado/controls/slider.js
+++ b/framework/Web/Javascripts/source/prado/controls/slider.js
@@ -9,33 +9,33 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
{
var slider = this;
this.options=options || {};
- this.track = $('#'+options.ID+'_track').get(0);
- this.handle =$('#'+options.ID+'_handle').get(0);
- this.progress = $('#'+options.ID+'_progress').get(0);
+ this.track = jQuery('#'+options.ID+'_track').get(0);
+ this.handle =jQuery('#'+options.ID+'_handle').get(0);
+ this.progress = jQuery('#'+options.ID+'_progress').get(0);
this.axis = this.options.axis || 'horizontal';
this.range = this.options.range || [0, 1];
this.value = 0;
this.maximum = this.options.maximum || this.range[1];
this.minimum = this.options.minimum || this.range[0];
- this.hiddenField=$('#'+this.options.ID+'_1').get(0);
-
+ this.hiddenField=jQuery('#'+this.options.ID+'_1').get(0);
+
// Will be used to align the handle onto the track, if necessary
this.alignX = parseInt(this.options.alignX || - this.track.offsetLeft);
this.alignY = parseInt(this.options.alignY || - this.track.offsetTop);
-
+
this.trackLength = this.maximumOffset() - this.minimumOffset();
- this.handleLength = this.isVertical() ?
- (this.handle.offsetHeight != 0 ?
- this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) :
- (this.handle.offsetWidth != 0 ? this.handle.offsetWidth :
+ this.handleLength = this.isVertical() ?
+ (this.handle.offsetHeight != 0 ?
+ this.handle.offsetHeight : this.handles.style.height.replace(/px$/,"")) :
+ (this.handle.offsetWidth != 0 ? this.handle.offsetWidth :
this.handle.style.width.replace(/px$/,""));
-
+
this.active = false;
this.dragging = false;
this.disabled = false;
if(this.options.disabled) this.setDisabled();
-
+
// Allowed values array
this.allowedValues = this.options.values ? this.options.values.sort() : false;
if(this.allowedValues) {
@@ -50,15 +50,15 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
// Initialize handle
this.setValue(parseFloat(slider.options.sliderValue));
this.observe (this.handle, "mousedown", this.eventMouseDown);
-
+
this.observe (this.track, "mousedown", this.eventMouseDown);
if (this.progress) this.observe (this.progress, "mousedown", this.eventMouseDown);
-
+
this.observe (document, "mouseup", this.eventMouseUp);
this.observe (document, "mousemove", this.eventMouseMove);
-
+
this.initialized=true;
-
+
if(this.options['AutoPostBack']==true)
this.observe(this.hiddenField, "change", jQuery.proxy(this.doPostback,this,options));
},
@@ -67,20 +67,20 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
{
new Prado.PostBack(options, event);
},
-
+
setDisabled: function(){
this.disabled = true;
},
setEnabled: function(){
this.disabled = false;
- },
+ },
getNearestValue: function(value){
if(this.allowedValues){
var max = Math.max.apply( Math, this.allowedValues );
var min = Math.min.apply( Math, this.allowedValues );
if(value >= max) return(max);
if(value <= min) return(min);
-
+
var offset = Math.abs(this.allowedValues[0] - value);
var newValue = this.allowedValues[0];
jQuery.each(this.allowedValues, function(idx, v) {
@@ -88,7 +88,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
if(currentOffset <= offset){
newValue = v;
offset = currentOffset;
- }
+ }
});
return newValue;
}
@@ -96,7 +96,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
if(value < this.range[0]) return this.range[0];
return value;
},
-
+
setValue: function(sliderValue){
if(!this.active) {
this.updateStyles();
@@ -106,47 +106,47 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
this.handle.style[this.isVertical() ? 'top' : 'left'] = pixelValue;
if (this.progress)
this.progress.style[this.isVertical() ? 'height' : 'width'] = pixelValue;
-
+
//this.drawSpans();
if(!this.dragging || !this.event) this.updateFinished();
},
-
+
setValueBy: function(delta) {
this.setValue(this.value + delta);
},
-
+
translateToPx: function(value) {
return Math.round(
((this.trackLength-this.handleLength)/(this.range[1]-this.range[0])) * (value - this.range[0])) + "px";
},
-
+
translateToValue: function(offset) {
return ((offset/(this.trackLength-this.handleLength) * (this.range[1]-this.range[0])) + this.range[0]);
},
-
+
minimumOffset: function(){
return(this.isVertical() ? this.alignY : this.alignX);
},
-
+
maximumOffset: function(){
- return(this.isVertical() ?
+ return(this.isVertical() ?
(this.track.offsetHeight != 0 ? this.track.offsetHeight :
- this.track.style.height.replace(/px$/,"")) - this.alignY :
- (this.track.offsetWidth != 0 ? this.track.offsetWidth :
+ this.track.style.height.replace(/px$/,"")) - this.alignY :
+ (this.track.offsetWidth != 0 ? this.track.offsetWidth :
this.track.style.width.replace(/px$/,"")) - this.alignX);
},
-
+
isVertical: function(){
return (this.axis == 'vertical');
},
-
+
updateStyles: function() {
- if (this.active)
+ if (this.active)
jQuery(this.handle).addClass('selected');
else
jQuery(this.handle).removeClass('selected');
},
-
+
startDrag: function(event) {
if (event.which === 1) {
// left click
@@ -158,7 +158,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
if(track==this.track) {
var offsets = jQuery(this.track).offset();
this.event = event;
- this.setValue(this.translateToValue(
+ this.setValue(this.translateToValue(
(this.isVertical() ? pointer[1]-offsets['top'] : pointer[0]-offsets['left'])-(this.handleLength/2)
));
var offsets = jQuery(this.handle).offset();
@@ -174,7 +174,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
event.stopPropagation();
}
},
-
+
update: function(event) {
if(this.active) {
if(!this.dragging) this.dragging = true;
@@ -182,7 +182,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
event.stopPropagation();
}
},
-
+
draw: function(event) {
var pointer = [event.pageX, event.pageY];
var offsets = jQuery(this.track).offset();
@@ -193,7 +193,7 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
if(this.initialized && this.options.onSlide)
this.options.onSlide(this.value, this);
},
-
+
endDrag: function(event) {
if(this.active && this.dragging) {
this.finishDrag(event, true);
@@ -201,18 +201,18 @@ Prado.WebUI.TSlider = jQuery.klass(Prado.WebUI.PostBackControl,
}
this.active = false;
this.dragging = false;
- },
-
+ },
+
finishDrag: function(event, success) {
this.active = false;
this.dragging = false;
this.updateFinished();
},
-
+
updateFinished: function() {
this.hiddenField.value=this.value;
this.updateStyles();
- if(this.initialized && this.options.onChange)
+ if(this.initialized && this.options.onChange)
this.options.onChange(this.value, this);
this.event = null;
if (this.options['AutoPostBack']==true)
diff --git a/framework/Web/Javascripts/source/prado/controls/tabpanel.js b/framework/Web/Javascripts/source/prado/controls/tabpanel.js
index 78f6478c..866e45fb 100644
--- a/framework/Web/Javascripts/source/prado/controls/tabpanel.js
+++ b/framework/Web/Javascripts/source/prado/controls/tabpanel.js
@@ -4,7 +4,7 @@ Prado.WebUI.TTabPanel = jQuery.klass(Prado.WebUI.Control,
{
this.views = options.Views;
this.viewsvis = options.ViewsVis;
- this.hiddenField = $("#"+options.ID+'_1').get(0);
+ this.hiddenField = jQuery("#"+options.ID+'_1').get(0);
this.activeCssClass = options.ActiveCssClass;
this.normalCssClass = options.NormalCssClass;
var length = options.Views.length;
@@ -18,10 +18,10 @@ Prado.WebUI.TTabPanel = jQuery.klass(Prado.WebUI.Control,
if (options.AutoSwitch)
this.observe(element, "mouseenter", jQuery.proxy(this.elementClicked,this,item));
}
-
+
if(element)
{
- var view = $("#"+options.Views[i]).get(0);
+ var view = jQuery("#"+options.Views[i]).get(0);
if (view)
if(this.hiddenField.value == i)
{