Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Started work on displaying posts.
Browse files Browse the repository at this point in the history
Issue #2 Steem module
Begun work on displaying steem posts. Saving progress to continue later.
  • Loading branch information
toniwidmo committed Dec 10, 2017
1 parent d7d66b3 commit 561df30
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions module/steem/steem-posts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
X,
31 changes: 22 additions & 9 deletions module/steem/steem.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function steem_load(args) {
getSteemProfile(args.user);
break;
case "posts":
console.log("posts");
getSteemPosts(args.users,args.tags);
console.log("Get posts for: user(s): "+args.user+", tag(s): "+args.tags);
break;
case "post":
getSteemPost(args.user,args.postid);
Expand All @@ -32,27 +33,41 @@ function steem_load(args) {
}

function displaySteemPosts(posts) {
// Get template from theme
// Template should be stored in global steem_posts

// First clear contentArea
$('#contentArea').html('');

// Else use default template
// Loop through posts, populate the template and append it to contentArea

// Then insert post values for each post returned
// Insert post values for each post returned

// Append post to content string

content = 'SteemPosts';

// Display content string
$('#contentArea').html(content);
}
function getSteemPostsTemplate(usernames,tags) {
// Save profile in global variable
steem_posts = posts;

// Get template from theme
var theme_template = "/theme/"+config.theme+"/steem-posts.html";
$.ajax(theme_template).done(displaySteemProfile).fail(function(){
// Else use default template
$.ajax("/module/steem/steem-posts.html").done(displaySteemPosts);
});

content = 'posts';
}
function getSteemPosts(usernames,tags) {
//
displaySteemPosts(['AAA']);
}

function displaySteemPost(post) {
// Get template from theme

// Else use default template
content = post;
// Display template
$('#contentArea').html(content);
Expand Down Expand Up @@ -150,5 +165,3 @@ $.getScript( "lib/steem-js/steem.min.js", function( data, textStatus, jqxhr ) {
console.log( jqxhr.status ); // 200
console.log( "steem.min.js load was performed." );
});

console.log( "XXXXX" ); // Data returned

0 comments on commit 561df30

Please sign in to comment.