summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--buildscripts/jsbuilder/build.php3
-rw-r--r--framework/Web/Javascripts/extended/effects.js7
-rw-r--r--framework/Web/Javascripts/js/compressed/effects.js3
-rw-r--r--framework/Web/Javascripts/js/debug/effects.js8
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackClientScript.php4
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page2
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php1
8 files changed, 24 insertions, 5 deletions
diff --git a/.gitattributes b/.gitattributes
index 24aa6eb6..a04e48b2 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1691,6 +1691,7 @@ framework/Web/Javascripts/effects/slider.js -text
framework/Web/Javascripts/extended/base.js -text
framework/Web/Javascripts/extended/builder.js -text
framework/Web/Javascripts/extended/date.js -text
+framework/Web/Javascripts/extended/effects.js -text
framework/Web/Javascripts/extended/event.js -text
framework/Web/Javascripts/extended/string.js -text
framework/Web/Javascripts/extra/json.js -text
diff --git a/buildscripts/jsbuilder/build.php b/buildscripts/jsbuilder/build.php
index e364a4d6..dbfb169f 100644
--- a/buildscripts/jsbuilder/build.php
+++ b/buildscripts/jsbuilder/build.php
@@ -95,7 +95,8 @@ $libraries = array(
//effects
'effects.js' => array(
- 'effects/effects.js'
+ 'effects/effects.js',
+ 'extended/effects.js'
),
//active controls
'ajax.js' => array(
diff --git a/framework/Web/Javascripts/extended/effects.js b/framework/Web/Javascripts/extended/effects.js
new file mode 100644
index 00000000..236686df
--- /dev/null
+++ b/framework/Web/Javascripts/extended/effects.js
@@ -0,0 +1,7 @@
+Prado.Effect =
+{
+ Highlight : function(element, options)
+ {
+ new Effect.Highlight(element,options||{});
+ }
+} \ No newline at end of file
diff --git a/framework/Web/Javascripts/js/compressed/effects.js b/framework/Web/Javascripts/js/compressed/effects.js
index 8870d77f..1a2915e6 100644
--- a/framework/Web/Javascripts/js/compressed/effects.js
+++ b/framework/Web/Javascripts/js/compressed/effects.js
@@ -63,4 +63,5 @@ return new Effect.Move(element,{x:initialMoveX,y:initialMoveY,duration:0.01,befo
Effect.Shrink=function(element){element=$(element);var options=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var oldStyle={top:element.style.top,left:element.style.left,height:element.style.height,width:element.style.width,opacity:element.getInlineOpacity()};var dims=element.getDimensions();var moveX,moveY;switch(options.direction){case'top-left':moveX=moveY=0;break;case'top-right':moveX=dims.width;moveY=0;break;case'bottom-left':moveX=0;moveY=dims.height;break;case'bottom-right':moveX=dims.width;moveY=dims.height;break;case'center':moveX=dims.width/2;moveY=dims.height/2;break;}
return new Effect.Parallel([new Effect.Opacity(element,{sync:true,to:0.0,from:1.0,transition:options.opacityTransition}),new Effect.Scale(element,window.opera?1:0,{sync:true,transition:options.scaleTransition,restoreAfterFinish:true}),new Effect.Move(element,{x:moveX,y:moveY,sync:true,transition:options.moveTransition})],Object.extend({beforeStartInternal:function(effect){effect.effects[0].element.makePositioned();effect.effects[0].element.makeClipping();},afterFinishInternal:function(effect){effect.effects[0].element.hide();effect.effects[0].element.undoClipping();effect.effects[0].element.undoPositioned();effect.effects[0].element.setStyle(oldStyle);}},options));}
Effect.Pulsate=function(element){element=$(element);var options=arguments[1]||{};var oldOpacity=element.getInlineOpacity();var transition=options.transition||Effect.Transitions.sinoidal;var reverser=function(pos){return transition(1-Effect.Transitions.pulse(pos))};reverser.bind(transition);return new Effect.Opacity(element,Object.extend(Object.extend({duration:3.0,from:0,afterFinishInternal:function(effect){effect.element.setStyle({opacity:oldOpacity});}},options),{transition:reverser}));}
-Effect.Fold=function(element){element=$(element);var oldStyle={top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};Element.makeClipping(element);return new Effect.Scale(element,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(effect){new Effect.Scale(element,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(effect){effect.element.hide();effect.element.undoClipping();effect.element.setStyle(oldStyle);}});}},arguments[1]||{}));};['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom','collectTextNodes','collectTextNodesIgnoreClass','childrenWithClassName'].each(function(f){Element.Methods[f]=Element[f];});Element.Methods.visualEffect=function(element,effect,options){s=effect.gsub(/_/,'-').camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](element,options);return $(element);};Element.addMethods(); \ No newline at end of file
+Effect.Fold=function(element){element=$(element);var oldStyle={top:element.style.top,left:element.style.left,width:element.style.width,height:element.style.height};Element.makeClipping(element);return new Effect.Scale(element,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(effect){new Effect.Scale(element,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(effect){effect.element.hide();effect.element.undoClipping();effect.element.setStyle(oldStyle);}});}},arguments[1]||{}));};['setOpacity','getOpacity','getInlineOpacity','forceRerendering','setContentZoom','collectTextNodes','collectTextNodesIgnoreClass','childrenWithClassName'].each(function(f){Element.Methods[f]=Element[f];});Element.Methods.visualEffect=function(element,effect,options){s=effect.gsub(/_/,'-').camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new Effect[effect_class](element,options);return $(element);};Element.addMethods();Prado.Effect={Highlight:function(element,options)
+{new Effect.Highlight(element,options||{});}} \ No newline at end of file
diff --git a/framework/Web/Javascripts/js/debug/effects.js b/framework/Web/Javascripts/js/debug/effects.js
index 7e8ba2ed..c0f3c4af 100644
--- a/framework/Web/Javascripts/js/debug/effects.js
+++ b/framework/Web/Javascripts/js/debug/effects.js
@@ -958,3 +958,11 @@ Element.Methods.visualEffect = function(element, effect, options) {
Element.addMethods();
+Prado.Effect =
+{
+ Highlight : function(element, options)
+ {
+ new Effect.Highlight(element,options||{});
+ }
+}
+
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php
index ebc5942f..4b568987 100644
--- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php
+++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php
@@ -417,7 +417,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function visualEffect($type, $element, $options=null)
{
- $this->callClientFunction($type, is_array($options) ? array($element, $options) : $element);
+ $this->callClientFunction($type, array($element, $options));
}
/**
@@ -578,7 +578,7 @@ class TCallbackClientScript extends TApplicationComponent
*/
public function highlight($element, $options=null)
{
- $this->visualEffect('Effect.Highlight', $element, $options);
+ $this->visualEffect('Prado.Effect.Highlight', $element, $options);
}
}
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
index 6dd58d48..09ab2fbc 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page
@@ -1,6 +1,6 @@
<com:TForm>
- <h1>PostLoading Test</h1>
+ <h1 id="heading">PostLoading Test</h1>
<com:TCallback ID="callback1" OnCallback="Page.callback1_requested" />
<com:TActivePanel ID="panel1" />
diff --git a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php
index a8c409e7..1257b45b 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.php
@@ -38,6 +38,7 @@ class PostLoadingTest extends TPage
{
$this->panel1->getControls()->add('Result is '.$this->MyTextBox->getText());
$this->panel1->render($param->NewWriter);
+ $this->Page->CallbackClient->Highlight('heading');
}
}