Merge pull request #327 from fredj/jshint

jshint. r=tschaub
This commit is contained in:
Frédéric Junod
2012-03-19 03:07:09 -07:00
19 changed files with 32 additions and 34 deletions

View File

@@ -82,7 +82,7 @@ OpenLayers.Animation = (function(window) {
} else {
delete loops[id];
}
}
};
requestFrame(loops[id], element);
return id;
}

View File

@@ -202,7 +202,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
*/
draw: function() {
OpenLayers.Control.prototype.draw.apply(this, arguments);
if(!(this.layers.length > 0)) {
if (this.layers.length === 0) {
if (this.map.baseLayer) {
var layer = this.map.baseLayer.clone();
this.layers = [layer];
@@ -356,7 +356,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
this.minimizeControl();
} else if (evt.buttonElement === this.maximizeDiv) {
this.maximizeControl();
};
}
},
/**

View File

@@ -345,7 +345,7 @@ OpenLayers.Format.CQL = (function() {
var result = buildAst(tokenize(text));
if (this.keepData) {
this.data = result;
};
}
return result;
},

View File

@@ -111,7 +111,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
var box = this.getElementsByTagNameNS(item,
this.georssns,
"box");
if (point.length > 0 || (lat.length > 0 && lon.length > 0)) {
var location;
if (point.length > 0) {
@@ -168,7 +168,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
point = new OpenLayers.Geometry.Point(coords[1], coords[0]);
components.push(point);
}
geometry = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(components)]);
geometry = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(components)]);
}
if (geometry && this.internalProjection && this.externalProjection) {

View File

@@ -64,7 +64,7 @@ OpenLayers.Format.OWSCommon.v1_1_0 = OpenLayers.Class(OpenLayers.Format.OWSCommo
range.maxValue = this.getChildValue(node);
},
"Identifier": function(node, obj) {
obj.identifier = this.getChildValue(node);
obj.identifier = this.getChildValue(node);
},
"SupportedCRS": function(node, obj) {
obj.supportedCRS = this.getChildValue(node);

View File

@@ -147,7 +147,7 @@ OpenLayers.Format.SOSCapabilities.v1_0_0 = OpenLayers.Class(
offering.resultModels.push(this.getChildValue(node));
},
"responseMode": function(node, offering) {
offering.responseModes.push(this.getChildValue(node));;
offering.responseModes.push(this.getChildValue(node));
}
},
"ows": OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers["ows"]

View File

@@ -1044,7 +1044,7 @@ OpenLayers.Format.WMC.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
version: server.version
};
if (server.title) {
attributes.title = server.title
attributes.title = server.title;
}
this.setAttributes(node, attributes);

View File

@@ -248,7 +248,7 @@ OpenLayers.Format.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Format.XML, {
var name = (child.prefix) ?
child.nodeName.split(":")[1] : child.nodeName;
if (grandchildren.length == 0) {
attributes[name] = null
attributes[name] = null;
} else if (grandchildren.length == 1) {
var grandchild = grandchildren[0];
if (grandchild.nodeType == 3 ||

View File

@@ -447,7 +447,7 @@ OpenLayers.Handler.Path = OpenLayers.Class(OpenLayers.Handler.Point, {
}
if(this.maxVertices && this.line &&
this.line.geometry.components.length === this.maxVertices) {
this.removePoint()
this.removePoint();
this.finalize();
} else {
this.addPoint(evt.xy);

View File

@@ -255,8 +255,7 @@ OpenLayers.Layer.EventPane = OpenLayers.Class(OpenLayers.Layer, {
var moOldZoom = this.getMapObjectZoom();
var oldZoom= this.getOLZoomFromMapObjectZoom(moOldZoom);
if ( !(newCenter.equals(oldCenter)) ||
!(newZoom == oldZoom) ) {
if (!(newCenter.equals(oldCenter)) || newZoom != oldZoom) {
if (!zoomChanged && oldCenter && this.dragPanMapObject &&
this.smoothDragPan) {

View File

@@ -284,7 +284,7 @@ OpenLayers.Layer.FixedZoomLevels = OpenLayers.Class({
if (this.map.baseLayer !== this) {
zoom = this.map.baseLayer.getZoomForResolution(
this.getResolutionForZoom(zoom)
)
);
}
}
return zoom;

View File

@@ -227,10 +227,10 @@ OpenLayers.Layer.Zoomify = OpenLayers.Class(OpenLayers.Layer.Grid, {
var h = this.standardTileSize;
if (x == this.tierSizeInTiles[z].w -1 ) {
var w = this.tierImageSize[z].w % this.standardTileSize;
};
}
if (y == this.tierSizeInTiles[z].h -1 ) {
var h = this.tierImageSize[z].h % this.standardTileSize;
};
}
return (new OpenLayers.Size(w, h));
} else {
return this.tileSize;

View File

@@ -513,10 +513,9 @@ OpenLayers.Popup = OpenLayers.Class({
this.contentDiv.innerHTML +
"</div>";
var containerElement = (this.map) ? this.map.div
: document.body;
var containerElement = (this.map) ? this.map.div : document.body;
var realSize = OpenLayers.Util.getRenderedDimensions(
preparedHTML, null, {
preparedHTML, null, {
displayClass: this.displayClass,
containerElement: containerElement
}
@@ -839,12 +838,12 @@ OpenLayers.Popup = OpenLayers.Class({
var contentDivPadding = this._contentDivPadding;
if (!contentDivPadding) {
if (this.div.parentNode == null) {
//make the div invisible and add it to the page
this.div.style.display = "none";
document.body.appendChild(this.div);
}
if (this.div.parentNode == null) {
//make the div invisible and add it to the page
this.div.style.display = "none";
document.body.appendChild(this.div);
}
//read the padding settings from css, put them in an OL.Bounds
contentDivPadding = new OpenLayers.Bounds(
OpenLayers.Element.getStyle(this.contentDiv, "padding-left"),
@@ -857,9 +856,9 @@ OpenLayers.Popup = OpenLayers.Class({
this._contentDivPadding = contentDivPadding;
if (this.div.parentNode == document.body) {
//remove the div from the page and make it visible again
document.body.removeChild(this.div);
this.div.style.display = "";
//remove the div from the page and make it visible again
document.body.removeChild(this.div);
this.div.style.display = "";
}
}
return contentDivPadding;

View File

@@ -132,7 +132,7 @@ OpenLayers.Protocol.HTTP = OpenLayers.Class(OpenLayers.Protocol, {
});
this.filterToParams = function(filter, params) {
return format.write(filter, params);
}
};
}
},

View File

@@ -570,7 +570,7 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
geometry.components[i], style, featureId) && rendered;
}
return rendered;
};
}
rendered = false;
var removeBackground = false;

View File

@@ -79,7 +79,7 @@ OpenLayers.Request = {
* will be the same as the provided url.
*/
makeSameOrigin: function(url, proxy) {
var sameOrigin = !(url.indexOf("http") == 0);
var sameOrigin = url.indexOf("http") !== 0;
var urlParts = !sameOrigin && url.match(this.URL_SPLIT_REGEX);
if (urlParts) {
var location = window.location;