update boilerplate and demo

This commit is contained in:
Iuri Matias 2018-01-03 12:42:48 -05:00
parent 569734a80d
commit 4b8a353720
10 changed files with 33 additions and 28 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ NOTES
demo/dist/ demo/dist/
demo/.embark/development/ demo/.embark/development/
demo/config/production/password demo/config/production/password
demo/node_modules/
boilerplate/dist/ boilerplate/dist/
docs/_build docs/_build
docs/utils/__pycache_ docs/utils/__pycache_

View File

View File

@ -0,0 +1,6 @@
import EmbarkJS from 'Embark/EmbarkJS';
// import your contracts
// e.g if you have a contract named SimpleStorage:
//import SimpleStorage from 'Embark/contracts/SimpleStorage';

View File

@ -2,7 +2,8 @@
"contracts": ["app/contracts/**"], "contracts": ["app/contracts/**"],
"app": { "app": {
"css/app.css": ["app/css/**"], "css/app.css": ["app/css/**"],
"js/app.js": ["embark.js", "app/js/**"], "js/app.js": ["app/js/index.js"],
"images/": ["app/images/**"],
"index.html": "app/index.html" "index.html": "app/index.html"
}, },
"buildDir": "dist/", "buildDir": "dist/",

View File

@ -1,7 +1,7 @@
<html> <html>
<head> <head>
<title>Embark - SimpleStorage Demo</title> <title>Embark - SimpleStorage Demo</title>
<link rel="stylesheet" href="css/app.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js"></script>
<script src="js/app.js"></script> <script src="js/app.js"></script>
</head> </head>
<body class="container"> <body class="container">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,11 @@
/*globals $, SimpleStorage, document*/ /*globals $, SimpleStorage, document*/
import $ from 'jquery';
import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
import EmbarkJS from 'Embark/EmbarkJS';
import SimpleStorage from 'Embark/contracts/SimpleStorage';
var addToLog = function(id, txt) { var addToLog = function(id, txt) {
$(id + " .logs").append("<br>" + txt); $(id + " .logs").append("<br>" + txt);
}; };
@ -48,19 +54,19 @@ $(document).ready(function() {
//EmbarkJS.Storage.setProvider('ipfs',{server: 'localhost', port: '5001'}); //EmbarkJS.Storage.setProvider('ipfs',{server: 'localhost', port: '5001'});
$("#storage .error").hide(); $("#storage .error").hide();
EmbarkJS.Storage.ipfsConnection.ping() //EmbarkJS.Storage.ipfsConnection.version()
.then(function(){ // .then(function(){
$("#status-storage").addClass('status-online'); $("#status-storage").addClass('status-online');
$("#storage-controls").show(); $("#storage-controls").show();
}) // })
.catch(function(err) { // .catch(function(err) {
if(err){ // if(err){
console.log("IPFS Connection Error => " + err.message); // console.log("IPFS Connection Error => " + err.message);
$("#storage .error").show(); // $("#storage .error").show();
$("#status-storage").addClass('status-offline'); // $("#status-storage").addClass('status-offline');
$("#storage-controls").hide(); // $("#storage-controls").hide();
} // }
}); // });
$("#storage button.setIpfsText").click(function() { $("#storage button.setIpfsText").click(function() {
var value = $("#storage input.ipfsText").val(); var value = $("#storage input.ipfsText").val();

View File

@ -1,10 +1,11 @@
{ {
"contracts": ["app/contracts/**"], "contracts": ["app/contracts/**"],
"app": { "app": {
"js/app.js": ["app/js/index.js"],
"js/jquery.js": ["app/js/_vendor/jquery.js"],
"index.html": "app/index.html",
"css/app.css": ["app/css/**"], "css/app.css": ["app/css/**"],
"images/": ["app/images/**"], "images/": ["app/images/**"]
"js/app.js": ["embark.js", "app/js/_vendor/jquery.min.js", "app/js/_vendor/bootstrap.min.js", "app/js/**"],
"index.html": "app/index.html"
}, },
"buildDir": "dist/", "buildDir": "dist/",
"config": "config/", "config": "config/",

View File

@ -10,5 +10,7 @@
"license": "ISC", "license": "ISC",
"homepage": "", "homepage": "",
"devDependencies": { "devDependencies": {
"bootstrap": "^3.3.6",
"jquery": "^1.11.3"
} }
} }