betterplace_explorer 0.0.1.pre.alpha8 → 0.0.1.pre.alpha9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ecc143fe7d23999251be7b161cd501711b678f9
4
- data.tar.gz: f5e4089eb3e4dcf2a67997858e5483216ae03878
3
+ metadata.gz: 7cb38aaab23cd71c813b9d60c68da64a5f3015f3
4
+ data.tar.gz: 8380c08c95f850e000bf01cfb2e6398a8824f62d
5
5
  SHA512:
6
- metadata.gz: 7d31cb1d6593e03427ae26e8f64de979edb09a568953e888a811f40c72168dd904d6df72cf59a1cf919b9dc39a93e7b5aec520b6fef572afc63d859b643b7048
7
- data.tar.gz: 9fc713eea83fada212daf393aaa4fa92f379f7a844a8b73b7461d63629a39c108d448a020445936aa1223098baa97e101129ef0c271fbdd73f198d3cbcd5b23e
6
+ metadata.gz: 7185224e40e048c53578c136831b08fdf292d40408a5eadd90be5bd90ed2b8001b63fde4280aef841e5c2caa94ed3d7a079b2fd7c84d8694d69d94bafbf27b84
7
+ data.tar.gz: 2d74115caf5efc440e1f1be2594e7df17d35550356cc959da6f2cdd32ed9fea6f84d0d2dd6d35b477e55847b9ac4dc4e28f1ca53e4a92c08adcd5cc75dcb8095
@@ -74,7 +74,7 @@
74
74
  displayName: 'Explorer',
75
75
  getInitialState: function () {
76
76
  function getInitialState() {
77
- return { records: [], currentBounds: {}, currentPage: 1 };
77
+ return { records: [], currentBounds: {}, currentPage: 1, visitedRecordIds: [] };
78
78
  }
79
79
 
80
80
  return getInitialState;
@@ -126,7 +126,9 @@
126
126
  highlightRecord: this.state.highlightRecord,
127
127
  mapIdle: this.loadByBoundingBox,
128
128
  records: this.state.records,
129
- setHighlightRecord: this.setHighlightRecord
129
+ setHighlightRecord: this.setHighlightRecord,
130
+ setRecordVisited: this.setRecordVisited,
131
+ visitedRecordIds: this.state.visitedRecordIds
130
132
  })
131
133
  );
132
134
  }
@@ -223,6 +225,15 @@
223
225
  }
224
226
 
225
227
  return setHighlightRecord;
228
+ }(),
229
+
230
+ setRecordVisited: function () {
231
+ function setRecordVisited(record) {
232
+ var newVisitedRecordIds = this.state.visitedRecordIds.concat([record.id]);
233
+ this.setState({ visitedRecordIds: newVisitedRecordIds });
234
+ }
235
+
236
+ return setRecordVisited;
226
237
  }()
227
238
  });
228
239
 
@@ -343,6 +354,31 @@
343
354
  // shim for using process in browser
344
355
 
345
356
  var process = module.exports = {};
357
+
358
+ // cached from whatever global is present so that test runners that stub it
359
+ // don't break things. But we need to wrap it in a try catch in case it is
360
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
361
+ // function because try/catches deoptimize in certain engines.
362
+
363
+ var cachedSetTimeout;
364
+ var cachedClearTimeout;
365
+
366
+ (function () {
367
+ try {
368
+ cachedSetTimeout = setTimeout;
369
+ } catch (e) {
370
+ cachedSetTimeout = function () {
371
+ throw new Error('setTimeout is not defined');
372
+ }
373
+ }
374
+ try {
375
+ cachedClearTimeout = clearTimeout;
376
+ } catch (e) {
377
+ cachedClearTimeout = function () {
378
+ throw new Error('clearTimeout is not defined');
379
+ }
380
+ }
381
+ } ())
346
382
  var queue = [];
347
383
  var draining = false;
348
384
  var currentQueue;
@@ -367,7 +403,7 @@
367
403
  if (draining) {
368
404
  return;
369
405
  }
370
- var timeout = setTimeout(cleanUpNextTick);
406
+ var timeout = cachedSetTimeout(cleanUpNextTick);
371
407
  draining = true;
372
408
 
373
409
  var len = queue.length;
@@ -384,7 +420,7 @@
384
420
  }
385
421
  currentQueue = null;
386
422
  draining = false;
387
- clearTimeout(timeout);
423
+ cachedClearTimeout(timeout);
388
424
  }
389
425
 
