Skip to content

Commit

Permalink
[stLei & mmBai] #12 add remoteView.get and callServiceGet, change CUR…
Browse files Browse the repository at this point in the history
…RENT_TRIP
  • Loading branch information
Li Gao committed Mar 21, 2012
1 parent 4386ff2 commit fbbedf8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/main/www/javascript/common/datapull.js
Expand Up @@ -163,7 +163,8 @@ DataPull.prototype.tripDetails = function(callback){


screens.show("pull_status"); screens.show("pull_status");
devtrac.dataPull.updateStatus("Retrieving field trip information."); 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){ DataPull.prototype.tripSiteDetails = function(callback){
Expand Down
12 changes: 7 additions & 5 deletions src/main/www/javascript/interactions/remote.view.js
Expand Up @@ -21,10 +21,12 @@ RemoteView.prototype.call = function(viewName, displayId, viewArgs, successCallb
devtrac.common.callService(params, successCallback, failedCallback); devtrac.common.callService(params, successCallback, failedCallback);
} }


RemoteView.prototype.callWithUrl = function(url, displayId, successCallback, failedCallback){ RemoteView.prototype.callWithUrl = function(url, successCallback, failedCallback){
var params = { devtrac.common.callServiceWithUrl(url, '', successCallback, failedCallback);
display_id: displayId }
};
devtrac.common.callServiceWithUrl(url, params, successCallback, failedCallback); RemoteView.prototype.get = function(url, successCallback, failedCallback){
navigator.log.log("Remote view get.");
devtrac.common.callServiceGet(url, successCallback, failedCallback);
} }


2 changes: 1 addition & 1 deletion src/main/www/javascript/lib/constants.js
Expand Up @@ -44,5 +44,5 @@ DT_D7 = {
SYSTEM_CONNECT: 'http://geo.devtrac.org/api/system/connect.json', SYSTEM_CONNECT: 'http://geo.devtrac.org/api/system/connect.json',
USER_LOGIN: 'http://geo.devtrac.org/api/user/login.json', USER_LOGIN: 'http://geo.devtrac.org/api/user/login.json',
USER_LOGOUT: 'http://geo.devtrac.org/api/user/logout.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.