zeroclipboard -> clipboard

This commit is contained in:
viktor 2017-07-03 14:52:26 +03:00
parent dbbb1a5eb4
commit de00f21664
10 changed files with 89 additions and 5256 deletions

View File

@ -62,6 +62,12 @@ Proof of phone is a smart oracle developed for the Oracles Network to serve as a
},
"dev": {
"contractAddress": "0x0000000000000000000000000000000000000000"
},
"contracts": {
"ProofOfPhone": {
"bin": "0x6060604052341561000c57fe5b5b6106438061001c6000396000f30060606040523615610081576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303679666146100835780633404fe32146100e357806371d01c73146101105780639fbebee51461015a578063b958a5e11461017e578063ceaecc84146101c8578063fe97ee8814610228575bfe5b341561008b57fe5b6100a16004808035906020019091905050610276565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100eb57fe5b61010e6004808035906020019091908035600019169060200190919050506102b4565b005b341561011857fe5b610144600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610354565b6040518082815260200191505060405180910390f35b341561016257fe5b61017c60048080356000191690602001909190505061036c565b005b341561018657fe5b6101b2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610537565b6040518082815260200191505060405180910390f35b34156101d057fe5b6101e66004808035906020019091905050610581565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561023057fe5b61025c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105b4565b604051808215151515815260200191505060405180910390f35b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b919050565b6040604051908101604052808381526020013373ffffffffffffffffffffffffffffffffffffffff168152506002600083600019166000191681526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050505b5050565b60006020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff1660026000836000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156103e55760006000fd5b60026000826000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001600060026000856000191660001916815260200190815260200160002060000154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260008260001916600019168152602001908152602001600020600001546000600060026000856000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b6000600060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415156106085760019050610612565b60009050610612565b5b9190505600a165627a7a7230582007f136df6454b733e1e101a03dccfd4fd2ad950dcba0025499b3f7a16c993ca50029",
"abi": [{"constant":true,"inputs":[{"name":"phone","type":"uint256"}],"name":"getAddressByPhone","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"phone","type":"uint256"},{"name":"codeToken","type":"bytes32"}],"name":"newToken","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"addressPhonePair","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"codeToken","type":"bytes32"}],"name":"activatePair","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPhoneByAddress","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phoneAddressPair","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"hasPhone","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"}]
}
}
}
}

View File

