• Register
  • Log In
  • Home
  • Quick Start
    • Configurator
    • Download YUI 3
  • Documentation
    • User Guides
    • Examples
    • API Docs
    • Environments
    • Tutorials
  • Community
    • Gallery
    • Blog
    • Forums
    • YUI Theater
    • Calendar
  • Contribute
    • YUI on GitHub »
    • File a Ticket
    • View Tickets
    • Dashboard
  • Other Projects
    • Shifter »
    • Yogi »
    • YUI 2
    • YUI Doc »
    • YUI Test
    • YUI Website
    • YUI Compressor »
    • YUI Builder »
    • YUI PHP Loader
    • Grid Builder »
    • Skin Builder »
  • YUI
  • >
  • Community
  • >
  • Gallery

Gallery

Modules

  • Home
  • Featured
  • Popular
  • New
  • All

Documentation

  • Yogi Documentation
  • Shifter Documentation
  • Developer Guide
  • Module Setup

Tag Cloud

Context Navigation

    Build Tag: gallery-2010.09.29-18-36

    Return to Raphael

    YUI({gallery: 'gallery-2010.09.22-20-15'}).use('gallery-raphael', function(Y) {
     
    	var log = Y.one('#log');
    	function alert(s) {
    		log.set('innerHTML', s);
    	}
     
    	var plugins = [
    		'r-test-plugin-canvas.js',
    		'r-test-plugin-element.js'
    	];
     
    	Y.Raphael({type:'raw'}).use(plugins, function(Raphael) {
     
    		// use Raphael just like normal
    		var paper = Raphael('rcanvas', 600, 800),
    			rect, circ, ellipse, img, group, redText;
     
    		paper.setSize(600, 799);
     
    		// create SVG objects normally as well
    		rect = paper.rect(0,0,100,200);
    		rect.attr({fill: 'cyan', stroke: '#000', 'stroke-width': 1});
     
    		circ = paper.circle(200, 200, 80);
    		circ.attr({fill: 'red', stroke: '#333', 'stroke-width': 5});
     
    		ellipse = paper.ellipse(20, 40, 400, 30);
    		ellipse.attr({fill: 'yellow'});
    		ellipse.$node.on('mouseover', function() {
    			rect.animate({
    			    "20%": {cx: 20, r: 20, easing: ">"},
    			    "50%": {cx: 70, r: 120},
    			    "100%": {cx: 10, r: 10}
    			}, 2000);
    		});
     
    		img = paper.image('images/gi_christ.jpg', 300,300,150,100)
     
    		img.node.onclick = function() {
    			alert('manual onclick');
    		}
     
    		// but now each has a .$node property that is a Y.Node wrapped around the SVG HTMLElement
    		circ.$node.on('click', function() {
    			// and each object Raphael creates is an EventTarget, so we can fire events now
    			circ.fire('bam');
    		});
    		// listening for circle events
    		circ.on('bam', function() {
    			alert('it worked');
    		});
     
    		// use .$node as a normal Y.Node for event handling
    		rect.$node.on('mouseover', function() {
    			circ.attr('fill', 'blue').attr('stroke', '#123432').attr('stroke-width', 1);
    		});
    		rect.$node.on('mouseout', function() {
    			circ.attr({fill: 'red', stroke: '#333', 'stroke-width': 5});
    		});
     
    		group = paper.set();
    		group.push(circ, rect, ellipse, img);
     
    		group.attr({fill: 'cyan', stroke: '#000', 'stroke-width': 1});
     
    		redText = paper.redtext(300,100, 'red text');
     
    		Y.one('#clear').on('click', function() {
    			paper.clear();
    		});
     
    		Y.one('#remove').on('click', function() {
    			group.pop().remove();
    		});
     
    		Y.one('#hide').on('click', function() {
    			circ.hide();
    		});
     
    		Y.one('#show').on('click', function() {
    			circ.show();
    		});
     
    		Y.one('#rotate').on('click', function() {
    			group.rotate(45);
    			ellipse.rotate(10);
    		});
     
    		Y.one('#creep').on('click', function() {
    			group.translate(10, 1);
    			img.translate(-10, -33);
    		});
     
    		Y.one('#animate').on('click', function() {
    			var c = circ;
    			c.animate({cx: 20, r: 20}, 2000);
    			c.animate({cx: 20, r: 20}, 2000, "bounce");
    			c.animate({
    			    "20%": {cx: 20, r: 20, easing: ">"},
    			    "50%": {cx: 70, r: 120},
    			    "100%": {cx: 10, r: 10}
    			}, 2000);
    		});
     
    		Y.one('#whatColor').on('click', function() {
    			var stroke = Raphael.getRGB(circ.attr("fill")).hex;
    			alert(stroke);
    		});
     
    		Y.one('#yellow').on('click', function() {
    			Y.Array.each(group, function(it) {
    				it.yellow();
    			});
    		});
     
    		var angle = Raphael.angle(10, 10, 50, 50);
    		alert(angle);
     
    	});
     
    });

    Build Output

    /home/y/libexec/ant/bin/ant all
    Buildfile: build.xml
         [echo] Starting Build For gallery-raphael
         [echo] Ant Properties
         [echo]     Home : /home/y/libexec/ant
         [echo]     Ant Version : Apache Ant version 1.7.1 compiled on June 27 2008
         [echo]     Build File : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build.xml
         [echo] Local Build Properties
         [echo]     version : 3
         [echo]     srcdir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery
         [echo]     builddir : ../../../builder/componentbuild
         [echo]     component : gallery-raphael
         [echo]     component.basefilename : gallery-raphael
         [echo]     component.basedir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael
         [echo]     component.builddir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp
         [echo] Global Build Properties
         [echo]     global.build.base : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build
         [echo]     global.build.component : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-raphael
         [echo]     global.build.component.assets : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-raphael/assets
    
    clean:
    
    init:
        [mkdir] Created dir: /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp
    
    -concatdebug:
         [echo] Concatenating
         [echo]     Source Files : gallery-raphael.js
         [echo]     In Source Dir : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/js
         [echo]     To : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael-debug.js
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/ant
       [delete] Deleting directory /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/ant
    
    -registerdebug:
         [echo] Wrapping /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael-debug.js in YUI.add module
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp
    
    -prependdebug:
    
    -appenddebug:
    
    builddebug:
    
    -createcore:
         [copy] Copying 1 file to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp
    
    -loggerregex:
         [echo] Replacing Logger Statements in /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael.js
    
    buildcore:
    
    -rollupjs:
    
    -concatskins:
    
    -buildskins:
    
    -rollupcss:
    
    buildskins:
    
    -buildlangs:
    
    -rolluplangs:
    
    buildlangs:
    
    build:
    
    minify:
         [echo] Running yuicompressor on /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael.js
         [java] 
         [java] [WARNING] The variable opts has already been declared in the same scope...
         [java] NAME="RaphaelLoader",loadedScripts={}, ---> opts <--- =opts||{},defaults={type
         [java] 
         [java] [WARNING] Found an undeclared symbol: YUI
         [java]  ---> YUI <--- .add("gallery-raphael",function(Y){
         [java] 
         [java] [WARNING] The symbol NAME is declared but is apparently never used.
         [java] This code can probably be written in a more compact way.
         [java] ];functionRaphaelLoader(opts){var  ---> NAME <--- ="RaphaelLoader",loadedScripts={},opts=
         [java] 
         [java] [WARNING] The symbol files is declared but is apparently never used.
         [java] This code can probably be written in a more compact way.
         [java] ,_ready:function(d){var  ---> files <--- =[],rdy=true;Y.
         [java] 
         [java] [WARNING] The symbol cache is declared but is apparently never used.
         [java] This code can probably be written in a more compact way.
         [java] ,arguments),raphInst={}, ---> cache <--- ={};functionwrapVector(vect){
    
    lint:
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael-debug.js
         [java]  
         [java] 
         [java] 	20, 17: 'opts' is already defined.
         [java] 	opts = opts || {},
         [java] 
         [java] 	49, 17: Missing semicolon.
         [java] 	}
         [java] 
         [java] 	73, 26: Expected '{' and instead saw 'return'.
         [java] 	if (!rdy) return;
         [java] 
         [java] 	75, 30: 'RaphWrapper' is undefined.
         [java] 	this.callback(RaphWrapper);
         [java] 
         [java] 	85, 19: 'Raphael' is undefined.
         [java] 	var raph = Raphael.apply(Raphael, arguments),
         [java] 
         [java] 	85, 33: 'Raphael' is undefined.
         [java] 	var raph = Raphael.apply(Raphael, arguments),
         [java] 
         [java] 	109, 22: 'Raphael' is undefined.
         [java] 	Y.Object.each(Raphael.fn, function(fn, fnName) {
         [java] 
         [java] 	123, 19: 'Raphael' is undefined.
         [java] 	return Raphael.prototype.raphael[fnName].apply(Raphael, arguments);
         [java] 
         [java] 	123, 59: 'Raphael' is undefined.
         [java] 	return Raphael.prototype.raphael[fnName].apply(Raphael, arguments);
         [java] 
         [java] 	124, 9: Missing semicolon.
         [java] 	}
         [java] 
         [java]  
         [java] 
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael-min.js
         [java]  
         [java] 
         [java] 	0, 404: 'H' is already defined.
         [java] 	[Code Evidence Omitted: Greater than 500 chars]
         [java] 
         [java] 	0, 1073: 'D' is undefined.
         [java] 	[Code Evidence Omitted: Greater than 500 chars]
         [java] 
         [java] 	0, 1099: 'Raphael' is undefined.
         [java] 	[Code Evidence Omitted: Greater than 500 chars]
         [java] 
         [java] 	0, 1113: 'Raphael' is undefined.
         [java] 	[Code Evidence Omitted: Greater than 500 chars]
         [java] 
         [java] 	0, 1377: 'Raphael' is undefined.
         [java] 	[Code Evidence Omitted: Greater than 500 chars]
         [java] 
         [java] 	0, 1526: 'Raphael' is undefined.
         [java] 	[Code Evidence Omitted: Greater than 500 chars]
         [java] 
         [java] 	0, 1561: 'Raphael' is undefined.
         [java] 	[Code Evidence Omitted: Greater than 500 chars]
         [java] 
         [java]  
         [java] 
         [java] Running JSLint on : /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael.js
         [java]  
         [java] 
         [java] 	20, 17: 'opts' is already defined.
         [java] 	opts = opts || {},
         [java] 
         [java] 	48, 17: Missing semicolon.
         [java] 	}
         [java] 
         [java] 	69, 26: Expected '{' and instead saw 'return'.
         [java] 	if (!rdy) return;
         [java] 
         [java] 	71, 30: 'RaphWrapper' is undefined.
         [java] 	this.callback(RaphWrapper);
         [java] 
         [java] 	81, 19: 'Raphael' is undefined.
         [java] 	var raph = Raphael.apply(Raphael, arguments),
         [java] 
         [java] 	81, 33: 'Raphael' is undefined.
         [java] 	var raph = Raphael.apply(Raphael, arguments),
         [java] 
         [java] 	105, 22: 'Raphael' is undefined.
         [java] 	Y.Object.each(Raphael.fn, function(fn, fnName) {
         [java] 
         [java] 	119, 19: 'Raphael' is undefined.
         [java] 	return Raphael.prototype.raphael[fnName].apply(Raphael, arguments);
         [java] 
         [java] 	119, 59: 'Raphael' is undefined.
         [java] 	return Raphael.prototype.raphael[fnName].apply(Raphael, arguments);
         [java] 
         [java] 	120, 9: Missing semicolon.
         [java] 	}
         [java] 
         [java]  
         [java] 
    
    local:
    
    deploybuild:
         [copy] Copying 3 files to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-raphael
         [copy] Copying /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael.js to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-raphael/gallery-raphael.js
         [copy] Copying /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael-min.js to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-raphael/gallery-raphael-min.js
         [copy] Copying /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/src/gallery-raphael/build_tmp/gallery-raphael-debug.js to /home/y/var/builds/workspace/gallery/build_tmp/src/yui3-gallery/build/gallery-raphael/gallery-raphael-debug.js
    
    deployassets:
    
    deployskins:
    
    deploylang:
    
    deploydocs:
    
    deploy:
    
    all:
    
    BUILD SUCCESSFUL
    Total time: 2 seconds

    © 2006-2013 Yahoo! Inc. All rights reserved.
    All code on this site is licensed under the BSD License unless stated otherwise.
    About This Site · Security Contact Info