Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
interbiznw committed Mar 5, 2018
1 parent dfa187b commit a86f3c4
Show file tree
Hide file tree
Showing 7 changed files with 416 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "public/lib"
}
43 changes: 43 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"node": true, // Enable globals available when code is running inside of the NodeJS runtime environment.
"browser": true, // Standard browser globals e.g. `window`, `document`.
"esnext": true, // Allow ES.next specific features such as `const` and `let`.
"bitwise": false, // Prohibit bitwise operators (&, |, ^, etc.).
"camelcase": false, // Permit only camelcase for `var` and `object indexes`.
"curly": false, // Require {} for every new block or scope.
"eqeqeq": true, // Require triple equals i.e. `===`.
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
"latedef": true, // Prohibit variable use before definition.
"newcap": true, // Require capitalization of all constructor functions e.g. `new F()`.
"noarg": true, // Prohibit use of `arguments.caller` and `arguments.callee`.
"quotmark": "single", // Define quotes to string values.
"regexp": true, // Prohibit `.` and `[^...]` in regular expressions.
"undef": true, // Require all non-global variables be declared before they are used.
"unused": true, // Warn unused variables.
"strict": true, // Require `use strict` pragma in every file.
"trailing": true, // Prohibit trailing whitespaces.
"smarttabs": false, // Suppresses warnings about mixed tabs and spaces
"globals": { // Globals variables.
"angular": true
},
"predef": [ // Extra globals.
"define",
"require",
"exports",
"module",
"describe",
"before",
"beforeEach",
"after",
"afterEach",
"it",
"inject",
"$",
"io",
"app",
"moment"
],
"indent": false, // Specify indentation spacing
"devel": true, // Allow development statements e.g. `console.log();`.
"noempty": true // Prohibit use of empty blocks.
}
39 changes: 39 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.swp
tags
pids
logs
results
build

node_modules

# extras
*.swp
*.swo
*~
.project
peerdb.json

npm-debug.log
.nodemonignore

.DS_Store
db/txs/*
db/txs
db/testnet/txs/*
db/testnet/txs
db/blocks/*
db/blocks
db/testnet/blocks/*
db/testnet/blocks

README.html
k*
136 changes: 136 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
'use strict';

module.exports = function(grunt) {

//Load NPM tasks
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-css');
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-macreload');
grunt.loadNpmTasks('grunt-angular-gettext');

// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
process: function(src, filepath) {
if (filepath.substr(filepath.length - 2) === 'js') {
return '// Source: ' + filepath + '\n' +
src.replace(/(^|\n)[ \t]*('use strict'|"use strict");?\s*/g, '$1');
} else {
return src;
}
}
},
vendors: {
src: ['public/src/js/ios-imagefile-megapixel/megapix-image.js', 'public/lib/qrcode-generator/js/qrcode.js', 'public/src/js/jsqrcode/grid.js', 'public/src/js/jsqrcode/version.js', 'public/src/js/jsqrcode/detector.js', 'public/src/js/jsqrcode/formatinf.js', 'public/src/js/jsqrcode/errorlevel.js', 'public/src/js/jsqrcode/bitmat.js', 'public/src/js/jsqrcode/datablock.js', 'public/src/js/jsqrcode/bmparser.js', 'public/src/js/jsqrcode/datamask.js', 'public/src/js/jsqrcode/rsdecoder.js', 'public/src/js/jsqrcode/gf256poly.js', 'public/src/js/jsqrcode/gf256.js', 'public/src/js/jsqrcode/decoder.js', 'public/src/js/jsqrcode/qrcode.js', 'public/src/js/jsqrcode/findpat.js', 'public/src/js/jsqrcode/alignpat.js', 'public/src/js/jsqrcode/databr.js', 'public/lib/moment/min/moment.min.js', 'public/lib/moment/lang/es.js', 'public/lib/zeroclipboard/ZeroClipboard.min.js',
'public/lib/c3/c3.min.js',
'public/lib/d3/d3.min.js'
],
dest: 'public/js/vendors.js'
},
angular: {
src: ['public/lib/angular/angular.min.js', 'public/lib/angular-resource/angular-resource.min.js', 'public/lib/angular-route/angular-route.min.js', 'public/lib/angular-qrcode/qrcode.js', 'public/lib/angular-animate/angular-animate.min.js', 'public/lib/angular-bootstrap/ui-bootstrap.js', 'public/lib/angular-bootstrap/ui-bootstrap-tpls.js', 'public/lib/angular-ui-utils/ui-utils.min.js', 'public/lib/ngprogress/build/ngProgress.min.js', 'public/lib/angular-gettext/dist/angular-gettext.min.js', 'public/lib/angular-moment/angular-moment.min.js'],
dest: 'public/js/angularjs-all.js'
},
main: {
src: ['public/src/js/app.js', 'public/src/js/controllers/*.js', 'public/src/js/services/*.js', 'public/src/js/directives.js', 'public/src/js/filters.js', 'public/src/js/config.js', 'public/src/js/init.js', 'public/src/js/translations.js'],
dest: 'public/js/main.js'
},
css: {
src: [
'public/lib/bootstrap/dist/css/bootstrap.min.css',
'public/lib/c3/c3.min.css',
'public/src/css/**/*.css'
],
dest: 'public/css/main.css'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n',
mangle: false
},
vendors: {
src: 'public/js/vendors.js',
dest: 'public/js/vendors.min.js'
},
angular: {
src: 'public/js/angularjs-all.js',
dest: 'public/js/angularjs-all.min.js'
},
main: {
src: 'public/js/main.js',
dest: 'public/js/main.min.js'
}
},
cssmin: {
css: {
src: 'public/css/main.css',
dest: 'public/css/main.min.css'
}
},
markdown: {
all: {
files: [
{
expand: true,
src: 'README.md',
dest: '.',
ext: '.html'
}
]
}
},
macreload: {
chrome: {
browser: 'chrome',
editor: 'macvim'
}
},
watch: {
main: {
files: ['public/src/js/**/*.js'],
tasks: ['concat:main', 'uglify:main'],
},
css: {
files: ['public/src/css/**/*.css'],
tasks: ['concat:css', 'cssmin'],
},
},
nggettext_extract: {
pot: {
files: {
'po/template.pot': ['public/views/*.html', 'public/views/**/*.html']
}
},
},
nggettext_compile: {
all: {
options: {
module: 'insight'
},
files: {
'public/src/js/translations.js': ['po/*.po']
}
},
}
});

