chrome browser extension update

This commit is contained in:
Matias Alejo Garcia 2014-07-02 15:53:29 -03:00
commit 50f0b9ae22
12 changed files with 55 additions and 12 deletions

View file

@ -0,0 +1,9 @@
Development
* Just run:
```
$ sh chrome/build.sh
```
* The ZIP file is *chrome/copay-chrome-extension.zip*

View file

@ -0,0 +1,59 @@
#! /bin/bash
# Description: This script compiles and copy the needed files to later package the application for Chrome
OpenColor="\033["
Red="1;31m"
Yellow="1;33m"
Green="1;32m"
CloseColor="\033[0m"
# Check function OK
checkOK() {
if [ $? != 0 ]; then
echo "${OpenColor}${Red}* ERROR. Exiting...${CloseColor}"
exit 1
fi
}
# Configs
BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APPDIR="$BUILDDIR/copay-chrome-extension"
ZIPFILE="copay-chrome-extension.zip"
VERSION=`cut -d '"' -f2 $BUILDDIR/../../version.js`
# Move to the build directory
cd $BUILDDIR
# Create/Clean temp dir
echo "${OpenColor}${Green}* Checking temp dir...${CloseColor}"
if [ -d $APPDIR ]; then
rm -rf $APPDIR
fi
mkdir -p $APPDIR
# Re-compile copayBundle.js
echo "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
grunt --target=dev shell
checkOK
# Copy all chrome-extension files
echo "${OpenColor}${Green}* Copying all chrome-extension files...${CloseColor}"
sed "s/APP_VERSION/$VERSION/g" manifest.json > $APPDIR/manifest.json
checkOK
INCLUDE=`cat ../include`
cd $BUILDDIR/../..
CMD="rsync -rLRv --exclude-from $BUILDDIR/../exclude $INCLUDE $APPDIR"
echo $CMD
$CMD
checkOK
# Zipping chrome-extension
echo "${OpenColor}${Green}* Zipping all chrome-extension files...${CloseColor}"
cd $BUILDDIR
zip -qr $ZIPFILE "`basename $APPDIR`"
checkOK
echo "${OpenColor}${Yellow}\nThe chrome Chome Extension is ready at $BUILDDIR.${CloseColor}"

View file

@ -0,0 +1,19 @@
{
"manifest_version": 2,
"name": "Copay",
"description": "A multisignature bitcoin wallet",
"version": "APP_VERSION",
"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", "notifications"
],
"options_page": "index.html#/settings",
"icons": {
"128": "img/icons/icon.png"
}
}

View file

@ -0,0 +1,18 @@
lib/socket.io
lib/*/test
lib/*/demo
lib/sjcl/
lib/angular/angular.js
lib/moment/lang
lib/moment/min/*lang*
lib/moment/moment.js
lib/angular/angular.min.js.gzip
lib/bitcore/node_modules
lib/bitcore/.git
lib/bitcore/docs
lib/bitcore/lib
lib/bitcore/examples
lib/bitcore/coverage
lib/bitcore/build
.git
tests

View file

@ -0,0 +1,13 @@
System Requirements
* Download [Add-on SDK](https://addons.mozilla.org/en-US/developers/builder)
* Install it. [Mozilla Docs](https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Installation)
Run
```
$ sh firefox/build.sh
```
- Copy the content of *firefox/firefox-addon* (lib, data, package.json) to your development path.
- Compile the XPI file [Mozilla Docs](https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Getting_started)

View file

@ -0,0 +1,51 @@
#! /bin/bash
# Description: This script compiles and copy the needed files to later package the application for Firefox
OpenColor="\033["
Red="1;31m"
Yellow="1;33m"
Green="1;32m"
CloseColor="\033[0m"
# Check function OK
checkOK() {
if [ $? != 0 ]; then
echo "${OpenColor}${Red}* ERROR. Exiting...${CloseColor}"
exit 1
fi
}
# Configs
BUILDDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APPDIR="$BUILDDIR/firefox-addon"
ZIPFILE="copay-firefox-addon.zip"
VERSION=`cut -d '"' -f2 $BUILDDIR/../version.js`
# Move to the build directory
cd $BUILDDIR
# Create/Clean temp dir
echo "${OpenColor}${Green}* Checking temp dir...${CloseColor}"
if [ -d $APPDIR ]; then
rm -rf $APPDIR
fi
mkdir -p "$APPDIR/data"
# Re-compile copayBundle.js
echo "${OpenColor}${Green}* Generating copay bundle...${CloseColor}"
grunt --target=dev shell
checkOK
# Copy all chrome-extension files
echo "${OpenColor}${Green}* Copying all firefox-addon files...${CloseColor}"
sed "s/APP_VERSION/$VERSION/g" package.json > $APPDIR/package.json
checkOK
cd $BUILDDIR/..
cp -af {css,font,img,js,lib,sound,config.js,version.js,index.html,./popup.html} "$APPDIR/data"
cp -af "$BUILDDIR/lib" $APPDIR
checkOK
echo "${OpenColor}${Yellow}\nAwesome! We have a brand new Firefox Addon, enjoy it!${CloseColor}"

View file

@ -0,0 +1,43 @@
var { ToggleButton } = require('sdk/ui/button/toggle');
var panels = require('sdk/panel');
var self = require('sdk/self');
var panelScript = "window.addEventListener('click', function(event) {" +
" var t = event.target;" +
" if (t.nodeName == 'A')" +
" self.port.emit('click-link');" +
"}, false);"
var button = ToggleButton({
id: 'copay-addon',
label: 'Copay',
icon: {
'16': './img/icons/icon-16.png',
'32': './img/icons/icon-32.png',
'64': './img/icons/icon-64.png'
},
onChange: handleChange
});
var panel = panels.Panel({
contentURL: self.data.url('popup.html'),
contentScript: panelScript,
onHide: handleHide,
height: 150
});
function handleChange(state) {
if (state.checked) {
panel.show({
position: button
});
}
}
function handleHide() {
button.state('window', {checked: false});
}
panel.port.on('click-link', function(url) {
panel.hide();
});

View file

@ -0,0 +1,11 @@
{
"name": "copay",
"title": "Copay",
"id": "copay@bitpay",
"description": "A multisignature Bitcoin wallet",
"icon": "data/img/icons/icon.png",
"author": "Mario Colque <mario@bitpay.com>",
"license": "MIT",
"version": "APP_VERSION"
}

View file

@ -0,0 +1,22 @@
css font img js sound config.js version.js index.html popup.html
lib/mousetrap/mousetrap.min.js
js/shell.js
lib/angular/angular-csp.css
lib/angular/angular.min.js
lib/moment/min/moment.min.js
lib/angular-moment/angular-moment.js
lib/qrcode-generator/js/qrcode.js
lib/angular-qrcode/qrcode.js
lib/angular-route/angular-route.min.js
lib/angular-foundation/mm-foundation.min.js
lib/angular-foundation/mm-foundation-tpls.min.js
lib/peerjs/peer.min.js
lib/bitcore/browser/bundle.js
lib/crypto-js/rollups/sha256.js
lib/crypto-js/rollups/pbkdf2.js
lib/crypto-js/rollups/aes.js
lib/file-saver/FileSaver.js
lib/socket.io-client/socket.io.js
lib/sjcl.js
lib/ios-imagefile-megapixel/megapix-image.js
lib/qrcode-decoder-js/lib/qrcode-decoder.min.js