Skip to content

Commit

Permalink
Merge pull request #95 from steemplus/master
Browse files Browse the repository at this point in the history
SteemPlus 2.16.1
  • Loading branch information
stoodkev committed Jun 1, 2018
2 parents a6b6814 + e98dee9 commit a87d7e6
Show file tree
Hide file tree
Showing 11 changed files with 500 additions and 404 deletions.
38 changes: 19 additions & 19 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,36 +287,36 @@ function startOfflineFeatures(items, user, account)
chrome.runtime.sendMessage({ token:token, to: 'rewards_tab', order: 'start',data:{totalSteem:totalSteemLS,totalVests:totalVestsLS,base:steemPriceLS}});
if(author_popup_info&&steemit)
chrome.runtime.sendMessage({ token:token, to: 'author_popup_info', order: 'start',data:{user:user}});
if(add_signature&&steemit)
if(add_signature&&(steemit||busy))
chrome.runtime.sendMessage({ token:token, to: 'add_signature', order: 'start',data:{user:user, steemit:steemit, busy:busy, utopian:utopian}});
if(add_signature&&steemit)
if(resteem_indicator&&steemit)
chrome.runtime.sendMessage({ token:token, to: 'resteem_indicator', order: 'start',data:{}});


if (steemit&&steemit_more_info) {
if(post_votes_list)
if (steemit_more_info) {
if(steemit&&post_votes_list)
chrome.runtime.sendMessage({ token:token, to: 'post_votes_list', order: 'start',data:{rewardBalance:rewardBalanceLS, recentClaims:recentClaimsLS, steemPrice:steemPriceLS}});
if(vote_tab)
if(steemit&&vote_tab)
chrome.runtime.sendMessage({ token:token, to: 'vote_tab', order: 'start',data:{rewardBalance:rewardBalanceLS, recentClaims:recentClaimsLS, steemPrice:steemPriceLS}});
if(external_link_tab)
if(steemit&&external_link_tab)
chrome.runtime.sendMessage({ token:token, to: 'external_link_tab', order: 'start',data:{}});
if(search_bar)
if(steemit&&search_bar)
chrome.runtime.sendMessage({ token:token, to: 'search_bar', order: 'start',data:{}});
if(mentions_tab)
if(steemit&&mentions_tab)
chrome.runtime.sendMessage({ token:token, to: 'mentions_tab', order: 'start',data:{rewardBalance:rewardBalanceLS, recentClaims:recentClaimsLS, steemPrice:steemPriceLS}});
if(vote_weight_slider)
if(steemit&&vote_weight_slider)
chrome.runtime.sendMessage({ token:token, to: 'vote_weight_slider', order: 'start',data:{rewardBalance:rewardBalanceLS, recentClaims:recentClaimsLS, steemPrice:steemPriceLS, votePowerReserveRate:votePowerReserveRateLS, account:account}});
if(boost_button)
chrome.runtime.sendMessage({ token:token, to: 'boost_button', order: 'start',data:{}});
if(gif_picker)
if((steemit||busy)&&boost_button)
chrome.runtime.sendMessage({ token:token, to: 'boost_button', order: 'start',data:{user:user, steemit:steemit, busy:busy}});
if(steemit&&gif_picker)
chrome.runtime.sendMessage({ token:token, to: 'gif_picker', order: 'start',data:{}});
if(user_info_popover)
if(steemit&&user_info_popover)
chrome.runtime.sendMessage({ token:token, to: 'user_info_popover', order: 'start',data:{rewardBalance:rewardBalanceLS, recentClaims:recentClaimsLS, steemPrice:steemPriceLS, votePowerReserveRate:votePowerReserveRateLS}});
if(blog_histogram)
if(steemit&&blog_histogram)
chrome.runtime.sendMessage({ token:token, to: 'blog_histogram', order: 'start',data:{rewardBalance: rewardBalanceLS, recentClaims:recentClaimsLS, steemPrice:steemPriceLS}});
if(md_editor_beautifier)
if(steemit&&md_editor_beautifier)
chrome.runtime.sendMessage({ token:token, to: 'md_editor_beautifier', order: 'start',data:{}});
if(post_floating_bottom_bar)
if(steemit&&post_floating_bottom_bar)
chrome.runtime.sendMessage({ token:token, to: 'post_floating_bottom_bar', order: 'start',data:{}});
}

Expand All @@ -337,8 +337,8 @@ function startOfflineFeatures(items, user, account)
chrome.runtime.sendMessage({ token:token, to: 'acc_v', order: 'click',data:{steemit:steemit,busy:busy,global:{totalSteem:totalSteemLS,totalVests:totalVestsLS},market:market} });
if(rank&&steemit)
chrome.runtime.sendMessage({ badge:items.badge,token:token, to: 'rank', order: 'click',data:{totalSteem:totalSteemLS,totalVests:totalVestsLS}});
if(steemit&&boost_button&&steemit_more_info)
chrome.runtime.sendMessage({ token:token, to: 'boost_button', order: 'click', data:{user:user}});
if((steemit||busy)&&boost_button&&steemit_more_info)
chrome.runtime.sendMessage({ token:token, to: 'boost_button', order: 'click', data:{user:user, steemit:steemit, busy:busy}});
if(steemit&&md_editor_beautifier&&steemit_more_info)
chrome.runtime.sendMessage({ token:token, to: 'md_editor_beautifier', order: 'click', data:{}});
if(steemit&&user_info_popover&&steemit_more_info)
Expand Down Expand Up @@ -371,7 +371,7 @@ function startOfflineFeatures(items, user, account)
chrome.runtime.sendMessage({ token:token, to: 'gif_picker', order: 'click',data:{}});
if(author_popup_info&&steemit)
chrome.runtime.sendMessage({ token:token, to: 'author_popup_info', order: 'click',data:{user:user}});
if(add_signature&&steemit)
if(add_signature&&(steemit||busy))
chrome.runtime.sendMessage({ token:token, to: 'add_signature', order: 'click',data:{user:user, steemit:steemit, busy:busy, utopian:utopian}});
if(resteem_indicator&&steemit)
chrome.runtime.sendMessage({ token:token, to: 'resteem_indicator', order: 'click',data:{}});
Expand Down
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"name": "SteemPlus",
"description": "Lightweight toolbox for Steemit",
"version": "2.16",
"version": "2.16.1",
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"browser_action": {
"default_icon": "src/img/logo.png",
Expand Down Expand Up @@ -111,6 +111,7 @@
"src/css/transferTo.css",
"src/css/oneup.css",
"src/css/favorite_section.css",
"src/css/boost_button.css",
"src/css/steemit_more_info.css",
"src/css/board_reward.css",
"src/css/classification_user.css",
Expand Down
45 changes: 45 additions & 0 deletions src/css/boost_button.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* The Modal (background) */
.modal-busy {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content/Box */
.modal-content-busy {
background-color: #fefefe;
margin: 15% auto; /* 15% from the top and centered */
padding: 20px;
border: 1px solid #888;
width: 80%; /* Could be more or less, depending on screen size */
}

/* The Close Button */
.close-busy {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}

.close-busy:hover,
.close-busy:focus {
color: black;
text-decoration: none;
cursor: pointer;
}

.input-busy, .select-busy
{
width: 50% !important;
border: 1px solid #0068DE !important;
border-radius: 3px !important;
padding-left: 0.50em !important;
}
2 changes: 1 addition & 1 deletion src/css/loginSteemPlus.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
width:36px;
height:36px;
display: inline-block;
margin-left: 0.5em;
margin-right: 0.4em;
margin-bottom: 0.5em;
vertical-align: middle;
}
71 changes: 65 additions & 6 deletions src/js/add_signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ function startAddSignature()

$('.Comment__footer__controls > a').click(function(){
setTimeout(function(){
console.log('Comment__footer__controls');
$('.ReplyEditor__body textarea').each(function() {
var textarea = $(this);
console.log(textarea);
setupAddCommentSignature(textarea);
});
},1000);
Expand All @@ -90,6 +88,53 @@ function startAddSignature()
});
}
}
else if(isBusy)
{
if(regexCreatePostBusy.test(window.location.href))
{
if($('textarea.ant-input').length===0)
{
retryCountAddSignature++;
setTimeout(startAddSignature, 1000);
}
else
{
setupAddPostSignature($('textarea.ant-input'));
}
}
else if(regexSettingsBusySignature.test(window.location.href))
{
if(window.location.href.match(regexSettingsBusySignature)[1]===myUsernameSignature)
{
$('.content').children().remove();
displayCreateSignature();
}
}
else if(regexPostBusy.test(window.location.href))
{
console.log('post busy');

setTimeout(function(){
console.log($('textarea.ant-input'));
$('textarea.ant-input').each(function() {
console.log($(this));
var textarea = $(this);
setupAddCommentSignature(textarea);
});
},2000);


$('a.CommentFooter__link').click(function(){
console.log('click');
setTimeout(function(){
$('textarea.ant-input').each(function() {
var textarea = $(this);
setupAddCommentSignature(textarea);
});
},1000);
});
}
}
}

