Skip to content

Commit

Permalink
Merge pull request #191 from stoodkev/updateSMBatch
Browse files Browse the repository at this point in the history
Update Steem Monster Batch Buying
  • Loading branch information
stoodkev authored Apr 1, 2019
2 parents 3d95c9d + c5a443a commit 6cec432
Show file tree
Hide file tree
Showing 14 changed files with 112 additions and 159 deletions.
4 changes: 0 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,10 @@ chrome.storage.local.get(['loginPub','loginUser','loginMethod','premium_features
let account;
if(connect.method=="keychain"){
account = (await steem.api.getAccountsAsync([user]))[0];
console.log(user,account);
}
else{
initializeSteemConnect(connect.sessionToken);
const me=await api.me();
console.log("me",me);
account = me.account;
}
const votePowerReserveRateLS = (items.votePowerReserveRateLS == undefined ? 1 : items.votePowerReserveRateLS);
Expand Down Expand Up @@ -1529,7 +1527,6 @@ function date_diff_indays(date1, date2) {
}

function checkLastPost(last_post_url, account) {
console.log('account', account);
steem.api.getDiscussionsByAuthorBeforeDate('steem-plus', null, new Date().toISOString().split('.')[0], 1, function(err, result) {
if (!result[0].title.includes('Daily SteemPlus Stats')) {
if (last_post_url == undefined || last_post_url !== result[0].url) {
Expand Down Expand Up @@ -1589,7 +1586,6 @@ function checkLastPost(last_post_url, account) {
});

$('#vote_as_witness').click(function() {
console.log("wtf");
if(!connect||connect.method=="sc2"){
var win = window.open('https://v2.steemconnect.com/sign/account-witness-vote?witness=stoodkev&approve=1', '_blank');
if (win) {
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "SteemPlus",
"description": "Lightweight toolbox for Steemit",
"version": "3.8.1.0",
"version": "3.8.2.0",
"content_security_policy": "script-src 'self' 'unsafe-eval' ; object-src 'self'; child-src 'unsafe-eval' 'self'",
"browser_action": {
"default_icon": "src/img/logo.png",
Expand Down
45 changes: 19 additions & 26 deletions src/css/sm_batch.css
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
#total {
float: right;
display: inline-block;
width: 180px;
font-size: 1.4em;
text-align: center;
height: 50px;
margin-top: -3px;
}

#buttons {
width: 100% !important;
#batch_buy{
font-size: 13px;
margin-left: 20px;
}

.left_sm{
text-align: left;
width: 100%;
#input_sm {
width: 50px;
display: none;
margin-top:5px;
margin-left: 10px;
color: black;
border-radius: 5px;
}

.select-sm {
margin-top: 10px;
margin-bottom: 20px;
.select-sm {
margin-top: 10px !important;
margin-left: 30px;
}

#input_sm {
display: none;
width: 75px;
height:25px;
font-size: 20px;
margin-top: 5px;
.select-sm select{
text-transform: uppercase;
}

#ddlCurrency {
display: inline-block !important;
#market_results {
display: inline-block;
font-size: 14px !important;
margin-top: 8px;
}
2 changes: 0 additions & 2 deletions src/js/account_val.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ function createTitle() {
} else {
if ($('.vests-added').length === 0 && acc_steemit) {
var spanVestingShares = $('.UserWallet__balance > .column')[3];
console.log(spanVestingShares);
var newDiv = $('<div title="' + getVestString(accountAccountValue[0].vesting_shares) + '">' + $(spanVestingShares)[0].textContent.split('(')[0] + ($(spanVestingShares)[0].textContent.split('(')[1] == undefined ? '</div>' : '</div><div title="STEEM POWER delegated to/from this account">(' + $(spanVestingShares)[0].textContent.split('(')[1] + '</div>"'));
console.log(newDiv);
$(spanVestingShares)[0].textContent = '';
$(spanVestingShares).append(newDiv);
$(newDiv).parent().eq(0).addClass('vests-added');
Expand Down
2 changes: 1 addition & 1 deletion src/js/author_popup_info.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
// No parameters
function startAuthorPopupInfo() {
// Check url of the page. Need to be on a post to start the function
if (isSteemit && (regexPostSteemit.test(window.location.href)||regexPostSteemitWallet.test(window.location.href)) && retryCountAuthorPopupInfo < 20) {
if (isSteemit && regexPostSteemit.test(window.location.href) && retryCountAuthorPopupInfo < 20) {
if ($('.ptc').length === 0) {
// Looking for the right html element. If can't find it retry later. Maximum 20 seconds
retryCountAuthorPopupInfo++;
Expand Down
1 change: 0 additions & 1 deletion src/js/beneficiaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ function isEverythingFilled() {
return false;
}
} else if (isBusy) {
console.log($('.Editor__title').eq(0).val() === '', $('.ant-select-selection__choice__content').length === 0, $('textarea#body').eq(0).innerHTML === '')
if ($('.Editor__title').eq(0).val() === '' || $('.ant-select-selection__choice__content').length === 0 || $('textarea#body').eq(0).innerHTML === '') {
alert("Please enter a title, body and tags to your post!");
return false;
Expand Down
2 changes: 0 additions & 2 deletions src/js/beneficiary_donation.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ async function postBeneficiaryDonation() {
}]
];

console.log(operations);
if(connect.method=="sc2"){
api.broadcast(
operations,
Expand All @@ -184,7 +183,6 @@ async function postBeneficiaryDonation() {
}
else{
steem_keychain.requestBroadcast(connect.user, operations, "Posting", function(result){
console.log(result);
if(result.success) {
if (isSteemit)
window.location.replace('https://steemit.com');
Expand Down
2 changes: 0 additions & 2 deletions src/js/delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,8 @@ function createPopoverDelegation(isSteemit, isBusy, incomingDelegations, outgoin
$('#popoverDelegation').click(function(){
setTimeout(function(){
$('#popoverDelegation').popover('show');
console.log($(".stop_del").length);
$(".stop_del").unbind("click").click(function(){
const delegatee=$(this).data("delegatee");
console.log("undelegate");
if(!connect||connect.method=="sc2"){ //Use SteemConnect
window.open("https://v2.steemconnect.com/sign/delegateVestingShares?delegator=" + user + '&delegatee=' + delegatee + "&vesting_shares=" + 0 + "%20VESTS","_blank");
}else { // Use Keychain
Expand Down
5 changes: 0 additions & 5 deletions src/js/loginSteemPlus.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
}

if (window.location.href.includes('?access_token=')) {
console.log('create');
var url = new URL(window.location.href);
chrome.storage.local.set({
tokenExpire: Date.now() + 7 * 24 * 3600 * 1000,
Expand Down Expand Up @@ -58,7 +57,6 @@ chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if(request.data.connect.method=="sc2")
showLogout(loginIcon,request.data.connect);
else if(request.data.connect.method=="keychain"){
console.log(request.data.connect.user,user);
if(request.data.connect.user!=user)
chrome.storage.local.remove(['loginPub', 'loginUser', 'loginMethod'], function() {
location.reload();
Expand Down Expand Up @@ -128,15 +126,12 @@ function showLogout(loginIcon,connect){
$(loginIcon).click(function() {
if(connect.method=="sc2")
api.revokeToken(function(err, res) {
console.log(err, res);
chrome.storage.local.remove(['sessionToken', 'tokenExpire','loginMethod'], function() {
console.log("remove");
location.reload();
});
});
else
chrome.storage.local.remove(['loginUser', 'loginPub','loginMethod'], function() {
console.log("remove");
location.reload();
});
});
Expand Down
3 changes: 0 additions & 3 deletions src/js/premium_features.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ async function createTabPremiumFeatureList(premiumFeatureList) {
spp=0;
else
spp=spps[0].nbPoints;
console.log(spp +"spp");
// Create tab content
premiumFeatureList.html('\
<div class="feed-layout container">\
Expand Down Expand Up @@ -120,7 +119,6 @@ async function createTabPremiumFeatureList(premiumFeatureList) {

// Create event listener for subscribe buttons
$('.button-steemit-subscribe').click(event => {
console.log(event.target.name);
subscribeFeature(event.target.name);
});

Expand Down Expand Up @@ -189,7 +187,6 @@ function unsubscribeFeature(nameFeature){
// Function used to send the transfer to SteemPlus
// @param memo : memo discribing the purpose of the transfer
function sendTransfer(memo){
console.log(memo);
if(!connect||connect.method=="sc2"){ //Use SteemConnect
const url = 'https://steemconnect.com/sign/transfer?to=' + encodeURIComponent(accountName) + '&amount=0.001%20SBD&memo=' + encodeURIComponent(memo);
var win = window.open(url, '_blank');
Expand Down
Loading

0 comments on commit 6cec432

Please sign in to comment.