Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
8468546
added grunt bootstrap for website development
cubedro Jul 18, 2016
5a967eb
updated package.json components
cubedro Jul 18, 2016
5eed5b1
changed jade to pug
cubedro Jul 18, 2016
79a41b8
fixed Gruntfile.js bug
cubedro Jul 18, 2016
50d9265
added header
cubedro Jul 18, 2016
b5d8199
added styling to header
cubedro Jul 18, 2016
134e799
added more styling
cubedro Jul 19, 2016
9d807ec
added fonts and more styling
cubedro Jul 19, 2016
069a12c
added features section
cubedro Jul 19, 2016
d1a530a
added footer and brought to you by section
cubedro Jul 19, 2016
a344cd4
fixed clean bug in Gruntfile.js
cubedro Jul 19, 2016
4211608
added consensys logo
cubedro Jul 19, 2016
336e508
jumbotron styling
cubedro Jul 20, 2016
8d0c5a0
finished jumbotron styling
cubedro Jul 21, 2016
235fef6
added links on brought to you by section
cubedro Jul 21, 2016
eba5b3e
added developers page (wip)
cubedro Jul 22, 2016
47ac3a1
added styling to left menu
cubedro Jul 22, 2016
de87c7d
left menu fix
cubedro Jul 22, 2016
76cc145
added collapsable examples left menu in developers
cubedro Jul 25, 2016
aac2bc0
added testnet
cubedro Jul 27, 2016
ecae827
added main net status
cubedro Jul 28, 2016
8b62742
live status improvements
cubedro Jul 28, 2016
758163d
added more styling to developer page
cubedro Jul 28, 2016
55e594c
added header partial
cubedro Aug 6, 2016
8137fd3
fixed github icon in header
cubedro Aug 6, 2016
f628dac
fixed footer position
cubedro Aug 6, 2016
bc6a1ae
fixed developers sidebar position
cubedro Aug 6, 2016
d8bb3ac
added footer partial
cubedro Aug 6, 2016
f355df8
more sidebar styling
cubedro Aug 6, 2016
a30a279
sidebar improvements
cubedro Aug 6, 2016
72e129f
fixed sidebar background height
cubedro Aug 6, 2016
0629b75
added more styling, abi and api to developers page
cubedro Aug 6, 2016
4ce01c1
added responsiveness to developers page
cubedro Aug 6, 2016
4ec052b
added missing external links
cubedro Aug 6, 2016
1a4e9ef
added functionality to main-net status page
cubedro Aug 7, 2016
ea7f01d
added testnet status page and functionality
cubedro Aug 7, 2016
c4898b8
status js improvements
cubedro Aug 7, 2016
15c62f0
added missing buttons on homepage + verify (wip)
cubedro Aug 7, 2016
39a168e
added verify tx pages
cubedro Aug 7, 2016
debc947
added status box for verify tx result field
cubedro Aug 7, 2016
6fa4e48
removed bitcoin processor menu items (it is included in relay tx)
cubedro Aug 7, 2016
fc77cca
added relay tx functionality
cubedro Aug 7, 2016
bd0db94
added error reporting in relay tx
cubedro Aug 7, 2016
6e8533f
added how to verify source code page
cubedro Aug 7, 2016
ffa5294
added favicons + minor improvements
cubedro Aug 7, 2016
8f8a9fc
fixed mainnet/morden stats link
cubedro Aug 7, 2016
71c568f
added become a relayer external link
cubedro Aug 7, 2016
ea66c75
added vars for ethstats links (main/test)
cubedro Aug 7, 2016
2569207
updated footer
cubedro Aug 8, 2016
a770465
fixed status button
cubedro Aug 8, 2016
bcb6aca
fixed left menu examples button margin
cubedro Aug 8, 2016
b770aad
fixed bug causing all developers page section to be displayed on load
cubedro Aug 8, 2016
c095536
fixed left menu button colors
cubedro Aug 8, 2016
4d8f4ac
added link on eth logo in footer
cubedro Aug 8, 2016
afbe5c4
fixed how it works svg text problem
cubedro Aug 23, 2016
b1d52eb
refactored developer pages
cubedro Aug 24, 2016
f6ac5cf
updated mainnet infura host for web3 HttpProvider
cubedro Aug 24, 2016
13eaa63
Update landing page text
ethers Sep 5, 2016
cf2bb15
Update features text
ethers Sep 5, 2016
96c26dc
Fix the mainnet relayTx example to link to testnet
ethers Sep 5, 2016
8566fb0
Simplify status pages
ethers Sep 5, 2016
5e3a16e
Add Terms of Use
ethers Sep 5, 2016
13eee38
Move github icon to footer
ethers Sep 6, 2016
352134b
Remove checkHeights since http://status.infura.io can be checked
ethers Sep 6, 2016
95c54c4
Add link to view source of testnetSampleCall
ethers Sep 6, 2016
495b2ed
Add link to view source of sampleCall
ethers Sep 6, 2016
4ad699a
Use ether as fee unit; UI does not need update
ethers Sep 6, 2016
d17936c
Remove async calls for MetaMask; MM has issue returns 0 for getLastBl…
ethers Sep 6, 2016
ca0be0e
Add details to relayTx example
ethers Sep 6, 2016
894ef27
Add clarifications to relayTx example
ethers Sep 6, 2016
24f9ae7
Use ether.camp since its the only one that shows contract storage
ethers Sep 6, 2016
c989f41
Add warning when node or MetaMask is pointed to other network from th…
ethers Sep 7, 2016
d265514
Add reminder to switch to testnet
ethers Sep 7, 2016
546585a
Fix relayTx example to use eth.coinbase
ethers Sep 7, 2016
dde185a
Fix link to relayTx hash
ethers Sep 7, 2016
ce2d9c8
Fix txBytes and relayTx sample is now working
ethers Sep 8, 2016
4743f0c
Move help and TOU to bottom of nav
ethers Sep 8, 2016
71b4db3
Fix txBytes by using text()
ethers Oct 27, 2016
f5468a5
Morden infura stopped connecting on port 8545
ethers Nov 11, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
*/**/.DS_Store
node_modules
npm-debug.log
bower_components
373 changes: 373 additions & 0 deletions website/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,373 @@
'use strict';

