├── src ├── assets │ ├── .gitkeep │ └── logo │ │ ├── logo.ico │ │ ├── logo.png │ │ ├── logo-blanco.ico │ │ ├── logo-blanco.png │ │ └── logo-blanco-recortado.png ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── favicon-blanco.ico ├── tsconfig.app.json ├── tsconfig.spec.json ├── tslint.json ├── browserslist ├── main.ts ├── app │ ├── services │ │ ├── service.module.ts │ │ ├── messages.service.ts │ │ ├── web3.service.ts │ │ └── organizations.service.ts │ ├── util │ │ ├── address.util.ts │ │ └── storage.util.ts │ ├── app.component.css │ ├── models │ │ ├── organization.ts │ │ └── donation.ts │ ├── components │ │ ├── user │ │ │ ├── user.component.ts │ │ │ └── user.component.html │ │ └── organizations │ │ │ ├── organizations-table.component.ts │ │ │ ├── organizations.component.ts │ │ │ ├── organizations.component.html │ │ │ ├── organization-add.component.html │ │ │ ├── organization-add.component.ts │ │ │ ├── organizations-table.component.html │ │ │ ├── organization-donation.component.ts │ │ │ └── organization-donation.component.html │ ├── app-routing.module.ts │ ├── app.component.ts │ ├── app.component.html │ └── app.module.ts ├── index.html ├── styles.css ├── test.ts ├── karma.conf.js └── polyfills.ts ├── slides ├── img │ ├── apps.png │ ├── dapps.png │ ├── slides.png │ ├── video.png │ ├── apps-vs-dapps.png │ ├── slides-sombra.png │ ├── video-sombra.png │ ├── apps-vs-dapps-1.png │ ├── apps-vs-dapps-2.png │ ├── apps-vs-dapps-bn.png │ ├── codemotion-charla.png │ ├── dapp-de-donaciones-a-ONG.png │ ├── esquema-implementacion-dapp-1.png │ ├── esquema-implementacion-dapp-2.png │ ├── esquema-implementacion-dapp-3.png │ └── esquema-implementacion-dapp-4.png ├── lib │ ├── reveal.js │ │ ├── .travis.yml │ │ ├── lib │ │ │ ├── font │ │ │ │ ├── league-gothic │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── league-gothic.eot │ │ │ │ │ ├── league-gothic.ttf │ │ │ │ │ ├── league-gothic.woff │ │ │ │ │ └── league-gothic.css │ │ │ │ └── source-sans-pro │ │ │ │ │ ├── source-sans-pro-italic.eot │ │ │ │ │ ├── source-sans-pro-italic.ttf │ │ │ │ │ ├── source-sans-pro-italic.woff │ │ │ │ │ ├── source-sans-pro-regular.eot │ │ │ │ │ ├── source-sans-pro-regular.ttf │ │ │ │ │ ├── source-sans-pro-regular.woff │ │ │ │ │ ├── source-sans-pro-semibold.eot │ │ │ │ │ ├── source-sans-pro-semibold.ttf │ │ │ │ │ ├── source-sans-pro-semibold.woff │ │ │ │ │ ├── source-sans-pro-semibolditalic.eot │ │ │ │ │ ├── source-sans-pro-semibolditalic.ttf │ │ │ │ │ ├── source-sans-pro-semibolditalic.woff │ │ │ │ │ ├── source-sans-pro.css │ │ │ │ │ └── LICENSE │ │ │ ├── js │ │ │ │ ├── html5shiv.js │ │ │ │ └── classList.js │ │ │ └── css │ │ │ │ └── zenburn.css │ │ ├── test │ │ │ ├── examples │ │ │ │ ├── assets │ │ │ │ │ ├── image1.png │ │ │ │ │ └── image2.png │ │ │ │ ├── barebones.html │ │ │ │ ├── embedded-media.html │ │ │ │ ├── slide-transitions.html │ │ │ │ ├── slide-backgrounds.html │ │ │ │ └── math.html │ │ │ ├── test-markdown.js │ │ │ ├── test-pdf.js │ │ │ ├── test-markdown.html │ │ │ ├── test-pdf.html │ │ │ ├── test.html │ │ │ ├── test-markdown-element-attributes.js │ │ │ ├── test-markdown-slide-attributes.js │ │ │ ├── test-markdown-slide-attributes.html │ │ │ ├── test-markdown-element-attributes.html │ │ │ └── qunit-1.12.0.css │ │ ├── .gitignore │ │ ├── plugin │ │ │ ├── markdown │ │ │ │ ├── example.md │ │ │ │ └── example.html │ │ │ ├── multiplex │ │ │ │ ├── client.js │ │ │ │ ├── package.json │ │ │ │ ├── master.js │ │ │ │ └── index.js │ │ │ ├── print-pdf │ │ │ │ └── print-pdf.js │ │ │ ├── math │ │ │ │ └── math.js │ │ │ ├── notes-server │ │ │ │ ├── index.js │ │ │ │ └── client.js │ │ │ └── notes │ │ │ │ └── notes.js │ │ ├── bower.json │ │ ├── css │ │ │ ├── theme │ │ │ │ ├── source │ │ │ │ │ ├── night.scss │ │ │ │ │ ├── serif.scss │ │ │ │ │ ├── league.scss │ │ │ │ │ ├── simple.scss │ │ │ │ │ ├── sky.scss │ │ │ │ │ ├── white.scss │ │ │ │ │ ├── beige.scss │ │ │ │ │ ├── black.scss │ │ │ │ │ ├── moon.scss │ │ │ │ │ ├── solarized.scss │ │ │ │ │ └── blood.scss │ │ │ │ ├── template │ │ │ │ │ ├── settings.scss │ │ │ │ │ └── mixins.scss │ │ │ │ └── README.md │ │ │ └── print │ │ │ │ ├── pdf.css │ │ │ │ └── paper.css │ │ ├── LICENSE │ │ ├── CONTRIBUTING.md │ │ ├── package.json │ │ ├── index.html │ │ └── Gruntfile.js │ └── reveal.js-menu │ │ ├── font-awesome-4.3.0 │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── TODO │ │ ├── bower.json │ │ ├── package.json │ │ ├── LICENSE │ │ ├── lib │ │ └── bowser.min.js │ │ └── menu.css ├── export │ └── desarrollo-dapps-blockchain-ethereum-reveal-slides.pdf └── build.properties ├── migrations ├── 1_initial_migration.js └── 2_deploy_contracts.js ├── index.html ├── ganache-cli.sh ├── e2e ├── src │ ├── app.po.ts │ └── app.e2e-spec.ts ├── tsconfig.e2e.json └── protractor.conf.js ├── .editorconfig ├── tsconfig.json ├── patch.js ├── contracts ├── Migrations.sol └── NonGovernmentalOrganizations.sol ├── .gitignore ├── truffle.js ├── package.json ├── tslint.json ├── README.md ├── angular.json └── test └── TestNonGovernmentalOrganizations.js /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /slides/img/apps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/apps.png -------------------------------------------------------------------------------- /slides/img/dapps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/dapps.png -------------------------------------------------------------------------------- /slides/img/slides.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/slides.png -------------------------------------------------------------------------------- /slides/img/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/video.png -------------------------------------------------------------------------------- /src/assets/logo/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/src/assets/logo/logo.ico -------------------------------------------------------------------------------- /src/assets/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/src/assets/logo/logo.png -------------------------------------------------------------------------------- /src/favicon-blanco.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/src/favicon-blanco.ico -------------------------------------------------------------------------------- /slides/lib/reveal.js/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 4.1.1 4 | before_script: 5 | - npm install -g grunt-cli -------------------------------------------------------------------------------- /slides/img/apps-vs-dapps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/apps-vs-dapps.png -------------------------------------------------------------------------------- /slides/img/slides-sombra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/slides-sombra.png -------------------------------------------------------------------------------- /slides/img/video-sombra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/video-sombra.png -------------------------------------------------------------------------------- /slides/img/apps-vs-dapps-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/apps-vs-dapps-1.png -------------------------------------------------------------------------------- /slides/img/apps-vs-dapps-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/apps-vs-dapps-2.png -------------------------------------------------------------------------------- /slides/img/apps-vs-dapps-bn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/apps-vs-dapps-bn.png -------------------------------------------------------------------------------- /src/assets/logo/logo-blanco.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/src/assets/logo/logo-blanco.ico -------------------------------------------------------------------------------- /src/assets/logo/logo-blanco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/src/assets/logo/logo-blanco.png -------------------------------------------------------------------------------- /slides/img/codemotion-charla.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/codemotion-charla.png -------------------------------------------------------------------------------- /slides/img/dapp-de-donaciones-a-ONG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/dapp-de-donaciones-a-ONG.png -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/league-gothic/LICENSE: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /src/assets/logo/logo-blanco-recortado.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/src/assets/logo/logo-blanco-recortado.png -------------------------------------------------------------------------------- /slides/img/esquema-implementacion-dapp-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/esquema-implementacion-dapp-1.png -------------------------------------------------------------------------------- /slides/img/esquema-implementacion-dapp-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/esquema-implementacion-dapp-2.png -------------------------------------------------------------------------------- /slides/img/esquema-implementacion-dapp-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/esquema-implementacion-dapp-3.png -------------------------------------------------------------------------------- /slides/img/esquema-implementacion-dapp-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/img/esquema-implementacion-dapp-4.png -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | var Migrations = artifacts.require("./Migrations.sol"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/examples/assets/image1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/test/examples/assets/image1.png -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/examples/assets/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/test/examples/assets/image2.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/league-gothic/league-gothic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/league-gothic/league-gothic.eot -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/league-gothic/league-gothic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/league-gothic/league-gothic.ttf -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/league-gothic/league-gothic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/league-gothic/league-gothic.woff -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /slides/export/desarrollo-dapps-blockchain-ethereum-reveal-slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/export/desarrollo-dapps-blockchain-ethereum-reveal-slides.pdf -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/TODO: -------------------------------------------------------------------------------- 1 | TODO 2 | 3 | Add menu panel for changing options, for both reveal (eg autoSlide, loop, show/hide controls, ...) and menu (eg change side, effect, ...) 4 | 5 | Customise width 6 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | *.iws 4 | *.eml 5 | out/ 6 | .DS_Store 7 | .svn 8 | log/*.log 9 | tmp/** 10 | node_modules/ 11 | .sass-cache 12 | css/reveal.min.css 13 | js/reveal.min.js -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js-menu/font-awesome-4.3.0/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff -------------------------------------------------------------------------------- /migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | var NonGovernmentalOrganizations = artifacts.require("./NonGovernmentalOrganizations.sol"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(NonGovernmentalOrganizations); 5 | }; 6 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asanzdiego/codemotion-charla-blockchain/HEAD/slides/lib/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff -------------------------------------------------------------------------------- /ganache-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "" > ganache-cli.log 4 | 5 | ganache-cli --gasLimit 7000001 --mnemonic "$(cat private/wallet.mnemonic)" >> ganache-cli.log & 6 | 7 | time sleep 2.0 > /dev/null 8 | 9 | tail -n 10 -f ganache-cli.log -------------------------------------------------------------------------------- /src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "es2015", 6 | "types": [] 7 | }, 8 | "exclude": [ 9 | "src/test.ts", 10 | "**/*.spec.ts" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "module": "commonjs", 6 | "target": "es5", 7 | "types": [ 8 | "jasmine", 9 | "jasminewd2", 10 | "node" 11 | ] 12 | } 13 | } -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/js/html5shiv.js: -------------------------------------------------------------------------------- 1 | document.createElement('header'); 2 | document.createElement('nav'); 3 | document.createElement('section'); 4 | document.createElement('article'); 5 | document.createElement('aside'); 6 | document.createElement('footer'); 7 | document.createElement('hgroup'); -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test-markdown.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 2, 'found two slides' ); 9 | }); 10 | 11 | 12 | } ); 13 | 14 | Reveal.initialize(); 15 | 16 | -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to material!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "module": "commonjs", 6 | "types": [ 7 | "jasmine", 8 | "node" 9 | ] 10 | }, 11 | "files": [ 12 | "test.ts", 13 | "polyfills.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/font/league-gothic/league-gothic.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'League Gothic'; 3 | src: url('league-gothic.eot'); 4 | src: url('league-gothic.eot?#iefix') format('embedded-opentype'), 5 | url('league-gothic.woff') format('woff'), 6 | url('league-gothic.ttf') format('truetype'); 7 | 8 | font-weight: normal; 9 | font-style: normal; 10 | } -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test-pdf.js: -------------------------------------------------------------------------------- 1 | 2 | Reveal.addEventListener( 'ready', function() { 3 | 4 | // Only one test for now, we're mainly ensuring that there 5 | // are no execution errors when running PDF mode 6 | 7 | test( 'Reveal.isReady', function() { 8 | strictEqual( Reveal.isReady(), true, 'returns true' ); 9 | }); 10 | 11 | 12 | } ); 13 | 14 | Reveal.initialize({ pdf: true }); 15 | 16 | -------------------------------------------------------------------------------- /src/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tslint.json", 3 | "rules": { 4 | "directive-selector": [ 5 | true, 6 | "attribute", 7 | "app", 8 | "camelCase" 9 | ], 10 | "component-selector": [ 11 | true, 12 | "element", 13 | "app", 14 | "kebab-case" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/browserslist: -------------------------------------------------------------------------------- 1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/markdown/example.md: -------------------------------------------------------------------------------- 1 | # Markdown Demo 2 | 3 | 4 | 5 | ## External 1.1 6 | 7 | Content 1.1 8 | 9 | Note: This will only appear in the speaker notes window. 10 | 11 | 12 | ## External 1.2 13 | 14 | Content 1.2 15 | 16 | 17 | 18 | ## External 2 19 | 20 | Content 2.1 21 | 22 | 23 | 24 | ## External 3.1 25 | 26 | Content 3.1 27 | 28 | 29 | ## External 3.2 30 | 31 | Content 3.2 32 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | import 'hammerjs'; 8 | 9 | if (environment.production) { 10 | enableProdMode(); 11 | } 12 | 13 | platformBrowserDynamic().bootstrapModule(AppModule) 14 | .catch(err => console.log(err)); 15 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/multiplex/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var multiplex = Reveal.getConfig().multiplex; 3 | var socketId = multiplex.id; 4 | var socket = io.connect(multiplex.url); 5 | 6 | socket.on(multiplex.id, function(data) { 7 | // ignore data from sockets that aren't ours 8 | if (data.socketId !== socketId) { return; } 9 | if( window.location.host === 'localhost:1947' ) return; 10 | 11 | Reveal.setState(data.state); 12 | }); 13 | }()); 14 | -------------------------------------------------------------------------------- /src/app/services/service.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { MessagesService } from './messages.service'; 3 | import { OrganizationsService } from './organizations.service'; 4 | import { Web3Service } from './web3.service'; 5 | 6 | @NgModule({ 7 | providers: [ 8 | MessagesService, 9 | OrganizationsService, 10 | Web3Service, 11 | ] 12 | }) 13 | export class ServicesModule { 14 | // nothing here 15 | } 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "outDir": "./dist/out-tsc", 6 | "sourceMap": true, 7 | "declaration": false, 8 | "moduleResolution": "node", 9 | "emitDecoratorMetadata": true, 10 | "experimentalDecorators": true, 11 | "target": "es5", 12 | "typeRoots": [ 13 | "node_modules/@types" 14 | ], 15 | "lib": [ 16 | "es2017", 17 | "dom" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /patch.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; 3 | 4 | fs.readFile(f, 'utf8', function (err, data) { 5 | if (err) { 6 | return console.log(err); 7 | } 8 | var result = data.replace(/node: false/g, 'node: {crypto: true, stream: true}'); 9 | 10 | fs.writeFile(f, result, 'utf8', function (err) { 11 | if (err) return console.log(err); 12 | }); 13 | }); -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/multiplex/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reveal-js-multiplex", 3 | "version": "1.0.0", 4 | "description": "reveal.js multiplex server", 5 | "homepage": "http://lab.hakim.se/reveal-js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "engines": { 10 | "node": "~4.1.1" 11 | }, 12 | "dependencies": { 13 | "express": "~4.13.3", 14 | "grunt-cli": "~0.1.13", 15 | "mustache": "~2.2.1", 16 | "socket.io": "~1.3.7" 17 | }, 18 | "license": "MIT" 19 | } 20 | -------------------------------------------------------------------------------- /src/app/util/address.util.ts: -------------------------------------------------------------------------------- 1 | export class AddressUtil { 2 | 3 | static truncateAddress(address: string): string { 4 | if (!address) { 5 | return ''; 6 | } 7 | let newAddress = address; 8 | if (address.length > 6) { 9 | newAddress = address.substring(0, 5) + '...'; 10 | } 11 | if (address.length > 10) { 12 | newAddress = newAddress + address.substring(address.length - 5, address.length - 1); 13 | } 14 | return newAddress; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reveal.js-menu", 3 | "version": "0.7.2", 4 | "homepage": "https://denehyg.github.io/reveal.js-menu", 5 | "authors": [ 6 | "Greg Denehy" 7 | ], 8 | "description": "A slideout menu for navigating reveal.js presentations", 9 | "keywords": [ 10 | "reveal", 11 | "menu" 12 | ], 13 | "license": "MIT, Copyright (C) 2016 Greg Denehy", 14 | "ignore": [ 15 | "**/.*", 16 | "node_modules", 17 | "bower_components", 18 | "test", 19 | "tests" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .app-container { 2 | display: flex; 3 | flex-direction: column; 4 | position: absolute; 5 | top: 0; 6 | bottom: 0; 7 | left: 0; 8 | right: 0; 9 | } 10 | 11 | .app-toolbar { 12 | position: fixed; 13 | z-index: 2; 14 | } 15 | 16 | .app-sidenav-name { 17 | text-align: center; 18 | width: 100%; 19 | } 20 | 21 | .app-sidenav-logo { 22 | height: 1em; 23 | } 24 | 25 | .app-sidenav-container { 26 | margin-top: 4em; 27 | flex: 1 0 auto; 28 | } 29 | 30 | .app-sidenav-content { 31 | padding: 1em; 32 | } -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Non Governmental Organizations 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | @import "~@angular/material/prebuilt-themes/indigo-pink.css"; 3 | 4 | .mat-form-field { 5 | width: 100%; 6 | } 7 | 8 | .app-flex-container { 9 | display: flex; 10 | justify-content: space-between 11 | } 12 | 13 | .app-primary { 14 | color: #3f51b5; 15 | } 16 | 17 | .app-accent { 18 | color: #ff4081; 19 | } 20 | 21 | .app-warn { 22 | color: #f44336; 23 | } 24 | 25 | table { 26 | width: 100%; 27 | } 28 | 29 | th.mat-sort-header-sorted { 30 | color: black; 31 | } 32 | 33 | .app-cursor { 34 | cursor: pointer; 35 | } -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.16; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | modifier restricted() { 8 | if (msg.sender == owner) _; 9 | } 10 | 11 | constructor() public { 12 | owner = msg.sender; 13 | } 14 | 15 | function setCompleted(uint completed) public restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) public restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reveal.js", 3 | "version": "3.3.0", 4 | "main": [ 5 | "js/reveal.js", 6 | "css/reveal.css" 7 | ], 8 | "homepage": "http://lab.hakim.se/reveal-js/", 9 | "license": "MIT", 10 | "description": "The HTML Presentation Framework", 11 | "authors": [ 12 | "Hakim El Hattab " 13 | ], 14 | "dependencies": { 15 | "headjs": "~1.0.3" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/hakimel/reveal.js.git" 20 | }, 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "test" 26 | ] 27 | } -------------------------------------------------------------------------------- /src/app/models/organization.ts: -------------------------------------------------------------------------------- 1 | import { AddressUtil } from '../util/address.util'; 2 | 3 | export class Organization { 4 | 5 | id: number; 6 | ownerAddress: string; 7 | name: string; 8 | string: string; 9 | 10 | ownerAddressTruncated(): string { 11 | 12 | return AddressUtil.truncateAddress(this.ownerAddress); 13 | } 14 | 15 | getString() { 16 | this.setString(); 17 | return this.string; 18 | } 19 | 20 | setString() { 21 | this.string = 'Organization[ID=' + this.id + '' 22 | + ', ownerAddress=' + this.ownerAddress + '' 23 | + ', name=' + this.name + ']'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reveal.js-menu", 3 | "version": "0.7.2", 4 | "description": "A slideout menu for navigating reveal.js presentations", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "git+https://github.com/denehyg/reveal.js-menu.git" 11 | }, 12 | "keywords": [ 13 | "reveal", 14 | "menu" 15 | ], 16 | "author": "Greg Denehy", 17 | "license": "MIT, Copyright (C) 2016 Greg Denehy", 18 | "bugs": { 19 | "url": "https://github.com/denehyg/reveal.js-menu/issues" 20 | }, 21 | "homepage": "https://github.com/denehyg/reveal.js-menu#readme" 22 | } 23 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build ---prod` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | /private 3 | ganache-cli.log 4 | 5 | # compiled output 6 | /build 7 | /dist 8 | /tmp 9 | /out-tsc 10 | 11 | # dependencies 12 | /node_modules 13 | 14 | # IDEs and editors 15 | /.idea 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # IDE - VSCode 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | 30 | # misc 31 | /.sass-cache 32 | /connect.lock 33 | /coverage 34 | /libpeerconnection.log 35 | npm-debug.log 36 | yarn-error.log 37 | testem.log 38 | /typings 39 | 40 | # System Files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/app/util/storage.util.ts: -------------------------------------------------------------------------------- 1 | export class StorageUtil { 2 | 3 | private static _userAddress = 'userAddress'; 4 | 5 | static getUserAddress() { 6 | return this._getFromLocalStorage(this._userAddress); 7 | } 8 | 9 | static setUserAddress(userAddress: string) { 10 | this._setToLocalStorage(this._userAddress, userAddress); 11 | } 12 | 13 | 14 | private static _getFromLocalStorage(collectionName: string) { 15 | const data = localStorage.getItem(collectionName); 16 | if (data) { 17 | return JSON.parse(data); 18 | } 19 | return {}; 20 | } 21 | 22 | private static _setToLocalStorage(collectionName: string, data: any) { 23 | localStorage.setItem(collectionName, JSON.stringify(data)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/app/services/messages.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Observable, Subject } from 'rxjs'; 3 | 4 | @Injectable() 5 | export class MessagesService { 6 | 7 | private newUserAddressSubject = new Subject(); 8 | private errorSubject = new Subject(); 9 | 10 | sendNewUserAddressMessage(message: string) { 11 | this.newUserAddressSubject.next(message); 12 | } 13 | 14 | getNewUserAddressMessage(): Observable { 15 | return this.newUserAddressSubject.asObservable(); 16 | } 17 | 18 | sendErrorMessage(message: string) { 19 | this.errorSubject.next(message); 20 | } 21 | 22 | getErrorMessage(): Observable { 23 | return this.errorSubject.asObservable(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './src/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: require('path').join(__dirname, './tsconfig.e2e.json') 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/examples/barebones.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Barebones 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 |
17 | 18 |
19 |

Barebones Presentation

20 |

This example contains the bare minimum includes and markup required to run a reveal.js presentation.

21 |
22 | 23 |
24 |

No Theme

25 |

There's no theme included, so it will fall back on browser defaults.

26 |
27 | 28 |
29 | 30 |
31 | 32 | 33 | 34 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/app/models/donation.ts: -------------------------------------------------------------------------------- 1 | import { AddressUtil } from '../util/address.util'; 2 | 3 | export class Donation { 4 | 5 | organizationId: number; 6 | ownerAddress: string; 7 | senderAddress: string; 8 | value: string; 9 | string: string; 10 | 11 | ownerAddressTruncated(): string { 12 | 13 | return AddressUtil.truncateAddress(this.ownerAddress); 14 | } 15 | 16 | senderAddressTruncated(): string { 17 | 18 | return AddressUtil.truncateAddress(this.senderAddress); 19 | } 20 | 21 | getString() { 22 | this.setString(); 23 | return this.string; 24 | } 25 | 26 | setString() { 27 | this.string = 'Donation[organizationID=' + this.organizationId + '' 28 | + ', ownerAddress=' + this.ownerAddress + '' 29 | + ', senderAddress=' + this.senderAddress + '' 30 | + ', value=' + this.value + ']'; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/multiplex/master.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | // Don't emit events from inside of notes windows 4 | if ( window.location.search.match( /receiver/gi ) ) { return; } 5 | 6 | var multiplex = Reveal.getConfig().multiplex; 7 | 8 | var socket = io.connect( multiplex.url ); 9 | 10 | function post() { 11 | 12 | var messageData = { 13 | state: Reveal.getState(), 14 | secret: multiplex.secret, 15 | socketId: multiplex.id 16 | }; 17 | 18 | socket.emit( 'multiplex-statechanged', messageData ); 19 | 20 | }; 21 | 22 | // Monitor events that trigger a change in state 23 | Reveal.addEventListener( 'slidechanged', post ); 24 | Reveal.addEventListener( 'fragmentshown', post ); 25 | Reveal.addEventListener( 'fragmenthidden', post ); 26 | Reveal.addEventListener( 'overviewhidden', post ); 27 | Reveal.addEventListener( 'overviewshown', post ); 28 | Reveal.addEventListener( 'paused', post ); 29 | Reveal.addEventListener( 'resumed', post ); 30 | 31 | }()); -------------------------------------------------------------------------------- /truffle.js: -------------------------------------------------------------------------------- 1 | var HDWalletProvider = require("truffle-hdwallet-provider"); 2 | 3 | var path = process.cwd(); 4 | 5 | module.exports = { 6 | networks: { 7 | development: { 8 | host: "localhost", 9 | port: 8545, 10 | gas: 6900000, 11 | network_id: "*" // Match any network id 12 | }, 13 | rinkeby: { 14 | provider: function () { 15 | 16 | var fs = require('fs'); 17 | 18 | var walletMmnemonic = fs.readFileSync(path + "/private/wallet.mnemonic.rinkeby").toString(); 19 | //console.log(walletMmnemonic); 20 | 21 | var apiKey = fs.readFileSync(path + "/private/api.key").toString(); 22 | //console.log(apiKey); 23 | 24 | let provider = new HDWalletProvider( 25 | walletMmnemonic, 26 | "https://rinkeby.infura.io/v3/" + apiKey); 27 | provider.getAddress(); 28 | 29 | return provider; 30 | }, 31 | gas: 6900000, 32 | network_id: 4 33 | } 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /src/app/components/user/user.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild } from '@angular/core'; 2 | import { StorageUtil } from '../../util/storage.util'; 3 | import { Organization } from '../../models/organization'; 4 | import { OrganizationsService } from '../../services/organizations.service'; 5 | 6 | @Component({ 7 | selector: 'app-user', 8 | templateUrl: './user.component.html' 9 | }) 10 | export class UserComponent implements OnInit { 11 | 12 | userAddress = ''; 13 | organizationOwner: Organization; 14 | isLoadingOwner = true; 15 | error = ''; 16 | 17 | constructor( 18 | private organizationsService: OrganizationsService) { 19 | 20 | } 21 | 22 | ngOnInit() { 23 | 24 | this.userAddress = StorageUtil.getUserAddress(); 25 | 26 | this._init().catch(error => this.error = error); 27 | } 28 | 29 | private async _init(): Promise { 30 | 31 | this.organizationOwner = await this.organizationsService.getCurrentUserOrganizationAsOwner(); 32 | this.isLoadingOwner = false; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { OrganizationsComponent } from './components/organizations/organizations.component'; 5 | import { OrganizationAddComponent } from './components/organizations/organization-add.component'; 6 | import { OrganizationDonationComponent } from './components/organizations/organization-donation.component'; 7 | import { UserComponent } from './components/user/user.component'; 8 | 9 | const routes: Routes = [ 10 | { path: '', redirectTo: '/user', pathMatch: 'full' }, 11 | { path: 'organizations', component: OrganizationsComponent }, 12 | { path: 'organization-add', component: OrganizationAddComponent }, 13 | { path: 'organization-donation/:organizationId', component: OrganizationDonationComponent }, 14 | { path: 'user', component: UserComponent }, 15 | ]; 16 | 17 | @NgModule({ 18 | imports: [RouterModule.forRoot(routes)], 19 | exports: [RouterModule] 20 | }) 21 | export class AppRoutingModule { 22 | // nothing here 23 | } 24 | -------------------------------------------------------------------------------- /src/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular-devkit/build-angular'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular-devkit/build-angular/plugins/karma') 14 | ], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | dir: require('path').join(__dirname, '../coverage'), 20 | reports: ['html', 'lcovonly'], 21 | fixWebpackSourcePaths: true 22 | }, 23 | reporters: ['progress', 'kjhtml'], 24 | port: 9876, 25 | colors: true, 26 | logLevel: config.LOG_INFO, 27 | autoWatch: true, 28 | browsers: ['Chrome'], 29 | singleRun: false 30 | }); 31 | }; -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015 Greg Denehy 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/night.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 16 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 17 | 18 | 19 | // Override theme settings (see ../template/settings.scss) 20 | $backgroundColor: #111; 21 | 22 | $mainFont: 'Open Sans', sans-serif; 23 | $linkColor: #e7ad52; 24 | $linkColorHover: lighten( $linkColor, 20% ); 25 | $headingFont: 'Montserrat', Impact, sans-serif; 26 | $headingTextShadow: none; 27 | $headingLetterSpacing: -0.03em; 28 | $headingTextTransform: none; 29 | $selectionBackgroundColor: #e7ad52; 30 | $mainFontSize: 30px; 31 | 32 | 33 | // Theme template ------------------------------ 34 | @import "../template/theme"; 35 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/examples/embedded-media.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Embedded Media 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 21 |
22 |

Embedded Media Test

23 |
24 | 25 |
26 | 27 |
28 | 29 |
30 |

Empty Slide

31 |
32 | 33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2016 Hakim El Hattab, http://hakim.se 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/app/components/organizations/organizations-table.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild, Input } from '@angular/core'; 2 | import { MatSort, MatTableDataSource } from '@angular/material'; 3 | import { Organization } from '../../models/organization'; 4 | 5 | @Component({ 6 | selector: 'app-organizations-table', 7 | templateUrl: './organizations-table.component.html' 8 | }) 9 | export class OrganizationsTableComponent implements OnInit { 10 | 11 | @ViewChild(MatSort) sort: MatSort; 12 | 13 | @Input() organizations: Organization[]; 14 | @Input() organization: Organization; 15 | 16 | dataSource: MatTableDataSource; 17 | displayedColumns: string[] = ['id', 'ownerAddress', 'name', 'donation']; 18 | 19 | constructor() { } 20 | 21 | ngOnInit() { 22 | if (this.organization) { 23 | this.organizations = []; 24 | this.organizations.push(this.organization); 25 | } 26 | this.dataSource = new MatTableDataSource(this.organizations); 27 | this.dataSource.sort = this.sort; 28 | } 29 | 30 | applyFilter(filterValue: string) { 31 | this.dataSource.filter = filterValue.trim().toLowerCase(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | Please keep the [issue tracker](http://github.com/hakimel/reveal.js/issues) limited to **bug reports**, **feature requests** and **pull requests**. 4 | 5 | 6 | ### Personal Support 7 | If you have personal support or setup questions the best place to ask those are [StackOverflow](http://stackoverflow.com/questions/tagged/reveal.js). 8 | 9 | 10 | ### Bug Reports 11 | When reporting a bug make sure to include information about which browser and operating system you are on as well as the necessary steps to reproduce the issue. If possible please include a link to a sample presentation where the bug can be tested. 12 | 13 | 14 | ### Pull Requests 15 | - Should follow the coding style of the file you work in, most importantly: 16 | - Tabs to indent 17 | - Single-quoted strings 18 | - Should be made towards the **dev branch** 19 | - Should be submitted from a feature/topic branch (not your master) 20 | 21 | 22 | ### Plugins 23 | Please do not submit plugins as pull requests. They should be maintained in their own separate repository. More information here: https://github.com/hakimel/reveal.js/wiki/Plugin-Guidelines 24 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/serif.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is brown. 4 | * 5 | * This theme is Copyright (C) 2012-2013 Owen Versteeg, http://owenversteeg.com - it is MIT licensed. 6 | */ 7 | 8 | 9 | // Default mixins and settings ----------------- 10 | @import "../template/mixins"; 11 | @import "../template/settings"; 12 | // --------------------------------------------- 13 | 14 | 15 | 16 | // Override theme settings (see ../template/settings.scss) 17 | $mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 18 | $mainColor: #000; 19 | $headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 20 | $headingColor: #383D3D; 21 | $headingTextShadow: none; 22 | $headingTextTransform: none; 23 | $backgroundColor: #F0F1EB; 24 | $linkColor: #51483D; 25 | $linkColorHover: lighten( $linkColor, 20% ); 26 | $selectionBackgroundColor: #26351C; 27 | 28 | .reveal a { 29 | line-height: 1.3em; 30 | } 31 | 32 | 33 | // Theme template ------------------------------ 34 | @import "../template/theme"; 35 | // --------------------------------------------- 36 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MessagesService } from './services/messages.service'; 3 | import { Web3Service } from './services/web3.service'; 4 | import { Router } from '@angular/router'; 5 | import { StorageUtil } from './util/storage.util'; 6 | 7 | @Component({ 8 | selector: 'app-root', 9 | templateUrl: './app.component.html', 10 | styleUrls: ['./app.component.css'] 11 | }) 12 | export class AppComponent implements OnInit { 13 | 14 | error = ''; 15 | 16 | constructor( 17 | private web3Service: Web3Service, 18 | private messagesService: MessagesService, 19 | private router: Router) { 20 | } 21 | 22 | ngOnInit() { 23 | 24 | this.messagesService.getErrorMessage().subscribe(error => { 25 | this.error = error; 26 | }); 27 | 28 | this.messagesService.getNewUserAddressMessage().subscribe(userAddress => { 29 | 30 | console.log('AppComponent->userAddress', userAddress); 31 | //window.location.reload(); 32 | window.location.href = 'user' 33 | }); 34 | 35 | this.web3Service.init(); 36 | } 37 | 38 | goInit() { 39 | this.router.navigate(['/init']); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 7 |

8 | Non Governmental Organizations 9 |

10 |
11 | 12 | 13 | 14 | 15 | 16 | User 17 | Organizations 18 | 19 | 20 | 21 | 22 |
23 |

Non Governmental Organizations

24 | 25 |
{{error}}
26 |
27 |
28 | 29 |
30 | 31 |
32 | 33 |
-------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/template/settings.scss: -------------------------------------------------------------------------------- 1 | // Base settings for all themes that can optionally be 2 | // overridden by the super-theme 3 | 4 | // Background of the presentation 5 | $backgroundColor: #2b2b2b; 6 | 7 | // Primary/body text 8 | $mainFont: 'Lato', sans-serif; 9 | $mainFontSize: 36px; 10 | $mainColor: #eee; 11 | 12 | // Vertical spacing between blocks of text 13 | $blockMargin: 20px; 14 | 15 | // Headings 16 | $headingMargin: 0 0 $blockMargin 0; 17 | $headingFont: 'League Gothic', Impact, sans-serif; 18 | $headingColor: #eee; 19 | $headingLineHeight: 1.2; 20 | $headingLetterSpacing: normal; 21 | $headingTextTransform: uppercase; 22 | $headingTextShadow: none; 23 | $headingFontWeight: normal; 24 | $heading1TextShadow: $headingTextShadow; 25 | 26 | $heading1Size: 3.77em; 27 | $heading2Size: 2.11em; 28 | $heading3Size: 1.55em; 29 | $heading4Size: 1.00em; 30 | 31 | // Links and actions 32 | $linkColor: #13DAEC; 33 | $linkColorHover: lighten( $linkColor, 20% ); 34 | 35 | // Text selection 36 | $selectionBackgroundColor: #FF5E99; 37 | $selectionColor: #fff; 38 | 39 | // Generates the presentation background, can be overridden 40 | // to return a background image or gradient 41 | @mixin bodyBackground() { 42 | background: $backgroundColor; 43 | } -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/league.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * League theme for reveal.js. 3 | * 4 | * This was the default theme pre-3.0.0. 5 | * 6 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Include theme-specific fonts 18 | @import url(../../lib/font/league-gothic/league-gothic.css); 19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 20 | 21 | // Override theme settings (see ../template/settings.scss) 22 | $headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2); 23 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 24 | 25 | // Background generator 26 | @mixin bodyBackground() { 27 | @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) ); 28 | } 29 | 30 | 31 | 32 | // Theme template ------------------------------ 33 | @import "../template/theme"; 34 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/lib/reveal.js/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reveal.js", 3 | "version": "3.3.0", 4 | "description": "The HTML Presentation Framework", 5 | "homepage": "http://lab.hakim.se/reveal-js", 6 | "subdomain": "revealjs", 7 | "main": "js/reveal.js", 8 | "scripts": { 9 | "test": "grunt test", 10 | "start": "grunt serve" 11 | }, 12 | "author": { 13 | "name": "Hakim El Hattab", 14 | "email": "hakim.elhattab@gmail.com", 15 | "web": "http://hakim.se" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/hakimel/reveal.js.git" 20 | }, 21 | "engines": { 22 | "node": "~4.1.1" 23 | }, 24 | "dependencies": { 25 | "express": "~4.13.3", 26 | "grunt-cli": "~0.1.13", 27 | "mustache": "~2.2.1", 28 | "socket.io": "~1.3.7" 29 | }, 30 | "devDependencies": { 31 | "grunt": "~0.4.5", 32 | "grunt-autoprefixer": "~3.0.3", 33 | "grunt-contrib-connect": "~0.11.2", 34 | "grunt-contrib-cssmin": "~0.14.0", 35 | "grunt-contrib-jshint": "~0.11.3", 36 | "grunt-contrib-qunit": "~0.7.0", 37 | "grunt-contrib-uglify": "~0.9.2", 38 | "grunt-contrib-watch": "~0.6.1", 39 | "grunt-sass": "~1.1.0-beta", 40 | "grunt-zip": "~0.17.1", 41 | "node-sass": "~3.3.3" 42 | }, 43 | "license": "MIT" 44 | } 45 | -------------------------------------------------------------------------------- /src/app/components/user/user.component.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | User 4 |

5 |
6 | 7 | 8 |
{{error}}
9 |
10 | 11 |
12 | 13 | 14 |
Your user address is {{userAddress}}.
15 |
16 | 17 |
18 | 19 | 20 |
21 | Loading user organization as owner... 22 |
23 | 24 |
25 | 26 |
27 |

You are the owner of the organization:

28 | 29 |
30 | 31 |
32 |

You are not the owner of any organizations.

33 | 34 | add 35 | Add organization 36 | 37 |
38 | 39 |
40 |
41 | 42 |
-------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/css/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | background: #3f3f3f; 13 | color: #dcdcdc; 14 | } 15 | 16 | .hljs-keyword, 17 | .hljs-selector-tag, 18 | .hljs-tag { 19 | color: #e3ceab; 20 | } 21 | 22 | .hljs-template-tag { 23 | color: #dcdcdc; 24 | } 25 | 26 | .hljs-number { 27 | color: #8cd0d3; 28 | } 29 | 30 | .hljs-variable, 31 | .hljs-template-variable, 32 | .hljs-attribute { 33 | color: #efdcbc; 34 | } 35 | 36 | .hljs-literal { 37 | color: #efefaf; 38 | } 39 | 40 | .hljs-subst { 41 | color: #8f8f8f; 42 | } 43 | 44 | .hljs-title, 45 | .hljs-name, 46 | .hljs-selector-id, 47 | .hljs-selector-class, 48 | .hljs-section, 49 | .hljs-type { 50 | color: #efef8f; 51 | } 52 | 53 | .hljs-symbol, 54 | .hljs-bullet, 55 | .hljs-link { 56 | color: #dca3a3; 57 | } 58 | 59 | .hljs-deletion, 60 | .hljs-string, 61 | .hljs-built_in, 62 | .hljs-builtin-name { 63 | color: #cc9393; 64 | } 65 | 66 | .hljs-addition, 67 | .hljs-comment, 68 | .hljs-quote, 69 | .hljs-meta { 70 | color: #7f9f7f; 71 | } 72 | 73 | 74 | .hljs-emphasis { 75 | font-style: italic; 76 | } 77 | 78 | .hljs-strong { 79 | font-weight: bold; 80 | } 81 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/simple.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is darkblue. 4 | * 5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. 6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Include theme-specific fonts 18 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); 19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 20 | 21 | 22 | // Override theme settings (see ../template/settings.scss) 23 | $mainFont: 'Lato', sans-serif; 24 | $mainColor: #000; 25 | $headingFont: 'News Cycle', Impact, sans-serif; 26 | $headingColor: #000; 27 | $headingTextShadow: none; 28 | $headingTextTransform: none; 29 | $backgroundColor: #fff; 30 | $linkColor: #00008B; 31 | $linkColorHover: lighten( $linkColor, 20% ); 32 | $selectionBackgroundColor: rgba(0, 0, 0, 0.99); 33 | 34 | 35 | 36 | // Theme template ------------------------------ 37 | @import "../template/theme"; 38 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/sky.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Sky theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); 17 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); 18 | 19 | 20 | // Override theme settings (see ../template/settings.scss) 21 | $mainFont: 'Open Sans', sans-serif; 22 | $mainColor: #333; 23 | $headingFont: 'Quicksand', sans-serif; 24 | $headingColor: #333; 25 | $headingLetterSpacing: -0.08em; 26 | $headingTextShadow: none; 27 | $backgroundColor: #f7fbfc; 28 | $linkColor: #3b759e; 29 | $linkColorHover: lighten( $linkColor, 20% ); 30 | $selectionBackgroundColor: #134674; 31 | 32 | // Fix links so they are not cut off 33 | .reveal a { 34 | line-height: 1.3em; 35 | } 36 | 37 | // Background generator 38 | @mixin bodyBackground() { 39 | @include radial-gradient( #add9e4, #f7fbfc ); 40 | } 41 | 42 | 43 | 44 | // Theme template ------------------------------ 45 | @import "../template/theme"; 46 | // --------------------------------------------- 47 | -------------------------------------------------------------------------------- /slides/build.properties: -------------------------------------------------------------------------------- 1 | CLEAN_LIB_FOLDER='no' 2 | COPY_IMG_FOLDER='no' 3 | ZIP_EXPORT_FOLDER='no' 4 | NUMBER_OFFSET='no' 5 | CURRENT_NUMBER_OFFSET=1 6 | REMOVE_MD_TO_BOOK='yes' 7 | REMOVE_MD_TO_SLIDES='yes' 8 | 9 | REVEAL_JS_SRC_ONLINE='https://asanzdiego.github.io/markdownslides/doc/lib/reveal.js/' 10 | REVEAL_JS_MENU_SRC_ONLINE='https://asanzdiego.github.io/markdownslides/doc/lib/reveal.js-menu/' 11 | 12 | #GENERATION_MODE='min|med|max' 13 | DEFAULT_GENERATION_MODE='min' 14 | 15 | #16:9 -> 800x450 960x540 1024x576 1280x720 1360x765 1600x900 1920x1080 16 | #4:3 -> 800x600 960x720 1024x768 1280x960 1360x1020 1600x1200 1920x1440 17 | 18 | #see https://github.com/hakimel/reveal.js#presentation-size 19 | WIDTH='1024' 20 | HEIGHT='576' 21 | MARGIN='0.3' 22 | MIN_SCALE='0.1' 23 | MAX_SCALE='1.9' 24 | #none/fade/slide/convex/concave/zoom 25 | TRANSITION='fade' 26 | 27 | PHANTOMJS_RESOLUTION="800x450" 28 | 29 | BUILD_REVEAL_SLIDES='min' 30 | BUILD_REVEAL_SLIDES_PDF='min' 31 | BUILD_REVEAL_SLIDES_ONLINE='max' 32 | BUILD_REVEAL_SLIDES_ALTERNATIVE='med' 33 | BUILD_REVEAL_SLIDES_ALTERNATIVE_PDF='med' 34 | BUILD_REVEAL_SLIDES_ALTERNATIVE_ONLINE='max' 35 | BUILD_BEAMER_SLIDES='deprecated' 36 | BUILD_DECK_SLIDES='deprecated' 37 | BUILD_DECK_SLIDES_ALTERNATIVE='deprecated' 38 | 39 | BUILD_HTML_BOOK='med' 40 | BUILD_DOCX_BOOK='max' 41 | BUILD_EPUB_BOOK='max' 42 | BUILD_ODT_BOOK='deprecated' 43 | BUILD_PDF_BOOK='deprecated' 44 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/white.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * White theme for reveal.js. This is the opposite of the 'black' theme. 3 | * 4 | * By Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css); 16 | 17 | 18 | // Override theme settings (see ../template/settings.scss) 19 | $backgroundColor: #fff; 20 | 21 | $mainColor: #222; 22 | $headingColor: #222; 23 | 24 | $mainFontSize: 38px; 25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif; 26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif; 27 | $headingTextShadow: none; 28 | $headingLetterSpacing: normal; 29 | $headingTextTransform: uppercase; 30 | $headingFontWeight: 600; 31 | $linkColor: #2a76dd; 32 | $linkColorHover: lighten( $linkColor, 15% ); 33 | $selectionBackgroundColor: lighten( $linkColor, 25% ); 34 | 35 | $heading1Size: 2.5em; 36 | $heading2Size: 1.6em; 37 | $heading3Size: 1.3em; 38 | $heading4Size: 1.0em; 39 | 40 | section.has-dark-background { 41 | &, h1, h2, h3, h4, h5, h6 { 42 | color: #fff; 43 | } 44 | } 45 | 46 | 47 | // Theme template ------------------------------ 48 | @import "../template/theme"; 49 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/beige.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Beige theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @import url(../../lib/font/league-gothic/league-gothic.css); 17 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 18 | 19 | 20 | // Override theme settings (see ../template/settings.scss) 21 | $mainColor: #333; 22 | $headingColor: #333; 23 | $headingTextShadow: none; 24 | $backgroundColor: #f7f3de; 25 | $linkColor: #8b743d; 26 | $linkColorHover: lighten( $linkColor, 20% ); 27 | $selectionBackgroundColor: rgba(79, 64, 28, 0.99); 28 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 29 | 30 | // Background generator 31 | @mixin bodyBackground() { 32 | @include radial-gradient( rgba(247,242,211,1), rgba(255,255,255,1) ); 33 | } 34 | 35 | 36 | 37 | // Theme template ------------------------------ 38 | @import "../template/theme"; 39 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/black.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. This is the opposite of the 'white' theme. 3 | * 4 | * By Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/source-sans-pro/source-sans-pro.css); 16 | 17 | 18 | // Override theme settings (see ../template/settings.scss) 19 | $backgroundColor: #222; 20 | 21 | $mainColor: #fff; 22 | $headingColor: #fff; 23 | 24 | $mainFontSize: 38px; 25 | $mainFont: 'Source Sans Pro', Helvetica, sans-serif; 26 | $headingFont: 'Source Sans Pro', Helvetica, sans-serif; 27 | $headingTextShadow: none; 28 | $headingLetterSpacing: normal; 29 | $headingTextTransform: uppercase; 30 | $headingFontWeight: 600; 31 | $linkColor: #42affa; 32 | $linkColorHover: lighten( $linkColor, 15% ); 33 | $selectionBackgroundColor: lighten( $linkColor, 25% ); 34 | 35 | $heading1Size: 2.5em; 36 | $heading2Size: 1.6em; 37 | $heading3Size: 1.3em; 38 | $heading4Size: 1.0em; 39 | 40 | section.has-light-background { 41 | &, h1, h2, h3, h4, h5, h6 { 42 | color: #222; 43 | } 44 | } 45 | 46 | 47 | // Theme template ------------------------------ 48 | @import "../template/theme"; 49 | // --------------------------------------------- -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test-markdown.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/print-pdf/print-pdf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * phantomjs script for printing presentations to PDF. 3 | * 4 | * Example: 5 | * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf 6 | * 7 | * By Manuel Bieh (https://github.com/manuelbieh) 8 | */ 9 | 10 | // html2pdf.js 11 | var page = new WebPage(); 12 | var system = require( 'system' ); 13 | 14 | var slideWidth = system.args[3] ? system.args[3].split( 'x' )[0] : 960; 15 | var slideHeight = system.args[3] ? system.args[3].split( 'x' )[1] : 700; 16 | 17 | page.viewportSize = { 18 | width: slideWidth, 19 | height: slideHeight 20 | }; 21 | 22 | // TODO 23 | // Something is wrong with these config values. An input 24 | // paper width of 1920px actually results in a 756px wide 25 | // PDF. 26 | page.paperSize = { 27 | width: Math.round( slideWidth * 2 ), 28 | height: Math.round( slideHeight * 2 ), 29 | border: 0 30 | }; 31 | 32 | var inputFile = system.args[1] || 'index.html?print-pdf'; 33 | var outputFile = system.args[2] || 'slides.pdf'; 34 | 35 | if( outputFile.match( /\.pdf$/gi ) === null ) { 36 | outputFile += '.pdf'; 37 | } 38 | 39 | console.log( 'Printing PDF (Paper size: '+ page.paperSize.width + 'x' + page.paperSize.height +')' ); 40 | 41 | page.open( inputFile, function( status ) { 42 | window.setTimeout( function() { 43 | console.log( 'Printed successfully' ); 44 | page.render( outputFile ); 45 | phantom.exit(); 46 | }, 1000 ); 47 | } ); 48 | 49 | -------------------------------------------------------------------------------- /src/app/components/organizations/organizations.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ViewChild } from '@angular/core'; 2 | import { Organization } from '../../models/organization'; 3 | import { OrganizationsService } from '../../services/organizations.service'; 4 | 5 | @Component({ 6 | selector: 'app-organizations', 7 | templateUrl: './organizations.component.html' 8 | }) 9 | export class OrganizationsComponent implements OnInit { 10 | 11 | organization: Organization; 12 | organizations: Organization[] = []; 13 | canCreate = false; 14 | isLoadingOrganization = true; 15 | isLoadingOrganizations = true; 16 | error = ''; 17 | 18 | constructor( 19 | private organizationsService: OrganizationsService) { 20 | 21 | } 22 | 23 | ngOnInit() { 24 | 25 | this._init().catch(error => this.error = error); 26 | } 27 | 28 | private async _init(): Promise { 29 | 30 | this.organization = await this.organizationsService.getCurrentUserOrganizationAsOwner(); 31 | if (!this.organization) { 32 | this.canCreate = true; 33 | } 34 | this.isLoadingOrganization = false; 35 | 36 | const organizations = await this.organizationsService.getAll(); 37 | for (let index = 0; index < organizations.length; index++) { 38 | if (!this.organization || this.organization.id.toString() !== organizations[index].id.toString()) { 39 | this.organizations.push(organizations[index]); 40 | } 41 | } 42 | this.isLoadingOrganizations = false; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/app/components/organizations/organizations.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Organizations

4 |
5 | 10 |
11 | 12 | 13 |
{{error}}
14 |
15 | 16 |
17 | 18 |
19 | Loading user organization... 20 |
21 | 22 |
23 | 24 |
25 |

My organization (as owner)

26 | 27 |

Other organizations

28 |
29 | 30 |
31 | Loading other organizations... 32 |
33 | 34 |
35 | 36 | 37 | 38 | 39 |
No organizations found.
40 |
41 | 42 |
43 | 44 |
45 | 46 |
-------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/moon.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Dark theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/league-gothic/league-gothic.css); 16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 17 | 18 | /** 19 | * Solarized colors by Ethan Schoonover 20 | */ 21 | html * { 22 | color-profile: sRGB; 23 | rendering-intent: auto; 24 | } 25 | 26 | // Solarized colors 27 | $base03: #002b36; 28 | $base02: #073642; 29 | $base01: #586e75; 30 | $base00: #657b83; 31 | $base0: #839496; 32 | $base1: #93a1a1; 33 | $base2: #eee8d5; 34 | $base3: #fdf6e3; 35 | $yellow: #b58900; 36 | $orange: #cb4b16; 37 | $red: #dc322f; 38 | $magenta: #d33682; 39 | $violet: #6c71c4; 40 | $blue: #268bd2; 41 | $cyan: #2aa198; 42 | $green: #859900; 43 | 44 | // Override theme settings (see ../template/settings.scss) 45 | $mainColor: $base1; 46 | $headingColor: $base2; 47 | $headingTextShadow: none; 48 | $backgroundColor: $base03; 49 | $linkColor: $blue; 50 | $linkColorHover: lighten( $linkColor, 20% ); 51 | $selectionBackgroundColor: $magenta; 52 | 53 | 54 | 55 | // Theme template ------------------------------ 56 | @import "../template/theme"; 57 | // --------------------------------------------- 58 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/lib/js/classList.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ 2 | if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p 2 | 3 | 4 | 5 | 6 | 7 | reveal.js 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 |
26 |
27 |
Slide 1
28 |
Slide 2
29 |
30 |
31 | 32 | 33 | 34 | 35 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/solarized.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Light theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(../../lib/font/league-gothic/league-gothic.css); 16 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 17 | 18 | 19 | /** 20 | * Solarized colors by Ethan Schoonover 21 | */ 22 | html * { 23 | color-profile: sRGB; 24 | rendering-intent: auto; 25 | } 26 | 27 | // Solarized colors 28 | $base03: #002b36; 29 | $base02: #073642; 30 | $base01: #586e75; 31 | $base00: #657b83; 32 | $base0: #839496; 33 | $base1: #93a1a1; 34 | $base2: #eee8d5; 35 | $base3: #fdf6e3; 36 | $yellow: #b58900; 37 | $orange: #cb4b16; 38 | $red: #dc322f; 39 | $magenta: #d33682; 40 | $violet: #6c71c4; 41 | $blue: #268bd2; 42 | $cyan: #2aa198; 43 | $green: #859900; 44 | 45 | // Override theme settings (see ../template/settings.scss) 46 | $mainColor: $base00; 47 | $headingColor: $base01; 48 | $headingTextShadow: none; 49 | $backgroundColor: $base3; 50 | $linkColor: $blue; 51 | $linkColorHover: lighten( $linkColor, 20% ); 52 | $selectionBackgroundColor: $magenta; 53 | 54 | // Background generator 55 | // @mixin bodyBackground() { 56 | // @include radial-gradient( rgba($base3,1), rgba(lighten($base3, 20%),1) ); 57 | // } 58 | 59 | 60 | 61 | // Theme template ------------------------------ 62 | @import "../template/theme"; 63 | // --------------------------------------------- 64 | -------------------------------------------------------------------------------- /src/app/components/organizations/organization-add.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

New organization

4 |
5 |
6 | 7 | 8 |
{{error}}
9 |
10 | 11 | 12 |
{{message}}
13 |
14 | 15 |
16 | 17 |
18 | Loading... 19 |
20 | 21 |
22 | 23 |
24 | Creating organization... 25 |
26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
35 | 36 |
37 | 38 |
39 | 40 |
41 | 42 |
43 |
44 |   45 |
46 |
47 |
48 | 49 | arrow_back 50 | Return 51 | 52 |   53 | 57 |
58 |
-------------------------------------------------------------------------------- /src/app/components/organizations/organization-add.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Organization } from '../../models/organization'; 3 | import { OrganizationsService } from '../../services/organizations.service'; 4 | import { StorageUtil } from '../../util/storage.util'; 5 | 6 | @Component({ 7 | selector: 'app-organization-add', 8 | templateUrl: './organization-add.component.html' 9 | }) 10 | export class OrganizationAddComponent implements OnInit { 11 | 12 | organization = new Organization(); 13 | isLoading = true; 14 | isCreating = false; 15 | error = ''; 16 | message = ''; 17 | 18 | constructor(private organizationsService: OrganizationsService) { } 19 | 20 | ngOnInit() { 21 | 22 | this._init().catch(error => this.error = error); 23 | } 24 | 25 | private async _init(): Promise { 26 | 27 | const organization: Organization = await this.organizationsService.getCurrentUserOrganizationAsOwner(); 28 | if (organization) { 29 | throw new Error('The user is already the owner of the organization with ID "' + organization.id + '".'); 30 | } 31 | this.organization.ownerAddress = StorageUtil.getUserAddress(); 32 | this.isLoading = false; 33 | } 34 | 35 | create() { 36 | 37 | this._create().catch(error => this.error = error); 38 | } 39 | 40 | private async _create(): Promise { 41 | 42 | if (this.organization.ownerAddress && this.organization.name && !this.isCreating) { 43 | this.isCreating = true; 44 | this.organization = await this.organizationsService.add(this.organization); 45 | this.message = 'Created organization with ID "' + this.organization.id + '".'; 46 | this.isCreating = false; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/template/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin vertical-gradient( $top, $bottom ) { 2 | background: $top; 3 | background: -moz-linear-gradient( top, $top 0%, $bottom 100% ); 4 | background: -webkit-gradient( linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom) ); 5 | background: -webkit-linear-gradient( top, $top 0%, $bottom 100% ); 6 | background: -o-linear-gradient( top, $top 0%, $bottom 100% ); 7 | background: -ms-linear-gradient( top, $top 0%, $bottom 100% ); 8 | background: linear-gradient( top, $top 0%, $bottom 100% ); 9 | } 10 | 11 | @mixin horizontal-gradient( $top, $bottom ) { 12 | background: $top; 13 | background: -moz-linear-gradient( left, $top 0%, $bottom 100% ); 14 | background: -webkit-gradient( linear, left top, right top, color-stop(0%,$top), color-stop(100%,$bottom) ); 15 | background: -webkit-linear-gradient( left, $top 0%, $bottom 100% ); 16 | background: -o-linear-gradient( left, $top 0%, $bottom 100% ); 17 | background: -ms-linear-gradient( left, $top 0%, $bottom 100% ); 18 | background: linear-gradient( left, $top 0%, $bottom 100% ); 19 | } 20 | 21 | @mixin radial-gradient( $outer, $inner, $type: circle ) { 22 | background: $outer; 23 | background: -moz-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 24 | background: -webkit-gradient( radial, center center, 0px, center center, 100%, color-stop(0%,$inner), color-stop(100%,$outer) ); 25 | background: -webkit-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 26 | background: -o-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 27 | background: -ms-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 28 | background: radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 29 | } -------------------------------------------------------------------------------- /src/app/components/organizations/organizations-table.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | 41 |
ID 10 | {{element.id}} 11 | Owner Address 17 | {{element.ownerAddress}} 18 | Name 24 | {{element.name}} 25 | 31 | 32 | monetization_on 33 | Donate 34 | 35 |
-------------------------------------------------------------------------------- /contracts/NonGovernmentalOrganizations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.21; 2 | contract NonGovernmentalOrganizations { 3 | 4 | struct Organization { 5 | uint id; 6 | address owner; 7 | string name; 8 | } 9 | 10 | Organization[] public organizations; 11 | 12 | mapping(address => uint) public ownerToOrganizationId; 13 | 14 | constructor() public { 15 | 16 | organizations.push(Organization(0, 0, "0")); // to fix problem with nulls 17 | } 18 | 19 | event OrganizationCreated(uint indexed id, address indexed owner, string name); 20 | event DonationSubmitted(uint indexed id, address indexed owner, address indexed sender, uint value); 21 | 22 | modifier ownerNotExists() { 23 | 24 | require(ownerToOrganizationId[msg.sender] == 0, "suplied owner already have an organization"); 25 | _; 26 | } 27 | 28 | modifier ownerExists(uint _organizationId) { 29 | 30 | require(organizations[_organizationId].owner != address(0), "suplied organization ID doesn't have a correct owner address"); 31 | _; 32 | } 33 | 34 | function addOrganization(string _name) external 35 | ownerNotExists() { 36 | 37 | uint organizationId = organizations.push(Organization(organizations.length, msg.sender, _name)) - 1; 38 | ownerToOrganizationId[msg.sender] = organizationId; 39 | emit OrganizationCreated(organizationId, msg.sender, _name); 40 | } 41 | 42 | function donation(uint _organizationId) external payable 43 | ownerExists(_organizationId) { 44 | 45 | organizations[_organizationId].owner.transfer(msg.value); 46 | emit DonationSubmitted(_organizationId, organizations[_organizationId].owner, msg.sender, msg.value); 47 | } 48 | 49 | function getOrganizationsLength() external view returns(uint) { 50 | 51 | return organizations.length; 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /src/app/components/organizations/organization-donation.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { ActivatedRoute } from '@angular/router'; 3 | import { Organization } from '../../models/organization'; 4 | import { OrganizationsService } from '../../services/organizations.service'; 5 | import { Donation } from 'src/app/models/donation'; 6 | 7 | @Component({ 8 | selector: 'app-organization-donation', 9 | templateUrl: './organization-donation.component.html' 10 | }) 11 | export class OrganizationDonationComponent implements OnInit { 12 | 13 | organization = new Organization(); 14 | isLoading = true; 15 | isUpdating = false; 16 | error = ''; 17 | message = ''; 18 | value: number; 19 | donation: Donation; 20 | 21 | constructor( 22 | private route: ActivatedRoute, 23 | private organizationsService: OrganizationsService) { 24 | 25 | } 26 | 27 | ngOnInit() { 28 | 29 | this._init().catch(error => this.error = error); 30 | } 31 | 32 | private async _init(): Promise { 33 | 34 | const organizationId: number = +this.route.snapshot.paramMap.get('organizationId'); 35 | this.organization = await this.organizationsService.getOne(organizationId); 36 | if (!this.organization) { 37 | throw new Error('Organization with ID "' + organizationId + '" not found.'); 38 | } 39 | this.isLoading = false; 40 | } 41 | 42 | donate() { 43 | 44 | this._donate().catch(error => { 45 | this.error = error; 46 | }); 47 | } 48 | 49 | private async _donate(): Promise { 50 | 51 | if (this.value && !this.isUpdating) { 52 | this.isUpdating = true; 53 | this.donation = await this.organizationsService.donation(this.organization.id, this.value); 54 | this.message = 'Donation of "' + this.donation.value + '" ETH submitted to the organization with ID "' + this.organization.id + '".'; 55 | this.isUpdating = false; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "academic-records", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "build": "ng build", 9 | "test": "ng test", 10 | "lint": "ng lint", 11 | "e2e": "ng e2e", 12 | "postinstall": "node patch.js" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/animations": "6.1.1", 17 | "@angular/cdk": "6.4.2", 18 | "@angular/common": "6.1.1", 19 | "@angular/compiler": "6.1.1", 20 | "@angular/core": "6.1.1", 21 | "@angular/forms": "6.1.1", 22 | "@angular/http": "6.1.1", 23 | "@angular/material": "6.4.2", 24 | "@angular/material-moment-adapter": "6.4.2", 25 | "@angular/platform-browser": "6.1.1", 26 | "@angular/platform-browser-dynamic": "6.1.1", 27 | "@angular/router": "6.1.1", 28 | "angular-in-memory-web-api": "0.6.1", 29 | "core-js": "2.5.7", 30 | "hammerjs": "2.0.8", 31 | "moment": "2.22.2", 32 | "rxjs": "6.2.2", 33 | "truffle-hdwallet-provider": "0.0.6", 34 | "web-animations-js": "2.3.1", 35 | "web3": "1.0.0-beta.34", 36 | "zone.js": "0.8.26" 37 | }, 38 | "devDependencies": { 39 | "@angular-devkit/build-angular": "^0.10.6", 40 | "@angular/cli": "~6.0.8", 41 | "@angular/compiler-cli": "^6.0.3", 42 | "@angular/language-service": "^6.0.3", 43 | "@types/jasmine": "~2.8.6", 44 | "@types/jasminewd2": "~2.0.3", 45 | "@types/node": "~8.9.4", 46 | "codelyzer": "~4.2.1", 47 | "jasmine-core": "~2.99.1", 48 | "jasmine-spec-reporter": "~4.2.1", 49 | "karma": "^3.1.1", 50 | "karma-chrome-launcher": "~2.2.0", 51 | "karma-cli": "~1.0.1", 52 | "karma-coverage-istanbul-reporter": "~2.0.0", 53 | "karma-jasmine": "~1.1.1", 54 | "karma-jasmine-html-reporter": "^0.2.2", 55 | "protractor": "^5.4.1", 56 | "truffle-contract": "^3.0.4", 57 | "ts-node": "~5.0.1", 58 | "tslint": "~5.9.1", 59 | "typescript": "~2.7.2" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/math/math.js: -------------------------------------------------------------------------------- 1 | /** 2 | * A plugin which enables rendering of math equations inside 3 | * of reveal.js slides. Essentially a thin wrapper for MathJax. 4 | * 5 | * @author Hakim El Hattab 6 | */ 7 | var RevealMath = window.RevealMath || (function(){ 8 | 9 | var options = Reveal.getConfig().math || {}; 10 | options.mathjax = options.mathjax || 'https://cdn.mathjax.org/mathjax/latest/MathJax.js'; 11 | options.config = options.config || 'TeX-AMS_HTML-full'; 12 | 13 | loadScript( options.mathjax + '?config=' + options.config, function() { 14 | 15 | MathJax.Hub.Config({ 16 | messageStyle: 'none', 17 | tex2jax: { 18 | inlineMath: [['$','$'],['\\(','\\)']] , 19 | skipTags: ['script','noscript','style','textarea','pre'] 20 | }, 21 | skipStartupTypeset: true 22 | }); 23 | 24 | // Typeset followed by an immediate reveal.js layout since 25 | // the typesetting process could affect slide height 26 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub ] ); 27 | MathJax.Hub.Queue( Reveal.layout ); 28 | 29 | // Reprocess equations in slides when they turn visible 30 | Reveal.addEventListener( 'slidechanged', function( event ) { 31 | 32 | MathJax.Hub.Queue( [ 'Typeset', MathJax.Hub, event.currentSlide ] ); 33 | 34 | } ); 35 | 36 | } ); 37 | 38 | function loadScript( url, callback ) { 39 | 40 | var head = document.querySelector( 'head' ); 41 | var script = document.createElement( 'script' ); 42 | script.type = 'text/javascript'; 43 | script.src = url; 44 | 45 | // Wrapper for callback to make sure it only fires once 46 | var finish = function() { 47 | if( typeof callback === 'function' ) { 48 | callback.call(); 49 | callback = null; 50 | } 51 | } 52 | 53 | script.onload = finish; 54 | 55 | // IE 56 | script.onreadystatechange = function() { 57 | if ( this.readyState === 'loaded' ) { 58 | finish(); 59 | } 60 | } 61 | 62 | // Normal browsers 63 | head.appendChild( script ); 64 | 65 | } 66 | 67 | })(); 68 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test-pdf.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test PDF exports 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 | 19 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /src/app/components/organizations/organization-donation.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Donate to an organization

4 |
5 |
6 | 7 | 8 |
{{error}}
9 |
10 | 11 | 12 |
{{message}}
13 |
14 | 15 |
16 | 17 |
18 | Loading... 19 |
20 | 21 |
22 | 23 |
24 | Updating... 25 |
26 | 27 |
28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 |
44 | 45 |
46 | 47 |
48 | 49 |
50 | 51 |
52 |
53 |   54 |
55 |
56 |
57 | 58 | arrow_back 59 | Return 60 | 61 |   62 | 66 |
67 |
-------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/multiplex/index.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var express = require('express'); 3 | var fs = require('fs'); 4 | var io = require('socket.io'); 5 | var crypto = require('crypto'); 6 | 7 | var app = express(); 8 | var staticDir = express.static; 9 | var server = http.createServer(app); 10 | 11 | io = io(server); 12 | 13 | var opts = { 14 | port: process.env.PORT || 1948, 15 | baseDir : __dirname + '/../../' 16 | }; 17 | 18 | io.on( 'connection', function( socket ) { 19 | socket.on('multiplex-statechanged', function(data) { 20 | if (typeof data.secret == 'undefined' || data.secret == null || data.secret === '') return; 21 | if (createHash(data.secret) === data.socketId) { 22 | data.secret = null; 23 | socket.broadcast.emit(data.socketId, data); 24 | }; 25 | }); 26 | }); 27 | 28 | [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) { 29 | app.use('/' + dir, staticDir(opts.baseDir + dir)); 30 | }); 31 | 32 | app.get("/", function(req, res) { 33 | res.writeHead(200, {'Content-Type': 'text/html'}); 34 | 35 | var stream = fs.createReadStream(opts.baseDir + '/index.html'); 36 | stream.on('error', function( error ) { 37 | res.write('

reveal.js multiplex server.

Generate token'); 38 | res.end(); 39 | }); 40 | stream.on('readable', function() { 41 | stream.pipe(res); 42 | }); 43 | }); 44 | 45 | app.get("/token", function(req,res) { 46 | var ts = new Date().getTime(); 47 | var rand = Math.floor(Math.random()*9999999); 48 | var secret = ts.toString() + rand.toString(); 49 | res.send({secret: secret, socketId: createHash(secret)}); 50 | }); 51 | 52 | var createHash = function(secret) { 53 | var cipher = crypto.createCipher('blowfish', secret); 54 | return(cipher.final('hex')); 55 | }; 56 | 57 | // Actually listen 58 | server.listen( opts.port || null ); 59 | 60 | var brown = '\033[33m', 61 | green = '\033[32m', 62 | reset = '\033[0m'; 63 | 64 | console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset ); -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/notes-server/index.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | var express = require('express'); 3 | var fs = require('fs'); 4 | var io = require('socket.io'); 5 | var Mustache = require('mustache'); 6 | 7 | var app = express(); 8 | var staticDir = express.static; 9 | var server = http.createServer(app); 10 | 11 | io = io(server); 12 | 13 | var opts = { 14 | port : 1947, 15 | baseDir : __dirname + '/../../' 16 | }; 17 | 18 | io.on( 'connection', function( socket ) { 19 | 20 | socket.on( 'new-subscriber', function( data ) { 21 | socket.broadcast.emit( 'new-subscriber', data ); 22 | }); 23 | 24 | socket.on( 'statechanged', function( data ) { 25 | delete data.state.overview; 26 | socket.broadcast.emit( 'statechanged', data ); 27 | }); 28 | 29 | socket.on( 'statechanged-speaker', function( data ) { 30 | delete data.state.overview; 31 | socket.broadcast.emit( 'statechanged-speaker', data ); 32 | }); 33 | 34 | }); 35 | 36 | [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach( function( dir ) { 37 | app.use( '/' + dir, staticDir( opts.baseDir + dir ) ); 38 | }); 39 | 40 | app.get('/', function( req, res ) { 41 | 42 | res.writeHead( 200, { 'Content-Type': 'text/html' } ); 43 | fs.createReadStream( opts.baseDir + '/index.html' ).pipe( res ); 44 | 45 | }); 46 | 47 | app.get( '/notes/:socketId', function( req, res ) { 48 | 49 | fs.readFile( opts.baseDir + 'plugin/notes-server/notes.html', function( err, data ) { 50 | res.send( Mustache.to_html( data.toString(), { 51 | socketId : req.params.socketId 52 | })); 53 | }); 54 | 55 | }); 56 | 57 | // Actually listen 58 | server.listen( opts.port || null ); 59 | 60 | var brown = '\033[33m', 61 | green = '\033[32m', 62 | reset = '\033[0m'; 63 | 64 | var slidesLocation = 'http://localhost' + ( opts.port ? ( ':' + opts.port ) : '' ); 65 | 66 | console.log( brown + 'reveal.js - Speaker Notes' + reset ); 67 | console.log( '1. Open the slides at ' + green + slidesLocation + reset ); 68 | console.log( '2. Click on the link in your JS console to go to the notes page' ); 69 | console.log( '3. Advance through your slides and your notes will advance automatically' ); 70 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/plugin/notes-server/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 3 | // don't emit events from inside the previews themselves 4 | if( window.location.search.match( /receiver/gi ) ) { return; } 5 | 6 | var socket = io.connect( window.location.origin ), 7 | socketId = Math.random().toString().slice( 2 ); 8 | 9 | console.log( 'View slide notes at ' + window.location.origin + '/notes/' + socketId ); 10 | 11 | window.open( window.location.origin + '/notes/' + socketId, 'notes-' + socketId ); 12 | 13 | /** 14 | * Posts the current slide data to the notes window 15 | */ 16 | function post() { 17 | 18 | var slideElement = Reveal.getCurrentSlide(), 19 | notesElement = slideElement.querySelector( 'aside.notes' ); 20 | 21 | var messageData = { 22 | notes: '', 23 | markdown: false, 24 | socketId: socketId, 25 | state: Reveal.getState() 26 | }; 27 | 28 | // Look for notes defined in a slide attribute 29 | if( slideElement.hasAttribute( 'data-notes' ) ) { 30 | messageData.notes = slideElement.getAttribute( 'data-notes' ); 31 | } 32 | 33 | // Look for notes defined in an aside element 34 | if( notesElement ) { 35 | messageData.notes = notesElement.innerHTML; 36 | messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string'; 37 | } 38 | 39 | socket.emit( 'statechanged', messageData ); 40 | 41 | } 42 | 43 | // When a new notes window connects, post our current state 44 | socket.on( 'new-subscriber', function( data ) { 45 | post(); 46 | } ); 47 | 48 | // When the state changes from inside of the speaker view 49 | socket.on( 'statechanged-speaker', function( data ) { 50 | Reveal.setState( data.state ); 51 | } ); 52 | 53 | // Monitor events that trigger a change in state 54 | Reveal.addEventListener( 'slidechanged', post ); 55 | Reveal.addEventListener( 'fragmentshown', post ); 56 | Reveal.addEventListener( 'fragmenthidden', post ); 57 | Reveal.addEventListener( 'overviewhidden', post ); 58 | Reveal.addEventListener( 'overviewshown', post ); 59 | Reveal.addEventListener( 'paused', post ); 60 | Reveal.addEventListener( 'resumed', post ); 61 | 62 | // Post the initial state 63 | post(); 64 | 65 | }()); 66 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/css/theme/source/blood.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Blood theme for reveal.js 3 | * Author: Walther http://github.com/Walther 4 | * 5 | * Designed to be used with highlight.js theme 6 | * "monokai_sublime.css" available from 7 | * https://github.com/isagalaev/highlight.js/ 8 | * 9 | * For other themes, change $codeBackground accordingly. 10 | * 11 | */ 12 | 13 | // Default mixins and settings ----------------- 14 | @import "../template/mixins"; 15 | @import "../template/settings"; 16 | // --------------------------------------------- 17 | 18 | // Include theme-specific fonts 19 | 20 | @import url(https://fonts.googleapis.com/css?family=Ubuntu:300,700,300italic,700italic); 21 | 22 | // Colors used in the theme 23 | $blood: #a23; 24 | $coal: #222; 25 | $codeBackground: #23241f; 26 | 27 | $backgroundColor: $coal; 28 | 29 | // Main text 30 | $mainFont: Ubuntu, 'sans-serif'; 31 | $mainFontSize: 36px; 32 | $mainColor: #eee; 33 | 34 | // Headings 35 | $headingFont: Ubuntu, 'sans-serif'; 36 | $headingTextShadow: 2px 2px 2px $coal; 37 | 38 | // h1 shadow, borrowed humbly from 39 | // (c) Default theme by Hakim El Hattab 40 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 41 | 42 | // Links 43 | $linkColor: $blood; 44 | $linkColorHover: lighten( $linkColor, 20% ); 45 | 46 | // Text selection 47 | $selectionBackgroundColor: $blood; 48 | $selectionColor: #fff; 49 | 50 | 51 | // Theme template ------------------------------ 52 | @import "../template/theme"; 53 | // --------------------------------------------- 54 | 55 | // some overrides after theme template import 56 | 57 | .reveal p { 58 | font-weight: 300; 59 | text-shadow: 1px 1px $coal; 60 | } 61 | 62 | .reveal h1, 63 | .reveal h2, 64 | .reveal h3, 65 | .reveal h4, 66 | .reveal h5, 67 | .reveal h6 { 68 | font-weight: 700; 69 | } 70 | 71 | .reveal p code { 72 | background-color: $codeBackground; 73 | display: inline-block; 74 | border-radius: 7px; 75 | } 76 | 77 | .reveal small code { 78 | vertical-align: baseline; 79 | } -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { AppComponent } from './app.component'; 3 | import { AppRoutingModule } from './app-routing.module'; 4 | import { BrowserModule } from '@angular/platform-browser'; 5 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 7 | import { ServicesModule } from './services/service.module'; 8 | 9 | import { OrganizationsComponent } from './components/organizations/organizations.component'; 10 | import { OrganizationsTableComponent } from './components/organizations/organizations-table.component'; 11 | import { OrganizationAddComponent } from './components/organizations/organization-add.component'; 12 | import { OrganizationDonationComponent } from './components/organizations/organization-donation.component'; 13 | import { UserComponent } from './components/user/user.component'; 14 | 15 | import { 16 | MatButtonModule, 17 | MatCardModule, 18 | MatCheckboxModule, 19 | MatGridListModule, 20 | MatIconModule, 21 | MatInputModule, 22 | MatListModule, 23 | MatSortModule, 24 | MatProgressSpinnerModule, 25 | MatTableModule, 26 | MatToolbarModule, 27 | MatSidenavModule, 28 | MatSlideToggleModule, 29 | MatSelectModule, 30 | } from '@angular/material'; 31 | 32 | @NgModule({ 33 | declarations: [ 34 | AppComponent, 35 | OrganizationsComponent, 36 | OrganizationAddComponent, 37 | OrganizationDonationComponent, 38 | OrganizationsTableComponent, 39 | UserComponent 40 | ], 41 | imports: [ 42 | AppRoutingModule, 43 | BrowserAnimationsModule, 44 | BrowserModule, 45 | FormsModule, 46 | MatButtonModule, 47 | MatCardModule, 48 | MatCheckboxModule, 49 | MatGridListModule, 50 | MatIconModule, 51 | MatInputModule, 52 | MatListModule, 53 | MatSelectModule, 54 | MatSidenavModule, 55 | MatSlideToggleModule, 56 | MatSortModule, 57 | MatProgressSpinnerModule, 58 | MatTableModule, 59 | MatToolbarModule, 60 | ReactiveFormsModule, 61 | ServicesModule 62 | ], 63 | providers: [], 64 | bootstrap: [AppComponent] 65 | }) 66 | export class AppModule { } 67 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Tests 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/examples/slide-transitions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Slide Transitions 8 | 9 | 10 | 11 | 21 | 22 | 23 | 24 | 25 |
26 | 27 |
28 | 29 |
30 |

Default

31 |
32 | 33 |
34 |

Default

35 |
36 | 37 |
38 |

data-transition: zoom

39 |
40 | 41 |
42 |

data-transition: zoom-in fade-out

43 |
44 | 45 |
46 |

Default

47 |
48 | 49 |
50 |

data-transition: convex

51 |
52 | 53 |
54 |

data-transition: convex-in concave-out

55 |
56 | 57 |
58 |
59 |

Default

60 |
61 |
62 |

data-transition: concave

63 |
64 |
65 |

data-transition: convex-in fade-out

66 |
67 |
68 |

Default

69 |
70 |
71 | 72 |
73 |

data-transition: none

74 |
75 | 76 |
77 |

Default

78 |
79 | 80 |
81 | 82 |
83 | 84 | 85 | 86 | 87 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /src/app/services/web3.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { StorageUtil } from '../util/storage.util'; 3 | import { MessagesService } from './messages.service'; 4 | 5 | import * as contract from 'truffle-contract'; 6 | declare let require: any; 7 | declare let window: any; 8 | const Web3 = require('web3'); 9 | const artifacts = require('../../../build/contracts/NonGovernmentalOrganizations.json'); 10 | 11 | @Injectable() 12 | export class Web3Service { 13 | 14 | web3: any; 15 | 16 | constructor(private messagesService: MessagesService) { 17 | 18 | if (typeof window.web3 === 'undefined') { 19 | return; 20 | } 21 | 22 | this.web3 = new Web3(window.web3.currentProvider); 23 | } 24 | 25 | init() { 26 | setInterval(() => this.getUserAddress(), 1000); 27 | } 28 | 29 | private getUserAddress() { 30 | 31 | if (!this.web3) { 32 | this.messagesService.sendErrorMessage('web3 server not found. Try MetaMask.'); 33 | return; 34 | } 35 | this.web3.eth.getAccounts() 36 | .then(accounts => { 37 | if (!accounts || accounts.length === 0) { 38 | this.messagesService.sendErrorMessage('No user accounts retrieved.'); 39 | return; 40 | } 41 | if (StorageUtil.getUserAddress() !== accounts[0].toLowerCase()) { 42 | StorageUtil.setUserAddress(accounts[0].toLowerCase()); 43 | console.log('Web3Service->accounts[0]', StorageUtil.getUserAddress()); 44 | this.messagesService.sendNewUserAddressMessage(StorageUtil.getUserAddress()); 45 | } 46 | this.getContractInstance().then().catch(error => { 47 | this.messagesService.sendErrorMessage(error); 48 | }); 49 | }).catch(error => { 50 | console.log(error); 51 | this.messagesService.sendErrorMessage('Ethereum accounts not found.'); 52 | }); 53 | } 54 | 55 | async getContractInstance(): Promise { 56 | 57 | if (!this.web3) { 58 | throw new Error('web3 server not found. Try MetaMask.'); 59 | } 60 | const ngoContract = contract(artifacts); 61 | ngoContract.setProvider(this.web3.currentProvider); 62 | try { 63 | const ngoInstance = await ngoContract.deployed(); 64 | return ngoInstance; 65 | } catch (error) { 66 | console.log(error); 67 | throw new Error('Contract has not been deployed to detected network.'); 68 | } 69 | } 70 | 71 | etherToWei(ether: string): string { 72 | 73 | return '' + this.web3.utils.toWei(ether, 'ether'); 74 | } 75 | 76 | weiToEther(wei: string): string { 77 | 78 | return '' + this.web3.utils.fromWei(wei, 'ether'); 79 | } 80 | 81 | isAddress(address: string): boolean { 82 | 83 | return this.web3.utils.isAddress(address); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test-markdown-element-attributes.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 4, 'found four slides' ); 9 | }); 10 | 11 | 12 | test( 'Attributes on element header in vertical slides', function() { 13 | strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.fade-out' ).length, 1, 'found one vertical slide with class fragment.fade-out on header' ); 14 | strictEqual( document.querySelectorAll( '.reveal .slides section>section h2.fragment.shrink' ).length, 1, 'found one vertical slide with class fragment.shrink on header' ); 15 | }); 16 | 17 | test( 'Attributes on element paragraphs in vertical slides', function() { 18 | strictEqual( document.querySelectorAll( '.reveal .slides section>section p.fragment.grow' ).length, 2, 'found a vertical slide with two paragraphs with class fragment.grow' ); 19 | }); 20 | 21 | test( 'Attributes on element list items in vertical slides', function() { 22 | strictEqual( document.querySelectorAll( '.reveal .slides section>section li.fragment.grow' ).length, 3, 'found a vertical slide with three list items with class fragment.grow' ); 23 | }); 24 | 25 | test( 'Attributes on element paragraphs in horizontal slides', function() { 26 | strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-red' ).length, 4, 'found a horizontal slide with four paragraphs with class fragment.grow' ); 27 | }); 28 | test( 'Attributes on element list items in horizontal slides', function() { 29 | strictEqual( document.querySelectorAll( '.reveal .slides section li.fragment.highlight-green' ).length, 5, 'found a horizontal slide with five list items with class fragment.roll-in' ); 30 | }); 31 | test( 'Attributes on element list items in horizontal slides', function() { 32 | strictEqual( document.querySelectorAll( '.reveal .slides section img.reveal.stretch' ).length, 1, 'found a horizontal slide with stretched image, class img.reveal.stretch' ); 33 | }); 34 | 35 | test( 'Attributes on elements in vertical slides with default element attribute separator', function() { 36 | strictEqual( document.querySelectorAll( '.reveal .slides section h2.fragment.highlight-red' ).length, 2, 'found two h2 titles with fragment highlight-red in vertical slides with default element attribute separator' ); 37 | }); 38 | 39 | test( 'Attributes on elements in single slides with default element attribute separator', function() { 40 | strictEqual( document.querySelectorAll( '.reveal .slides section p.fragment.highlight-blue' ).length, 3, 'found three elements with fragment highlight-blue in single slide with default element attribute separator' ); 41 | }); 42 | 43 | } ); 44 | 45 | Reveal.initialize(); 46 | 47 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test-markdown-slide-attributes.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | Reveal.addEventListener( 'ready', function() { 4 | 5 | QUnit.module( 'Markdown' ); 6 | 7 | test( 'Vertical separator', function() { 8 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section' ).length, 6, 'found six vertical slides' ); 9 | }); 10 | 11 | test( 'Id on slide', function() { 12 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section#slide2' ).length, 1, 'found one slide with id slide2' ); 13 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section a[href="#/slide2"]' ).length, 1, 'found one slide with a link to slide2' ); 14 | }); 15 | 16 | test( 'data-background attributes', function() { 17 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A0C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 18 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#ff0000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 19 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C6916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 20 | }); 21 | 22 | test( 'data-transition attributes', function() { 23 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="zoom"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 24 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="fade"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 25 | strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="zoom"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 26 | }); 27 | 28 | test( 'data-background attributes with default separator', function() { 29 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#A7C66B"]' ).length, 1, 'found one vertical slide with data-background="#A0C66B"' ); 30 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-background="#f70000"]' ).length, 1, 'found one vertical slide with data-background="#ff0000"' ); 31 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#C7916B"]' ).length, 1, 'found one slide with data-background="#C6916B"' ); 32 | }); 33 | 34 | test( 'data-transition attributes with default separator', function() { 35 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="concave"]' ).length, 1, 'found one vertical slide with data-transition="zoom"' ); 36 | strictEqual( document.querySelectorAll( '.reveal .slides>section>section[data-transition="page"]' ).length, 1, 'found one vertical slide with data-transition="fade"' ); 37 | strictEqual( document.querySelectorAll( '.reveal .slides section [data-transition="concave"]' ).length, 1, 'found one slide with data-transition="zoom"' ); 38 | }); 39 | 40 | test( 'data-transition attributes with inline content', function() { 41 | strictEqual( document.querySelectorAll( '.reveal .slides>section[data-background="#ff0000"]' ).length, 3, 'found three horizontal slides with data-background="#ff0000"' ); 42 | }); 43 | 44 | } ); 45 | 46 | Reveal.initialize(); 47 | 48 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-use-before-declare": true, 76 | "no-var-keyword": true, 77 | "object-literal-sort-keys": false, 78 | "one-line": [ 79 | true, 80 | "check-open-brace", 81 | "check-catch", 82 | "check-else", 83 | "check-whitespace" 84 | ], 85 | "prefer-const": true, 86 | "quotemark": [ 87 | true, 88 | "single" 89 | ], 90 | "radix": true, 91 | "semicolon": [ 92 | true, 93 | "always" 94 | ], 95 | "triple-equals": [ 96 | true, 97 | "allow-null-check" 98 | ], 99 | "typedef-whitespace": [ 100 | true, 101 | { 102 | "call-signature": "nospace", 103 | "index-signature": "nospace", 104 | "parameter": "nospace", 105 | "property-declaration": "nospace", 106 | "variable-declaration": "nospace" 107 | } 108 | ], 109 | "unified-signatures": true, 110 | "variable-name": false, 111 | "whitespace": [ 112 | true, 113 | "check-branch", 114 | "check-decl", 115 | "check-operator", 116 | "check-separator", 117 | "check-type" 118 | ], 119 | "no-output-on-prefix": true, 120 | "use-input-property-decorator": true, 121 | "use-output-property-decorator": true, 122 | "use-host-property-decorator": true, 123 | "no-input-rename": true, 124 | "no-output-rename": true, 125 | "use-life-cycle-interface": true, 126 | "use-pipe-transform-interface": true, 127 | "component-class-suffix": true, 128 | "directive-class-suffix": true 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /slides/lib/reveal.js/test/test-markdown-slide-attributes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Test Markdown Attributes 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cómo desarrollar aplicaciones descentralizadas en la Blockchain de Ethereum 2 | 3 | En esta charla práctica y nada teórica (bueno un poco si), pretendo mostrar el código necesario para desarrollar una pequeña aplicación descentralizada ([ÐApps](https://en.wikipedia.org/wiki/Decentralized_application)) con un pequeño contrato inteligente ([Smart Contracts](https://en.wikipedia.org/wiki/Smart_contract)) en la Blockchain de [Ethereum](https://www.ethereum.org/). 4 | 5 | Veremos un poco de [Solidity](https://solidity.readthedocs.io/en/v0.4.24/), un lenguaje para programar contratos inteligentes. Utilizaremos también [Truffle](http://truffleframework.com/), un framework para desarrollar y testear aplicaciones descentralizadas. Necesitaremos usar [web3js](https://github.com/ethereum/web3.js/) para llamar desde nuestra web a la Blockchain. Usaremos [MetaMask](https://metamask.io/) para interactuar con la aplicación. Y para minar nuestras transacciones de prueba levantaremos una instancia de [Ganache](http://truffleframework.com/ganache/). 6 | 7 | Es una charla de 45 minutos en donde presento resumir todo lo que yo he aprendido a base de golpes durante casi un año. 8 | 9 | [Charla en el Codemotion](https://madrid2018.codemotionworld.com/conference/) 10 | 11 | ## Recursos 12 | 13 | ### Vídeo de la charla 14 | 15 | [Vídeo de la charla](https://www.youtube.com/watch?v=P8W9YBqJnk0) 16 | 17 | 18 | Vídeo de la charla 19 | 20 | 21 | ### Slides de la charla 22 | 23 | [Slides de la charla](https://asanzdiego.github.io/codemotion-charla-blockchain/) 24 | 25 | 26 | Slides de la charla 27 | 28 | 29 | ## Ejecución de la ÐApp 30 | 31 | ### Prerequisitos 32 | 33 | Instalar NodeJS https://nodejs.org/ 34 | 35 | Instalar MetaMask https://metamask.io/ 36 | 37 | ### Clonar el repositorio 38 | 39 | Ejecutar: 40 | 41 | ~~~ 42 | git clone git@github.com:asanzdiego/codemotion-charla-blockchain.git 43 | cd codemotion-charla-blockchain 44 | ~~~ 45 | 46 | ### Instalar dependencias globales 47 | 48 | Ejecutar: 49 | 50 | ~~~ 51 | npm install -g truffle 52 | npm install -g ganache-cli 53 | npm install -g @angular/cli 54 | ~~~ 55 | 56 | ### Instalar dependencias del proyecto 57 | 58 | Ejecutar en la carpeta del proyecto: 59 | 60 | ~~~ 61 | npm install 62 | ~~~ 63 | 64 | ### Ejecutar ganache (nodo privado) 65 | 66 | Ejecutar en la carpeta del proyecto en una consola separada: 67 | 68 | ~~~ 69 | ganache-cli --gasLimit 7000001 70 | ~~~ 71 | 72 | ### Compilar y migrar los contratos al nodo privado 73 | 74 | Ejecutar en la carpeta del proyecto en una consola separada: 75 | 76 | ~~~ 77 | truffle compile && truffle migrate 78 | ~~~ 79 | 80 | ### Testear los contratos contra el nodo privado 81 | 82 | Ejecutar en la carpeta del proyecto en una consola separada: 83 | 84 | ~~~ 85 | truffle test 86 | ~~~ 87 | 88 | ### Arrancar el front 89 | 90 | Ejecutar en la carpeta del proyecto en una consola separada: 91 | 92 | ~~~ 93 | ng serve 94 | ~~~ 95 | 96 | ### Abrir la aplicación 97 | 98 | En un navegador con MetaMask instalado abrir: . 99 | 100 | Ejemplo en . 101 | 102 | ### Para desarrollar 103 | 104 | Recomiendo [Visual Studio Code](https://code.visualstudio.com/) con el [plugin de Solidity de Juan Blanco](https://marketplace.visualstudio.com/items?itemName=JuanBlanco.solidity) 105 | -------------------------------------------------------------------------------- /slides/lib/reveal.js-menu/lib/bowser.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bowser - a browser detector 3 | * https://github.com/ded/bowser 4 | * MIT License | (c) Dustin Diaz 2014 5 | */ 6 | !function(e,t){typeof module!="undefined"&&module.exports?module.exports.browser=t():typeof define=="function"&&define.amd?define(t):this[e]=t()}("bowser",function(){function t(t){function n(e){var n=t.match(e);return n&&n.length>1&&n[1]||""}function r(e){var n=t.match(e);return n&&n.length>1&&n[2]||""}var i=n(/(ipod|iphone|ipad)/i).toLowerCase(),s=/like android/i.test(t),o=!s&&/android/i.test(t),u=n(/edge\/(\d+(\.\d+)?)/i),a=n(/version\/(\d+(\.\d+)?)/i),f=/tablet/i.test(t),l=!f&&/[^-]mobi/i.test(t),c;/opera|opr/i.test(t)?c={name:"Opera",opera:e,version:a||n(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(t)?c={name:"Yandex Browser",yandexbrowser:e,version:a||n(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/windows phone/i.test(t)?(c={name:"Windows Phone",windowsphone:e},u?(c.msedge=e,c.version=u):(c.msie=e,c.version=n(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?c={name:"Internet Explorer",msie:e,version:n(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:/chrome.+? edge/i.test(t)?c={name:"Microsoft Edge",msedge:e,version:u}:/chrome|crios|crmo/i.test(t)?c={name:"Chrome",chrome:e,version:n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:i?(c={name:i=="iphone"?"iPhone":i=="ipad"?"iPad":"iPod"},a&&(c.version=a)):/sailfish/i.test(t)?c={name:"Sailfish",sailfish:e,version:n(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(t)?c={name:"SeaMonkey",seamonkey:e,version:n(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel/i.test(t)?(c={name:"Firefox",firefox:e,version:n(/(?:firefox|iceweasel)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t)&&(c.firefoxos=e)):/silk/i.test(t)?c={name:"Amazon Silk",silk:e,version:n(/silk\/(\d+(\.\d+)?)/i)}:o?c={name:"Android",version:a}:/phantom/i.test(t)?c={name:"PhantomJS",phantom:e,version:n(/phantomjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?c={name:"BlackBerry",blackberry:e,version:a||n(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:/(web|hpw)os/i.test(t)?(c={name:"WebOS",webos:e,version:a||n(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(c.touchpad=e)):/bada/i.test(t)?c={name:"Bada",bada:e,version:n(/dolfin\/(\d+(\.\d+)?)/i)}:/tizen/i.test(t)?c={name:"Tizen",tizen:e,version:n(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||a}:/safari/i.test(t)?c={name:"Safari",safari:e,version:a}:c={name:n(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!c.msedge&&/(apple)?webkit/i.test(t)?(c.name=c.name||"Webkit",c.webkit=e,!c.version&&a&&(c.version=a)):!c.opera&&/gecko\//i.test(t)&&(c.name=c.name||"Gecko",c.gecko=e,c.version=c.version||n(/gecko\/(\d+(\.\d+)?)/i)),!c.msedge&&(o||c.silk)?c.android=e:i&&(c[i]=e,c.ios=e);var h="";c.windowsphone?h=n(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):i?(h=n(/os (\d+([_\s]\d+)*) like mac os x/i),h=h.replace(/[_\s]/g,".")):o?h=n(/android[ \/-](\d+(\.\d+)*)/i):c.webos?h=n(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):c.blackberry?h=n(/rim\stablet\sos\s(\d+(\.\d+)*)/i):c.bada?h=n(/bada\/(\d+(\.\d+)*)/i):c.tizen&&(h=n(/tizen[\/\s](\d+(\.\d+)*)/i)),h&&(c.osversion=h);var p=h.split(".")[0];if(f||i=="ipad"||o&&(p==3||p==4&&!l)||c.silk)c.tablet=e;else if(l||i=="iphone"||i=="ipod"||o||c.blackberry||c.webos||c.bada)c.mobile=e;return c.msedge||c.msie&&c.version>=10||c.yandexbrowser&&c.version>=15||c.chrome&&c.version>=20||c.firefox&&c.version>=20||c.safari&&c.version>=6||c.opera&&c.version>=10||c.ios&&c.osversion&&c.osversion.split(".")[0]>=6||c.blackberry&&c.version>=10.1?c.a=e:c.msie&&c.version<10||c.chrome&&c.version<20||c.firefox&&c.version<20||c.safari&&c.version<6||c.opera&&c.version<10||c.ios&&c.osversion&&c.osversion.split(".")[0]<6?c.c=e:c.x=e,c}var e=!0,n=t(typeof navigator!="undefined"?navigator.userAgent:"");return n.test=function(e){for(var t=0;t