Merge all changes from the naturaldocs sandbox. This brings all the work that

has been done in the NaturalDocs branch back to trunk. Thanks to everyone who
helped out in making this happen. (I could list people, but the list would
be long, and I'm already mentally on vacation.)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-06-29 15:59:20 +00:00
parent f1c61fd0d6
commit 3948913bfc
107 changed files with 8658 additions and 4011 deletions
+160 -75
View File
@@ -4,7 +4,7 @@
/**
* @class
* Class: OpenLayers.Popup
*/
OpenLayers.Popup = OpenLayers.Class.create();
@@ -16,55 +16,94 @@ OpenLayers.Popup.BORDER = "0px";
OpenLayers.Popup.prototype = {
/** @type OpenLayers.Events*/
events: null,
/**
* Property: events
* {<OpenLayers.Events>}
*/
events: null,
/** @type String */
/** Property: id
* {String}
*/
id: "",
/** @type OpenLayers.LonLat */
lonlat: null,
/** @type DOMElement */
div: null,
/** @type OpenLayers.Size*/
size: null,
/** @type String */
contentHTML: "",
/** @type String */
backgroundColor: "",
/** @type float */
opacity: "",
/** @type String */
border: "",
/** @type DOMElement */
contentDiv:null,
/** @type DOMElement */
groupDiv:null,
/** @type int */
padding: 5,
/** this gets set in Map.js when the popup is added to the map
* @type OpenLayers.Map */
map: null,
/**
* Property: lonlat
* {<OpenLayers.LonLat>}
*/
lonlat: null,
/**
* @constructor
* Property: div
* {DOMElement}
*/
div: null,
/**
* Property: size
* {<OpenLayers.Size>}
*/
size: null,
/**
* Property: contentHTML
* {String}
*/
contentHTML: "",
/**
* Property: backgroundColor
* {String}
*/
backgroundColor: "",
/**
* Property: opacity
* {float}
*/
opacity: "",
/**
* Property: border
* {String}
*/
border: "",
/**
* Property: contentDiv
* {DOMElement}
*/
contentDiv: null,
/**
* Property: groupDiv
* {DOMElement}
*/
groupDiv: null,
/**
* Property: padding
* {int}
*/
padding: 5,
/**
* Property: map
* {<OpenLayers.Map>} this gets set in Map.js when the popup is added to the map
*/
map: null,
/**
* Constructor: OpenLayers.Popup
* Create a popup.
*
* @param {String} id
* @param {OpenLayers.LonLat} lonlat
* @param {OpenLayers.Size} size
* @param {String} contentHTML
* @param {Boolean} closeBox
* Parameters:
* id - {String}
* lonlat - {<OpenLayers.LonLat>}
* size - {<OpenLayers.Size>}
* contentHTML - {String}
* closeBox - {Boolean}
*/
initialize:function(id, lonlat, size, contentHTML, closeBox) {
if (id == null) {
@@ -125,7 +164,9 @@ OpenLayers.Popup.prototype = {
},
/**
*/
* Method: destroy
* nullify references to prevent circular references and memory leaks
*/
destroy: function() {
if (this.map != null) {
this.map.removePopup(this);
@@ -137,10 +178,13 @@ OpenLayers.Popup.prototype = {
},
/**
* @param {OpenLayers.Pixel} px
* method: draw
*
* @returns Reference to a div that contains the drawn popup
* @type DOMElement
* Parameters:
* px - {<OpenLayers.Pixel>}
*
* Return:
* {DOMElement} Reference to a div that contains the drawn popup
*/
draw: function(px) {
if (px == null) {
@@ -160,8 +204,9 @@ OpenLayers.Popup.prototype = {
},
/**
* Method: updatePosition
* if the popup has a lonlat and its map members set,
* then have it move itself to its proper position
* then have it move itself to its proper position
*/
updatePosition: function() {
if ((this.lonlat) && (this.map)) {
@@ -171,7 +216,10 @@ OpenLayers.Popup.prototype = {
},
/**
* @param {OpenLayers.Pixel} px
* Method: moveTo
*
* Parameters:
* px - {<OpenLayers.Pixel>}
*/
moveTo: function(px) {
if ((px != null) && (this.div != null)) {
@@ -181,36 +229,41 @@ OpenLayers.Popup.prototype = {
},
/**
* @returns Boolean indicating whether or not the popup is visible
* @type Boolean
* method: visible
*
* Returns:
* {Boolean} Boolean indicating whether or not the popup is visible
*/
visible: function() {
return OpenLayers.Element.visible(this.div);
},
/**
*
* Method: toggle
*/
toggle: function() {
OpenLayers.Element.toggle(this.div);
},
/**
*
* Method: show
*/
show: function() {
OpenLayers.Element.show(this.div);
},
/**
*
* Method: hide
*/
hide: function() {
OpenLayers.Element.hide(this.div);
},
/**
* @param {OpenLayers.Size} size
* Method: setSize
*
* Parameters:
* size - {<OpenLayers.Size>}
*/
setSize:function(size) {
if (size != undefined) {
@@ -228,7 +281,10 @@ OpenLayers.Popup.prototype = {
},
/**
* @param {String} color
* Method: setBackgroundColor
*
* Parameters:
* color - {String}
*/
setBackgroundColor:function(color) {
if (color != undefined) {
@@ -241,7 +297,10 @@ OpenLayers.Popup.prototype = {
},
/**
* @param {float} opacity
* Method: setOpacity
*
* Parameters:
* opacity - {float}
*/
setOpacity:function(opacity) {
if (opacity != undefined) {
@@ -258,7 +317,10 @@ OpenLayers.Popup.prototype = {
},
/**
* @param {int} border
* Method: setBorder
*
* Parameters:
* border - {int}
*/
setBorder:function(border) {
if (border != undefined) {
@@ -271,7 +333,10 @@ OpenLayers.Popup.prototype = {
},
/**
* @param {String} contentHTML
* Method: setContentHTML
*
* Parameters:
* contentHTML - {String}
*/
setContentHTML:function(contentHTML) {
if (contentHTML != null) {
@@ -285,7 +350,11 @@ OpenLayers.Popup.prototype = {
/** Do this in a separate function so that subclasses can
/**
* Method: registerEvents
* Registers events on the popup.
*
* Do this in a separate function so that subclasses can
* choose to override it if they wish to deal differently
* with mouse events
*
@@ -313,22 +382,28 @@ OpenLayers.Popup.prototype = {
this.events.register("dblclick", this, this.ondblclick);
},
/** When mouse goes down within the popup, make a note of
/**
* Method: onmousedown
* When mouse goes down within the popup, make a note of
* it locally, and then do not propagate the mousedown
* (but do so safely so that user can select text inside)
*
* @param {Event} evt
* Parameters:
* evt - {Event}
*/
onmousedown: function (evt) {
this.mousedown = true;
OpenLayers.Event.stop(evt, true);
},
/** If the drag was started within the popup, then
/**
* Method: onmousemove
* If the drag was started within the popup, then
* do not propagate the mousemove (but do so safely
* so that user can select text inside)
*
* @param {Event} evt
* Parameters:
* evt - {Event}
*/
onmousemove: function (evt) {
if (this.mousedown) {
@@ -336,12 +411,15 @@ OpenLayers.Popup.prototype = {
}
},
/** When mouse comes up within the popup, after going down
/**
* Method: onmouseup
* When mouse comes up within the popup, after going down
* in it, reset the flag, and then (once again) do not
* propagate the event, but do so safely so that user can
* select text inside
*
* @param {Event} evt
* Parameters:
* evt - {Event}
*/
onmouseup: function (evt) {
if (this.mousedown) {
@@ -350,28 +428,35 @@ OpenLayers.Popup.prototype = {
}
},
/** Ignore clicks, but allowing default browser handling
/**
* Method: onclick
* Ignore clicks, but allowing default browser handling
*
* @param {Event} evt
* Parameters:
* evt - {Event}
*/
onclick: function (evt) {
OpenLayers.Event.stop(evt, true);
},
/** When mouse goes out of the popup set the flag to false so that
/**
* Method: onmouseout
* When mouse goes out of the popup set the flag to false so that
* if they let go and then drag back in, we won't be confused.
*
* @param {Event} evt
*
* @type Boolean
* Parameters:
* evt - {Event}
*/
onmouseout: function (evt) {
this.mousedown = false;
},
/** Ignore double-clicks, but allowing default browser handling
/**
* Method: ondblclick
* Ignore double-clicks, but allowing default browser handling
*
* @param {Event} evt
* Parameters:
* evt - {Event}
*/
ondblclick: function (evt) {
OpenLayers.Event.stop(evt, true);