// Function used to display the panel to create the signature
Expand All @@ -101,11 +146,16 @@ function displayCreateSignature()
var userSignatureComments = (item.user_signature_comments===undefined ? '' : item.user_signature_comments );
var userSignaturePosts = (item.user_signature_posts===undefined ? '' : item.user_signature_posts );

var classButtonSaveSignature = '';
if(isBusy) classButtonSaveSignature = 'ant-btn Action--primary';
else if(isSteemit) classButtonSaveSignature = 'button';


var divSignature = $('<div class="signature-panel">\
<div class="bootstrap-wrapper">\
<h4>Signature</h4>\
<div class="container container-signature-md">\
<div class="row">\
<h4>Signature</h4>\
<select id="select-type-signature" class="col-12">\
<option value="posts">Posts</option> \
<option value="comments">Comments</option>\
Expand Down Expand Up @@ -150,14 +200,22 @@ function displayCreateSignature()
</div>\
<textarea class="col-6 signature-editor" data-bar=".editor-bar" data-preview=".editor-preview">'+ userSignaturePosts + '</textarea>\
<div class="markdownlive-preview editor-preview col-6 signature-preview"></div>\
<input id="saveSignature" class="button" value="Save Posts Signature" style="margin-top: 1em;">\
<input id="saveSignature" class="' + classButtonSaveSignature + '" value="Save Posts Signature" style="margin-top: 1em;">\
</div>\
</div>\
</div>\
</div>');

// Add panel to setting page
$('.Settings').append(divSignature);
if(isSteemit)
$('.Settings').append(divSignature);
else if(isBusy)
{
document.title = 'Edit signature';
$('.content').children().remove();
$('.content').append(divSignature);

}

// Listener on change dropdown lists
$('#select-type-signature').on('change', function(){
Expand Down Expand Up @@ -263,6 +321,7 @@ function setupAddCommentSignature(textarea)
// Get signature from local storage
// We use local storage again and not parameter cause if user updated his signature in another tab, we still use the newest one
chrome.storage.local.get(['user_signature_comments'], function(item){
console.log(item.user_signature_comments);
if(item.user_signature_comments!==undefined&&item.user_signature_comments!=='')
{
$(textarea).after('<a class="add-signature-comment">Add Signature</a>');
Expand Down

0 comments on commit a87d7e6

Please sign in to comment.