Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AddBlockX(operation)
- {
- var listWrapper = document.getElementById('items_list_wrapper');
- var main_div = document.createElement("div");
- main_div.classList.add("col-xs-12","q_wrapper");
- var metadata = JSON.parse(operation.json_metadata);
- if(metadata.image)
- {
- var image = metadata.image[0];
- }
- else
- {
- var image = '/components/com_q/noimage.png';
- }
- var img_div = document.createElement("div");
- img_div.classList.add("img_div");
- main_div.appendChild(img_div);
- img_div.style.backgroundImage = "url('"+image+"')";
- var q_div = document.createElement("div");
- q_div.classList.add("q_div");
- main_div.appendChild(q_div);
- var title = operation.title;
- var author = operation.author;
- var created = operation.created;
- var last_update = operation.last_update;
- var total_payout_value = operation.total_payout_value;
- var pending_payout_value = operation.pending_payout_value;
- var total_pending_payout_value = operation.total_pending_payout_value;
- var votes = operation.active_votes.length;
- var vl = total_pending_payout_value;
- if(total_payout_value > total_pending_payout_value)
- {
- vl = total_payout_value;
- }
- var tags = '';
- if(typeof metadata.tags !== "undefined")
- {
- var tags_count = metadata.tags.length;
- for(var i = 0;i < tags_count;i++)
- {
- if(tags_count > 1)
- {
- tags = tags + " <span class='label label-warning'><a href='/created/" + metadata.tags[i] + "'>"+detransliterate(metadata.tags[i], 0)+'</a></span>';
- }
- }
- }
- var dt = getCommentDate(created);
- var s = 'onClick="getContentX(\''+operation.permlink.trim() +'\', \''+operation.author.trim() +'\');"';
- q_div.innerHTML = '<div class="q_header_wrapper"><h3><a href="javascript:void(0)" '+s+'>'+ title + '</a></h3></div>' + dt +' - Автор: <a href="/@'+ author +'" title="Все посты пользователя">@' + author + '</a>' + '<br/> Голосов <strong>' + votes + '</strong> на сумму <strong>' + vl + '</strong><br/>' + tags;
- var clearFix = document.createElement("div");
- clearFix.classList.add("clearFix");
- main_div.appendChild(clearFix);
- listWrapper.appendChild(main_div);
- }
Add Comment
Please, Sign In to add comment