Added dump debug method
Change-Id: I60c444d076fd63b4ba25295d341f1194b9b38793
diff --git a/src/static/index.css b/src/static/index.css
index 46adc30..b6d591e 100644
--- a/src/static/index.css
+++ b/src/static/index.css
@@ -144,6 +144,10 @@
text-indent: -.5em;
}
+.messages span {
+ text-indent: initial;
+}
+
.messages.headlines li {
background-color: rgba(0, 0, 0, .6);
border-radius: 4px;
@@ -156,7 +160,6 @@
border-radius: 2px;
display: inline-block;
padding: 1px 3px;
- text-indent: initial;
}
.messages.headlines li.history {
diff --git a/src/travel.js b/src/travel.js
index 3e86d43..f089fba 100644
--- a/src/travel.js
+++ b/src/travel.js
@@ -21,6 +21,7 @@
var vanadiumWrapperDefault = require('./vanadium-wrapper');
+var debug = require('./debug');
var describeDestination = require('./describe-destination');
var naming = require('./naming');
var strings = require('./strings').currentLocale;
@@ -76,6 +77,14 @@
var Travel = defineClass({
publics: {
+ dump: function() {
+ this.sync.getData().then(function(data) {
+ debug.log(data);
+ }, function(err) {
+ console.error(err);
+ });
+ },
+
error: function (err) {
this.messages.push(Message.error(err));
},
diff --git a/src/travelsync.js b/src/travelsync.js
index e3406ac..f32f572 100644
--- a/src/travelsync.js
+++ b/src/travelsync.js
@@ -83,6 +83,12 @@
});
},
+ getData: function() {
+ return this.startSyncbase.then(function(syncbase) {
+ return syncbase.getData();
+ });
+ },
+
/**
* Sets the active trip to the given trip ID after it is available.
*/
diff --git a/src/vanadium-wrapper/syncbase-wrapper.js b/src/vanadium-wrapper/syncbase-wrapper.js
index b6f63ae..6cf439e 100644
--- a/src/vanadium-wrapper/syncbase-wrapper.js
+++ b/src/vanadium-wrapper/syncbase-wrapper.js
@@ -140,6 +140,10 @@
return this.manageWrite(this.standardDelete(this.deleteFromSyncbase, k));
},
+ getData: function() {
+ return this.data;
+ },
+
/**
* Since I/O is asynchronous, sparse, and fast, let's avoid concurrency/
* merging with the local syncbase instance by only starting a refresh if
@@ -162,6 +166,7 @@
if (!current) {
current = this.pull.current = this.pull().then(function(data) {
self.pull.current = null;
+ self.data = data;
self.onUpdate(data);
return data;
}, function(err) {