radial-tool.js revision eaee839afff6e24a5ba7277c5fdacd4eeba4253b
YUI({filter:"raw"}).use('graphics','dd','event-key','dd-delegate','dd-constrain','resize','json', 'cssbutton', 'panel', 'dd-plugin', 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
});
});
});
// 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
});
// Handle drag of the container of the inner control ring
});
// Handle a click on the 'get code snippet' button
var html = ''+
'var 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';
});
stopsArr = [
];
});
stopsArr = [
];
});
///////////////////// 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();
////////////////////////////////////////
bodyContent: '<div class="textarea-box"><textarea></textarea></div>',
headerContent: 'Code Snippet',
width : 350,
height : 400,
zIndex : 5,
centered : true,
modal : true,
visible : false,
render : '#panel-content',
});
value : 'Close',
action : function (e) {
e.preventDefault();
}
});
});