module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);

// src paths
var SRC_DIR = 'src/';
var SRC_DIR_JS = SRC_DIR + 'js/';
var SRC_DIR_LESS = SRC_DIR + 'less/';
var SRC_DIR_PUG = SRC_DIR + 'views/';
var SRC_DIR_IMAGES = SRC_DIR + 'images/';
var SRC_DIR_FONTS = SRC_DIR + 'fonts/';
var SRC_FILES_JS = SRC_DIR_JS + '*.js';
var SRC_FILE_LESS = SRC_DIR_LESS + 'style.less';
var SRC_FILES_LESS = SRC_DIR_LESS + '*.less';
var SRC_FILES_PUG = SRC_DIR_PUG + '*.pug';
var WATCH_FILES_PUG = SRC_DIR_PUG + '**/*.pug';
var SRC_FILES_IMAGES = SRC_DIR_IMAGES + '**';
var SRC_FILES_FONTS = SRC_DIR_FONTS + '**';

// bower dependencies
var SRC_BOWER_DIR = 'bower_components/';
var SRC_JQUERY_DIR = 'jquery/dist/';
var SRC_JQUERY_JS_DIR = SRC_BOWER_DIR + SRC_JQUERY_DIR;
var SRC_JQUERY_JS_FILE = 'jquery.min.js';
var SRC_BOOTSTRAP_DIR = 'bootstrap/dist/';
var SRC_BOOTSTRAP_JS_DIR = SRC_BOWER_DIR + SRC_BOOTSTRAP_DIR + 'js/';
var SRC_BOOTSTRAP_JS_FILE = 'bootstrap.min.js';
var SRC_BOOTSTRAP_FONTS_DIR = SRC_BOWER_DIR + SRC_BOOTSTRAP_DIR + 'fonts/';
var SRC_BIGNUMBER_DIR = 'bignumber.js/';
var SRC_BIGNUMBER_JS_DIR = SRC_BOWER_DIR + SRC_BIGNUMBER_DIR;
var SRC_BIGNUMBER_JS_FILE = 'bignumber.min.js';
var SRC_WEB3_DIR = 'web3/dist/';
var SRC_WEB3_JS_DIR = SRC_BOWER_DIR + SRC_WEB3_DIR;
var SRC_WEB3_JS_FILE = 'web3.min.js';

