diff --git a/.gitignore b/.gitignore index 28fe0f592..640ac6f20 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,7 @@ dist/windows dist/*.dmg dist/*.tar.gz dist/*.exe + +doc/ +/node_modules +/*-cov diff --git a/Gruntfile.js b/Gruntfile.js index 4b1216fb4..b1dbd2949 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,14 +9,37 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-angular-gettext'); + grunt.loadNpmTasks('grunt-jsdoc'); + grunt.loadNpmTasks('grunt-release'); // Project Configuration grunt.initConfig({ + release: { + options: { + bump: true, + file: 'package.json', + add: true, + commit: true, + tag: true, + push: true, + pushTags: true, + npm: false, + npmtag: true, + tagName: 'v<%= version %>', + commitMessage: 'New release v<%= version %>', + tagMessage: 'Version <%= version %>', + github: { + repo: 'bitpay/copay', + usernameVar: 'GITHUB_USERNAME', //ENVIRONMENT VARIABLE that contains Github username + passwordVar: 'GITHUB_PASSWORD' //ENVIRONMENT VARIABLE that contains Github password + } + } + }, shell: { prod: { options: { stdout: false, - stderr: false + stderr: false }, command: 'node ./util/build.js' }, @@ -41,7 +64,9 @@ module.exports = function(grunt) { }, scripts: { files: [ - 'js/models/**/*.js' + 'js/models/**/*.js', + 'js/models/*.js', + 'plugins/*.js', ], tasks: ['shell:dev'] }, @@ -51,14 +76,20 @@ module.exports = function(grunt) { }, main: { files: [ - 'js/app.js', - 'js/directives.js', - 'js/filters.js', - 'js/routes.js', - 'js/services/*.js', + 'js/init.js', + 'js/app.js', + 'js/directives.js', + 'js/filters.js', + 'js/routes.js', + 'js/mobile.js', + 'js/services/*.js', 'js/controllers/*.js' ], tasks: ['concat:main'] + }, + config: { + files: ['config.js'], + tasks: ['shell:dev', 'concat:main'] } }, mochaTest: { @@ -107,21 +138,23 @@ module.exports = function(grunt) { 'lib/ng-idle/angular-idle.min.js', 'lib/angular-foundation/mm-foundation.min.js', 'lib/angular-foundation/mm-foundation-tpls.min.js', - 'lib/angular-gettext/dist/angular-gettext.min.js' + 'lib/angular-gettext/dist/angular-gettext.min.js', + 'lib/angular-load/angular-load.min.js' + // If you add libs here, remember to add it too to karma.conf ], dest: 'lib/angularjs-all.js' }, main: { src: [ - 'js/app.js', - 'js/directives.js', - 'js/filters.js', - 'js/routes.js', - 'js/services/*.js', + 'js/app.js', + 'js/directives.js', + 'js/filters.js', + 'js/routes.js', + 'js/services/*.js', 'js/controllers/*.js', 'js/translations.js', 'js/mobile.js', // PLACEHOLDER: CORDOVA SRIPT - 'js/init.js' + 'js/init.js', ], dest: 'js/copayMain.js' } @@ -166,11 +199,23 @@ module.exports = function(grunt) { 'js/translations.js': ['po/*.po'] } }, + }, + jsdoc: { + dist : { + src: ['js/models/core/*.js', 'js/models/*.js', 'plugins/*.js'], + options: { + destination: 'doc', + configure: 'jsdoc.conf.json', + template: './node_modules/grunt-jsdoc/node_modules/ink-docstrap/template', + theme: 'flatly' + } + } } }); + grunt.registerTask('default', ['shell:dev', 'nggettext_compile', 'concat', 'cssmin']); grunt.registerTask('prod', ['shell:prod', 'nggettext_compile', 'concat', 'cssmin', 'uglify']); grunt.registerTask('translate', ['nggettext_extract']); - + grunt.registerTask('docs', ['jsdoc']); }; diff --git a/bower.json b/bower.json index 9300e2b27..cccd15f07 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,8 @@ "zeroclipboard": "~1.3.5", "ng-idle": "*", "underscore": "~1.7.0", - "inherits": "~0.0.1" + "inherits": "~0.0.1", + "angular-load": "0.2.0" }, "resolutions": { "angular": "=1.2.19" diff --git a/config.js b/config.js index 9c0ef9224..35e3d9b14 100644 --- a/config.js +++ b/config.js @@ -2,15 +2,9 @@ var defaultConfig = { defaultLanguage: 'en', // DEFAULT network (livenet or testnet) - networkName: 'testnet', - forceNetwork: false, + networkName: 'livenet', logLevel: 'info', - // DEFAULT unit: Bit - unitName: 'bits', - unitToSatoshi: 100, - alternativeName: 'US Dollar', - alternativeIsoCode: 'USD', // wallet limits limits: { @@ -20,9 +14,12 @@ var defaultConfig = { // network layer config network: { - host: 'test-insight.bitpay.com', - port: 443, - schema: 'https' + testnet: { + url: 'https://test-insight.bitpay.com:443' + }, + livenet: { + url: 'https://insight.bitpay.com:443' + }, }, // wallet default config @@ -30,25 +27,15 @@ var defaultConfig = { requiredCopayers: 2, totalCopayers: 3, spendUnconfirmed: true, - verbose: 1, - // will duplicate itself after each try reconnectDelay: 5000, - idleDurationMin: 4 - }, - - // blockchain service API config - blockchain: { - schema: 'https', - host: 'test-insight.bitpay.com', - port: 443, - retryDelay: 1000, - }, - // socket service API config - socket: { - schema: 'https', - host: 'test-insight.bitpay.com', - port: 443, - reconnectDelay: 1000, + idleDurationMin: 4, + settings: { + unitName: 'bits', + unitToSatoshi: 100, + unitDecimals: 2, + alternativeName: 'US Dollar', + alternativeIsoCode: 'USD', + } }, // local encryption/security config @@ -63,6 +50,27 @@ var defaultConfig = { }, verbose: 1, + + plugins: { + LocalStorage: true, + //GoogleDrive: true, + }, + + GoogleDrive: { + home: 'copay', + + /* + * This clientId was generated at: + * https://console.developers.google.com/project + * To run Copay with Google Drive at your domain you need + * to generata your own Id. + */ + // for localhost:3001 you can use you can: + clientId: '232630733383-a35gcnovnkgka94394i88gq60vtjb4af.apps.googleusercontent.com', + + // for copay.io: + // clientId: '1036948132229-biqm3b8sirik9lt5rtvjo9kjjpotn4ac.apps.googleusercontent.com', + }, }; if (typeof module !== 'undefined') - module.exports = defaultConfig; \ No newline at end of file + module.exports = defaultConfig; diff --git a/copay.js b/copay.js index 5f058d6ab..6bba1b613 100644 --- a/copay.js +++ b/copay.js @@ -11,11 +11,12 @@ module.exports.HDParams = require('./js/models/core/HDParams'); // components var Async = module.exports.Async = require('./js/models/network/Async'); var Insight = module.exports.Insight = require('./js/models/blockchain/Insight'); -var StorageLocalEncrypted = module.exports.StorageLocalEncrypted = require('./js/models/storage/LocalEncrypted'); +var Storage = module.exports.Storage = require('./js/models/Storage'); module.exports.WalletFactory = require('./js/models/core/WalletFactory'); module.exports.Wallet = require('./js/models/core/Wallet'); module.exports.WalletLock = require('./js/models/core/WalletLock'); +module.exports.PluginManager = require('./js/models/core/PluginManager'); module.exports.version = require('./version').version; module.exports.commitHash = require('./version').commitHash; diff --git a/css/src/main.css b/css/src/main.css index bea1ac145..1d0d9cf2e 100644 --- a/css/src/main.css +++ b/css/src/main.css @@ -280,7 +280,6 @@ a:hover { .last-transactions-header { padding: 1rem 0; - height: 50px; } .last-transactions-footer { @@ -385,6 +384,7 @@ a:hover { .size-48 { font-size: 48px; } .size-60 { font-size: 60px; } .size-72 { font-size: 72px; } +.m3r {margin-right: 3px;} .m5t {margin-top: 5px;} .m10t {margin-top: 10px;} .m5b {margin-bottom: 5px;} @@ -725,6 +725,14 @@ button.radius, .button.radius { } /* SECONDARY */ + +input[type='submit'] +{ + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + button.secondary, .button.secondary { background-color: #4A90E2; @@ -758,6 +766,7 @@ button.primary, .button.primary { background-color: #1ABC9C; color: #fff; + border-radius: 0; } button.primary:hover, button.primary:focus, @@ -1046,7 +1055,7 @@ a.text-warning:hover {color: #FD7262;} background: #2C3E50; -moz-box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20); box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20); - margin-bottom: 5px; + margin-bottom: 15px; } .box-setup-copay-required { diff --git a/css/src/mobile.css b/css/src/mobile.css index 9deb53219..f4f0bb509 100644 --- a/css/src/mobile.css +++ b/css/src/mobile.css @@ -122,13 +122,13 @@ display: block; float: none; margin: 0 auto; - width: 210px; - height: 210px; + width: 160px; + height: 160px; } .panel qrcode canvas { - width: 200px; - height: 200px; + width: 150px; + height: 150px; } .addresses .panel { diff --git a/index.html b/index.html index e6f34fd00..a9bf2e579 100644 --- a/index.html +++ b/index.html @@ -17,18 +17,21 @@ Network Error. Attempting to reconnect... -