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/.embark/development/
demo/config/production/password
demo/node_modules/
boilerplate/dist/
docs/_build
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/**"],
"app": {
"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"
},
"buildDir": "dist/",

View File

@ -1,7 +1,7 @@
<html>
<head>
<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>
</head>
<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*/
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) {
$(id + " .logs").append("<br>" + txt);
};
@ -48,19 +54,19 @@ $(document).ready(function() {
//EmbarkJS.Storage.setProvider('ipfs',{server: 'localhost', port: '5001'});
$("#storage .error").hide();
EmbarkJS.Storage.ipfsConnection.ping()
.then(function(){
//EmbarkJS.Storage.ipfsConnection.version()
// .then(function(){
$("#status-storage").addClass('status-online');
$("#storage-controls").show();
})
.catch(function(err) {
if(err){
console.log("IPFS Connection Error => " + err.message);
$("#storage .error").show();
$("#status-storage").addClass('status-offline');
$("#storage-controls").hide();
}
});
// })
// .catch(function(err) {
// if(err){
// console.log("IPFS Connection Error => " + err.message);
// $("#storage .error").show();
// $("#status-storage").addClass('status-offline');
// $("#storage-controls").hide();
// }
// });
$("#storage button.setIpfsText").click(function() {
var value = $("#storage input.ipfsText").val();

View File

@ -1,10 +1,11 @@
{
"contracts": ["app/contracts/**"],
"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/**"],
"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"
"images/": ["app/images/**"]
},
"buildDir": "dist/",
"config": "config/",

View File

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