Permalink
Browse files

Merge pull request #4 from doug-martin/localhost-changes

Localhost changes
  • Loading branch information...
2 parents 0a4e851 + 7724cae commit 535593c0a771b89c4cca66da6d638d6c2c84f46d @doug-martin doug-martin committed Apr 16, 2012
Showing with 177 additions and 158 deletions.
  1. +3 −3 node/server/config.js
  2. +3 −3 node/server/lib/models/SafeItem.js
  3. +1 −1 node/server/lib/routes.js
  4. +12 −1 web/css/style.css
  5. +2 −2 web/foursquare/oauth2.html
  6. +6 −2 web/index.html
  7. +144 −146 web/js/map.js
  8. +6 −0 web/js/run.js
View
@@ -1,6 +1,6 @@
exports = module.exports = {
MONGO_URL:"mongodb://localhost:27017/safeomaha",
- HOST:"localhost",
- PORT:8088,
+ HOST:"www.safeomaha.org",
+ PORT:80,
DEFAULT_RADIUS : 0.5
-}
+}
@@ -22,7 +22,7 @@ SafeItemSchema.statics.categories = function (type, cb) {
SafeItemSchema.statics.getItems = function (opts, includeMeta, cb) {
var q = comb.merge({}, opts);
- opts.loc && (q.loc = { $near:opts.loc, $spherical:true, $maxDistance:(opts.radius || config.DEFAULT_RADIUS) / 6378 });
+ opts.loc && (q.loc = { $near:opts.loc, $maxDistance:(opts.radius || config.DEFAULT_RADIUS) / 6378 });
opts.box && (q.loc = {"$within":{"$box":opts.box}});
delete q.radius;
delete q.box;
@@ -33,7 +33,7 @@ SafeItemSchema.statics.getItems = function (opts, includeMeta, cb) {
SafeItemSchema.statics.topOfficers = function (opts, cb) {
var q = comb.merge({}, opts);
- opts.loc && (q.loc = { $near:opts.loc, $spherical:true, $maxDistance:(opts.radius || config.DEFAULT_RADIUS) / 6378 });
+ opts.loc && (q.loc = { $near:opts.loc, $maxDistance:(opts.radius || config.DEFAULT_RADIUS) / 6378 });
opts.box && (q.loc = {"$within":{"$box":opts.box}});
delete q.radius;
delete q.box;
@@ -78,7 +78,7 @@ SafeItemSchema.statics.topOfficers = function (opts, cb) {
SafeItemSchema.statics.topCrimes = function (opts, cb) {
var q = comb.merge({}, opts);
- opts.loc && (q.loc = { $near:opts.loc, $spherical:true, $maxDistance:(opts.radius || config.DEFAULT_RADIUS) / 6378 });
+ opts.loc && (q.loc = { $near:opts.loc, $maxDistance:(opts.radius || config.DEFAULT_RADIUS) / 6378 });
opts.box && (q.loc = {"$within":{"$box":opts.box}});
delete q.radius;
delete q.box;
@@ -8,11 +8,11 @@ var connected = false;
var connect = function (cb) {
var ret = new comb.Promise();
if (!connected) {
+ connected = true;
mongoose.connect(config.MONGO_URL, function (err) {
if (err) {
ret.errback(err);
} else {
- connected = true;
ret.callback();
}
});
View
@@ -24,13 +24,24 @@ body {padding:0; height:100%; margin:0px auto 0px auto; background:url(../images
#navbar #foursquare:hover {opacity:0.95}
#controls {overlow:auto; background:#dcd2aa; -webkit-border-radius:4px; -moz-border-radius:4px; border-radius:4px; float:left}
- #slider-container {float:left; vertical-align:top; width:244px;height:450px; margin:5px 0px 0px 5px; -webkit-border-top-left-radius: 2px; -webkit-border-bottom-left-radius: 2px; -moz-border-radius-topleft: 2px; -moz-border-radius-bottomleft: 2px; border-top-left-radius: 2px; border-bottom-left-radius: 2px; background:url(../images/sidebar-bg.png) repeat-y #f6f4f4; background-position:top right}
+ #slider-container {float:left; vertical-align:top; width:244px;height:450px; overflow-x: auto; margin:5px 0px 0px 5px; -webkit-border-top-left-radius: 2px; -webkit-border-bottom-left-radius: 2px; -moz-border-radius-topleft: 2px; -moz-border-radius-bottomleft: 2px; border-top-left-radius: 2px; border-bottom-left-radius: 2px; background:url(../images/sidebar-bg.png) repeat-y #f6f4f4; background-position:top right}
#slider-container h2 {margin:15px 10px 0px 10px; padding:6px 6px 18px 6px; color:#000; line-height:15px; font-weight:normal; background:url(../images/sidebar-divider.png) no-repeat; background-position:bottom}
#slider-container ul {list-style: none; margin:-5px 10px 5px 10px; color:#000; font-size:15px; padding:0px 6px 21px 6px; line-height:15px; font-weight:normal; background:url(../images/sidebar-divider.png) no-repeat; background-position:bottom}
#map_canvas {color:#37341F; float:left; margin:5px 5px 5px 0px; overflow:hidden; height:450px; width:706px}
#footer {width:960px; margin:0px auto 0px auto; text-align:center; font-size:13px; color:#605c43; padding:40px 0px 40px 0px; overflow:hidden}
+
+#crime-facts,
+#cops-facts {
+ display: block;
+ font-size: 8pt;
+ background: wheat;
+ border-radius: 9px;
+ overflow: auto;
+ max-height: 287px;
+}
+
.infowindow {
text-transform:capitalize;
max-height: 80px;
@@ -95,8 +95,8 @@
});
</script>
</head>
-<body>
- <a href="https://foursquare.com/oauth2/authenticate?client_id=MFHWM4ODQS5CMN5FQLP5JKTBYXLC50EZCUCL5Y3XBVQRFCIQ&response_type=token&redirect_uri=http://safeomaha.org/foursquare/oauth2.html">Link your Foursquare</a>
+<body>
+ <a href="https://foursquare.com/oauth2/authenticate?client_id=MFHWM4ODQS5CMN5FQLP5JKTBYXLC50EZCUCL5Y3XBVQRFCIQ&response_type=token&redirect_uri=http://www.safeomaha.org/foursquare/oauth2.html">Link your Foursquare</a>
<div id="map_canvas" style="width:1000px;height:400px;"></div>
View
@@ -61,12 +61,16 @@
<li>
<h4 id="crime-toggler">Crime</h4>
<input type="range" id="crimeSlider" min="0" max="4" step="1" value="2" onChange="onRatingChange(event,'crime')" />
- <div id="crime-facts"></div>
+ <div id="crime-title">Top Crimes</div>
+ <div id="crime-facts">
+ </div>
</li>
<li>
<h4 id="cops-toggler">Cops</h4>
<input type="range" id="policeSlider" min="0" max="4" step="1" value="2" onChange="onRatingChange(event,'police')" />
- <div id="cops-facts"></div>
+ <div id="cops-title">Top Arrests</div>
+ <div id="cops-facts">
+ </div>
</li>
<li>
<h4 id="accidents-toggler">Accidents</h4>
Oops, something went wrong.

0 comments on commit 535593c

Please sign in to comment.