incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r483080 - in /incubator/xap/trunk/src/xap: bridges/ext/effectsBridge.js bridges/ext/effectsPane.js taghandling/plugin.xml
Date Wed, 06 Dec 2006 13:52:26 GMT
Author: mturyn
Date: Wed Dec  6 05:52:24 2006
New Revision: 483080

URL: http://svn.apache.org/viewvc?view=rev&rev=483080
Log:
>From Rob Gagne

renaming transitionPanel to effectsPane

Added:
    incubator/xap/trunk/src/xap/bridges/ext/effectsBridge.js
    incubator/xap/trunk/src/xap/bridges/ext/effectsPane.js
Modified:
    incubator/xap/trunk/src/xap/taghandling/plugin.xml

Added: incubator/xap/trunk/src/xap/bridges/ext/effectsBridge.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/ext/effectsBridge.js?view=auto&rev=483080
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/ext/effectsBridge.js (added)
+++ incubator/xap/trunk/src/xap/bridges/ext/effectsBridge.js Wed Dec  6 05:52:24 2006
@@ -0,0 +1,117 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+ 
+ /**
+ * @fileoverview
+ * @author Rob Gagne
+ *
+ * A bridge class that provides animations effects
+ */
+
+/*
+ * this library requires Scriptaculous to be loaded
+ *
+ */
+
+Xap.provide("xap.bridges.ext.effectsBridge"); 
+
+Xap.require("xap.bridges.dojo.DojoWidgetBridge");
+Xap.require("xap.bridges.ext.effectsPane"); 
+Xap.require("dojo.style"); 
+
+xap.bridges.ext.effectsBridge.loaded = false;
+
+xap.bridges.ext.effectsBridge= function() { 
+	this._duration = 1;	
+	xap.bridges.dojo.DojoWidgetBridge.call(this);
+}
+
+Xap.setupClassAsSubclassOf(
+	"xap.bridges.ext.effectsBridge",
+	"xap.bridges.dojo.DojoWidgetBridge"						
+);
+
+xap.bridges.ext.effectsBridge.prototype.getPeerString = function(){
+	/*
+	require does not work since the objects are not in a class; this also does not work
+	if ( !xap.bridges.ext.effectsBridge.loaded ){
+		libPath = this.getSession().getApplication().getConfiguration().srcPath + "src/xap/bridges/ext/lib/";
+		document.write('<script type="text/javascript" src="'+libPath+'prototype.js"></script>');
+		document.write('<script type="text/javascript" src="'+libPath+'scriptaculous.js?load=effects"></script>');
+		xap.bridges.ext.effectsBridge.loaded = true;
+	}
+	*/
+	return "effectsPane" ;
+}
+ 
+/**
+ * Attribute definitions
+ */ 
+ 
+xap.bridges.ext.effectsBridge.prototype.getNewAllowedAttributes = function(){
+	return ["toggle", "effect",  "duration", "visible"];
+}	
+
+/** XML attribute set method for "toggle" */
+xap.bridges.ext.effectsBridge.prototype.setToggleAttribute = function(value){
+	var node = this.getPeer().domNode;
+	if ( !node ) return;
+	node.style.visibility = 'visible';
+	new Effect.toggle (node, value, {duration: this._duration});
+}
+
+xap.bridges.ext.effectsBridge.prototype.setEffectAttribute = function(value){
+	var node = this.getPeer().domNode;
+	var dur = this._duration;
+	if ( !node ) return;
+	node.style.visibility = 'visible';
+	
+	if ( value == 'blinddown' ) new Effect.BlindDown (node, {duration: dur});
+	if ( value == 'appear' ) new Effect.Appear (node, {duration: dur});
+	if ( value == 'blindup' ) new Effect.BlindUp (node, {duration: dur});
+	if ( value == 'fade' ) new Effect.Fade (node, {duration: dur});
+	if ( value == 'highlight' ) new Effect.Highlight (node, {duration: dur} );
+	
+}
+
+/** XML attribute set method for "visible" */
+xap.bridges.ext.effectsBridge.prototype.setVisibleAttribute = function(value){
+	var node = this.getPeer().domNode;
+	var duration = this._duration;
+	if ( !node ) return;
+	if ( value == 'true' ) {
+		node.style.display = 'block';
+		node.style.visibility = 'visible';
+	}
+	else if ( value == 'false' ) {
+		node.style.display = 'none';
+		new Effect.BlindUp (node, {duration: '0', fps: '0'});
+	}
+}
+
+/** XML attribute set method for "duration" */
+xap.bridges.ext.effectsBridge.prototype.setDurationAttribute = function(value){
+	this._duration = value;
+} 
+
+xap.bridges.ext.effectsBridge.prototype.addChild = function(childHandler, index) {
+	var childPeer = this.getDojoWidgetPeer(childHandler);
+	if (childPeer) {
+		this.getPeer().addChild(childPeer, null, 'insertAtIndex', null, index);
+	}
+}
+ 
\ No newline at end of file

Added: incubator/xap/trunk/src/xap/bridges/ext/effectsPane.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/bridges/ext/effectsPane.js?view=auto&rev=483080
==============================================================================
--- incubator/xap/trunk/src/xap/bridges/ext/effectsPane.js (added)
+++ incubator/xap/trunk/src/xap/bridges/ext/effectsPane.js Wed Dec  6 05:52:24 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright  2006 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+ 
+ /**
+ * @fileoverview
+ * @author Rob Gagne
+ *
+ * A pane class that provides animations effects
+ */
+
+Xap.provide("xap.bridges.ext.effectsPane");
+
+dojo.require("dojo.widget.*");
+dojo.require("dojo.widget.HtmlWidget");
+dojo.require("dojo.dom");
+dojo.require("dojo.html");
+dojo.require("dojo.style");
+dojo.require("dojo.event");
+
+dojo.widget.manager.registerWidgetPackage("xap.bridges.ext");
+dojo.widget.tags.addParseTreeHandler("dojo:effectsPane");
+
+xap.bridges.ext.effectsPane = function(){
+	dojo.widget.HtmlWidget.call(this);
+}
+dojo.inherits(xap.bridges.ext.effectsPane, dojo.widget.HtmlWidget);
+
+dojo.lang.extend(xap.bridges.ext.effectsPane, {	
+	templateString: '<div style="overflow:hidden; visibility: hidden;">' 
+		+ '<div dojoAttachPoint="containerNode" style="width: 100%; height: 100%; position:relative;
overflow:hidden"/></div>',
+	templateCssPath: null ,
+	widgetType: "effectsPane",
+	isContainer: true,
+	
+	addChild: function(child, overrideContainerNode, pos, ref, insertIndex){
+		xap.bridges.ext.effectsPane.superclass.addChild.call(this,child, overrideContainerNode,
pos, ref, insertIndex);
+	}
+}
+);
+
+

Modified: incubator/xap/trunk/src/xap/taghandling/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/taghandling/plugin.xml?view=diff&rev=483080&r1=483079&r2=483080
==============================================================================
--- incubator/xap/trunk/src/xap/taghandling/plugin.xml (original)
+++ incubator/xap/trunk/src/xap/taghandling/plugin.xml Wed Dec  6 05:52:24 2006
@@ -216,6 +216,6 @@
 	<tag-mappings namespace="http://openxal.org/ext" document="ui">	
 		<mapping class="xap.bridges.ext.helloWorldBridge" name="helloWorld"/>
 		<mapping class="xap.bridges.ext.htmlPaneBridge" name="htmlPane"/>
-		<mapping class="xap.bridges.ext.transitionBridge" name="transition"/>
+		<mapping class="xap.bridges.ext.effectsBridge" name="effectsPane"/>
 	</tag-mappings>	
 </plugin>



Mime
View raw message