// build paths
var BUILD_DIR = 'dist/';
var BUILD_DIR_JS = BUILD_DIR + 'js/';
var BUILD_DIR_CSS = BUILD_DIR + 'css/';
var BUILD_DIR_IMAGES = BUILD_DIR + 'images/';
var BUILD_DIR_FONTS = BUILD_DIR + 'fonts/';
var BUILD_FILE_JS = BUILD_DIR_JS + 'app.js';
var BUILD_FILE_CSS = BUILD_DIR_CSS + 'style.css';

var AP_BROWSERS = [
'Android 2.3',
'Android >= 4',
'Chrome >= 20',
'Firefox >= 24', // Firefox 24 is the latest ESR
'Explorer >= 8',
'iOS >= 6',
'Opera >= 12',
'Safari >= 6'
];

var PUG_FILE_CFG = [{
expand: true,
cwd: SRC_DIR_PUG + 'pages/',
src: ['**/*.pug'],
dest: BUILD_DIR,
ext: '.html'
}];

// object to represent the type of environment we are running in.
// eg. production or development
var EnvType = {
prod: 'production',
dev: 'development'
};

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

// wipe the build directory clean
clean: {
build: {
src: [BUILD_DIR]
},
images: {
src: [BUILD_DIR_IMAGES]
},
fonts: {
src: [BUILD_DIR_FONTS]
},
scripts: {
src: [BUILD_DIR_JS + '*.js', ['!' + BUILD_FILE_JS, '!' + SRC_BOOTSTRAP_JS_FILE, '!' + SRC_JQUERY_JS_FILE]]
}
},

// copy files into dist directory
copy: {
build: {
files: [{
cwd: SRC_DIR,
src: ['**', '!**/less/**', '!**/views/**'],
dest: BUILD_DIR,
expand: true
},
{
cwd: SRC_BOOTSTRAP_FONTS_DIR,
src: ['**'],
dest: BUILD_DIR_FONTS,
expand: true
}]
},
vendor: {
files: [{
cwd: SRC_BOOTSTRAP_JS_DIR,
src: SRC_BOOTSTRAP_JS_FILE,
dest: BUILD_DIR_JS,
expand: true
},
{
cwd: SRC_JQUERY_JS_DIR,
src: SRC_JQUERY_JS_FILE,
dest: BUILD_DIR_JS,
expand: true
},
{
cwd: SRC_BIGNUMBER_JS_DIR,
src: SRC_BIGNUMBER_JS_FILE,
dest: BUILD_DIR_JS,
expand: true
},
{
cwd: SRC_WEB3_JS_DIR,
src: SRC_WEB3_JS_FILE,
dest: BUILD_DIR_JS,
expand: true
}]
}
},

// Configure the less compilation for both dev and prod
less: {
development: {
files: {
"dist/css/style.css": SRC_FILE_LESS
}
},
production: {
options: {
// minify css in prod mode
cleancss: true,
},
files: {
"dist/css/style.css": SRC_FILE_LESS
}
}
},

// configure autoprefixing for compiled output css
autoprefixer: {
options: {
browsers: AP_BROWSERS
},
build: {
expand: true,
cwd: BUILD_DIR,
src: ['css/*.css'],
dest: BUILD_DIR
}
},

// configure concatenation for the js: for dev mode.
// this task will only concat files. useful for when in development
// and debugging as the file will be readable.
concat: {
dist: {
// if some scripts depend upon eachother,
// make sure to list them here in order
// rather than just using the '*' wildcard.
src: [SRC_DIR_JS + '*.js'],
dest: BUILD_FILE_JS
}
},

// configure minification for the js: for prod mode.
// this task both concatenates and minifies the files.
uglify: {
build: {
options: {
banner: '/*! <%= pkg.name %>' +
'<%= grunt.template.today("dd-mm-yyyy") %> */\n',
mangle: false
},
files: {
"dist/js/app.js": [BUILD_DIR_JS + '*.js']
}
}
},

