mirror of https://github.com/BTCPrivate/copay.git
commit
82abcb8036
|
@ -42,4 +42,4 @@ lib/*
|
||||||
js/copayBundle.js
|
js/copayBundle.js
|
||||||
config.js
|
config.js
|
||||||
webapp
|
webapp
|
||||||
|
chrome-extension
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"crypto-js": "http://crypto-js.googlecode.com/files/CryptoJS%20v3.1.2.zip",
|
"crypto-js": "http://crypto-js.googlecode.com/files/CryptoJS%20v3.1.2.zip",
|
||||||
"sjcl": "1.0.0",
|
"sjcl": "1.0.0",
|
||||||
"file-saver": "*",
|
"file-saver": "*",
|
||||||
"qrcode-decoder-js": "*"
|
"qrcode-decoder-js": "*",
|
||||||
|
"bitcore": "~0.1.19"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -631,3 +631,7 @@ p.dr-notification-text {
|
||||||
margin-top: -5px;
|
margin-top: -5px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input.ng-invalid-wallet-secret {
|
||||||
|
background: #FFB6C1;
|
||||||
|
}
|
||||||
|
|
51
ghpages.sh
51
ghpages.sh
|
@ -1,51 +0,0 @@
|
||||||
#! /bin/bash
|
|
||||||
|
|
||||||
#Description: A simple script to compile and copy only the needed files for the web app.
|
|
||||||
|
|
||||||
# Configs
|
|
||||||
APPDIR="webapp"
|
|
||||||
LIBDIR="$APPDIR/lib"
|
|
||||||
DOWNLOADDIR="$APPDIR/download"
|
|
||||||
ZIPFILE="copay_webapp_.zip"
|
|
||||||
|
|
||||||
OpenColor="\033["
|
|
||||||
Red="1;31m"
|
|
||||||
Yellow="1;33m"
|
|
||||||
Green="1;32m"
|
|
||||||
CloseColor="\033[0m"
|
|
||||||
|
|
||||||
# Create/Clean temp dir
|
|
||||||
echo -e "${OpenColor}${Green}* Checking temp dir...${CloseColor}"
|
|
||||||
if [ -d $APPDIR ]; then
|
|
||||||
rm -rf $APPDIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p $APPDIR
|
|
||||||
|
|
||||||
# Generate and copy bitcore bundle
|
|
||||||
if [ ! -d node_modules/bitcore ]; then
|
|
||||||
echo -e "${OpenColor}${Red}X The node_modules/bitcore dir does not exist. \nRun npm install and try again.${CloseColor}"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
echo -e "${OpenColor}${Green}* Generating bitcore bundle...${CloseColor}"
|
|
||||||
cd node_modules/bitcore
|
|
||||||
grunt --target=dev shell
|
|
||||||
cd ../..
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Re-compile copayBundle.js
|
|
||||||
echo -e "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
|
|
||||||
grunt --target=dev shell
|
|
||||||
|
|
||||||
# Copy all app files
|
|
||||||
echo -e "${OpenColor}${Green}* Copying all app files...${CloseColor}"
|
|
||||||
cp -af {css,font,img,js,lib,config.js,index.html} $APPDIR
|
|
||||||
cp -af node_modules/bitcore/browser/bundle.js $LIBDIR/
|
|
||||||
mv $LIBDIR/bundle.js $LIBDIR/bitcore.js
|
|
||||||
|
|
||||||
echo -e "${OpenColor}${Green}* Zipping all app files...${CloseColor}"
|
|
||||||
zip -r $ZIPFILE $APPDIR
|
|
||||||
mkdir -p $DOWNLOADDIR
|
|
||||||
mv $ZIPFILE $DOWNLOADDIR
|
|
||||||
|
|
||||||
echo -e "${OpenColor}${Yellow}\nAwesome! You just need to copy and paste the ./webapp content to your local repository and push it.${CloseColor}"
|
|
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
|
@ -0,0 +1,22 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<title>Copay Chrome Extension - Install</title>
|
||||||
|
<link rel="stylesheet" href="../../css/foundation.min.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="row">
|
||||||
|
<h1>Copay Installation:</h1>
|
||||||
|
<ul>
|
||||||
|
<li>Download <a href="copay-chrome-extension.zip">ZIP</a></li>
|
||||||
|
<li>Unpack the ZIP file</li>
|
||||||
|
<li>Navigate to "chrome://extensions" in your browser</li>
|
||||||
|
<li>Enable Developer Mode</li>
|
||||||
|
<li>Click "Load unpacked extension" and select the unzipped folder</li>
|
||||||
|
<li>Copay is installed!</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,5 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en" ng-csp>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
|
@ -7,6 +7,7 @@
|
||||||
<title>Copay - Multisignature Wallet</title>
|
<title>Copay - Multisignature Wallet</title>
|
||||||
<link rel="stylesheet" href="css/foundation.min.css">
|
<link rel="stylesheet" href="css/foundation.min.css">
|
||||||
<link rel="stylesheet" href="css/foundation-icons.css">
|
<link rel="stylesheet" href="css/foundation-icons.css">
|
||||||
|
<link rel="stylesheet" href="lib/angular/angular-csp.css">
|
||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
</head>
|
</head>
|
||||||
<body ng-cloak class="ng-cloak">
|
<body ng-cloak class="ng-cloak">
|
||||||
|
@ -192,7 +193,7 @@
|
||||||
<div class="box-signin radius">
|
<div class="box-signin radius">
|
||||||
<h3>Join a Wallet in Creation</h3>
|
<h3>Join a Wallet in Creation</h3>
|
||||||
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
|
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
|
||||||
<input type="text" class="form-control" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" required>
|
<input type="text" class="form-control" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required>
|
||||||
<input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" required>
|
<input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" required>
|
||||||
<input type="text" class="form-control" placeholder="Your name (optional)" name="nickname" ng-model="nickname">
|
<input type="text" class="form-control" placeholder="Your name (optional)" name="nickname" ng-model="nickname">
|
||||||
<button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button>
|
<button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button>
|
||||||
|
@ -592,7 +593,7 @@
|
||||||
<h3>{{title}}</h3>
|
<h3>{{title}}</h3>
|
||||||
<div class="small-12 medium-6 medium-centered large-6 large-centered columns">
|
<div class="small-12 medium-6 medium-centered large-6 large-centered columns">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Network Name</legend>
|
<legend>Bitcoin Network</legend>
|
||||||
<input id="network-name" type="checkbox" ng-model="networkName" ng-true-value="livenet" ng-false-value="testnet">
|
<input id="network-name" type="checkbox" ng-model="networkName" ng-true-value="livenet" ng-false-value="testnet">
|
||||||
<label for="network-name">Livenet</label>
|
<label for="network-name">Livenet</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@ -662,7 +663,7 @@ on supported browsers please check <a href="http://www.webrtc.org/">http://www.w
|
||||||
<script src="lib/angular-foundation/mm-foundation.min.js"></script>
|
<script src="lib/angular-foundation/mm-foundation.min.js"></script>
|
||||||
<script src="lib/angular-foundation/mm-foundation-tpls.min.js"></script>
|
<script src="lib/angular-foundation/mm-foundation-tpls.min.js"></script>
|
||||||
<script src="lib/peerjs/peer.js"></script>
|
<script src="lib/peerjs/peer.js"></script>
|
||||||
<script src="lib/bitcore.js"></script>
|
<script src="lib/bitcore/browser/bundle.js"></script>
|
||||||
<script src="lib/crypto-js/rollups/sha256.js"></script>
|
<script src="lib/crypto-js/rollups/sha256.js"></script>
|
||||||
<script src="lib/crypto-js/rollups/pbkdf2.js"></script>
|
<script src="lib/crypto-js/rollups/pbkdf2.js"></script>
|
||||||
<script src="lib/crypto-js/rollups/aes.js"></script>
|
<script src="lib/crypto-js/rollups/aes.js"></script>
|
||||||
|
|
|
@ -64,6 +64,21 @@ angular.module('copay.directives')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
.directive('walletSecret', ['walletFactory',
|
||||||
|
function(walletFactory) {
|
||||||
|
return {
|
||||||
|
require: 'ngModel',
|
||||||
|
link: function(scope, elem, attrs, ctrl) {
|
||||||
|
var validator = function(value) {
|
||||||
|
ctrl.$setValidity('walletSecret', Boolean(walletFactory.decodeSecret(value)));
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
ctrl.$parsers.unshift(validator);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
])
|
||||||
.directive('loading', function() {
|
.directive('loading', function() {
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
|
|
|
@ -162,16 +162,20 @@ WalletFactory.prototype.remove = function(walletId) {
|
||||||
this.log('TODO: remove wallet contents');
|
this.log('TODO: remove wallet contents');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
WalletFactory.prototype.decodeSecret = function(secret) {
|
||||||
|
try {
|
||||||
|
return Wallet.decodeSecret(secret);
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, cb) {
|
WalletFactory.prototype.joinCreateSession = function(secret, nickname, passphrase, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var s;
|
var s = self.decodeSecret(secret);
|
||||||
try {
|
if (!s) return cb('badSecret');
|
||||||
s=Wallet.decodeSecret(secret);
|
|
||||||
} catch (e) {
|
|
||||||
return cb('badSecret');
|
|
||||||
}
|
|
||||||
|
|
||||||
//Create our PrivateK
|
//Create our PrivateK
|
||||||
var privateKey = new PrivateKey({ networkName: this.networkName });
|
var privateKey = new PrivateKey({ networkName: this.networkName });
|
||||||
|
|
|
@ -74,4 +74,7 @@ angular
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.config(function($compileProvider) {
|
||||||
|
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|tel|chrome-extension):/);
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
"manifest_version": 2,
|
||||||
|
"name": "Copay",
|
||||||
|
"description": "A multisignature bitcoin wallet",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"homepage_url": "http://bitpay.github.io/copay",
|
||||||
|
"browser_action": {
|
||||||
|
"default_title": "Copay",
|
||||||
|
"default_icon": "img/icons/icon.png",
|
||||||
|
"default_popup": "popup.html"
|
||||||
|
},
|
||||||
|
"permissions": [
|
||||||
|
"tabs", "storage"
|
||||||
|
],
|
||||||
|
"options_page": "index.html#/settings",
|
||||||
|
"icons": {
|
||||||
|
"128": "img/icons/icon.png"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Copay</title>
|
||||||
|
<style>
|
||||||
|
body { background-color: #2C3E50; }
|
||||||
|
a {
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #008cba;
|
||||||
|
color: #fff;
|
||||||
|
display: block;
|
||||||
|
font-family: "Helvetica Neue","Helvetica",Helvetica,Arial,sans-serif;
|
||||||
|
margin: 20px 0;
|
||||||
|
opacity: .8;
|
||||||
|
outline: none;
|
||||||
|
padding: 10px;
|
||||||
|
text-decoration: none;
|
||||||
|
text-align: center;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
a:hover { opacity: 1; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a href="index.html#signin" target="_blank">Open wallet</a>
|
||||||
|
<a href="index.html#settings" target="_blank">Settings</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,65 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
#Description: A simple script to compile and copy only the needed files for the web app.
|
||||||
|
|
||||||
|
# Moving to root path
|
||||||
|
cd ../
|
||||||
|
|
||||||
|
# Configs
|
||||||
|
APPDIR="./webapp"
|
||||||
|
CHROMEDIR="./chrome-extension"
|
||||||
|
|
||||||
|
LIBDIR="$APPDIR/lib"
|
||||||
|
DOWNLOADDIR="$APPDIR/download"
|
||||||
|
CHROMEDOWNLOADDIR="$DOWNLOADDIR/chrome"
|
||||||
|
|
||||||
|
ZIPFILE="copay.zip"
|
||||||
|
CHROMEZIPFILE="copay-chrome-extension.zip"
|
||||||
|
|
||||||
|
OpenColor="\033["
|
||||||
|
Red="1;31m"
|
||||||
|
Yellow="1;33m"
|
||||||
|
Green="1;32m"
|
||||||
|
CloseColor="\033[0m"
|
||||||
|
|
||||||
|
# Create/Clean temp dir
|
||||||
|
echo -e "${OpenColor}${Green}* Checking temp dir...${CloseColor}"
|
||||||
|
if [ -d $APPDIR ]; then
|
||||||
|
rm -rf $APPDIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p $APPDIR
|
||||||
|
|
||||||
|
# Create/Clean chrome-extension dir
|
||||||
|
if [ -d $CHROMEDIR ]; then
|
||||||
|
rm -rf $CHROMEDIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p $CHROMEDIR
|
||||||
|
|
||||||
|
# Re-compile copayBundle.js
|
||||||
|
echo -e "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
|
||||||
|
grunt --target=dev shell
|
||||||
|
|
||||||
|
# Copy all app files
|
||||||
|
echo -e "${OpenColor}${Green}* Copying all app files...${CloseColor}"
|
||||||
|
cp -af {css,font,img,js,lib,sound,config.js,index.html} $APPDIR
|
||||||
|
|
||||||
|
# Copy all chrome-extension files
|
||||||
|
echo -e "${OpenColor}${Green}* Copying all chrome-extension files...${CloseColor}"
|
||||||
|
cp -af {css,font,img,js,lib,sound,config.js,index.html,popup.html,manifest.json} $CHROMEDIR
|
||||||
|
|
||||||
|
# Zipping apps
|
||||||
|
echo -e "${OpenColor}${Green}* Zipping all app files...${CloseColor}"
|
||||||
|
zip -r $ZIPFILE $APPDIR
|
||||||
|
|
||||||
|
# Zipping chrome-extension
|
||||||
|
echo -e "${OpenColor}${Green}* Zipping all chrome-extension files...${CloseColor}"
|
||||||
|
zip -r $CHROMEZIPFILE $CHROMEDIR
|
||||||
|
|
||||||
|
mkdir -p $CHROMEDOWNLOADDIR
|
||||||
|
mv $ZIPFILE $DOWNLOADDIR
|
||||||
|
mv $CHROMEZIPFILE $CHROMEDOWNLOADDIR
|
||||||
|
cp index-download-chrome.html $CHROMEDOWNLOADDIR/index.html
|
||||||
|
|
||||||
|
echo -e "${OpenColor}${Yellow}\nAwesome! Now you have the webapp in ./webapp and the chrome extension files in ./webapp/download/.${CloseColor}"
|
Loading…
Reference in New Issue