Skip to content

Commit

Permalink
Minor style changes and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho committed Jan 2, 2024
1 parent bde8e7e commit 5ee68df
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 28 deletions.
26 changes: 12 additions & 14 deletions assets/eco-scripts/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,11 @@ function askForSavingContracts(changeToExample = true) {
buttonsStyling: false
});
swalWithBootstrapButtons.fire({
title: "Want to save codes to local storage?",
icon: "warning",
title: "Do you want to save your " + Editor.tabs + 1 + " files in your browser local storage?",
icon: "question",
showDenyButton: true,
confirmButtonText: "Yes, save it!",
denyButtonText: "No",
denyButtonText: "No. Clean it.",
timer: 15000,
color: "#00AF92",
background: "#263A40",
Expand All @@ -249,16 +249,14 @@ function askForSavingContracts(changeToExample = true) {
html: htmlText,
color: "#00AF92",
background: "#263A40",
}).then((result) => {
if (result.isConfirmed) {
var fileName = document.getElementById("swal-filename").value;
if (!fileName)
fileName = "saved_" + SELECTED_COMPILER;

saveSCExample(fileName);
if (changeToExample)
setExample(SELECTED_COMPILER, $("#ExampleList")[0].selectedIndex);
}
}).then(() => {
var fileName = document.getElementById("swal-filename").value;
if (!fileName)
fileName = makeid(5) + "_" + SELECTED_COMPILER;

saveSCExample(fileName);
if (changeToExample)
setExample(SELECTED_COMPILER, $("#ExampleList")[0].selectedIndex);
});

/*
Expand Down Expand Up @@ -291,7 +289,7 @@ function askForDeletingContract() {
});
swalWithBootstrapButtons.fire({
title: "Want to delete contract " + key + "?",
icon: "warning",
icon: "question",
showCancelButton: true,
confirmButtonText: "Yes, delete it!",
cancelButtonText: "No",
Expand Down
14 changes: 14 additions & 0 deletions assets/eco-scripts/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,3 +293,17 @@ function hexToBase64(hexstr) {
const str = hexstring2str(hexstr);
return btoa(str);
}



//Function to generated random IDS
function makeid(length) {
let id = '';
const labelCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let counter = 0;
while (counter < length) {
id += labelCharacters.charAt(Math.floor(Math.random() * labelCharacters.length));
counter += 1;
}
return id;
}
12 changes: 0 additions & 12 deletions assets/eco-scripts/wallet_addNewAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ function togglePasswordSwal() {
passwordField.attr('type', passwordFieldType === 'password' ? 'text' : 'password');
}

//Function to generated label to imported account
function makeid(length) {
let id = '';
const labelCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let counter = 0;
while (counter < length) {
id += labelCharacters.charAt(Math.floor(Math.random() * labelCharacters.length));
counter += 1;
}
return id;
}

//First verifications for adding new wallet
function addWalletFromForm() {
var type = $("#type_to_register")[0].value;
Expand Down
8 changes: 8 additions & 0 deletions assets/ux_css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ body {
background: #154d44;
}

.btn-1-darker-danger {
background: #5f1b1d;
}

.btn-1-darker-danger:hover {
background: #f25e63;
}

/* END SIMPLE BTN */

.preloader .spinner-grow {
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@
<div class="col-md-4">
<button type="button" id="deleteContractBtn" onClick="askForDeletingContract()"
style="text-align: center!important;font-weight: bold!important; width: 100%;"
class="btn btn-default btn-1 btn-1-darker"><i class="fa-solid fa-trash"></i>
class="btn btn-default btn-1 btn-1-darker-danger"><i class="fa-solid fa-trash"></i>
Delete
</button>
</div>
<div class="col-md-4">
<button type="button" id="saveContractBtn" onClick="askForSavingContracts(false)"
style="text-align: center!important;font-weight: bold!important; width: 100%;"
class="btn btn-default btn-1 btn-1-darker"><i
class="btn btn-default btn-1"><i
class="fa-solid fa-floppy-disk"></i>
Save
</button>
Expand Down

0 comments on commit 5ee68df

Please sign in to comment.