mirror of https://github.com/django/django.git
Fixed JavaScript "curly" violations.
This commit is contained in:
parent
e25ba6e8bb
commit
ac6164948e
|
@ -3,7 +3,7 @@
|
||||||
"camelcase": [1, {"properties": "always"}],
|
"camelcase": [1, {"properties": "always"}],
|
||||||
"comma-spacing": [1, {"before": false, "after": true}],
|
"comma-spacing": [1, {"before": false, "after": true}],
|
||||||
"dot-notation": [1, {"allowKeywords": true}],
|
"dot-notation": [1, {"allowKeywords": true}],
|
||||||
"curly": [1, "all"],
|
"curly": [2, "all"],
|
||||||
"indent": [
|
"indent": [
|
||||||
2,
|
2,
|
||||||
4
|
4
|
||||||
|
@ -48,4 +48,4 @@
|
||||||
"globals": {
|
"globals": {
|
||||||
"django": false
|
"django": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,8 +95,12 @@ var SelectBox = {
|
||||||
a = a.text.toLowerCase();
|
a = a.text.toLowerCase();
|
||||||
b = b.text.toLowerCase();
|
b = b.text.toLowerCase();
|
||||||
try {
|
try {
|
||||||
if (a > b) return 1;
|
if (a > b) {
|
||||||
if (a < b) return -1;
|
return 1;
|
||||||
|
}
|
||||||
|
if (a < b) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
// silently fail on IE 'unknown' exception
|
// silently fail on IE 'unknown' exception
|
||||||
|
|
|
@ -56,12 +56,14 @@ var DateTimeShortcuts = {
|
||||||
var timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600;
|
var timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600;
|
||||||
|
|
||||||
// Only warn if there is a time zone mismatch.
|
// Only warn if there is a time zone mismatch.
|
||||||
if (!timezoneOffset)
|
if (!timezoneOffset) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if warning is already there.
|
// Check if warning is already there.
|
||||||
if ($(inp).siblings('.' + warningClass).length)
|
if ($(inp).siblings('.' + warningClass).length) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var message;
|
var message;
|
||||||
if (timezoneOffset > 0) {
|
if (timezoneOffset > 0) {
|
||||||
|
|
|
@ -66,7 +66,9 @@ function showRelatedObjectPopup(triggeringLink) {
|
||||||
function updateRelatedObjectLinks(triggeringLink) {
|
function updateRelatedObjectLinks(triggeringLink) {
|
||||||
var $this = django.jQuery(triggeringLink);
|
var $this = django.jQuery(triggeringLink);
|
||||||
var siblings = $this.nextAll('.change-related, .delete-related');
|
var siblings = $this.nextAll('.change-related, .delete-related');
|
||||||
if (!siblings.length) return;
|
if (!siblings.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var value = $this.val();
|
var value = $this.val();
|
||||||
if (value) {
|
if (value) {
|
||||||
siblings.each(function() {
|
siblings.each(function() {
|
||||||
|
|
|
@ -91,7 +91,9 @@ var CalendarNamespace = {
|
||||||
|
|
||||||
// use UTC function; see above for explanation.
|
// use UTC function; see above for explanation.
|
||||||
if (isSelectedMonth && currentDay === selected.getUTCDate()) {
|
if (isSelectedMonth && currentDay === selected.getUTCDate()) {
|
||||||
if (todayClass !== '') todayClass += " ";
|
if (todayClass !== '') {
|
||||||
|
todayClass += " ";
|
||||||
|
}
|
||||||
todayClass += "selected";
|
todayClass += "selected";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,13 @@ function removeEvent(obj, evType, fn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelEventPropagation(e) {
|
function cancelEventPropagation(e) {
|
||||||
if (!e) e = window.event;
|
if (!e) {
|
||||||
|
e = window.event;
|
||||||
|
}
|
||||||
e.cancelBubble = true;
|
e.cancelBubble = true;
|
||||||
if (e.stopPropagation) e.stopPropagation();
|
if (e.stopPropagation) {
|
||||||
|
e.stopPropagation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]);
|
// quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]);
|
||||||
|
@ -52,7 +56,9 @@ function quickElement() {
|
||||||
|
|
||||||
// "a" is reference to an object
|
// "a" is reference to an object
|
||||||
function removeChildren(a) {
|
function removeChildren(a) {
|
||||||
while (a.hasChildNodes()) a.removeChild(a.lastChild);
|
while (a.hasChildNodes()) {
|
||||||
|
a.removeChild(a.lastChild);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
|
@ -170,9 +170,13 @@ function MapWidget(options) {
|
||||||
this.wkt_f = new OpenLayers.Format.DjangoWKT();
|
this.wkt_f = new OpenLayers.Format.DjangoWKT();
|
||||||
|
|
||||||
// Mapping from OGRGeomType name to OpenLayers.Geometry name
|
// Mapping from OGRGeomType name to OpenLayers.Geometry name
|
||||||
if (options['geom_name'] === 'Unknown') options['geom_type'] = OpenLayers.Geometry;
|
if (options['geom_name'] === 'Unknown') {
|
||||||
else if (options['geom_name'] === 'GeometryCollection') options['geom_type'] = OpenLayers.Geometry.Collection;
|
options['geom_type'] = OpenLayers.Geometry;
|
||||||
else options['geom_type'] = eval('OpenLayers.Geometry.' + options['geom_name']);
|
} else if (options['geom_name'] === 'GeometryCollection') {
|
||||||
|
options['geom_type'] = OpenLayers.Geometry.Collection;
|
||||||
|
} else {
|
||||||
|
options['geom_type'] = eval('OpenLayers.Geometry.' + options['geom_name']);
|
||||||
|
}
|
||||||
|
|
||||||
// Default options
|
// Default options
|
||||||
this.options = {
|
this.options = {
|
||||||
|
@ -261,8 +265,11 @@ function MapWidget(options) {
|
||||||
|
|
||||||
MapWidget.prototype.create_map = function() {
|
MapWidget.prototype.create_map = function() {
|
||||||
var map = new OpenLayers.Map(this.options.map_id, this.options.map_options);
|
var map = new OpenLayers.Map(this.options.map_id, this.options.map_options);
|
||||||
if (this.options.base_layer) this.layers.base = this.options.base_layer;
|
if (this.options.base_layer) {
|
||||||
else this.layers.base = new OpenLayers.Layer.WMS('OpenLayers WMS', 'http://vmap0.tiles.osgeo.org/wms/vmap0', {layers: 'basic'});
|
this.layers.base = this.options.base_layer;
|
||||||
|
} else {
|
||||||
|
this.layers.base = new OpenLayers.Layer.WMS('OpenLayers WMS', 'http://vmap0.tiles.osgeo.org/wms/vmap0', {layers: 'basic'});
|
||||||
|
}
|
||||||
map.addLayer(this.layers.base);
|
map.addLayer(this.layers.base);
|
||||||
return map;
|
return map;
|
||||||
};
|
};
|
||||||
|
@ -359,8 +366,9 @@ MapWidget.prototype.enableEditing = function () {
|
||||||
MapWidget.prototype.getControls = function(layer) {
|
MapWidget.prototype.getControls = function(layer) {
|
||||||
this.panel = new OpenLayers.Control.Panel({'displayClass': 'olControlEditingToolbar'});
|
this.panel = new OpenLayers.Control.Panel({'displayClass': 'olControlEditingToolbar'});
|
||||||
this.controls = [new OpenLayers.Control.Navigation()];
|
this.controls = [new OpenLayers.Control.Navigation()];
|
||||||
if (!this.options.modifiable && layer.features.length)
|
if (!this.options.modifiable && layer.features.length) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (this.options.geom_name.indexOf('LineString') >= 0 || this.options.geom_name === 'GeometryCollection' || this.options.geom_name === 'Unknown') {
|
if (this.options.geom_name.indexOf('LineString') >= 0 || this.options.geom_name === 'GeometryCollection' || this.options.geom_name === 'Unknown') {
|
||||||
this.controls.push(new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Path, {'displayClass': 'olControlDrawFeaturePath'}));
|
this.controls.push(new OpenLayers.Control.DrawFeature(layer, OpenLayers.Handler.Path, {'displayClass': 'olControlDrawFeaturePath'}));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue