Skip to content

Commit

Permalink
Minor style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vncoelho committed Jan 2, 2024
1 parent 3c42a8b commit 024e685
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
11 changes: 8 additions & 3 deletions assets/eco-scripts/contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ function checkNativeOrLocalExistedAndSwal(contractHashToAdd) {

var checkResultLocalContracts = checkIfLocalContractExists(contractHashToAdd);
if (checkResultLocalContracts != -1) {
var sText = "This is a Native Contract!" + "Local Contract is already listed!" + "Before adding it to Local Contract you should delete " + LOCAL_CONTRACTS[checkResultLocalContracts].manifest.name + " with hash " + LOCAL_CONTRACTS[checkResultLocalContracts].hash;
swal2Simple("Contract exists", sText, 5500, "error");
var sTitle = "Local Contract is already listed!";
var sText = "Before adding it to Local Contract you should delete " + LOCAL_CONTRACTS[checkResultLocalContracts].manifest.name + " with hash " + LOCAL_CONTRACTS[checkResultLocalContracts].hash;
swal2Simple(sTitle, sText, 5500, "error");
return true;
}

Expand All @@ -294,9 +295,12 @@ function checkNativeOrLocalExistedAndSwal(contractHashToAdd) {

function saveLocalContract() {
var contractHashToAdd = $("#import_contract_hash").val();

// if start with 0x cuts it
if (contractHashToAdd.slice(0, 2) === "0x")
contractHashToAdd = contractHashToAdd.slice(2);

// verify if scripthash is correct
if (!Neon.default.is.scriptHash(contractHashToAdd)) {
swal2Simple("Saving contract problems", "Invalid scripthash!", 5500, "error");
return;
Expand Down Expand Up @@ -326,7 +330,8 @@ function saveLocalContract() {
},
"json" // The format the response should be in
).fail(function () {
console.log("Error when trying to get getnativecontracts");
console.error("Error when trying to get getcontractstate inside function");
swal2Simple("Error when trying to get getcontractstate inside function", "Json call error", 5500, "error");
}); //End of POST for search
}

Expand Down
2 changes: 1 addition & 1 deletion assets/eco-scripts/wallet_center.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ function askToConnectToDapi() {

function checkIfWalletIsConnected() {
if (CONNECTED_WALLET_ID == -1) {
swal2Simple("No Wallet", "Connect a wallet and select an account first!", 5500, "error");
swal2Simple("Wallet not found!", "Connect a wallet and select an account first!", 5500, "error");
// Blink Wallet button for some couple of time
addBlinkToElement("#button-connect-wallet");
return false;
Expand Down
29 changes: 16 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,9 @@ <h4 class="green-title">

<div class="row mb-2 collapse show" id="hidden_notification_contracts">
<div class="row mb-2">
<div class="col-md-6">
<label for="native_methods">ABI Methods</label>
</div>
<div class="col-md-6">
<label for="notification_contracts">Additional Contracts</label>
<button type="submit" onclick="btnAdditionalContractsSave()"
Expand All @@ -451,6 +454,12 @@ <h4 class="green-title">
</div>
</div>
<div class="row mb-2">
<div class="col-md-6">
<div class="form-group">
<select onchange="drawParametersTable()" id="contract_methods"
class="form-select checkedOption" size="8"></select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<select id="notification_contracts" name="notification_contracts"
Expand All @@ -459,16 +468,11 @@ <h4 class="green-title">
</div>
</div>
</div>

</div>

<div class="row mb-2">
<div class="col-md-12">
<div class="form-group">
<label for="native_methods">ABI Methods</label>
<select onchange="drawParametersTable()" id="contract_methods"
class="form-select checkedOption" size="8"></select>
</div>

</div>
</div>

Expand All @@ -494,17 +498,16 @@ <h4 class="green-title">
<div class="standardContainer" style="margin-bottom: 30px;">
<h4 class="green-title">
Import Contract
<button type="button" onclick="saveLocalContract();" id="btnAddNewAccount"
class="btn btn-success btn-sm">
<i class="fas fa-user-plus"></i>
</button>
</h4>
<div class="container">
<div class="row mb-2">
<div class="col-md-6">
<button id="import_contract_hash_button" type="button" onclick="saveLocalContract()"
style="width: 100%;" class="btn btn-1"><i class="fas fa-file-contract"></i> Save
contract</button>
</div>
<div class="col-md-6">
<div class="col-md-12">
<input id="import_contract_hash" name="import_contract_hash" class="form-control"
placeholder="Insert contract script hash">
placeholder="Contract Script Hash (example: 0xacce6fd80d44e1796aa0c2c625e9e4e0ce39efc0)">
</div>
</div>
</div>
Expand Down

0 comments on commit 024e685

Please sign in to comment.