Skip to content

Commit

Permalink
Completed functionality for photo retrieval from database in order to…
Browse files Browse the repository at this point in the history
… populate the feeds view photos for each conspiracy.
  • Loading branch information
WilliamRADFunk committed Mar 4, 2016
1 parent 85f7bfb commit bcc7ee3
Showing 1 changed file with 41 additions and 4 deletions.
45 changes: 41 additions & 4 deletions js/scripts.js
Expand Up @@ -102,10 +102,45 @@ function registrationCall(victory)
}
function populateListView(consp)
{
/*var Conspiracies = Parse.Object.extend("Conspiracies");
var query = new Parse.Query(Conspiracies);
var query = new Parse.Query("Conspiracies");

//query.descending("viewCount");
query.equalTo("objectId", currentUser.id + "");
query.first({
success: function(user)
{
if(currentUser !== null)
{
post.set("username", user.get("username"));
post.set("title", title);
post.set("description", synopsis);
post.set("believer", true);
post.set("commentCount", 0);
post.set("conspirator_count", 0);
if(parseFile !== null) post.set("photo", parseFile);

post.save(null,
{
success: function(post)
{
submitPostCall(true);
},
error: function(post, error)
{
submitPostCall(false);
}
});
}
else
{
document.getElementById("input_title").value = "";
document.getElementById("input_synopsis").value = "";
document.getElementById("input_proof").value = "";
logout();
activateModal("Not logged in", "You are not logged in!");
}
}
});
/*
query.find({
success: function(results)
{
Expand Down Expand Up @@ -371,9 +406,11 @@ function populateFeedsCall(victory, results)
{
var object = results[i];
var ident = object.get("objectId");
var photo = object.get("photo")._url;

document.getElementById("feeds").innerHTML += '<div id="' + ident + '"' +
'class="feed" onclick="populateListView(this)"><div class="img_main-evidence">' +
'<img src="images/placeholder.jpg" height="200px" width="200px"></div>' +
'<img src="' + photo + '" height="200px" width="200px"></div>' +
'<div class="feed-content"><h3>' + object.get("title") + '</h3>' +
'<p class="author">Author: <span>' + object.get("username") + '</span></p>' +
'<p class="details">Conspirators: <span> ' + object.get("conspirator_count") + ' </span>' +
Expand Down

0 comments on commit bcc7ee3

Please sign in to comment.