This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(EventEmitter, tmpl){ | |
/* LoginForm */ | |
var $root = document.getElementById('root'), | |
$container = document.createElement('div'); | |
EventEmitter.on('LoginForm:mount', function() { | |
$container.innerHTML = tmpl('LoginForm', {}) | |
$root.appendChild($container) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/html" id="LoginForm"> | |
<div class="LoginForm"> | |
<div class="LoginForm__title">Login</div> | |
<form class="LoginForm__form"> | |
<div class="Control"> | |
<label class="Control__label" for="user">User</label> | |
<input class="Control__input" name="user" type="text" placeholder="User" /> | |
</div> | |
<div> | |
<label class="Control__label" for="password">Password</label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(win){ | |
// Simple JavaScript Templating | |
// John Resig - https://johnresig.com/ - MIT Licensed | |
// https://johnresig.com/blog/javascript-micro-templating/ | |
// | |
// There are some minor modification done by me. | |
var cache = {}; | |
function tmpl(str, data){ | |
var fn; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(win){ | |
var events = {}; | |
function on(event, listener) { | |
if (typeof events[event] !== 'object') { | |
events[event] = []; | |
} | |
events[event].push(listener); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EventEmitter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="LoginForm"> | |
<div class="LoginForm__title">Login</div> | |
<form class="LoginForm__form"> | |
<div class="Control"> | |
<label class="Control__label" for="user">User</label> | |
<input class="Control__input" name="user" type="text" placeholder="User" /> | |
</div> | |
<div> | |
<label class="Control__label" for="password">Password</label> | |
<input class="Control__input" name="password" type="password" placeholder="Password" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>AWS Cognito authentication example</title> | |
</head> | |
<body> | |
<h1>The web server is working fine</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import T from 'prop-types' | |
import Chart from './Chart.js' | |
import Background from './Background.js' | |
import Axis from './Axis.js' | |
import Bars from './Bars.js' | |
const SubjectBarsChart = ({data}) => ( | |
<Chart | |
data={data} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import T from 'prop-types' | |
import Chart from './Chart.js' | |
import D3Background from './D3Background.js' | |
import D3XAxis from './D3XAxis.js' | |
import D3YAxis from './D3YAxis.js' | |
import D3Bars from './D3Bars.js' | |
const D3SubjectBarsChart = ({data}) => ( | |
<Chart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import T from 'prop-types' | |
import uniqueId from 'lodash/uniqueId' | |
import isArray from 'lodash/isArray' | |
import {IMargin, IScale, IAxisOptions} from './propTypes.js' | |
const d3 = Object.assign({}, | |
require('d3-selection'), | |
require('d3-scale'), | |
require('d3-array') |