@ -216,9 +216,6 @@ input.POPInput.POPInputWallet:focus {
.shareButton:focus {
background: rgb(40,201,122) url("/img/shareIcon.png") no-repeat left center;
}
.shareButton.zeroclipboard-is-hover {
background: rgb(40,201,122) url("/img/shareIcon.png") no-repeat left center;
}
#step3CopyTable {
display: inline-block;
}
@ -242,10 +239,6 @@ table.copyTable.nomargin {
width: 42px;
height: 40px;
}
.copyTableCellCopyButton.zeroclipboard-is-hover {
transition: .2s ease-out;
background: rgb(115, 196, 217) url("/img/copy.png") no-repeat center center !important;
}
.copyTableCellCopyButton2 {
transition: .2s ease-out;
background: rgb(80,182,207) url("/img/copy.png") no-repeat center center;
@ -255,10 +248,6 @@ table.copyTable.nomargin {
width: 42px;
height: 40px;
}
.copyTableCellCopyButton2.zeroclipboard-is-hover {
transition: .2s ease-out;
background: rgb(115, 196, 217) url("/img/copy.png") no-repeat center center !important;
}
td.copyTableCellWalletValue1 {
background: rgb(156,224,236);
color: rgb(48,142,162);

File diff suppressed because one or more lines are too long

View File

@ -49,7 +49,7 @@ function startDapp(web3, isOraclesNetwork) {
var step1CopyTable = $('#step1CopyTable');
var step3CopyTable = $('#step3CopyTable');
var checkButton = $('#verifyButton');
var verifyButton = $('#verifyButton');
var topLabel = $('.topLabel');
var bottomLabelRight = $('.bottomLabelRight');
@ -64,6 +64,8 @@ function startDapp(web3, isOraclesNetwork) {
var privacyPolicyCheckbox = $("#privacyPolicyCheckbox");
var addressVal = $("#addressVal");
var addr = addressVal.text();
$("#copyWallet").attr("data-clipboard-text",addr);
function getConfigCallBack(web3, accounts, config) {
console.log(accounts);
@ -91,30 +93,19 @@ function startDapp(web3, isOraclesNetwork) {
});
}
var clientCopyWallet = new ZeroClipboard( document.getElementById("copyWallet") );
var copyWallet = document.getElementById('copyWallet');
var clientCopyWallet = new Clipboard( copyWallet );
clientCopyWallet.on( "success", function( event ) {
Materialize.toast('Address copied to buffer', 3000, 'rounded');
});
clientCopyWallet.on( "ready", function( readyEvent ) {
clientCopyWallet.on( "beforecopy", function( event ) {
var addr = addressVal.text();
$("#copyWallet").attr("data-clipboard-text",addr);
});
clientCopyWallet.on( "aftercopy", function( event ) {
Materialize.toast('Address copied to buffer', 3000, 'rounded');
});
});
var clientShare = new ZeroClipboard( document.getElementById("POPShare") );
clientShare.on( "ready", function( readyEvent ) {
clientShare.on( "beforecopy", function( event ) {
var host = "https://"+window.location.hostname;
var newUrl = host + "/?wallet=" + successTableCellWalletValue.text().trim();
$("#POPShare").attr("data-clipboard-text",newUrl);
});
clientShare.on( "aftercopy", function( event ) {
Materialize.toast('url copied to buffer', 3000, 'rounded');
});
});
var POPShare = document.getElementById('POPShare');
var clientShare = new Clipboard( POPShare );
clientShare.on( "success", function( event ) {
Materialize.toast('url copied to buffer', 3000, 'rounded');
});
phoneRadio.click(function(e) {
phoneRadioCheck();
@ -152,7 +143,7 @@ function startDapp(web3, isOraclesNetwork) {
location.reload();
});
checkButton.click(function(e) {
verifyButton.click(function(e) {
changeStepNumber(null, 4);
});
@ -389,6 +380,10 @@ function startDapp(web3, isOraclesNetwork) {
If the _addr is registered in the contract\'s Phone Registry, the hasPhone method returns true. Otherwise it returns false.');
successTableCellWalletValue.text(POPInputWallet.val());
var host = "https://" + window.location.hostname;
var newUrl = host + "/?wallet=" + successTableCellWalletValue.text().trim();
$("#POPShare").attr("data-clipboard-text", newUrl);
successTableCellPhoneValue.text(POPInputPhone.val());
radioContainer.addClass("hide");
inputContainer.hide();
@ -405,12 +400,10 @@ function startDapp(web3, isOraclesNetwork) {
POPDescContainerShortend.removeClass("POPDescContainerShortend");
checkboxContainer.addClass("hide");
var clientCopyWallet3 = new ZeroClipboard( $("#copyWallet3")[0] );
clientCopyWallet3.on( "ready", function( readyEvent ) {
clientCopyWallet3.on( "aftercopy", function( event ) {
Materialize.toast('Address copied to buffer', 3000, 'rounded');
});
var copyWallet3 = document.getElementById('copyWallet3');
var clientCopyWallet3 = new Clipboard( copyWallet3 );
clientCopyWallet3.on( "success", function( readyEvent ) {
Materialize.toast('Address copied to buffer', 3000, 'rounded');
});
}
break;
@ -447,14 +440,11 @@ function startDapp(web3, isOraclesNetwork) {
POPDescContainer.addClass("POPDescContainerShortend");
POPDescContainer.removeClass("POPDescContainer");
var clientCopyWallet2 = new ZeroClipboard( $("#copyWallet2")[0] );
console.log(clientCopyWallet2);
clientCopyWallet2.on( "ready", function( readyEvent ) {
clientCopyWallet2.on( "aftercopy", function( event ) {
Materialize.toast('Address copied to buffer', 3000, 'rounded');
});
var copyWallet2 = document.getElementById('copyWallet2');
var clientCopyWallet2 = new Clipboard(copyWallet2);
clientCopyWallet2.on( "success", function( readyEvent ) {
Materialize.toast('Address copied to buffer', 3000, 'rounded');
});
checkboxContainer.addClass("hide");
}

View File

@ -1,8 +1,14 @@
{
"environment": "live",
"Ethereum": {
"live": {
"contractAddress": "0x9bdf3f3d61f23f0d4eba9fff950b8facb6628fc3"
}
}
"environment": "live",
"Ethereum": {
"live": {
"contractAddress": "0x9bdf3f3d61f23f0d4eba9fff950b8facb6628fc3"
},
"contracts": {
"ProofOfPhone": {
"bin": "0x6060604052341561000c57fe5b5b6106438061001c6000396000f30060606040523615610081576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806303679666146100835780633404fe32146100e357806371d01c73146101105780639fbebee51461015a578063b958a5e11461017e578063ceaecc84146101c8578063fe97ee8814610228575bfe5b341561008b57fe5b6100a16004808035906020019091905050610276565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156100eb57fe5b61010e6004808035906020019091908035600019169060200190919050506102b4565b005b341561011857fe5b610144600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610354565b6040518082815260200191505060405180910390f35b341561016257fe5b61017c60048080356000191690602001909190505061036c565b005b341561018657fe5b6101b2600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610537565b6040518082815260200191505060405180910390f35b34156101d057fe5b6101e66004808035906020019091905050610581565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561023057fe5b61025c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506105b4565b604051808215151515815260200191505060405180910390f35b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b919050565b6040604051908101604052808381526020013373ffffffffffffffffffffffffffffffffffffffff168152506002600083600019166000191681526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050505b5050565b60006020528060005260406000206000915090505481565b3373ffffffffffffffffffffffffffffffffffffffff1660026000836000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156103e55760006000fd5b60026000826000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166001600060026000856000191660001916815260200190815260200160002060000154815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260008260001916600019168152602001908152602001600020600001546000600060026000856000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b6000600060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006000600060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415156106085760019050610612565b60009050610612565b5b9190505600a165627a7a7230582007f136df6454b733e1e101a03dccfd4fd2ad950dcba0025499b3f7a16c993ca50029",
"abi": [{"constant":true,"inputs":[{"name":"phone","type":"uint256"}],"name":"getAddressByPhone","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"phone","type":"uint256"},{"name":"codeToken","type":"bytes32"}],"name":"newToken","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"addressPhonePair","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"codeToken","type":"bytes32"}],"name":"activatePair","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPhoneByAddress","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phoneAddressPair","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"hasPhone","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"}]
}
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
//=require jquery.min.js
//=require web3.js
//=require ZeroClipboard.js
//=require clipboard.min.js
//=require materialize.min.js

View File

@ -114,4 +114,4 @@ html
div.loader-i.loader-i_right-bottom
include ./bottom.pug
script(src="./javascripts/sweetalert2.min.js" type="text/javascript").
script(src="./javascripts/application.js?v=1.4" type="text/javascript").
script(src="./javascripts/application.js?v=1.5" type="text/javascript").