//Making grunt default to force in order not to break the project.
grunt.option('force', true);

//Default task(s).
grunt.registerTask('default', ['watch']);

//Update .pot file
grunt.registerTask('translate', ['nggettext_extract']);

//Compile task (concat + minify)
grunt.registerTask('compile', ['nggettext_compile', 'concat', 'uglify', 'cssmin']);


};
101 changes: 100 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,100 @@
# insight-ui-btcp
# Insight UI

A Bitcoin blockchain explorer web application service for [Bitcore Node](https://github.com/bitpay/bitcore-node) using the [Insight API](https://github.com/interbiznw-btcpcontrib/insight-api-btcp).

## Quick Start

Please see the guide at [https://bitcore.io/guides/full-node](https://bitcore.io/guides/full-node) for information about getting a block explorer running. This is only the front-end component of the block explorer, and is packaged together with all of the necessary components in [Bitcore](https://github.com/bitpay/bitcore).

## Getting Started

To manually install all of the necessary components, you can run these commands:

```bash
npm install interbiznw-btcpcontrib/bitcore-node-btcp
./node_modules/bitcore-node-btcp/bin/bitcore-node create btcp-explorer
cd btcp-explorer
../node_modules/bitcore-node-btcp/bin/bitcore-node install interbiznw-btcpcontrib/insight-api-btcp interbiznw-btcpcontrib/insight-ui-btcp
nvm use v4; ./node_modules/bitcore-node-interbiznw-btcpcontrib/bin/bitcore-node start
```
Get the memo script from https://gist.github.com/aayanl/e2a757eaa9866e83c454d115cc214a89 and have it save the memos to public/js/memos.txt

Open a web browser to `http://localhost:3001/insight/`

## Development

To run Insight UI locally in development mode:

Install bower dependencies:

```
$ bower install
```

To compile and minify the web application's assets:

```
$ grunt compile
```

There is a convenient Gruntfile.js for automation during editing the code

```
$ grunt
```

## Multilanguage support

Insight UI uses [angular-gettext](http://angular-gettext.rocketeer.be) for multilanguage support.

To enable a text to be translated, add the ***translate*** directive to html tags. See more details [here](http://angular-gettext.rocketeer.be/dev-guide/annotate/). Then, run:

```
grunt compile
```

This action will create a template.pot file in ***po/*** folder. You can open it with some PO editor ([Poedit](http://poedit.net)). Read this [guide](http://angular-gettext.rocketeer.be/dev-guide/translate/) to learn how to edit/update/import PO files from a generated POT file. PO file will be generated inside po/ folder.

If you make new changes, simply run **grunt compile** again to generate a new .pot template and the angular javascript ***js/translations.js***. Then (if use Poedit), open .po file and choose ***update from POT File*** from **Catalog** menu.

Finally changes your default language from ***public/src/js/config***

```
gettextCatalog.currentLanguage = 'es';
```

This line will take a look at any *.po files inside ***po/*** folder, e.g.
**po/es.po**, **po/nl.po**. After any change do not forget to run ***grunt
compile***.


## Note

For more details about the [Insight API](https://github.com/interbiznw-btcpcontrib/insight-api-btcp) configuration and end-points, go to [Insight API GitHub repository](https://github.com/interbiznw-btcpcontrib/insight-api-btcp).

## Contribute

Contributions and suggestions are welcomed at the [Insight UI GitHub repository](https://github.com/interbiznw-btcpcontrib/insight-ui-btcp).


## License
(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 changes: 20 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Insight",
"version": "0.0.1",
"dependencies": {
"angular": "~1.5.8",
"angular-resource": "~1.5.8",
"angular-route": "~1.5.8",
"bootstrap": "~3.1.1",
"angular-bootstrap": "~0.10.0",
"angular-qrcode": "~3.1.0",
"angular-animate": "~1.5.8",
"moment": "~2.10.6",
"zeroclipboard": "~1.3.2",
"ngprogress": "~1.0.4",
"angular-ui-utils": "~0.1.1",
"angular-gettext": "~1.1.0",
"angular-moment": "1.0.0-beta.6",
"c3": "~0.4.11"
}
}
Loading

0 comments on commit a86f3c4

Please sign in to comment.