Skip to content

Commit

Permalink
Revert changed to rest.js which use search parameters not yet impleme…
Browse files Browse the repository at this point in the history
…nted i.e. log version.
  • Loading branch information
shroffk committed Apr 17, 2014
1 parent 359ac5b commit 3c03354
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Olog/public_html/static/js/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,19 @@ function getLog(id){
} else {
$.ajaxSetup({async:false});
var idParts = id.split("_");
var url = serviceurl + 'logs/' + idParts[0];
var url = serviceurl + 'logs?id=' + idParts[0];

// Append version parameter that enabled us to get particular version from DB
url += '/?' + versionParameter + '=' + idParts[1];
// Append include history parameter because we can get old version from
// URL but have history disabled
url += '&' + historyParameter;

l(url);

// Get log/logs data
$.getJSON(url, function(log) {
savedLogs[log.id + '_' + log.version] = log;
$.getJSON(url, function(logs) {
$.each(logs, function(i, log) {
savedLogs[log.id + '_' + log.version] = log
});
logData = savedLogs[id];
});
}
Expand All @@ -198,16 +201,19 @@ function getLogNew(id, myFunction){

} else {
var idParts = id.split("_");
var url = serviceurl + 'logs/' + idParts[0];
var url = serviceurl + 'logs?id=' + idParts[0];

// Append version parameter that enabled us to get particular version from DB
url += '/?' + versionParameter + '=' + idParts[1];
// Append include history parameter because we can get old version from
// URL but have history disabled
url += '&' + historyParameter;

l(url);

// Get log/logs data
$.getJSON(url, function(log) {
savedLogs[log.id + '_' + log.version] = log;
$.getJSON(url, function(logs) {
$.each(logs, function(i, log) {
savedLogs[log.id + '_' + log.version] = log;
});
myFunction(savedLogs[id]);
});
}
Expand Down

0 comments on commit 3c03354

Please sign in to comment.