patch for #441 - resolving Rico namespace conflict

git-svn-id: http://svn.openlayers.org/trunk/openlayers@2094 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-12-22 19:31:32 +00:00
parent 01cf10f53d
commit 112978ac3d
4 changed files with 29 additions and 29 deletions
+5 -5
View File
@@ -354,12 +354,12 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.div.appendChild(this.layersDiv); this.div.appendChild(this.layersDiv);
Rico.Corner.round(this.div, {corners: "tl bl", OpenLayers.Rico.Corner.round(this.div, {corners: "tl bl",
bgColor: "transparent", bgColor: "transparent",
color: this.activeColor, color: this.activeColor,
blend: false}); blend: false});
Rico.Corner.changeOpacity(this.layersDiv, 0.75); OpenLayers.Rico.Corner.changeOpacity(this.layersDiv, 0.75);
var imgLocation = OpenLayers.Util.getImagesLocation(); var imgLocation = OpenLayers.Util.getImagesLocation();
var sz = new OpenLayers.Size(18,18); var sz = new OpenLayers.Size(18,18);
+4 -4
View File
@@ -91,7 +91,7 @@ OpenLayers.Popup.AnchoredBubble.prototype =
if (this.div != null) { if (this.div != null) {
if (this.contentDiv != null) { if (this.contentDiv != null) {
this.div.style.background = "transparent"; this.div.style.background = "transparent";
Rico.Corner.changeColor(this.contentDiv, this.backgroundColor); OpenLayers.Rico.Corner.changeColor(this.contentDiv, this.backgroundColor);
} }
} }
}, },
@@ -106,7 +106,7 @@ OpenLayers.Popup.AnchoredBubble.prototype =
if (this.div != null) { if (this.div != null) {
if (this.contentDiv != null) { if (this.contentDiv != null) {
Rico.Corner.changeOpacity(this.contentDiv, this.opacity); OpenLayers.Rico.Corner.changeOpacity(this.contentDiv, this.opacity);
} }
} }
}, },
@@ -137,9 +137,9 @@ OpenLayers.Popup.AnchoredBubble.prototype =
blend: false}; blend: false};
if (firstTime) { if (firstTime) {
Rico.Corner.round(this.div, options); OpenLayers.Rico.Corner.round(this.div, options);
} else { } else {
Rico.Corner.reRound(this.contentDiv, options); OpenLayers.Rico.Corner.reRound(this.contentDiv, options);
//set the popup color and opacity //set the popup color and opacity
this.setBackgroundColor(); this.setBackgroundColor();
this.setOpacity(); this.setOpacity();
+18 -18
View File
@@ -1,6 +1,6 @@
Rico.Color = OpenLayers.Class.create(); OpenLayers.Rico.Color = OpenLayers.Class.create();
Rico.Color.prototype = { OpenLayers.Rico.Color.prototype = {
initialize: function(red, green, blue) { initialize: function(red, green, blue) {
this.rgb = { r: red, g : green, b : blue }; this.rgb = { r: red, g : green, b : blue };
@@ -25,7 +25,7 @@ Rico.Color.prototype = {
hsb.h = h; hsb.h = h;
// convert back to RGB... // convert back to RGB...
this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b); this.rgb = OpenLayers.Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
}, },
setSaturation: function(s) { setSaturation: function(s) {
@@ -34,7 +34,7 @@ Rico.Color.prototype = {
hsb.s = s; hsb.s = s;
// convert back to RGB and set values... // convert back to RGB and set values...
this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b); this.rgb = OpenLayers.Rico.Color.HSBtoRGB(hsb.h, hsb.s, hsb.b);
}, },
setBrightness: function(b) { setBrightness: function(b) {
@@ -43,17 +43,17 @@ Rico.Color.prototype = {
hsb.b = b; hsb.b = b;
// convert back to RGB and set values... // convert back to RGB and set values...
this.rgb = Rico.Color.HSBtoRGB( hsb.h, hsb.s, hsb.b ); this.rgb = OpenLayers.Rico.Color.HSBtoRGB( hsb.h, hsb.s, hsb.b );
}, },
darken: function(percent) { darken: function(percent) {
var hsb = this.asHSB(); var hsb = this.asHSB();
this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.max(hsb.b - percent,0)); this.rgb = OpenLayers.Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.max(hsb.b - percent,0));
}, },
brighten: function(percent) { brighten: function(percent) {
var hsb = this.asHSB(); var hsb = this.asHSB();
this.rgb = Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.min(hsb.b + percent,1)); this.rgb = OpenLayers.Rico.Color.HSBtoRGB(hsb.h, hsb.s, Math.min(hsb.b + percent,1));
}, },
blend: function(other) { blend: function(other) {
@@ -80,7 +80,7 @@ Rico.Color.prototype = {
}, },
asHSB: function() { asHSB: function() {
return Rico.Color.RGBtoHSB(this.rgb.r, this.rgb.g, this.rgb.b); return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r, this.rgb.g, this.rgb.b);
}, },
toString: function() { toString: function() {
@@ -89,7 +89,7 @@ Rico.Color.prototype = {
}; };
Rico.Color.createFromHex = function(hexCode) { OpenLayers.Rico.Color.createFromHex = function(hexCode) {
if(hexCode.length==4) { if(hexCode.length==4) {
var shortHexCode = hexCode; var shortHexCode = hexCode;
var hexCode = '#'; var hexCode = '#';
@@ -101,39 +101,39 @@ shortHexCode.charAt(i));
var red = hexCode.substring(0,2); var red = hexCode.substring(0,2);
var green = hexCode.substring(2,4); var green = hexCode.substring(2,4);
var blue = hexCode.substring(4,6); var blue = hexCode.substring(4,6);
return new Rico.Color( parseInt(red,16), parseInt(green,16), parseInt(blue,16) ); return new OpenLayers.Rico.Color( parseInt(red,16), parseInt(green,16), parseInt(blue,16) );
} }
/** /**
* Factory method for creating a color from the background of * Factory method for creating a color from the background of
* an HTML element. * an HTML element.
*/ */
Rico.Color.createColorFromBackground = function(elem) { OpenLayers.Rico.Color.createColorFromBackground = function(elem) {
var actualColor = RicoUtil.getElementsComputedStyle($(elem), "backgroundColor", "background-color"); var actualColor = RicoUtil.getElementsComputedStyle($(elem), "backgroundColor", "background-color");
if ( actualColor == "transparent" && elem.parentNode ) if ( actualColor == "transparent" && elem.parentNode )
return Rico.Color.createColorFromBackground(elem.parentNode); return OpenLayers.Rico.Color.createColorFromBackground(elem.parentNode);
if ( actualColor == null ) if ( actualColor == null )
return new Rico.Color(255,255,255); return new OpenLayers.Rico.Color(255,255,255);
if ( actualColor.indexOf("rgb(") == 0 ) { if ( actualColor.indexOf("rgb(") == 0 ) {
var colors = actualColor.substring(4, actualColor.length - 1 ); var colors = actualColor.substring(4, actualColor.length - 1 );
var colorArray = colors.split(","); var colorArray = colors.split(",");
return new Rico.Color( parseInt( colorArray[0] ), return new OpenLayers.Rico.Color( parseInt( colorArray[0] ),
parseInt( colorArray[1] ), parseInt( colorArray[1] ),
parseInt( colorArray[2] ) ); parseInt( colorArray[2] ) );
} }
else if ( actualColor.indexOf("#") == 0 ) { else if ( actualColor.indexOf("#") == 0 ) {
return Rico.Color.createFromHex(actualColor); return OpenLayers.Rico.Color.createFromHex(actualColor);
} }
else else
return new Rico.Color(255,255,255); return new OpenLayers.Rico.Color(255,255,255);
} }
Rico.Color.HSBtoRGB = function(hue, saturation, brightness) { OpenLayers.Rico.Color.HSBtoRGB = function(hue, saturation, brightness) {
var red = 0; var red = 0;
var green = 0; var green = 0;
@@ -188,7 +188,7 @@ Rico.Color.HSBtoRGB = function(hue, saturation, brightness) {
return { r : parseInt(red), g : parseInt(green) , b : parseInt(blue) }; return { r : parseInt(red), g : parseInt(green) , b : parseInt(blue) };
} }
Rico.Color.RGBtoHSB = function(r, g, b) { OpenLayers.Rico.Color.RGBtoHSB = function(r, g, b) {
var hue; var hue;
var saturation; var saturation;
+2 -2
View File
@@ -14,8 +14,8 @@
**/ **/
var Rico = new Object(); OpenLayers.Rico = new Object();
Rico.Corner = { OpenLayers.Rico.Corner = {
round: function(e, options) { round: function(e, options) {
var e = $(e); var e = $(e);