Permalink
Browse files

[stLei & mmBai] #12 add remoteView.get and callServiceGet, change CUR…

…RENT_TRIP
  • Loading branch information...
1 parent 4386ff2 commit fbbedf801e265bf54b05a12f7ef5f72bf6b98525 Li Gao committed Mar 21, 2012
@@ -163,7 +163,8 @@ DataPull.prototype.tripDetails = function(callback){
screens.show("pull_status");
devtrac.dataPull.updateStatus("Retrieving field trip information.");
- devtrac.remoteView.callWithUrl(DT_D7.CURRENT_TRIP, 'current_trip', tripSuccess, tripFailed);
+ devtrac.remoteView.get(DT_D7.CURRENT_TRIP, tripSuccess, tripFailed);
+
}
DataPull.prototype.tripSiteDetails = function(callback){
@@ -21,10 +21,12 @@ RemoteView.prototype.call = function(viewName, displayId, viewArgs, successCallb
devtrac.common.callService(params, successCallback, failedCallback);
}
-RemoteView.prototype.callWithUrl = function(url, displayId, successCallback, failedCallback){
- var params = {
- display_id: displayId
- };
- devtrac.common.callServiceWithUrl(url, params, successCallback, failedCallback);
+RemoteView.prototype.callWithUrl = function(url, successCallback, failedCallback){
+ devtrac.common.callServiceWithUrl(url, '', successCallback, failedCallback);
+}
+
+RemoteView.prototype.get = function(url, successCallback, failedCallback){
+ navigator.log.log("Remote view get.");
+ devtrac.common.callServiceGet(url, successCallback, failedCallback);
}
@@ -44,5 +44,5 @@ DT_D7 = {
SYSTEM_CONNECT: 'http://geo.devtrac.org/api/system/connect.json',
USER_LOGIN: 'http://geo.devtrac.org/api/user/login.json',
USER_LOGOUT: 'http://geo.devtrac.org/api/user/logout.json',
- CURRENT_TRIP: 'http://geo.devtrac.org/api/views/api_fieldtrips.json'
+ CURRENT_TRIP: 'http://geo.devtrac.org/api/views/api_fieldtrips.json?display_id=current_trip'
};

0 comments on commit fbbedf8

Please sign in to comment.