390
426
  process.nextTick = function (fun) {
@@ -396,7 +432,7 @@
396
432
  }
397
433
  queue.push(new Item(fun, args));
398
434
  if (queue.length === 1 && !draining) {
399
- setTimeout(drainQueue, 0);
435
+ cachedSetTimeout(drainQueue, 0);
400
436
  }
401
437
  };
402
438
 
@@ -1284,7 +1320,7 @@
1284
1320
  var warning = emptyFunction;
1285
1321
 
1286
1322
  if (process.env.NODE_ENV !== 'production') {
1287
- warning = function (condition, format) {
1323
+ warning = function warning(condition, format) {
1288
1324
  for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
1289
1325
  args[_key - 2] = arguments[_key];
1290
1326
  }
@@ -1332,6 +1368,7 @@
1332
1368
  * LICENSE file in the root directory of this source tree. An additional grant
1333
1369
  * of patent rights can be found in the PATENTS file in the same directory.
1334
1370
  *
1371
+ *
1335
1372
  */
1336
1373
 
1337
1374
  function makeEmptyFunction(arg) {
@@ -1345,7 +1382,7 @@
1345
1382
  * primarily useful idiomatically for overridable function endpoints which
1346
1383
  * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
1347
1384
  */
1348
- function emptyFunction() {}
1385
+ var emptyFunction = function emptyFunction() {};
1349
1386
 
1350
1387
  emptyFunction.thatReturns = makeEmptyFunction;
1351
1388
  emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
@@ -2234,11 +2271,11 @@
2234
2271
  * because of Facebook's testing infrastructure.
2235
2272
  */
2236
2273
  if (performance.now) {
2237
- performanceNow = function () {
2274
+ performanceNow = function performanceNow() {
2238
2275
  return performance.now();
2239
2276
  };
2240
2277
  } else {
2241
- performanceNow = function () {
2278
+ performanceNow = function performanceNow() {
2242
2279
  return Date.now();
2243
2280
  };
2244
2281
  }
@@ -3326,7 +3363,7 @@
3326
3363
  * @param {object} obj
3327
3364
  * @return {object}
3328
3365
  */
3329
- var keyMirror = function (obj) {
3366
+ var keyMirror = function keyMirror(obj) {
3330
3367
  var ret = {};
3331
3368
  var key;
3332
3369
  !(obj instanceof Object && !Array.isArray(obj)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'keyMirror(...): Argument must be an object.') : invariant(false) : void 0;
@@ -3398,7 +3435,7 @@
3398
3435
  * 'xa12' in that case. Resolve keys you want to use once at startup time, then
3399
3436
  * reuse those resolutions.
3400
3437
  */
3401
- var keyOf = function (oneKeyObj) {
3438
+ var keyOf = function keyOf(oneKeyObj) {
3402
3439
  var key;
3403
3440
  for (key in oneKeyObj) {
3404
3441
  if (!oneKeyObj.hasOwnProperty(key)) {
@@ -8532,11 +8569,11 @@
8532
8569
  arity: true
8533
8570
  };
8534
8571
 
8535
- module.exports = function hoistNonReactStatics(targetComponent, sourceComponent) {
8572
+ module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) {
8536
8573
  if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
8537
8574
  var keys = Object.getOwnPropertyNames(sourceComponent);
8538
- for (var i=0; i<keys.length; ++i) {
8539
- if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]]) {
8575
+ for (var i = 0; i < keys.length; ++i) {
8576
+ if (!REACT_STATICS[keys[i]] && !KNOWN_STATICS[keys[i]] && (!customStatics || !customStatics[keys[i]])) {
8540
8577
  try {
8541
8578
  targetComponent[keys[i]] = sourceComponent[keys[i]];
8542
8579
  } catch (error) {
@@ -9711,7 +9748,11 @@
9711
9748
  var useRefresh = !isSupported || forceRefresh;
9712
9749
 
9713
9750
  function getCurrentLocation(historyState) {
9714
- historyState = historyState || window.history.state || {};
9751
+ try {
9752
+ historyState = historyState || window.history.state || {};
9753
+ } catch (e) {
9754
+ historyState = {};
9755
+ }
9715
9756
 
9716
9757
  var path = _DOMUtils.getWindowPath();
9717
9758
  var _historyState = historyState;
@@ -17395,6 +17436,7 @@
17395
17436
  * LICENSE file in the root directory of this source tree. An additional grant
17396
17437
  * of patent rights can be found in the PATENTS file in the same directory.
17397
17438
  *
17439
+ *
17398
17440
  * @typechecks static-only
17399
17441
  */
17400
17442
 
@@ -17402,9 +17444,6 @@
17402
17444
 
17403
17445
  /**
17404
17446
  * Memoizes the return value of a function that accepts one string argument.
17405
- *
17406
- * @param {function} callback
17407
- * @return {function}
17408
17447
  */
17409
17448
 
17410
17449
  function memoizeStringOnly(callback) {
@@ -22649,18 +22688,18 @@
22649
22688
  * @param {function} callback Callback function.
22650
22689
  * @return {object} Object with a `remove` method.
22651
22690
  */
22652
- listen: function (target, eventType, callback) {
22691
+ listen: function listen(target, eventType, callback) {
22653
22692
  if (target.addEventListener) {
22654
22693
  target.addEventListener(eventType, callback, false);
22655
22694
  return {
22656
- remove: function () {
22695
+ remove: function remove() {
22657
22696
  target.removeEventListener(eventType, callback, false);
22658
22697
  }
22659
22698
  };
22660
22699
  } else if (target.attachEvent) {
22661
22700
  target.attachEvent('on' + eventType, callback);
22662
22701
  return {
22663
- remove: function () {
22702
+ remove: function remove() {
22664
22703
  target.detachEvent('on' + eventType, callback);
22665
22704
  }
22666
22705
  };
@@ -22675,11 +22714,11 @@
22675
22714
  * @param {function} callback Callback function.
22676
22715
  * @return {object} Object with a `remove` method.
22677
22716
  */
22678
- capture: function (target, eventType, callback) {
22717
+ capture: function capture(target, eventType, callback) {
22679
22718
  if (target.addEventListener) {
22680
22719
  target.addEventListener(eventType, callback, true);
22681
22720
  return {
22682
- remove: function () {
22721
+ remove: function remove() {
22683
22722
  target.removeEventListener(eventType, callback, true);
22684
22723
  }
22685
22724
  };
@@ -22693,7 +22732,7 @@
22693
22732
  }
22694
22733
  },
22695
22734
 
22696
- registerDefault: function () {}
22735
+ registerDefault: function registerDefault() {}
22697
22736
  };
22698
22737
 
22699
22738
  module.exports = EventListener;
@@ -23389,7 +23428,7 @@
23389
23428
  * LICENSE file in the root directory of this source tree. An additional grant
23390
23429
  * of patent rights can be found in the PATENTS file in the same directory.
23391
23430
  *
23392
- * @typechecks
23431
+ *
23393
23432
  */
23394
23433
 
23395
23434
  var isTextNode = __webpack_require__(205);
@@ -23398,10 +23437,6 @@
23398
23437
 
23399
23438
  /**
23400
23439
  * Checks if a given DOM node contains or is another DOM node.
23401
- *
23402
- * @param {?DOMNode} outerNode Outer DOM node.
23403
- * @param {?DOMNode} innerNode Inner DOM node.
23404
- * @return {boolean} True if `outerNode` contains or is `innerNode`.
23405
23440
  */
23406
23441
  function containsNode(outerNode, innerNode) {
23407
23442
  if (!outerNode || !innerNode) {
@@ -23412,7 +23447,7 @@
23412
23447
  return false;
23413
23448
  } else if (isTextNode(innerNode)) {
23414
23449
  return containsNode(outerNode, innerNode.parentNode);
23415
- } else if (outerNode.contains) {
23450
+ } else if ('contains' in outerNode) {
23416
23451
  return outerNode.contains(innerNode);
23417
23452
  } else if (outerNode.compareDocumentPosition) {
23418
23453
  return !!(outerNode.compareDocumentPosition(innerNode) & 16);
@@ -26340,6 +26375,13 @@
26340
26375
  anchor: new google.maps.Point(16, 16)
26341
26376
  };
26342
26377
 
26378
+ var visitedPin = {
26379
+ url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAdVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD+/v739/fs7Ozq6urPz8+ZmZmEhIQqKioAAAAAAADa2trt7e3t7e1ISEjc3NwAAABnZGPt7e1ua2q4t7acmpmRj453dHRraGfr6+u8u7rLysnR0M/LysrJyMh/fHvZ2w4nAAAAGHRSTlMABAcNFCgdLPvt09CfZ1g0Ihmx19U9sh+WxKfKAAAA+klEQVQ4y42T2RbCIAxERQjdVzegq3X5/080okerzTHOSx/mnimQyWomIcQahZ8VITSlVF5SIkTYSpcQoKDU6hvxNuRpEoVhlKQ5eOTDryCLbdP1g7t2zRhnUCEx83VR29a81Nq60Ei8/d325MxMbtruXoSQVbE5mi8dN0UlxSNAQX02C533oHyEkDqzbgk4m2kfgQFxawi1MUb4gNwaUjbHCATKtKGBJi3vgIKko4EuASXwCEHU00AfBWp9B8KBBobwH4D9BX9I/pr4UCMNjP6hmKf+PawDBjzHPS2B6TluvjB05S6PynGlpWo/9LPa84vDrx6/vOz63wC77Demd5pVhAAAAABJRU5ErkJggg==',
26380
+ size: new google.maps.Size(32, 32),
26381
+ origin: new google.maps.Point(0, 0),
26382
+ anchor: new google.maps.Point(16, 16)
26383
+ };
26384
+
26343
26385
  var Map = _react2['default'].createClass({
26344
26386
  displayName: 'Map',
26345
26387
 
@@ -26350,7 +26392,7 @@
26350
26392
  var markers = this.props.records.map(function (record) {
26351
26393
  return _react2['default'].createElement(_reactGoogleMaps.Marker, {
26352
26394
  customInfo: 'Marker A',
26353
- icon: record == _this.props.highlightRecord ? highlightPin : defaultPin,
26395
+ icon: _this.getPinForRecord(record),
26354
26396
  key: record.id,
26355
26397
  onClick: _this.handleMarkerClick.bind(_this, record),
26356
26398
  onMouseout: _this.handleMarkerMouseOut.bind(_this, record),
@@ -26466,6 +26508,8 @@
26466
26508
  this.preventReloadOnce = true;
26467
26509
  this.infoBubbleRecord = record;
26468
26510
  this.infoBubble.open();
26511
+
26512
+ this.props.setRecordVisited(record);
26469
26513
  }
26470
26514
 
26471
26515
  return handleMarkerClick;
@@ -26496,6 +26540,22 @@
26496
26540
  }
26497
26541
 
26498
26542
  return closeInfoBubble;
26543
+ }(),
26544
+
26545
+ getPinForRecord: function () {
26546
+ function getPinForRecord(record) {
26547
+ if (record == this.getHighlightRecord()) return highlightPin;else if (this.props.visitedRecordIds.indexOf(record.id) !== -1) return visitedPin;else return defaultPin;
26548
+ }
26549
+
26550
+ return getPinForRecord;
26551
+ }(),
26552
+
26553
+ getHighlightRecord: function () {
26554
+ function getHighlightRecord() {
26555
+ return this.props.highlightRecord || this.infoBubbleRecord;
26556
+ }
26557
+
26558
+ return getHighlightRecord;
26499
26559
  }()
26500
26560
  });
26501
26561
 
@@ -26613,7 +26673,7 @@
26613
26673
  _createClass(GoogleMapLoader, [{
26614
26674
  key: "mountGoogleMap",
26615
26675
  value: function mountGoogleMap(domEl) {
26616
- if (this.state.map) {
26676
+ if (this.state.map || domEl === null) {
26617
26677
  return;
26618
26678
  }
26619
26679
  var _props$googleMapElement$props = this.props.googleMapElement.props;
@@ -29538,6 +29598,21 @@
29538
29598
  }
29539
29599
  };
29540
29600
 
29601
+ // If we're inside a MarkerClusterer, allow ourselves to be clustered
29602
+ if (overlayViewProps.anchorHolderRef) {
29603
+ if ("MarkerClusterer" === overlayViewProps.anchorHolderRef.getAnchorType()) {
29604
+ overlayView.getDraggable = function getDraggable() {
29605
+ return !!overlayViewProps.draggable;
29606
+ };
29607
+
29608
+ overlayView.getPosition = function getPosition() {
29609
+ return new google.maps.LatLng(this.position);
29610
+ };
29611
+
29612
+ overlayViewProps.anchorHolderRef.getAnchor().addMarker(overlayView);
29613
+ }
29614
+ }
29615
+
29541
29616
  return overlayView;
29542
29617
  }
29543
29618
  }, {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betterplace_explorer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.alpha8
4
+ version: 0.0.1.pre.alpha9
5
5
  platform: ruby
6
6
  authors:
7
7
  - betterplace developers
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  version: 1.3.1
47
47
  requirements: []
48
48
  rubyforge_project:
49
- rubygems_version: 2.6.4
49
+ rubygems_version: 2.5.1
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: An awesome explorer