// configure the pug template file compilation
pug: {
development: {
options: {
pretty: true,
debug: true,
data: {
}
},
files: PUG_FILE_CFG
},

production: {
options: {
debug: false,
data: {
}
},
files: PUG_FILE_CFG
}
},

// grunt-express will serve the files from the folders listed in `bases`
// on specified `port` and `hostname`
express: {
all: {
options: {
port: 3001,
hostname: "0.0.0.0",
bases: [BUILD_DIR],
livereload: true
}
}
},

// configure grunt-watch to monitor the projects files
// and perform each specific file type build task.
watch: {
images: {
options: { livereload: false },
files: [SRC_FILES_IMAGES],
tasks: ['clean:images', 'copy']
},

fonts: {
options: { livereload: false },
files: [SRC_FILES_FONTS],
tasks: ['clean:fonts', 'copy']
},

scripts: {
options: { livereload: true },
files: [SRC_FILES_JS],
tasks: ['concat']
},

stylesless: {
options: { livereload: true },
files: [SRC_FILES_LESS],
tasks: ['less:development', 'autoprefixer']
},

pug: {
options: { livereload: true },
files: [WATCH_FILES_PUG],
tasks: ['pug:development']
}
},

// grunt-open will open your browser at the project's URL
open: {
all: {
// Gets the port from the connect configuration
path: 'http://localhost:<%= express.all.options.port%>'
}
},

surge: {
'BTC Relay': {
options: {
// The path or directory to your compiled project
project: 'dist/',
// The domain or subdomain to deploy to
domain: 'staging-btcrelay.surge.sh'
}
}
}
});

/**
* Utility function to register the stylesheets task to grunt.
* @param {[type]} mode [the mode, either dev, or production]
*/
var registerStyleSheetsTask = function(mode) {
grunt.registerTask('stylesheets:' + mode,
'Compiles the stylesheets for development mode',
['less:' + mode, 'autoprefixer']
);
};

/**
* Utility function to register the scripts task to grunt.
* @param {[type]} mode [the mode, either dev, or production]
*/
var registerScriptsTask = function(mode) {
// if we are running in dev mode, only concat the scripts
// otherwise minify them also
var scriptTask = (mode === EnvType.dev) ? 'concat' : 'uglify';

grunt.registerTask('scripts:' + mode,
'Compiles the javascript files in ' + mode + ' mode',
[ scriptTask, 'copy:vendor', 'clean:scripts']
);
};

/**
* Utility function to register the build task to grunt.
* @param {[type]} mode [the mode, either dev, or production]
*/
var registerBuildTask = function(mode) {
grunt.registerTask('build:' + mode,
'Compiles all of the assets and copies them' +
' to th build directory',
['clean:build', 'copy:build', 'stylesheets:' + mode, 'scripts:' + mode,
'copy:vendor', 'pug:' + mode]
);
};

/**
* Utility function to register the server task to grunt.
* @param {[type]} mode [the mode, either dev, or production]
*/
var registerServerTask = function(mode) {
var tasks = ['express', 'open'];

// if we are running in development mode, run the watch task
if (mode === EnvType.dev) {
tasks.push('watch');
} else if (mode === EnvType.prod) {
tasks.push('express-keepalive');
}

grunt.registerTask('server:' + mode,
'Begins the express server and opens it in a browser' +
'constantly watching for changes',
tasks
);
};

/**
* Utility function to register the main task to grunt.
* @param {[type]} mode [the mode, either dev, or production]
*/
var registerMainTask = function(mode) {
grunt.registerTask(mode,
'Watches the project for changes' +
'automatically builds them and runs a server',
['build:' + mode, 'server:' + mode]
);
};

// register all the tasks for both development and production
registerStyleSheetsTask(EnvType.dev);
registerStyleSheetsTask(EnvType.prod);
registerScriptsTask(EnvType.dev);
registerScriptsTask(EnvType.prod);
registerBuildTask(EnvType.dev);
registerBuildTask(EnvType.prod);
registerServerTask(EnvType.dev);
registerServerTask(EnvType.prod);
registerMainTask(EnvType.dev);
registerMainTask(EnvType.prod);

// register development mode as the main task
grunt.registerTask('default', 'Default task: development', 'development');

grunt.registerTask('deploy', ['surge']);

// grunt.registerTask('build', 'default');
};
Loading