radial-tool.js revision 3b28a6cd6294fa40166327b097529ae5da1698ce
YUI({filter:"raw"}).use('graphics','dd','event-key','dd-delegate','dd-constrain','resize','json', 'cssbutton', 'cssbuttons', function (Y){
///////////////////// gradient UI controls //////////////////////
theCX = 0.5,
theCY = 0.5,
theFX = 0.5,
theFY = 0.5,
theR = 0.5,
centerColor = '#ff8800',
outerColor = '#300060',
stopsArr = [
];
// Updates the radial fill properties in myellipse
var updateGraphic = function(){
type: "radial",
r: theR
}
);
}
// This recenters the outter edge of the gradient control, as it is sized
var recenterGradientR = function(e){
'borderRadius': radius
} );
}
// Instatiate a resize object on the outter gradient control ring
//Selector of the node to resize
node: '#resize-r',
});
minWidth: 20,
minHeight: 20,
maxWidth: 300,
maxHeight: 300,
preserveRatio: true
});
closeCode();
});
closeCode();
});
// Instantiate a drag on the container of the outter gradient control ring
node: '.grad-c'
});
// Instantiate a drag on the container of the inner gradient control ring
node: '.grad-f'
});
// Handle drag of the container of the outter control ring
closeCode();
});
// Handle drag of the container of the inner control ring
closeCode();
});
// Handle a click on the 'get code snippet' button
var html = ''+
'myellipse = mygraphic.addShape({\n'+
' type: "ellipse",\n'+
' fill: {\n'+
' type: "radial",\n'+
' stops: [\n'+
' ],\n'+
' },\n'+
' stroke: {\n'+
' weight: 0,\n'+
' color: "#000" \n'+
' },\n'+
' width: 150,\n'+
' height: 100,\n'+
' x: 35,\n'+
' y: 35\n'+
'});\n';
});
var closeCode = function(){
}
}
closeCode();
});
stopsArr = [
];
closeCode();
});
stopsArr = [
];
closeCode();
});
///////////////////// END gradient UI controls //////////////////////
// Instantiate a new graphic to contain objects
// add shapes to the graphics object
var loadGraphics = function (e)
{
//create an ellipse with addShape
type: "ellipse",
fill: {
type: "radial",
cx: 0.5,
cy: 0.5,
fx: 0.5,
fy: 0.5,
r: 0.5
},
stroke: {
weight: 0,
color: "#000"
},
width: 150,
height: 100,
x: 45,
y: 55
});
}
loadGraphics();
});