diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d842ef6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# @AngularClass +# http://editorconfig.org + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc59448 --- /dev/null +++ b/.gitignore @@ -0,0 +1,55 @@ +# @AngularClass + +# Logs +logs +*.log + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Users Environment Variables +.lock-wscript + +# OS generated files # +.DS_Store +ehthumbs.db +Icon? +Thumbs.db + +# Node Files # +/node_modules +/bower_components + +# Typing TSD # +/src/typings/tsd/ +/typings/ +/tsd_typings/ + +# Dist # +/dist +/public/__build__/ +/src/*/__build__/ +__build__/** +.webpack.json + + +# IDE # +.idea/ + +# bash and zbash +*.un~ +*~ diff --git a/README.md b/README.md index ef133fb..ecbfa96 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,72 @@ -# angular2.0-App +[![GitHub version](https://badge.fury.io/gh/1337programming%2Fangular2.0-App.svg)](http://badge.fury.io/gh/1337programming%2Fangular2.0-App) +[![Dependency Status](https://david-dm.org/1337-programming/angular2.0-App.svg)](https://david-dm.org/1337programming/angular2.0-App) +[![Issue Stats](http://issuestats.com/github/1337-programming/angular2.0-Appr/badge/pr?style=flat)](http://issuestats.com/github/1337-programming/angular2.0-App) +# Angular 2.0 Sample App + Angular 2.0 Sample App using Typescript as a ECMAScript 6 standard and invoking webpack as a module bundler. + +## Tags +* Angular 2.0 +* TypeScript +* ECMAScript 6 Standard +* Webpack + +# Getting Started +## Dependencies +What is needed to run this app: +* `node` +* `npm` + +Install the following node modules +* `webpack` (`npm install -g webpack`) +* `webpack-dev-server` (`npm install -g webpack-dev-server`) +* `karma` (`npm install -g karma-cli`) +* `protractor` (`npm install -g protractor`) +* `TypeScript` (`npm install -g typescript`) +* `TSD typings` (`npm install -g tsd`) + +## Install +* `fork` repo +* `clone` +* `npm install` +* `npm install express connect-history-api-fallback morgan body-parser` installs sample backend api +* `npm run express` starts up sample backend api server in one tab +* `npm run server` starts the dev server in another tab + +## Running App +After installation run `npm run server` to start a local server using `webpack-dev-server` which will watch, build (in-memory), and reload for you. The port will be displayed to you as `http://localhost:3000` (or if you prefer IPv6, if you're using `express` server, then it's `http://[::1]:3000/`). + +### server +```bash +$ webpack-dev-server +``` + +## Other Commands + +### build files +```bash +$ webpack +``` + +### watch and build files +```bash +$ webpack --watch +``` + +### run tests +```bash +$ karma start +``` + +### run webdriver (E2E) +```bash +$ webdriver-manager start +then +$ npm run e2e +``` + +# Angular 2.0 API +reference: https://angular.io/docs/js/latest/api/ + +# License + [MIT](/LICENSE) diff --git a/gulp/clean.js b/gulp/clean.js new file mode 100644 index 0000000..4bb3ed5 --- /dev/null +++ b/gulp/clean.js @@ -0,0 +1,6 @@ +var gulp = require('gulp'); +var clean = require('gulp-clean'); + +gulp.task('clean', function() { + return gulp.src('__build__', {read: false}).pipe(clean()); +}); \ No newline at end of file diff --git a/gulp/default.js b/gulp/default.js new file mode 100644 index 0000000..0aebb24 --- /dev/null +++ b/gulp/default.js @@ -0,0 +1,4 @@ +var gulp = require('gulp'); +gulp.task('default', function() { + gulp.run('serve'); +}); \ No newline at end of file diff --git a/gulp/serve.js b/gulp/serve.js new file mode 100644 index 0000000..fcbd2c5 --- /dev/null +++ b/gulp/serve.js @@ -0,0 +1,3 @@ +var gulp = require('gulp'); + +gulp.task('serve', ['webpack']); \ No newline at end of file diff --git a/gulp/watch.js b/gulp/watch.js new file mode 100644 index 0000000..ef0369a --- /dev/null +++ b/gulp/watch.js @@ -0,0 +1,10 @@ +var gulp = require('gulp'); +var browserSync = require('browser-sync'); + +gulp.task('watch', function() { + gulp.watch('src/*{,*/*}.*', ['reload-webpack']); +}); + +gulp.task('reload-webpack', ['webpack'], function() { + browserSync.reload(); +}); \ No newline at end of file diff --git a/gulp/webpack.js b/gulp/webpack.js new file mode 100644 index 0000000..8f03f0a --- /dev/null +++ b/gulp/webpack.js @@ -0,0 +1,38 @@ +var gulp = require('gulp'); +var gutil = require('gulp-util'); +var WebpackDevServer = require('webpack-dev-server'); +var webpack = require('webpack'); +var path = require('path'); +var config = require('../webpack.config'); + + +gulp.task('webpack-dev-server', function(callback) { + var server = new WebpackDevServer(webpack(config), { + publicPath: '/__build__/', + contentBase: 'src/public', + hot: true, + inline: true, + noInfo: true, + quiet: true, + stats: { colors: true }, + watchDelay: 3001 + }); + + server.listen(8080, "localhost", function() {}); + + gutil.log('[webpack-dev-server]', 'http://localhost:8080/'); + + callback(); +}); + +gulp.task('webpack', ['clean', 'webpack-dev-server'], function (callback) { + webpack(config, function (err, stats) { + if (err) { + throw new gutil.PluginError('webpack', err); + } + + gutil.log('[webpack]', stats.toString({ + colors: true + })); + }); +}); \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..d1193d7 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,2 @@ +var requireDir = require('require-dir'); +requireDir('./gulp'); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..0c2eb78 --- /dev/null +++ b/package.json @@ -0,0 +1,75 @@ +{ + "name": "angular2.0-App", + "version": "0.0.0", + "description": "An Angular 2.0 sample app using Webpack", + "main": "", + "scripts": { + "build": "npm run build:dev && npm run build:prod", + "build:dev": " npm run env:dev npm run webpack --colors --display-error-details --display-cached", + "build:prod": "npm run env:prod npm run webpack --colors --display-error-details --display-cached", + "webpack": "webpack", + "clean": "rm -rf node_modules && rm -rf tsd_typings", + "watch": "webpack --watch", + "server": "webpack-dev-server --inline --colors --display-error-details --display-cached --port 3000", + "express": "NODE_ENV=development node ./server/express-server-example.js", + "express:dev": " npm run env:dev node ./server/express-server-example.js", + "express:prod": "npm run env:prod node ./server/express-server-example.js", + "express-install": "npm install express connect-history-api-fallback morgan body-parser", + "env:dev": "NODE_ENV=development", + "env:prod": "NODE_ENV=production", + "webdriver-update": "webdriver-manager update", + "webdriver-start": "webdriver-manager start", + "preprotractor": "npm run webdriver-update", + "protractor": "protractor", + "e2e": "npm run protractor", + "test": "karma start", + "postinstall": "tsd reinstall --overwrite", + "prestart": "npm install", + "start": "npm run server" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/1337programming/angular2.0-App/issues" + }, + "dependencies": { + "angular2": "2.0.0-alpha.34", + "reflect-metadata": "^0.1.0", + "rtts_assert": "2.0.0-alpha.34", + "rx": "^2.5.3", + "firebase": "^2.2.4", + "zone.js": "^0.5.2" + }, + "devDependencies": { + "browser-sync": "^2.8.2", + "browser-sync-spa": "^1.0.2", + "css-loader": "^0.15.1", + "exports-loader": "^0.6.2", + "expose-loader": "^0.7.0", + "file-loader": "^0.8.1", + "gulp": "^3.9.0", + "gulp-clean": "^0.3.1", + "gulp-util": "^3.0.6", + "imports-loader": "^0.6.3", + "json-loader": "^0.5.1", + "karma": "^0.13.3", + "karma-chrome-launcher": "^0.2.0", + "karma-coverage": "^0.4.2", + "karma-jasmine": "^0.3.5", + "karma-phantomjs-launcher": "^0.2.0", + "karma-sourcemap-loader": "^0.3.5", + "karma-webpack": "^1.7.0", + "phantomjs": "^1.9.17", + "protractor": "^2.1.0", + "raw-loader": "^0.5.1", + "require-dir": "^0.3.0", + "style-loader": "^0.12.2", + "tsd": "^0.6.3", + "typescript": "^1.5.3", + "typescript-simple-loader": "^0.3.2", + "url-loader": "^0.5.5", + "webpack": "^1.10.5", + "webpack-dev-server": "^1.10.1", + "webpack-stream": "^2.1.0", + "moment": "^2.10.6" + } +} diff --git a/server/express-server.js b/server/express-server.js new file mode 100644 index 0000000..1def89d --- /dev/null +++ b/server/express-server.js @@ -0,0 +1,60 @@ +// Webpack +var webpack = require('webpack'); +var WebpackDevServer = require('webpack-dev-server'); +var webpackConfig = require('../webpack.config'); + +// Express +var express = require('express'); +var history = require('connect-history-api-fallback'); +var morgan = require('morgan'); +var bodyParser = require('body-parser'); + +// Express App +var app = express(); + +// Env +var PORT = process.env.PORT || 3000; +var NODE_ENV = process.env.NODE_ENV || 'development'; + +app.use(morgan('dev')); +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ + extended: true +})); + +// Angular Http content type for POST etc defaults to text/plain at +app.use(bodyParser.text(), function ngHttpFix(req, next) { + try { + req.body = JSON.parse(req.body); + next(); + } catch (e) { + next(); + } +}); + +// Your middleware +app.use(history()); +app.use(express.static('src/public')); + +// Only use in development +if (NODE_ENV === 'development') { + var server = new WebpackDevServer(webpack(webpackConfig), { + publicPath: '/__build__', + historyApiFallback: false, // won't work due to order + inline: true, + quiet: false, + noInfo: false, + stats: { + colors: true + } + }); + // Webpack express app that uses socket.io + app.use(server.app); +} else { + app.use('/__build__', express.static('__build__')); +} + + +app.listen(PORT, function () { + console.log('Listen on http://localhost:' + PORT + ' in ' + NODE_ENV); +}); diff --git a/src/app/bootstrap.ts b/src/app/bootstrap.ts new file mode 100644 index 0000000..8187b9e --- /dev/null +++ b/src/app/bootstrap.ts @@ -0,0 +1,93 @@ +/// + +// Angular 2 +import {bootstrap} from 'angular2/angular2'; + + +/* + * Common Injectables + * our custom helper injectables to configure our app differently using the dependency injection system + */ +import { + jitInjectables, + dynamicInjectables, + preGeneratedInjectables +} from '../common/changeDetectionInjectables'; +import { + html5locationInjectables, + hashlocationInjectables +} from '../common/locationInjectables'; + +/* + * Angular Modules + */ +import {httpInjectables, formInjectables} from 'angular2/angular2'; +import {routerInjectables} from 'angular2/router'; + +/* + * App Services + * our collection of injectables services + */ +import {appServicesInjectables} from './services/services'; + + +/* + * App Component + * our top level component that holds all of our components + */ +import {App} from './components/app'; + + +/* + * Universal injectables + */ +var universalInjectables = [ + // Angular's http/form/router services/bindings + httpInjectables, + formInjectables, + routerInjectables, + + // Our collection of services from /services + appServicesInjectables +]; + +/* + * Platform injectables + */ +var platformInjectables = [ + // if we want to use the Just-In-Time change detection + // bestChangeDetectionInjectables, + + // if we want to use hashBash url for the router + // hashlocationInjectables +]; + +/* + * Bootstrap our Angular app with a top level component `App` and inject + * our Universal/Platform services/bindings into Angular's dependency injection + */ +bootstrap( + // Top Level Component + App, + + // AppInjector + [ + universalInjectables, + platformInjectables + ] +); + +if(module.hot) { + module.hot.accept(function() { + bootstrap( + // Top Level Component + App, + + // AppInjector + [ + universalInjectables, + platformInjectables + ] + ); + }); +} diff --git a/src/app/components/app.css b/src/app/components/app.css new file mode 100644 index 0000000..63c89c0 --- /dev/null +++ b/src/app/components/app.css @@ -0,0 +1,84 @@ +.top-nav { + height: 56px; + min-height: 56px; + padding: 0 16px; + box-shadow: 0 2px 5px 0 rgba(0,0,0,0.26); +} + +.top-nav h1 { + width: 200px; + float: left; + font-size: 16px; + font-weight: 400; + letter-spacing: 0.005em; +} +.top-nav .logo { + line-height:56px; + display:inline-block; + color:#FFF; + padding:0 5px; + font-weight:400; + font-size:16px; + position:relative +} + + +.top-nav ul { + list-style-type: none; + margin: 0; + padding: 0 20px; +} + +.top-nav ul li { + margin: 0; +} +.l-left { + float: left; +} + +.top-nav { + font-family:'Roboto',"Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; +} + +.top-nav .top-nav-button{ + line-height:56px; + display:inline-block; + color:#FFF; + text-decoration:none; + padding:0 10px; + text-transform:uppercase; + font-weight:400; + font-size:16px; + border:none; + background:none; + border-radius:0; + position:relative +} + + +.top-nav .top-nav-button:hover{ + background-color: rgba(158, 158, 158, 0.2); +} + +a:active, a:hover { + outline: 0px none; +} + +.ac-default-theme { + background-color: rgb(25,118,210); + color: rgb(255,255,255); +} + + +[layout=row] { + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; +} +[layout] { + box-sizing: border-box; + display: -webkit-flex; + display: -moz-flex; + display: -ms-flexbox; + display: flex; +} diff --git a/src/app/components/app.html b/src/app/components/app.html new file mode 100644 index 0000000..78f084c --- /dev/null +++ b/src/app/components/app.html @@ -0,0 +1,32 @@ +
+
+ + AngularP + + + +
+
+ +
+ +
+ + diff --git a/src/app/components/app.ts b/src/app/components/app.ts new file mode 100644 index 0000000..b8c27db --- /dev/null +++ b/src/app/components/app.ts @@ -0,0 +1,76 @@ +/// + +/* + * Angular 2 + */ +import {Component, View} from 'angular2/angular2'; +import {RouteConfig} from 'angular2/router'; + +/* + * Directives + */ +import {coreDirectives, formDirectives} from 'angular2/angular2'; +import {routerDirectives} from 'angular2/router'; +// Import all of our custom app directives +import {appDirectives} from '../directives/directives'; + +/* + * App Pipes + * our collection of pipes registry + */ +import {appPipes} from '../pipes/pipes'; + +/* + * Components + */ + +// We use a folder if we want separate files +import {Home} from './home/home'; +// Otherwise we only use one file for a component +import {Dashboard} from './dashboard/dashboard'; + +// Example modules +import {ExampleModules} from './example-modules/example-modules'; +// Use webpack's `require` to get files as a raw string using raw-loader +let styles = require('./app.css'); +let template = require('./app.html'); + +/* + * App Component + * Top Level Component + * Simple router component example + */ +@Component({ + selector: 'app', // without [ ] means we are selecting the tag directly + viewBindings: [ appPipes ] +}) +@View({ + // needed in order to tell Angular's compiler what's in the template + directives: [ + // Angular's core directives + coreDirectives, + + // Angular's form directives + formDirectives, + + // Angular's router + routerDirectives, + + // Our collection of directives from /directives + appDirectives + ], + // include our .css file + styles: [ styles ], + template: template +}) +@RouteConfig([ + { path: '/', as: 'home', component: Home }, + { path: '/dashboard', as: 'dashboard', component: Dashboard }, + { path: '/example-modules/...', as: 'example-modules', component: ExampleModules } +]) +export class App { + name: string; + constructor() { + this.name = 'angular'; + } +} diff --git a/src/app/components/dashboard/dashboard.ts b/src/app/components/dashboard/dashboard.ts new file mode 100644 index 0000000..8c03591 --- /dev/null +++ b/src/app/components/dashboard/dashboard.ts @@ -0,0 +1,38 @@ +/// + +/* + * Angular 2 + */ +import {Component, View, Directive, ElementRef} from 'angular2/angular2'; + +let view = require('./views/dashboard.html'); + +/* + * TODO: refactor + * simple example directive that should be in `/directives` folder + */ +@Directive({ + selector: '[x-large]' // using [ ] means selecting attributes +}) +class XLarge { + constructor(public el: ElementRef) { + // simple dom manipulation to set font size to x-large + if (this.el.nativeElement.style) { + this.el.nativeElement.style.fontSize = 'x-large'; + } + } +} + +// Simple component with custom directive example +@Component({ + selector: 'dashboard' +}) +@View({ + directives: [ XLarge ], + template: view +}) +export class Dashboard { + constructor() { + + } +} diff --git a/src/app/components/dashboard/views/dashboard.html b/src/app/components/dashboard/views/dashboard.html new file mode 100644 index 0000000..c09c167 --- /dev/null +++ b/src/app/components/dashboard/views/dashboard.html @@ -0,0 +1,9 @@ + +
+

Dashboard

+ This is a useless dashboard! +
\ No newline at end of file diff --git a/src/app/components/example-modules/example-modules.css b/src/app/components/example-modules/example-modules.css new file mode 100644 index 0000000..ffb36cb --- /dev/null +++ b/src/app/components/example-modules/example-modules.css @@ -0,0 +1,83 @@ +.example-modules-menu, +.example-modules-menu ul { + list-style: none; + padding: 0; +} + +.example-modules-menu li { + margin: 0; +} + +.example-modules-menu > li:nth-child(1) { + border-top: none; +} + +.example-modules-menu .ac-button { + border-radius: 0; + color: inherit; + cursor: pointer; + display: block; + line-height: 40px; + margin: 0; + max-height: 40px; + overflow: hidden; + padding: 0px 16px; + text-align: left; + text-decoration: none; + white-space: normal; + width: 100%; +} + +.example-modules-menu ac-select { + /* Override md-select margins. With margins the menu will look incorrect and causes mobile list + to not be scrollable. + */ + margin: 0; + width: 100%; +} + +.example-modules-menu .ac-button.active { + color: #03a9f4; +} + +ul.example-modules-menu li:hover { + background: rgba(0, 0, 0, 0.1); +} + +.side-nav { + background: #FFF; + box-shadow: 3px 0 6px rgba(0, 0, 0, 0.3); + width: 260px; + bottom: 0; + overflow: auto; +} + +nav { + align-items: stretch; +} + +[layout] { + box-sizing: border-box; + display: -webkit-flex; + display: -moz-flex; + display: -ms-flexbox; + display: flex; +} + +[layout=column] { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.wide { + width: 100%; +} + +.example-modules-content { + align-items: stretch; + display: block; + position: relative; + overflow: auto; + -webkit-overflow-scrolling: touch; +} diff --git a/src/app/components/example-modules/example-modules.html b/src/app/components/example-modules/example-modules.html new file mode 100644 index 0000000..9f8c714 --- /dev/null +++ b/src/app/components/example-modules/example-modules.html @@ -0,0 +1,33 @@ +
+ + +
+
+ +
+
+ +
diff --git a/src/app/components/example-modules/example-modules.ts b/src/app/components/example-modules/example-modules.ts new file mode 100644 index 0000000..c023a34 --- /dev/null +++ b/src/app/components/example-modules/example-modules.ts @@ -0,0 +1,32 @@ +/// + +// Angular 2 +import {Component, View, CSSClass} from 'angular2/angular2'; +import {RouteConfig, routerDirectives} from 'angular2/router'; +// Modules +import {Tictactoe} from './tictactoe-module/tictactoe'; +import {Search} from './search-module/search'; +import {Memory} from './memory-module/memory'; +import {HackerNews} from './hn-module/hn'; +// View +let template = require('./example-modules.html'); +let styles = require('./example-modules.css') +@Component({ + selector: 'example-modules' +}) +@RouteConfig([ + { path: '/', redirectTo: '/search' }, + { path: '/search', as: 'search', component: Search }, + { path: '/tictactoe', as: 'tictactoe', component: Tictactoe }, + { path: '/memory', as: 'memory', component: Memory }, + { pathL '/hn', as: 'hn', component: HackerNews } +]) +@View({ + directives: [ routerDirectives, CSSClass ], + // include our .css file + styles: [ styles ], // Use webpack's `require` to get files as a raw string using raw-loader + template: template +}) +export class ExampleModules { + active: number = 0; +} diff --git a/src/app/components/example-modules/hn-module/components/hn-item/hn-item.ts b/src/app/components/example-modules/hn-module/components/hn-item/hn-item.ts new file mode 100644 index 0000000..ea157d8 --- /dev/null +++ b/src/app/components/example-modules/hn-module/components/hn-item/hn-item.ts @@ -0,0 +1,70 @@ +import { Component, View, For, If, Switch, SwitchWhen, SwitchDefault } from 'angular2/angular2'; +import { HNApi } from '../../services/hn-api'; +import { timeAgo } from '../../../../../services/time'; +import { DomainPipe } from './pipes/domain.pipe'; + +let view = require('./views/hn-item.html'); +let styles = require('./styles/hn-item.less'); + +var hnApi; + +@Component({ + selector: 'hn-item', + viewBindings: [HNApi], + properties: { + newItemId: 'itemId', + newLoadChildren: 'loadChildren', + newTopLevel: 'topLevel' + } +}) +@View({ + template: view, + styles: [ styles ], + directives: [ + For, + If, + Switch, + SwitchWhen, + SwitchDefault + ] +}) +export class HNItem { + data: Object; + domainPipe: Object; + loadChildren: boolean; + topLevel: boolean; + itemId; + timeAgo; + + + constructor(hnApiInstance: HNApi) { + this.domainPipe = DomainPipe.transform; + + // Default value. + this.loadChildren = true; + + // Make accessible in other methods. + hnApi = hnApiInstance; + + this.timeAgo = timeAgo; + } + + set newItemId(itemId) { + this.itemId = itemId; + this.fetchData(); + } + + set newLoadChildren(loadChildren) { + this.loadChildren = loadChildren === 'true'; + } + + set newTopLevel(topLevel) { + this.topLevel = topLevel === 'true'; + } + + fetchData() { + hnApi.fetchItem(this.itemId).then(data => { + this.data = data; + }); + } +} diff --git a/src/app/components/example-modules/hn-module/components/hn-item/pipes/domain.ts b/src/app/components/example-modules/hn-module/components/hn-item/pipes/domain.ts new file mode 100644 index 0000000..e3110fb --- /dev/null +++ b/src/app/components/example-modules/hn-module/components/hn-item/pipes/domain.ts @@ -0,0 +1,11 @@ +import { Pipes } from 'angular2/angular2'; + +export class DomainPipe extends Pipes { + static transform(input) { + if (!input) { + return ''; + } + var domain = input.split('/')[2]; + return domain ? domain.replace('www.', '') : domain; + } +} diff --git a/src/app/components/example-modules/hn-module/components/hn-item/styles/hn-item.less b/src/app/components/example-modules/hn-module/components/hn-item/styles/hn-item.less new file mode 100644 index 0000000..08e5b2e --- /dev/null +++ b/src/app/components/example-modules/hn-module/components/hn-item/styles/hn-item.less @@ -0,0 +1,33 @@ +hn-item { + display: block; + margin: 10px 0; +} + +.hnItem-title { + font-size: 10pt; + color: #828282; +} + +.hnItem > section { + font-size: 7pt; + &, + a:link, + a:visited { + color: #828282; + } + a:hover { + text-decoration: underline; + } +} + +.hnItem--comment { + margin: 15px 0; +} + +.hnItem--coment-content { + margin-top: 5px; +} + +.hnItem--comment-children { + margin-left: 50px; +} diff --git a/src/app/components/example-modules/hn-module/components/hn-item/views/hn-item.html b/src/app/components/example-modules/hn-module/components/hn-item/views/hn-item.html new file mode 100644 index 0000000..d893a78 --- /dev/null +++ b/src/app/components/example-modules/hn-module/components/hn-item/views/hn-item.html @@ -0,0 +1,69 @@ +
+
+
+
+
+
+
+
+
+ + + + +
+
diff --git a/src/app/components/example-modules/hn-module/directives/home.ts b/src/app/components/example-modules/hn-module/directives/home.ts new file mode 100644 index 0000000..86512d5 --- /dev/null +++ b/src/app/components/example-modules/hn-module/directives/home.ts @@ -0,0 +1,28 @@ +import { Component, View, For } from 'angular2/angular2'; +import { HNApi } from '../services/hn-api'; +import { HNItem } from '../components/hn-item/hn-item'; + +let view = require('../views/home.html'); +let styles = require('../styles/hn.less'); + +@Component({ + selector: 'page-home', + viewBindings: HNApi +}) +@View({ + directives: [ + For, + HNItem + ], + styles: [ styles ], + template: view +}) +export class HomePage { + topStories: Array; + + constructor(public hnApi: HNApi) { + hnApi.fetchTopStories().then(() => { + this.topStories = hnApi.topStories; + }); + } +} diff --git a/src/app/components/example-modules/hn-module/directives/item.ts b/src/app/components/example-modules/hn-module/directives/item.ts new file mode 100644 index 0000000..e4494a0 --- /dev/null +++ b/src/app/components/example-modules/hn-module/directives/item.ts @@ -0,0 +1,27 @@ +import { Component, View, For } from 'angular2/angular2'; +import { HNApi } from '../services/hn-api'; +import { HNItem } from '../../components/hn-item'; + +let view = require('../views/item.html'); +let styles = require('../styles/hn.less'); + +@Component({ + selector: 'page-item', + viewBindings: HNApi +}) +@View({ + directives: [ + For, + HNItem + ], + template: view, + styles: [ styles ] +}) +export class ItemPage { + childrenIds: Array; + itemId; + + constructor(public hnApi: HNApi, id) { + this.itemId = id; + } +} diff --git a/src/app/components/example-modules/hn-module/directives/user.ts b/src/app/components/example-modules/hn-module/directives/user.ts new file mode 100644 index 0000000..9da63f9 --- /dev/null +++ b/src/app/components/example-modules/hn-module/directives/user.ts @@ -0,0 +1,30 @@ +import { Component, View, For, If } from 'angular2/angular2'; +import { HNApi } from '../services/hn-api'; +import { timeAgo } from '../../../../../services/time'; +import { HNItem } from '../components/hn-item/hn-item'; + +let view = require('../views/user.html'); +let styles = require('../styles/hn.less'); + +@Component({ + selector: 'page-user', + viewBindings: HNApi +}) +@View({ + directives: [ + For, + If, + HNItem + ], + styles: [ styles ], + template: view +}) +export class UserPage { + showSubmissions: boolean; + timeAgo; + + constructor(hnApi: HNApi) { + this.timeAgo = timeAgo; + this.showSubmissions = false; + } +} diff --git a/src/app/components/example-modules/hn-module/hn.ts b/src/app/components/example-modules/hn-module/hn.ts new file mode 100644 index 0000000..0292b84 --- /dev/null +++ b/src/app/components/example-modules/hn-module/hn.ts @@ -0,0 +1,35 @@ +//import {zone} from 'zone.js'; +//window.zone = window.Zone = zone; + +let styles = require('./styles/hn.less'); +let view = require('/.views/hn.html'); + +import {RouteConfig} from 'angular2/router'; +import {Component, View} from 'angular2/angular2'; +import {HomePage} from './directives/home' +import {ItemPage} from './directives/item' +import {UserPage} from './directives/user' +import {HNItem} from './components/hn-item/hn-item'; + + +@Component({ + selector: 'hacker-news' +}) +@RouteConfig([ + { path: '/', redirectTo: '/hn' }, + { path: '/hn', as: 'hn', component: HackerNews }, + { path: '/hn-item', as: 'hn-item', component: HNItem }, +]) +@View({ + template: view, + styles: [ styles ], + directives: [ + HomePage, + ItemPage, + UserPage + ] +}) +export class HackerNews { + +} + diff --git a/src/app/components/example-modules/hn-module/services/hn-api.ts b/src/app/components/example-modules/hn-module/services/hn-api.ts new file mode 100644 index 0000000..d2650d5 --- /dev/null +++ b/src/app/components/example-modules/hn-module/services/hn-api.ts @@ -0,0 +1,78 @@ +import {Firebase} from 'firebase/firebase'; +import {Injectable} from 'angular2/angular2'; + +const connection = new Firebase('https://hacker-news.firebaseio.com/v0/'); + +@Injectable() +export class HNApi { + itemStore: Object; + userStore: Object; + topStories: Array; + + constructor() { + this.itemStore = {}; + this.userStore = {}; + } + + fetchTopStories() { + return new Promise((resolve) => { + HNApi.topStoriesRef().once('value', snapshot => { + this.topStories = snapshot.val().splice(0, 20); + + resolve(this.topStories); + }); + }); + } + + fetchItems(items = []) { + return new Promise(resolve => { + let promises = []; + + items.forEach(itemId => { + promises.push(new Promise((resolveItem) => { + HNApi.itemRef(itemId).on('value', value => { + this.itemStore[itemId] = value.val(); + + resolveItem(this.itemStore[itemId]); + }); + })); + }); + + Promise.all(promises).then(resolve); + }); + } + + fetchItem(item) { + if (!item) { + return Promise.reject(item); + } + + return this.fetchItems([item]).then(data => data[0]); + } + + fetchUser(userId) { + if (!userId) { + return Promise.reject(userId); + } + + return new Promise(resolve => { + HNApi.userRef(userId).on('value', value => { + this.userStore[userId] = value.val(); + + resolve(this.userStore[userId]); + }); + }); + } + + static topStoriesRef() { + return connection.child('topstories/'); + } + + static itemRef(itemId) { + return connection.child('item/' + itemId); + } + + static userRef(userId) { + return connection.child('user/' + userId); + } +} diff --git a/src/app/components/example-modules/hn-module/styles/hn.less b/src/app/components/example-modules/hn-module/styles/hn.less new file mode 100644 index 0000000..72aff87 --- /dev/null +++ b/src/app/components/example-modules/hn-module/styles/hn.less @@ -0,0 +1,115 @@ +input { font-family:Courier; font-size:10pt; color:#000000; } +input[type=submit] { font-family:Verdana, Geneva, sans-serif; } +textarea { font-family:Courier; font-size:10pt; color:#000000; } + +a:link { color:#000000; text-decoration:none; } +a:visited { color:#828282; text-decoration:none; } + +.default { font-family:Verdana, Geneva, sans-serif; font-size: 10pt; color:#828282; } +.admin { font-family:Verdana, Geneva, sans-serif; font-size:8.5pt; color:#000000; } + +.adtitle { font-family:Verdana, Geneva, sans-serif; font-size: 9pt; color:#828282; } +.yclinks { font-family:Verdana, Geneva, sans-serif; font-size: 8pt; color:#828282; } +.pagetop { font-family:Verdana, Geneva, sans-serif; font-size: 10pt; color:#222222; } +.comhead { font-family:Verdana, Geneva, sans-serif; font-size: 8pt; color:#828282; } +.comment { font-family:Verdana, Geneva, sans-serif; font-size: 9pt; } +.dead { font-family:Verdana, Geneva, sans-serif; font-size: 9pt; color:#dddddd; } + +.comment a:link, .comment a:visited { text-decoration:underline;} +.dead a:link, .dead a:visited { color:#dddddd; } +.pagetop a:visited { color:#000000;} +.topsel a:link, .topsel a:visited { color:#ffffff; } + +.comhead a:link, .subtext a:visited { color:#828282; } +.comhead a:hover { text-decoration:underline; } + +.default p { margin-top: 8px; margin-bottom: 0px; } + +.pagebreak {page-break-before:always} + +pre { overflow: auto; padding: 2px; max-width:600px; } +pre:hover {overflow:auto} + + +/** + * Real Styles + */ + +.u-pointer { + cursor: pointer; +} + +body { + font-family: Verdana, Geneva, sans-serif; + font-size: 10pt; + color: #828282; +} + +.bodyContainer { + margin: 0 auto; + width: 85%; + max-width: 1280px; + background: #F6F6EF; +} + +.headerBar { + background: #FF6600; +} + +.userDetail { + margin: 10px 20px; +} + +.userDetail-item { + + &:first-of-type { + margin-top: 30px; + } +} + +.itemDetail { + margin: 10px 20px; +} + +.itemDetail-item { + + &:first-of-type { + margin-top: 30px; + } +} + +hn-item { + display: block; + margin: 10px 0; +} + +.hnItem-title { + font-size: 10pt; + color:#828282; +} + +.hnItem > section { + font-size: 7pt; + + &, + a:link, + a:visited { + color: #828282; + } + + a:hover { + text-decoration: underline; + } +} + +.hnItem--comment { + margin: 15px 0; +} + +.hnItem--coment-content { + margin-top: 5px; +} + +.hnItem--comment-children { + margin-left: 50px; +} \ No newline at end of file diff --git a/src/app/components/example-modules/hn-module/views/footer-bar.html b/src/app/components/example-modules/hn-module/views/footer-bar.html new file mode 100644 index 0000000..cc139c9 --- /dev/null +++ b/src/app/components/example-modules/hn-module/views/footer-bar.html @@ -0,0 +1,10 @@ +
+ + + + + + + +
+
diff --git a/src/app/components/example-modules/hn-module/views/header-bar.html b/src/app/components/example-modules/hn-module/views/header-bar.html new file mode 100644 index 0000000..29b8a38 --- /dev/null +++ b/src/app/components/example-modules/hn-module/views/header-bar.html @@ -0,0 +1,19 @@ +
+ + + + + + + +
+ + + + + + Hacker News written in Angular 2 + + +
+
diff --git a/src/app/components/example-modules/hn-module/views/hn.html b/src/app/components/example-modules/hn-module/views/hn.html new file mode 100644 index 0000000..e34488b --- /dev/null +++ b/src/app/components/example-modules/hn-module/views/hn.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/src/app/components/example-modules/hn-module/views/home.html b/src/app/components/example-modules/hn-module/views/home.html new file mode 100644 index 0000000..2792aac --- /dev/null +++ b/src/app/components/example-modules/hn-module/views/home.html @@ -0,0 +1,7 @@ +
+
    +
  1. + +
  2. +
+
diff --git a/src/app/components/example-modules/hn-module/views/item.html b/src/app/components/example-modules/hn-module/views/item.html new file mode 100644 index 0000000..be651b7 --- /dev/null +++ b/src/app/components/example-modules/hn-module/views/item.html @@ -0,0 +1,6 @@ +
+ +
+ +
+
diff --git a/src/app/components/example-modules/hn-module/views/user.html b/src/app/components/example-modules/hn-module/views/user.html new file mode 100644 index 0000000..47ffb2d --- /dev/null +++ b/src/app/components/example-modules/hn-module/views/user.html @@ -0,0 +1,18 @@ +
+

user: {{data.id}}

+

created: {{timeAgo(data.created)}}

+

karma: {{data.karma}}

+

about: {{data.about}}

+

+ show submitted stories and comments +

+
+ +
+
+

+

+ submissions + comments +

+
diff --git a/src/app/components/example-modules/memory-module/directives/board.ts b/src/app/components/example-modules/memory-module/directives/board.ts new file mode 100644 index 0000000..addbf7a --- /dev/null +++ b/src/app/components/example-modules/memory-module/directives/board.ts @@ -0,0 +1,21 @@ +/// + +// Angular 2 +import {Component, View, EventEmitter, coreDirectives} from 'angular2/angular2'; + +let styles = require('../views/css/memory.css'); +let template = require('../views/board.html'); + +@Component({ + selector: 'board', + properties: [ 'board' ], + events: [ 'select' ] +}) +@View({ + directives: [ coreDirectives ], + styles: [styles], + template: template +}) +export class Board { + select: EventEmitter = new EventEmitter(); +} diff --git a/src/app/components/example-modules/memory-module/memory.ts b/src/app/components/example-modules/memory-module/memory.ts new file mode 100644 index 0000000..c79d488 --- /dev/null +++ b/src/app/components/example-modules/memory-module/memory.ts @@ -0,0 +1,32 @@ +/// + +// Angular 2 +import {Component, View, coreDirectives} from 'angular2/angular2'; + +// Services +import {MemoryGame} from './services/game'; + +// Directives +import {Board} from './directives/board'; + +// View +let view = require('./views/memory.html'); + +@Component({ + selector: 'memory', + viewBindings: [MemoryGame] +}) +@View({ + directives: [coreDirectives, Board], + template: view +}) + +export class Memory { + game: MemoryGame; + tileNames: Array; + constructor() { + this.tileNames = ['8-ball', 'kronos', 'baked-potato', 'dinosaur', 'rocket', 'skinny-unicorn', + 'that-guy', 'zeppelin']; + this.game = new MemoryGame(this.tileNames); + } +} diff --git a/src/app/components/example-modules/memory-module/services/game.ts b/src/app/components/example-modules/memory-module/services/game.ts new file mode 100644 index 0000000..21982d7 --- /dev/null +++ b/src/app/components/example-modules/memory-module/services/game.ts @@ -0,0 +1,108 @@ +/// + +import {Injectable} from 'angular2/angular2'; +import {Tile} from '../services/tile'; + + +var message = { + CLICK:'Click on a tile.', + ONE_MORE:'Pick one more card', + MISS: 'Try again', + MATCH: 'Good job! Keep going.', + WON: 'You win!' +}; + +@Injectable() +export class MemoryGame { + tileDeck: Array; + grid: Tile[][]; + message: string; + unmatchedPairs: number; + private _firstPick: Tile; + private _secondPick: Tile; + + constructor(tileNames: Array) { + this._firstPick = new Tile(''); + this._secondPick = new Tile(''); + this.tileDeck = MemoryGame.makeDeck(tileNames); + this.message = message.CLICK; + this.unmatchedPairs = tileNames.length; + this.grid = MemoryGame.makeGrid(this.tileDeck); + } + + static makeDeck(tileNames) { + var tileDeck: Array = []; + for (var i:number = 0; i < tileNames.length; i++) { + tileDeck.push(new Tile(tileNames[i])); + tileDeck.push(new Tile(tileNames[i])); + } + + return tileDeck; + } + + static makeGrid(tileDeck) { + var gridDimension = Math.sqrt(tileDeck.length); + var grid:Array = []; + + for (var row:number = 0; row < gridDimension; row++) { + grid[row] = []; + for (var col:number = 0; col < gridDimension; col++) { + grid[row][col] = MemoryGame.removeRandomTile(tileDeck); + } + } + + return grid; + } + + static removeRandomTile(tileDeck) { + var i:number = Math.floor(Math.random()*tileDeck.length); + return tileDeck.splice(i, 1)[0]; + } + + flipTile(tile) { + if (tile.flipped) { + return; + } + + tile.flip(); + + if(!this._firstPick || this._secondPick) { + + if (this._secondPick) { + this._firstPick.flip(); + this._secondPick.flip(); + this._firstPick = this._secondPick = undefined; + } + + this._firstPick = tile; + this.message = message.ONE_MORE; + + } else { + if (this._firstPick.title === tile.title) { + this.unmatchedPairs--; + if (this.unmatchedPairs > 0) { + this.message = message.WON; + } + this._firstPick = this._secondPick = undefined; + } else { + this._secondPick = tile; + this.message = message.MISS; + } + } + } + + public get secondPick():Tile { + return this._secondPick; + } + + public set secondPick(value:Tile) { + this._secondPick = value; + } + public get firstPick():Tile { + return this._firstPick; + } + + public set firstPick(value:Tile) { + this._firstPick = value; + } +} diff --git a/src/app/components/example-modules/memory-module/services/tile.ts b/src/app/components/example-modules/memory-module/services/tile.ts new file mode 100644 index 0000000..19d0095 --- /dev/null +++ b/src/app/components/example-modules/memory-module/services/tile.ts @@ -0,0 +1,18 @@ +/// + +import {Injectable} from 'angular2/angular2'; + +@Injectable() +export class Tile { + title: string; + flipped: boolean; + + constructor(title: string) { + this.title = title; + this.flipped = false + } + + flip() { + this.flipped = !this.flipped; + } +} \ No newline at end of file diff --git a/src/app/components/example-modules/memory-module/views/board.html b/src/app/components/example-modules/memory-module/views/board.html new file mode 100644 index 0000000..139597f --- /dev/null +++ b/src/app/components/example-modules/memory-module/views/board.html @@ -0,0 +1,2 @@ + + diff --git a/src/app/components/example-modules/memory-module/views/css/memory.css b/src/app/components/example-modules/memory-module/views/css/memory.css new file mode 100644 index 0000000..a2b970a --- /dev/null +++ b/src/app/components/example-modules/memory-module/views/css/memory.css @@ -0,0 +1,86 @@ +.container { + width: 165px; + height: 200px; + position: relative; + -webkit-perspective: 800px; + -moz-perspective: 800px; + -ms-perspective: 800px; + -o-perspective: 800px; + perspective: 800px; +} + +.card .back .front{ + width: 100%; + height: 100%; + -webkit-transition: -webkit-transform 1s; + -moz-transition: -moz-transform 1s; + -ms-transition: -ms-transform 1s; + -o-transition: -o-transform 1s; + transition: transform 1s; + -webkit-transform-style: preserve-3d; + -moz-transform-style: preserve-3d; + -ms-transform-style: preserve-3d; + -o-transform-style: preserve-3d; + transform-style: preserve-3d; +} + +.card.flipped { + -webkit-transform: rotateY( 180deg ); + -moz-transform: rotateY( 180deg ); + -ms-transform: rotateY( 180deg ); + -o-transform: rotateY( 180deg ); + transform: rotateY( 180deg ); +} + +.card:active { + -webkit-transform: rotateY( 180deg ); + -moz-transform: rotateY( 180deg ); + -ms-transform: rotateY( 180deg ); + -o-transform: rotateY( 180deg ); + transform: rotateY( 180deg ); +} + +.back:active { + -webkit-transform: rotateY( 180deg ); + -moz-transform: rotateY( 180deg ); + -ms-transform: rotateY( 180deg ); + -o-transform: rotateY( 180deg ); + transform: rotateY( 180deg ); +} + +.front:active { + -webkit-transform: rotateY( 180deg ); + -moz-transform: rotateY( 180deg ); + -ms-transform: rotateY( 180deg ); + -o-transform: rotateY( 180deg ); + transform: rotateY( 180deg ); +} + + +.card img { + display: block; + height: 100%; + width: 100%; + position: absolute; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + -o-backface-visibility: hidden; + backface-visibility: hidden; +} + + + +.card .back { + background: blue; + -webkit-transform: rotateY( 180deg ); + -moz-transform: rotateY( 180deg ); + -ms-transform: rotateY( 180deg ); + -o-transform: rotateY( 180deg ); + transform: rotateY( 180deg ); +} + +.message { + width: 660px; + text-align: center; +} diff --git a/src/app/components/example-modules/memory-module/views/memory.html b/src/app/components/example-modules/memory-module/views/memory.html new file mode 100644 index 0000000..c767955 --- /dev/null +++ b/src/app/components/example-modules/memory-module/views/memory.html @@ -0,0 +1,13 @@ +
Pairs left to match: {{game.unmatchedPairs}}
+
Matching: {{game.firstPick.title}}
+ + + + +
+
+ + +
+
+
{{game.message}}
diff --git a/src/app/components/example-modules/search-module/directives/autosuggest.ts b/src/app/components/example-modules/search-module/directives/autosuggest.ts new file mode 100644 index 0000000..3bdbb34 --- /dev/null +++ b/src/app/components/example-modules/search-module/directives/autosuggest.ts @@ -0,0 +1,52 @@ +/// + +// Angular 2 +import {Directive, View, EventEmitter, ElementRef, LifecycleEvent} from 'angular2/angular2'; + +import {Github} from '../services/github'; +// RxJs +import * as Rx from 'rx'; + + +@Directive({ + selector: 'input[type=text][autosuggest]', + lifecycle: [ LifecycleEvent.onInit ], + events: [ 'term', 'loading' ] +}) +export class Autosuggest { + term: EventEmitter = new EventEmitter(); + loading: EventEmitter = new EventEmitter(); + + constructor(private el: ElementRef, public github: Github) { + + } + onInit() { + + (Rx).Observable.fromEvent(this.el.nativeElement, 'keyup'). + map(e => e.target.value). // Project the text from the input + filter((text: string) => text.length > 2). // Only if the text is longer than 2 characters + debounce(250). // Pause for 250ms + distinctUntilChanged(). // Only if the value has changed + do(() => this.loading.next(true)). + flatMapLatest((query: string) => this.github.search(query)). // send query to search service + // here is the real action + subscribe( + (repos: string[]) => { + // fire "term" event + // the Search component is the listener + this.loading.next(false); + this.term.next(repos); + }, + err => { + console.log(err); + this.loading.next(false); + this.term.next(['ERROR, see console']); + }, + () => { + console.log('complete') + this.loading.next(false); + } + )//subscribe + } + +} diff --git a/src/app/components/example-modules/search-module/search.ts b/src/app/components/example-modules/search-module/search.ts new file mode 100644 index 0000000..80ce8b5 --- /dev/null +++ b/src/app/components/example-modules/search-module/search.ts @@ -0,0 +1,28 @@ +/// + +// Angular 2 +import {Component, View, coreDirectives, formDirectives} from 'angular2/angular2'; + +import {Autosuggest} from './directives/autosuggest'; + +let view = require('./views/search.html'); + +@Component({ + selector: 'search-github' +}) +@View({ + directives: [ coreDirectives, formDirectives, Autosuggest ], + template: view +}) +export class Search { + repos: Array = []; + loading: boolean = false; + + constructor() { + } + + showResults(results: string[]) { + this.repos = results; + } + +} diff --git a/src/app/components/example-modules/search-module/services/github.ts b/src/app/components/example-modules/search-module/services/github.ts new file mode 100644 index 0000000..4ccd7ae --- /dev/null +++ b/src/app/components/example-modules/search-module/services/github.ts @@ -0,0 +1,30 @@ +/// + +import {bind, Injectable, Http} from 'angular2/angular2' + +import {ISearchable} from './searchable'; + +@Injectable() +export class Github implements ISearchable { + url: string = 'https://api.github.com/search/repositories?q='; + + constructor(public http: Http) { + + } + + /** + * @returns an Observable of repository names + */ + search(query: string): Rx.Observable { + return this.http.get(`${ this.url }${ query }`). + toRx(). // convert it to pure Rx stream + map(res => res.json()). // make json + map(res => res.items). // extract "items" only + filter(repos => repos); // only if there are results + } + +} + +export var githubInjectables = [ + bind(Github).toClass(Github) +]; diff --git a/src/app/components/example-modules/search-module/services/searchable.ts b/src/app/components/example-modules/search-module/services/searchable.ts new file mode 100644 index 0000000..921f31d --- /dev/null +++ b/src/app/components/example-modules/search-module/services/searchable.ts @@ -0,0 +1,5 @@ +/// + +export interface ISearchable { + search(query: string): Rx.Observable; +} diff --git a/src/app/components/example-modules/search-module/views/search.html b/src/app/components/example-modules/search-module/views/search.html new file mode 100644 index 0000000..a13d02b --- /dev/null +++ b/src/app/components/example-modules/search-module/views/search.html @@ -0,0 +1,20 @@ +
+

Search Github repos

+ +
+ + + + +
+ +
+ + + +
+
diff --git a/src/app/components/example-modules/tictactoe-module/directives/board.ts b/src/app/components/example-modules/tictactoe-module/directives/board.ts new file mode 100644 index 0000000..7086b5e --- /dev/null +++ b/src/app/components/example-modules/tictactoe-module/directives/board.ts @@ -0,0 +1,21 @@ +/// + +// Angular 2 +import {Component, View, EventEmitter, coreDirectives} from 'angular2/angular2'; + +let styles = require('../styles/board.css'); +let template = require('../views/board.html'); + +@Component({ + selector: 'board', + properties: [ 'board' ], + events: [ 'select' ] +}) +@View({ + directives: [ coreDirectives ], + styles: [styles], + template: template +}) +export class Board { + select: EventEmitter = new EventEmitter(); +} diff --git a/src/app/components/example-modules/tictactoe-module/services/game.ts b/src/app/components/example-modules/tictactoe-module/services/game.ts new file mode 100644 index 0000000..4105242 --- /dev/null +++ b/src/app/components/example-modules/tictactoe-module/services/game.ts @@ -0,0 +1,82 @@ +/// + +import {Injectable} from 'angular2/angular2'; + +type Triple = [ string, string, string ]; // tuple type +type Rows = [ Triple, Triple, Triple ]; +type Point = { x: number; y: number }; + +@Injectable() +export class Game { + + board: Rows = [ + ['', '', ''], + ['', '', ''], + ['', '', ''] + ]; + plays: Point[] = []; + + public static create(): Game { + return new Game(); + } + + dispose() { + this.board = null; + this.plays = null; + } + + play(coord: Point) { + const { x, y } = coord; + if (!this.gameover && this.board[x][y] === '') { + this.board[x][y] = this.player; + } + this.plays.push(coord); //TODO: create Rx Observable + } + + get player() { + return ['x', 'o'][this.plays.length % 2]; + } + + get gameover() { + return this.draw || this.winner !== ''; + } + + get winner(): string { + return getWinnerFromBoard(this.board); + } + + get draw() { + return this.plays.length === 9; + } + +} + +// Pure functions + +function getWinnerFromBoard(board: Rows): string { + const allWinningLists = [].concat( + board, // rows + zip(board), // columns + diagonals(board) // diagonals + ); + + return allWinningLists.reduce(getWinnerFromList, ''); +} + +function getWinnerFromList(winner: string, list: Triple) { + if (winner) return winner; + if (list.every(s => s == 'o')) return 'o'; + if (list.every(s => s == 'x')) return 'x'; + return ''; +} + +function zip(arrays: Rows) { + return arrays[0].map((_, i) => arrays.map(array => array[i])); +} + +function diagonals(rows: Rows) { + return [ + rows.map((row, index) => row[index]), // left to right diagonal + rows.map((row, index) => row[row.length - 1 - index]) // right to left diagonal + ]; +} diff --git a/src/app/components/example-modules/tictactoe-module/styles/board.css b/src/app/components/example-modules/tictactoe-module/styles/board.css new file mode 100644 index 0000000..21d3b93 --- /dev/null +++ b/src/app/components/example-modules/tictactoe-module/styles/board.css @@ -0,0 +1,42 @@ +.board { + margin: 100px auto; +} + +.board .row .tile { + border: 1px solid rgb(210, 210, 210); + height: 100px; + width: 100px; + display: inline-block; + cursor: pointer; + float: left; + margin-left: -1px; + margin-bottom: -1px; +} + + +.board .row .x { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAM4AAAD1CAAAAAA9yZV2AAAJO0lEQVR42t2dK3AyMRDH16OZwSEQWAyqAolEYrAYXCUSh0dUodBMBR6D6uBPn2AGd+pmTpzIJ9p+vO6RfSW5ru1Mrr+7ZLP7300A0yzL18NjxZ+hWTRxBwDe/wrOEQAAYJj+CZwd/Fgn+QM4K/hv3UvjcaZwb1HDcR5pAM5NxslH8Gyn5uKkrzSFPM3ASYdQZNdm4iTdQhoYNRLn2oMS+2ogTgylxv860fmcO6WJymk+mTj5pgsA7X0YNGOmZ4vbPwMtnH2gczkNDDIWTtL6P9KbI5oTVNmYhTO5G6k8RldICEqtf6HjPM7imQOaPdTakYyzqBxIM72psrUx+XnTj7E42dNm1s5DoAGYzu+WkT1OXPBeAqD5tW09Tvx+9wUOLyNEAdEAxHU4cQvebkn55mWAYUg03/Eo1M2u/0nf2+sIO58+7cU2lTiXx/85sUs4/NEARBU4txxjY4wx5r1ogHlINDAox8n7j0lsyRNOAdEArEtx7gMa+NjPSgboKWw+n0C2CKwigMpNORwaGBTjbJHuPhAamBfifGHdvZwdODRwLsJJUEPsw6EZF7qCEW6QNBQaiItwNtgJGwrNrmjfifAzNgyaaWGQ00eP08ucZNJ1CycvwjkTRloFQPMdoBQIibTgT1OBss/fXnGmhKH6/mm+0+tXnA/KWBs9rdN2AafFOBHR5Sup6rbzIy3RCtIOZTiWLHppcWnaSamSM6fuYeRqFJ/mWi4bEj3mhUzT49K0LhUqaEYbc0KkyYbshRNXirpT2qC00DqXpCnEoebqCQVnwqaJaiT3hDju3AvNubaCQH0Gvqgwl6UpxtlRx8aG1gs2zcmivkOdbVV9gEX2Lk1TorPNpIavtDWb5mhXGz2RH5C7pDnYlnrb1CcsrGm2bJpP676Ctdz3lxaiK6NEEI/Y7XSqgwpNqeQ+pgur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eEycnFFSnoXoibqy7kuLmU2umW+DJO6nZI24ZjDe3ByT7UR0n0r0zbaHH+TE0Me0CO23lkhGSfTknBOeefYVUSigKAoCgKCjDIxQYdzH6cADABBB7EfBHxQKzrLoq31dT+OuvKCn8u3t42eT1Yzk5OcLwpOByR7CopO/8AA2qzbEt7MPMAXmSK4DmJcA+r2GB35OM4oNRq+hXmjTlJxG0fBWSORXVgeRyD8UVrQcUBn5/mgCfigk/SnQup9WXkCwMIbNhmS5YcIc4KjPdgfaiOhOk+jIdLsdPAiike0TbAxZiIVY5Zh7Mxz9RHOPbGKqJ8q7cUF1AUBQFAUBQWsobvQa+709ZVZEJjRuXCAZcc5Bz7H+aCLar0va31nBE+lwTmJ0eCCXCbmTuTnOFKgZABPOfmgX3VvhtFLI+64l/qV3I7BSjeUSMsX3YY7UXaoHGTUVDF8JNdmVltbvT7idRuMUc+WPG7gY/6cHJIyDxQq+w8Idc1B3iimieVHHKq/lNGcAOspAU5J+kc4B+2RUw6e8CXhDPrMglcthVQ42YP7gg+kg9xzxVKbOmdOw2ITyFSBFO7bCAFckY547D2xjFESBY0QAKoA74FBfQFAUBQFAUBQFAYB9qDzMSlw+Bke5FB4rAUbCsduTkd85OaCqwhTny0GVAyqjINB5tFKVRd4RV9wP8AGKDIEeSWPPwPig9Aq47D+KCtAUBQFAUBQFAUBQFAUBQFAUBQFAUBQFAUBQFB/9k=); +} + +.board .row .x, +.board .row .o { + cursor: default; + background-size: 100px 100px; + background-repeat: no-repeat; +} + + +.board .row::after { + content: " "; + clear: both; + display: table; +} + + +.board .row .tile:hover { + background-color: rgb(210, 210, 210); +} diff --git a/src/app/components/example-modules/tictactoe-module/tictactoe.ts b/src/app/components/example-modules/tictactoe-module/tictactoe.ts new file mode 100644 index 0000000..f40bc71 --- /dev/null +++ b/src/app/components/example-modules/tictactoe-module/tictactoe.ts @@ -0,0 +1,33 @@ +/// + +// Angular 2 +import {Component, View, coreDirectives} from 'angular2/angular2'; + +// Services +import {Game} from './services/game'; + +// Directives +import {Board} from './directives/board'; + +// View +let view = require('./views/tictactoe.html'); + +@Component({ + selector: 'tictactoe', + viewBindings: [ Game ] +}) +@View({ + directives: [ coreDirectives, Board ], + template: view +}) +export class Tictactoe { + constructor(public game: Game) { + + } + + reset() { + this.game.dispose(); + this.game = Game.create(); + } + +} diff --git a/src/app/components/example-modules/tictactoe-module/views/board.html b/src/app/components/example-modules/tictactoe-module/views/board.html new file mode 100644 index 0000000..5415481 --- /dev/null +++ b/src/app/components/example-modules/tictactoe-module/views/board.html @@ -0,0 +1,11 @@ +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/app/components/example-modules/tictactoe-module/views/tictactoe.html b/src/app/components/example-modules/tictactoe-module/views/tictactoe.html new file mode 100644 index 0000000..c72b80f --- /dev/null +++ b/src/app/components/example-modules/tictactoe-module/views/tictactoe.html @@ -0,0 +1,7 @@ +
+

Tic Tac Toe

+

{{ game.winner }} won!

+

draw

+ + +
diff --git a/src/app/components/home/home.ts b/src/app/components/home/home.ts new file mode 100644 index 0000000..4b62c3b --- /dev/null +++ b/src/app/components/home/home.ts @@ -0,0 +1,37 @@ +/// + +/* + * Angular 2 + * @Component: factory function + * @View: factory function + * @ViewEncapsulation: ENUM How the template and styles of a view should be encapsulated. + */ +import {Component, View, ViewEncapsulation} from 'angular2/angular2'; + +/* + * Directives + * @angularDirectives: Angular's core/form/router directives + * @appDirectives: Our collection of directives from /directives + */ +import {appDirectives, angularDirectives} from 'app/directives/directives'; + +// Webpack's `require` to get files +let styles = require('./styles/home.css'); +let template = require('./views/home.html'); + +// Simple external file component example +@Component({ + selector: 'home' +}) +@View({ + directives: [ angularDirectives, appDirectives ], + encapsulation: ViewEncapsulation.EMULATED, // EMULATED: Emulate scoping of styles by preprocessing the style rules and adding additional attributes to elements. + // include .html and .css file + styles: [ styles ], + template: template +}) +export class Home { + constructor() { + + } +} \ No newline at end of file diff --git a/src/app/components/home/styles/home.css b/src/app/components/home/styles/home.css new file mode 100644 index 0000000..a90d011 --- /dev/null +++ b/src/app/components/home/styles/home.css @@ -0,0 +1,3 @@ +.home { + background-color: #F8F8F8; +} diff --git a/src/app/components/home/test/home.spec.ts b/src/app/components/home/test/home.spec.ts new file mode 100644 index 0000000..5a4c50c --- /dev/null +++ b/src/app/components/home/test/home.spec.ts @@ -0,0 +1,27 @@ +/// +import {Component, View} from 'angular2/angular2'; +import {Home} from './home'; + +@Component({ + selector: 'test-cmp' +}) +@View({ + directives: [ Home ] +}) +class TestComponent { + +} + +describe('Home', () => { + var home; + + beforeEach(() => { + home = new Home(); + }); + + it('should work', () => { + expect(home).toBeDefined(); + }); + +}); + diff --git a/src/app/components/home/views/home.html b/src/app/components/home/views/home.html new file mode 100644 index 0000000..204288d --- /dev/null +++ b/src/app/components/home/views/home.html @@ -0,0 +1,3 @@ +
+

Home

+
diff --git a/src/app/directives/directives.ts b/src/app/directives/directives.ts new file mode 100644 index 0000000..c7887e2 --- /dev/null +++ b/src/app/directives/directives.ts @@ -0,0 +1,32 @@ +/// +/* + * Angular 2 + * @coreDirectives: collection of Angular core directives + * @formDirectives: list of all the form directives + * @routerDirectives: list of all the router directives + */ +import {coreDirectives, formDirectives} from 'angular2/angular2'; +import {routerDirectives} from 'angular2/router'; + +/* + * App + */ +/* TODO: Create Autofocus directive */ +//import {Autofocus} from './Autofocus'; + +// global App only directives +export var appDirectives: Array = [ + //Autofocus +]; + +// global Angular core and other Angular module directives (form/router) +export var angularDirectives: Array = [ + // Angular's core directives + coreDirectives, + + // Angular's form directives + formDirectives, + + // Angular's router + routerDirectives +]; diff --git a/src/app/directives/directives/auto-focus.ts b/src/app/directives/directives/auto-focus.ts new file mode 100644 index 0000000..358bbf4 --- /dev/null +++ b/src/app/directives/directives/auto-focus.ts @@ -0,0 +1,19 @@ +/// +/* + * Angular 2 + * @Directive: factory function + * @ElementRef: class, reference to the element + */ +import {Directive, ElementRef} from 'angular2/angular2'; +// Simple example directive that fixes autofocus problem with multiple views +@Directive({ + selector: '[autofocus]' // using [ ] means selecting attributes +}) +export class Autofocus { + constructor(public el: ElementRef) { + // autofocus fix for multiple views + if (this.el.nativeElement.focus) { + this.el.nativeElement.focus(); + } + } +} diff --git a/src/app/pipes/capitalize/capitalize-pipe.spec.ts b/src/app/pipes/capitalize/capitalize-pipe.spec.ts new file mode 100644 index 0000000..614443b --- /dev/null +++ b/src/app/pipes/capitalize/capitalize-pipe.spec.ts @@ -0,0 +1,138 @@ +/// +import {CapitalizePipe, CapitalizeFactory} from './Capitalize-Pipe'; + +describe('Capitalize', () => { + + describe('CapitalizePipe', () => { + var subject; + var result; + var pipe; + + beforeEach(() => { + pipe = new CapitalizePipe(); + }); + afterEach(() => { + expect(subject).toEqual(result); + }); + + describe('#support', () => { + + it('should support string', () => { + subject = pipe.supports('yolo'); + result = true; + }); + + it('should not support null', () => { + subject = pipe.supports(null); + result = false; + }); + + it('should not support NaN', () => { + subject = pipe.supports(NaN); + result = false; + }); + + it('should not support new Object()', () => { + subject = pipe.supports({}); + result = false; + }); + + it('should not support function(){}', () => { + subject = pipe.supports(function(){}); + result = false; + }); + + }); + + describe('#transform', () => { + it('should transform string to Capitalized versions', () => { + subject = pipe.transform('yolo'); + result = 'Yolo'; + }); + + it('should transform all strings to Capitalized versions', () => { + var str = 'what does the scouter say about its power level'; + + subject = pipe.transform(str, true); + result = 'What Does The Scouter Say About Its Power Level'; + }); + + }); + + + describe('#capitalizeWord', () => { + it('should capitalized a word', () => { + subject = CapitalizePipe.capitalizeWord('something'); + result = 'Something'; + }); + + it('should only capitalized first char', () => { + subject = CapitalizePipe.capitalizeWord('something something something'); + result = 'Something something something'; + }); + + }); + + + }); + + describe('CapitalizeFactory', () => { + var subject; + var result; + var factory; + + beforeEach(() => { + factory = new CapitalizeFactory(); + }); + + afterEach(() => { + expect(subject).toEqual(result); + }); + + it('should exist', () => { + subject = Boolean(factory); + result = true; + }); + + describe('#support', () => { + it('should support string', () => { + subject = factory.supports('yolo'); + result = true; + }); + + it('should not support null', () => { + subject = factory.supports(null); + result = false; + }); + + it('should not support NaN', () => { + subject = factory.supports(NaN); + result = false; + }); + + it('should not support new Object()', () => { + subject = factory.supports({}); + result = false; + }); + + it('should not support function(){}', () => { + subject = factory.supports(function(){}); + result = false; + }); + + + }); + + describe('#create', () => { + it('should be instance of CapitalizePipe', () => { + subject = factory.create() instanceof CapitalizePipe; + result = true; + }); + + }); + + + }); + + +}); diff --git a/src/app/pipes/capitalize/capitalize-pipe.ts b/src/app/pipes/capitalize/capitalize-pipe.ts new file mode 100644 index 0000000..2ee9eea --- /dev/null +++ b/src/app/pipes/capitalize/capitalize-pipe.ts @@ -0,0 +1,43 @@ +/// +import {Pipe, PipeFactory} from 'angular2/angular2'; + +// Check if the value is supported for the pipe +export function isString(txt): boolean { + return typeof txt === 'string'; +} + +// Simple example of a Pipe +export class CapitalizePipe implements Pipe { + regexp: RegExp = /([^\W_]+[^\s-]*) */g; + + supports(txt): boolean { + return isString(txt); + } + transform(value: string, args?: List): any { + return (!value) ? '' : + (!args) ? + CapitalizePipe.capitalizeWord(value) : + value.replace(this.regexp, CapitalizePipe.capitalizeWord); + } + static capitalizeWord(txt: string): string { + return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); + } + onDestroy(): void { + // not needed since this is stateless + } + +} + +// We create a factory since we create an instance for each binding for stateful pipes +export class CapitalizeFactory implements PipeFactory { + supports(txt): boolean { + return isString(txt); + } + create(cdRef): Pipe { + return new CapitalizePipe(); + } +} + +// Since templates in angular are async we are passing the value to +// NullPipeFactory if the value is not supported +export var capitalize = [ new CapitalizeFactory() ]; diff --git a/src/app/pipes/pipes.ts b/src/app/pipes/pipes.ts new file mode 100644 index 0000000..5b0abff --- /dev/null +++ b/src/app/pipes/pipes.ts @@ -0,0 +1,18 @@ +/// +/* + * Angular 2 + */ +import {Pipes} from 'angular2/change_detection'; + +/* + * App Pipes + */ +import {capitalize} from './Capitalize/Capitalize-Pipe'; +import {rxAsync} from './rx/rxpipe'; + +export var appPipes = [ + Pipes.extend({ + 'async': rxAsync, + 'capitalize': capitalize + }) +]; diff --git a/src/app/pipes/rx/rxpipe.ts b/src/app/pipes/rx/rxpipe.ts new file mode 100644 index 0000000..62c72ac --- /dev/null +++ b/src/app/pipes/rx/rxpipe.ts @@ -0,0 +1,38 @@ +/// + +import {Pipe, PipeFactory} from 'angular2/angular2'; +import {ObservablePipe} from 'angular2/pipes'; +import {async} from 'angular2/src/change_detection/change_detection'; +import * as Rx from 'rx'; + +export function isObservable(obs) { + return obs && typeof obs.subscribe === 'function'; +} + +//upgrade async pipe with Rx support +export class RxPipe extends ObservablePipe { + _subscription: any; + _observable: any; + constructor(ref) { super(ref); } + supports(obs) { return isObservable(obs); } + _subscribe(obs) { + this._observable = obs; + this._subscription = obs.subscribe( + value => this._updateLatestValue(value), + e => { throw e; } + ); + } + transform(value: any, args?: List): any { + return super.transform(value, args); + } + onDestroy(): void { + return super.onDestroy(); + } +} + +export class RxPipeFactory implements PipeFactory { + supports(obs) { return isObservable(obs); } + create(cdRef): Pipe { return new RxPipe(cdRef); } +} + +export var rxAsync = [ new RxPipeFactory() ].concat(async); diff --git a/src/app/services/services.ts b/src/app/services/services.ts new file mode 100644 index 0000000..0b72a65 --- /dev/null +++ b/src/app/services/services.ts @@ -0,0 +1,10 @@ +/// + +import {bind} from 'angular2/angular2'; + +import {githubInjectables} from '../components/example-modules/search-module/services/github'; + +// Include injectables that you want to have globally throughout our app +export var appServicesInjectables: Array = [ + githubInjectables, +]; \ No newline at end of file diff --git a/src/app/services/time.ts b/src/app/services/time.ts new file mode 100644 index 0000000..ff789c8 --- /dev/null +++ b/src/app/services/time.ts @@ -0,0 +1,5 @@ +import {moment} from 'moment/moment'; + +export function timeAgo(time) { + return moment(time * 1000).fromNow(); +} diff --git a/src/common/changeDetectionInjectables.ts b/src/common/changeDetectionInjectables.ts new file mode 100644 index 0000000..2e84e0d --- /dev/null +++ b/src/common/changeDetectionInjectables.ts @@ -0,0 +1,25 @@ +/// +import {bind} from 'angular2/angular2'; +import { + ChangeDetection, + DynamicChangeDetection, + JitChangeDetection, + PreGeneratedChangeDetection +} from 'angular2/change_detection'; + +export var jitInjectables = [ + bind(ChangeDetection).toClass(JitChangeDetection) +]; + +export var dynamicInjectables = [ + bind(ChangeDetection).toClass(DynamicChangeDetection) +]; + +export var preGeneratedInjectables = [ + bind(ChangeDetection).toClass(PreGeneratedChangeDetection) +]; + +export var bestChangeDetectionInjectables = [ + PreGeneratedChangeDetection.isSupported() ? preGeneratedInjectables : + JitChangeDetection.isSupported() ? jitInjectables : dynamicInjectables +]; diff --git a/src/common/locationInjectables.ts b/src/common/locationInjectables.ts new file mode 100644 index 0000000..fc71da4 --- /dev/null +++ b/src/common/locationInjectables.ts @@ -0,0 +1,15 @@ +/// +import {bind} from 'angular2/angular2'; +import { + LocationStrategy, + HashLocationStrategy, + HTML5LocationStrategy +} from 'angular2/router'; + +export var html5locationInjectables = [ + bind(LocationStrategy).toClass(HTML5LocationStrategy) +]; + +export var hashlocationInjectables = [ + bind(LocationStrategy).toClass(HashLocationStrategy) +]; diff --git a/src/public/angular-shield.png b/src/public/angular-shield.png new file mode 100644 index 0000000..9838bd7 Binary files /dev/null and b/src/public/angular-shield.png differ diff --git a/src/public/angularjs-logo_patrick.png b/src/public/angularjs-logo_patrick.png new file mode 100644 index 0000000..90f9b3a Binary files /dev/null and b/src/public/angularjs-logo_patrick.png differ diff --git a/src/public/css/angular2_material.css b/src/public/css/angular2_material.css new file mode 100644 index 0000000..56d65e0 --- /dev/null +++ b/src/public/css/angular2_material.css @@ -0,0 +1,1122 @@ +.md-shadow-bottom-z-1, [md-button].md-raised:not([disabled]), [md-button].md-fab { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); } + +.md-shadow-bottom-z-2, [md-button].md-raised:not([disabled]):focus, [md-button].md-raised:not([disabled]):hover, [md-button].md-fab:not([disabled]):focus, [md-button].md-fab:not([disabled]):hover { + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4); } + +.md-shadow-bottom-z-1, [md-button].md-raised:not([disabled]), [md-button].md-fab { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); } + +.md-shadow-bottom-z-2, [md-button].md-raised:not([disabled]):focus, [md-button].md-raised:not([disabled]):hover, [md-button].md-fab:not([disabled]):focus, [md-button].md-fab:not([disabled]):hover { + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4); } + +/** + * Mixin to create distinct classes for fab positions, e.g. ".md-fab-bottom-right". + */ +[md-button] { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + position: relative; + outline: none; + border: 0; + padding: 6px; + margin: 0; + background: transparent; + white-space: nowrap; + text-align: center; + font-weight: 500; + font-style: inherit; + font-variant: inherit; + font-size: inherit; + font-family: inherit; + line-height: inherit; + text-decoration: none; + cursor: pointer; + overflow: hidden; + -webkit-transition: box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), -webkit-transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); + transition: box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); } + [md-button]:focus { + outline: none; } + [md-button]:hover { + text-decoration: none; } + [md-button].md-cornered { + border-radius: 0; } + [md-button].md-icon { + padding: 0; + background: none; } + [md-button].md-raised { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); } + [md-button].md-fab { + z-index: 20; + width: 56px; + height: 56px; + border-radius: 50%; + overflow: hidden; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transition: 0.2s linear; + transition: 0.2s linear; + -webkit-transition-property: -webkit-transform, box-shadow; + transition-property: transform, box-shadow; } + [md-button].md-fab.md-fab-bottom-right { + top: auto; + right: 20px; + bottom: 20px; + left: auto; + position: absolute; } + [md-button].md-fab.md-fab-bottom-left { + top: auto; + right: auto; + bottom: 20px; + left: 20px; + position: absolute; } + [md-button].md-fab.md-fab-top-right { + top: 20px; + right: 20px; + bottom: auto; + left: auto; + position: absolute; } + [md-button].md-fab.md-fab-top-left { + top: 20px; + right: auto; + bottom: auto; + left: 20px; + position: absolute; } + [md-button].md-fab md-icon { + line-height: 56px; + margin-top: 0; } + [md-button].md-fab.md-mini { + width: 40px; + height: 40px; } + [md-button].md-fab.md-mini md-icon { + line-height: 40px; } + [md-button]:not([disabled]).md-raised:focus, [md-button]:not([disabled]).md-raised:hover, [md-button]:not([disabled]).md-fab:focus, [md-button]:not([disabled]).md-fab:hover { + -webkit-transform: translate3d(0, -1px, 0); + transform: translate3d(0, -1px, 0); } + +.md-toast-open-top [md-button].md-fab-top-left, .md-toast-open-top [md-button].md-fab-top-right { + -webkit-transform: translate3d(0, 42px, 0); + transform: translate3d(0, 42px, 0); } + .md-toast-open-top [md-button].md-fab-top-left:not([disabled]):focus, .md-toast-open-top [md-button].md-fab-top-left:not([disabled]):hover, .md-toast-open-top [md-button].md-fab-top-right:not([disabled]):focus, .md-toast-open-top [md-button].md-fab-top-right:not([disabled]):hover { + -webkit-transform: translate3d(0, 41px, 0); + transform: translate3d(0, 41px, 0); } + +.md-toast-open-bottom [md-button].md-fab-bottom-left, .md-toast-open-bottom [md-button].md-fab-bottom-right { + -webkit-transform: translate3d(0, -42px, 0); + transform: translate3d(0, -42px, 0); } + .md-toast-open-bottom [md-button].md-fab-bottom-left:not([disabled]):focus, .md-toast-open-bottom [md-button].md-fab-bottom-left:not([disabled]):hover, .md-toast-open-bottom [md-button].md-fab-bottom-right:not([disabled]):focus, .md-toast-open-bottom [md-button].md-fab-bottom-right:not([disabled]):hover { + -webkit-transform: translate3d(0, -43px, 0); + transform: translate3d(0, -43px, 0); } + +.md-button-group { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + width: 100%; } + +.md-button-group > [md-button] { + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; + display: block; + overflow: hidden; + width: 0; + border-width: 1px 0 1px 1px; + border-radius: 0; + text-align: center; + text-overflow: ellipsis; + white-space: nowrap; } + .md-button-group > [md-button]:first-child { + border-radius: 2px 0 0 2px; } + .md-button-group > [md-button]:last-child { + border-right-width: 1px; + border-radius: 0 2px 2px 0; } + +md-toolbar [md-button].md-fab { + background-color: white; } + +[md-button] { + border-radius: 3px; } + [md-button].md-primary { + color: #3f51b5; } + [md-button].md-primary.md-fab, [md-button].md-primary.md-raised { + color: rgba(255, 255, 255, 0.870588); + background-color: #3f51b5; } + [md-button].md-accent { + color: #ff5252; } + [md-button].md-accent.md-fab, [md-button].md-accent.md-raised { + color: white; + background-color: #ff5252; } + [md-button].md-warn { + color: #f44336; } + [md-button].md-warn.md-fab, [md-button].md-warn.md-raised { + color: white; + background-color: #f44336; } + [md-button].md-fab { + border-radius: 50%; + background-color: #ff5252; + color: white; } + [md-button].md-raised { + color: rgba(0, 0, 0, 0.870588); + background-color: #fafafa; } + +[md-button]:not([disabled]):focus, [md-button]:not([disabled]):hover { + background-color: rgba(158, 158, 158, 0.2); } +[md-button]:not([disabled]).md-primary.md-fab:hover, [md-button]:not([disabled]).md-primary.md-fab:focus, [md-button]:not([disabled]).md-primary.md-raised:hover, [md-button]:not([disabled]).md-primary.md-raised:focus { + background-color: #3949ab; } +[md-button]:not([disabled]).md-accent.md-fab:hover, [md-button]:not([disabled]).md-accent.md-fab:focus, [md-button]:not([disabled]).md-accent.md-raised:hover, [md-button]:not([disabled]).md-accent.md-raised:focus { + background-color: #d32f2f; } +[md-button]:not([disabled]).md-warn.md-fab:hover, [md-button]:not([disabled]).md-warn.md-fab:focus, [md-button]:not([disabled]).md-warn.md-raised:hover, [md-button]:not([disabled]).md-warn.md-raised:focus { + background-color: #d32f2f; } +[md-button]:not([disabled]).md-fab:hover, [md-button]:not([disabled]).md-fab:focus { + background-color: #d50000; } +[md-button]:not([disabled]).md-raised:hover, [md-button]:not([disabled]).md-raised:focus { + background-color: #eeeeee; } + +[md-button][disabled], [md-button][disabled].md-fab, [md-button][disabled].md-raised { + color: rgba(0, 0, 0, 0.26); + background-color: transparent; + cursor: not-allowed; } + +.md-shadow-bottom-z-1, [md-button].md-raised:not([disabled]), [md-button].md-fab { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); } + +.md-shadow-bottom-z-2, [md-button].md-raised:not([disabled]):focus, [md-button].md-raised:not([disabled]):hover, [md-button].md-fab:not([disabled]):focus, [md-button].md-fab:not([disabled]):hover { + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4); } + +md-checkbox { + box-sizing: border-box; + display: block; + margin: 15px; + white-space: nowrap; + cursor: pointer; + outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + md-checkbox *, md-checkbox *:after { + box-sizing: border-box; } + md-checkbox[aria-checked="true"] .md-checkbox-icon { + border: none; } + md-checkbox[disabled] { + cursor: no-drop; } + md-checkbox:focus .md-checkbox-label:not(:empty) { + border-color: black; } + md-checkbox[aria-checked="true"] .md-checkbox-icon:after { + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + position: absolute; + left: 6px; + top: 2px; + display: table; + width: 6px; + height: 12px; + border: 2px solid; + border-top: 0; + border-left: 0; + content: ' '; } + +.md-checkbox-container { + position: relative; + top: 4px; + display: inline-block; + width: 18px; + height: 18px; } + .md-checkbox-container:after { + content: ''; + position: absolute; + top: -10px; + right: -10px; + bottom: -10px; + left: -10px; } + .md-checkbox-container .md-ripple-container { + position: absolute; + display: block; + width: auto; + height: auto; + left: -15px; + top: -15px; + right: -15px; + bottom: -15px; } + +.md-checkbox-icon { + -webkit-transition: 240ms; + transition: 240ms; + position: absolute; + top: 0; + left: 0; + width: 18px; + height: 18px; + border: 2px solid; + border-radius: 2px; } + +.md-checkbox-label { + border: 1px dotted transparent; + position: relative; + display: inline-block; + margin-left: 10px; + vertical-align: middle; + white-space: normal; + pointer-events: none; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; } + +md-checkbox .md-ripple { + color: #e53935; } +md-checkbox[aria-checked="true"] .md-ripple { + color: #757575; } +md-checkbox .md-checkbox-icon { + border-color: rgba(0, 0, 0, 0.54); } +md-checkbox[aria-checked="true"] .md-checkbox-icon { + background-color: rgba(255, 82, 82, 0.87); } +md-checkbox[aria-checked="true"] .md-checkbox-icon:after { + border-color: #eeeeee; } +md-checkbox:not([disabled]).md-primary .md-ripple { + color: #3949ab; } +md-checkbox:not([disabled]).md-primary[aria-checked="true"] .md-ripple { + color: #757575; } +md-checkbox:not([disabled]).md-primary .md-checkbox-icon { + border-color: rgba(0, 0, 0, 0.54); } +md-checkbox:not([disabled]).md-primary[aria-checked="true"] .md-checkbox-icon { + background-color: rgba(63, 81, 181, 0.87); } +md-checkbox:not([disabled]).md-primary[aria-checked="true"] .md-checkbox-icon:after { + border-color: #eeeeee; } +md-checkbox:not([disabled]).md-warn .md-ripple { + color: #e53935; } +md-checkbox:not([disabled]).md-warn .md-checkbox-icon { + border-color: rgba(0, 0, 0, 0.54); } +md-checkbox:not([disabled]).md-warn[aria-checked="true"] .md-checkbox-icon { + background-color: rgba(244, 67, 54, 0.87); } +md-checkbox:not([disabled]).md-warn[aria-checked="true"] .md-checkbox-icon:after { + border-color: #eeeeee; } +md-checkbox[disabled] .md-checkbox-icon { + border-color: rgba(0, 0, 0, 0.26); } +md-checkbox[disabled][aria-checked="true"] .md-checkbox-icon { + background-color: rgba(0, 0, 0, 0.26); } + +md-grid-list { + display: block; + position: relative; } + +md-grid-tile { + display: block; + position: absolute; } + md-grid-tile figure { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: absolute; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: 0; + margin: 0; } + md-grid-tile md-grid-tile-header, md-grid-tile md-grid-tile-footer { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + height: 48px; + color: #fff; + background: rgba(0, 0, 0, 0.18); + overflow: hidden; + position: absolute; + left: 0; + right: 0; } + md-grid-tile md-grid-tile-header h3, md-grid-tile md-grid-tile-header h4, md-grid-tile md-grid-tile-footer h3, md-grid-tile md-grid-tile-footer h4 { + font-weight: 400; + margin: 0 0 0 16px; } + md-grid-tile md-grid-tile-header h3, md-grid-tile md-grid-tile-footer h3 { + font-size: 14px; } + md-grid-tile md-grid-tile-header h4, md-grid-tile md-grid-tile-footer h4 { + font-size: 12px; } + md-grid-tile md-grid-tile-header { + top: 0; } + md-grid-tile md-grid-tile-footer { + bottom: 0; } + +md-input-container { + box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + position: relative; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + overflow-x: hidden; + padding: 2px; + padding-bottom: 26px; + /* + * The .md-input class is added to the input/textarea + */ } + md-input-container > md-icon { + position: absolute; + top: 5px; + left: 2px; } + md-input-container > md-icon + input { + margin-left: 56px; } + md-input-container textarea, md-input-container input[type="text"], md-input-container input[type="password"], md-input-container input[type="datetime"], md-input-container input[type="datetime-local"], md-input-container input[type="date"], md-input-container input[type="month"], md-input-container input[type="time"], md-input-container input[type="week"], md-input-container input[type="number"], md-input-container input[type="email"], md-input-container input[type="url"], md-input-container input[type="search"], md-input-container input[type="tel"], md-input-container input[type="color"] { + -moz-appearance: none; + -webkit-appearance: none; + appearance: none; } + md-input-container textarea { + resize: none; + overflow: hidden; } + md-input-container textarea.md-input { + min-height: 56px; + -ms-flex-preferred-size: auto; } + md-input-container label:not(.md-no-float), md-input-container .md-placeholder:not(.md-select-label) { + -webkit-box-ordinal-group: 2; + -webkit-order: 1; + -ms-flex-order: 1; + order: 1; + pointer-events: none; + -webkit-font-smoothing: antialiased; + padding-left: 2px; + z-index: 1; + -webkit-transform: translate3d(0, 24px, 0) scale(1); + transform: translate3d(0, 24px, 0) scale(1); + -webkit-transform-origin: left top; + -ms-transform-origin: left top; + transform-origin: left top; + -webkit-transition: -webkit-transform cubic-bezier(0.25, 0.8, 0.25, 1) 0.25s; + transition: transform cubic-bezier(0.25, 0.8, 0.25, 1) 0.25s; } + md-input-container .md-placeholder:not(.md-select-label) { + position: absolute; + top: 0; + opacity: 0; + -webkit-transition-property: opacity, -webkit-transform; + transition-property: opacity, transform; + -webkit-transform: translate3d(0, 30px, 0); + transform: translate3d(0, 30px, 0); } + md-input-container.md-input-focused .md-placeholder { + opacity: 1; + -webkit-transform: translate3d(0, 24px, 0); + transform: translate3d(0, 24px, 0); } + md-input-container.md-input-has-value .md-placeholder { + -webkit-transition: none; + transition: none; + opacity: 0; } + md-input-container:not(.md-input-has-value) input:not(:focus) { + color: transparent; } + md-input-container .md-input { + -webkit-box-flex: 1; + -webkit-flex: 1 1 auto; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + -webkit-box-ordinal-group: 3; + -webkit-order: 2; + -ms-flex-order: 2; + order: 2; + display: block; + background: none; + padding: 2px 2px 1px; + border-width: 0 0 1px 0; + line-height: 26px; + -ms-flex-preferred-size: 26px; + border-radius: 0; } + md-input-container .md-input:focus { + outline: none; } + md-input-container .md-input:invalid { + outline: none; + box-shadow: none; } + md-input-container .md-char-counter { + -webkit-font-smoothing: antialiased; + position: absolute; + font-size: 12px; + line-height: 24px; + bottom: 2px; + right: 2px; } + md-input-container.md-input-focused label:not(.md-no-float), md-input-container.md-input-has-value label:not(.md-no-float) { + -webkit-transform: translate3d(0, 4px, 0) scale(0.75); + transform: translate3d(0, 4px, 0) scale(0.75); } + md-input-container.md-input-focused .md-input { + padding-bottom: 0; + border-width: 0 0 2px 0; } + md-input-container .md-input[disabled], [disabled] md-input-container .md-input { + background-position: 0 bottom; + background-size: 3px 1px; + background-repeat: repeat-x; } + +md-input-container .md-input { + color: rgba(0, 0, 0, 0.87); + border-color: rgba(0, 0, 0, 0.12); } + md-input-container .md-input::-webkit-input-placeholder, md-input-container .md-input::-moz-placeholder, md-input-container .md-input:-moz-placeholder, md-input-container .md-input:-ms-input-placeholder { + color: rgba(0, 0, 0, 0.26); } +md-input-container > md-icon { + color: rgba(0, 0, 0, 0.87); } +md-input-container label, md-input-container .md-placeholder { + color: rgba(0, 0, 0, 0.26); } +md-input-container div[ng-messages] { + color: #f44336; } +md-input-container:not(.md-input-invalid).md-input-has-value label { + color: rgba(0, 0, 0, 0.54); } +md-input-container:not(.md-input-invalid).md-input-focused .md-input { + border-color: #3f51b5; } +md-input-container:not(.md-input-invalid).md-input-focused label { + color: #3f51b5; } +md-input-container:not(.md-input-invalid).md-input-focused md-icon { + color: #3f51b5; } +md-input-container:not(.md-input-invalid).md-input-focused.md-accent .md-input { + border-color: #f44336; } +md-input-container:not(.md-input-invalid).md-input-focused.md-accent label { + color: #f44336; } +md-input-container:not(.md-input-invalid).md-input-focused.md-warn .md-input { + border-color: #f44336; } +md-input-container:not(.md-input-invalid).md-input-focused.md-warn label { + color: #f44336; } +md-input-container.md-input-invalid .md-input { + border-color: #f44336; } +md-input-container.md-input-invalid label { + color: #f44336; } +md-input-container.md-input-invalid .md-char-counter { + color: #f44336; } +md-input-container .md-input[disabled], [disabled] md-input-container .md-input { + border-bottom-color: transparent; + color: rgba(0, 0, 0, 0.26); + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.12) 33%, transparent 0%); + background-image: linear-gradient(to right, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.12) 33%, transparent 0%); + background-image: -ms-linear-gradient(left, transparent 0%, rgba(0, 0, 0, 0.12) 100%); } + +md-progress-linear { + display: block; + width: 100%; + height: 5px; } + md-progress-linear *, md-progress-linear *:before { + box-sizing: border-box; } + md-progress-linear .md-progress-linear-container { + overflow: hidden; + position: relative; + height: 5px; + top: 5px; + -webkit-transform: translate(0, 5px) scale(1, 0); + -ms-transform: translate(0, 5px) scale(1, 0); + transform: translate(0, 5px) scale(1, 0); + -webkit-transition: all .3s linear; + transition: all .3s linear; } + md-progress-linear .md-progress-linear-container.md-ready { + -webkit-transform: translate(0, 0) scale(1, 1); + -ms-transform: translate(0, 0) scale(1, 1); + transform: translate(0, 0) scale(1, 1); } + md-progress-linear .md-progress-linear-bar { + height: 5px; + position: absolute; + width: 100%; } + md-progress-linear .md-progress-linear-bar1, md-progress-linear .md-progress-linear-bar2 { + -webkit-transition: all 0.2s linear; + transition: all 0.2s linear; } + md-progress-linear[md-mode="determinate"] .md-progress-linear-bar1 { + display: none; } + md-progress-linear[md-mode="indeterminate"] .md-progress-linear-bar1 { + -webkit-animation: indeterminate1 4s infinite linear; + animation: indeterminate1 4s infinite linear; } + md-progress-linear[md-mode="indeterminate"] .md-progress-linear-bar2 { + -webkit-animation: indeterminate2 4s infinite linear; + animation: indeterminate2 4s infinite linear; } + md-progress-linear[md-mode="buffer"] .md-progress-linear-container { + background-color: transparent !important; } + md-progress-linear[md-mode="buffer"] .md-progress-linear-dashed:before { + content: ""; + display: block; + height: 5px; + width: 100%; + margin-top: 0px; + position: absolute; + background-color: transparent; + background-size: 10px 10px !important; + background-position: 0px -23px; + -webkit-animation: buffer 3s infinite linear; + animation: buffer 3s infinite linear; } + md-progress-linear[md-mode="query"] .md-progress-linear-bar2 { + -webkit-animation: query .8s infinite cubic-bezier(0.39, 0.575, 0.565, 1); + animation: query .8s infinite cubic-bezier(0.39, 0.575, 0.565, 1); } + +@-webkit-keyframes indeterminate1 { + 0% { + -webkit-transform: translateX(-25%) scale(.5, 1); + transform: translateX(-25%) scale(.5, 1); } + + 10% { + -webkit-transform: translateX(25%) scale(.5, 1); + transform: translateX(25%) scale(.5, 1); } + + 19.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 20% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 30% { + -webkit-transform: translateX(37.5%) scale(.25, 1); + transform: translateX(37.5%) scale(.25, 1); } + + 34.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 36.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 37% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 47% { + -webkit-transform: translateX(20%) scale(.25, 1); + transform: translateX(20%) scale(.25, 1); } + + 52% { + -webkit-transform: translateX(35%) scale(.05, 1); + transform: translateX(35%) scale(.05, 1); } + + 55% { + -webkit-transform: translateX(35%) scale(.1, 1); + transform: translateX(35%) scale(.1, 1); } + + 58% { + -webkit-transform: translateX(50%) scale(.1, 1); + transform: translateX(50%) scale(.1, 1); } + + 61.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 69.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 70% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 80% { + -webkit-transform: translateX(20%) scale(.25, 1); + transform: translateX(20%) scale(.25, 1); } + + 85% { + -webkit-transform: translateX(35%) scale(.05, 1); + transform: translateX(35%) scale(.05, 1); } + + 88% { + -webkit-transform: translateX(35%) scale(.1, 1); + transform: translateX(35%) scale(.1, 1); } + + 91% { + -webkit-transform: translateX(50%) scale(.1, 1); + transform: translateX(50%) scale(.1, 1); } + + 92.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 93% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 100% { + -webkit-transform: translateX(-25%) scale(.5, 1); + transform: translateX(-25%) scale(.5, 1); } } + +@keyframes indeterminate1 { + 0% { + -webkit-transform: translateX(-25%) scale(.5, 1); + transform: translateX(-25%) scale(.5, 1); } + + 10% { + -webkit-transform: translateX(25%) scale(.5, 1); + transform: translateX(25%) scale(.5, 1); } + + 19.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 20% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 30% { + -webkit-transform: translateX(37.5%) scale(.25, 1); + transform: translateX(37.5%) scale(.25, 1); } + + 34.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 36.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 37% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 47% { + -webkit-transform: translateX(20%) scale(.25, 1); + transform: translateX(20%) scale(.25, 1); } + + 52% { + -webkit-transform: translateX(35%) scale(.05, 1); + transform: translateX(35%) scale(.05, 1); } + + 55% { + -webkit-transform: translateX(35%) scale(.1, 1); + transform: translateX(35%) scale(.1, 1); } + + 58% { + -webkit-transform: translateX(50%) scale(.1, 1); + transform: translateX(50%) scale(.1, 1); } + + 61.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 69.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 70% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 80% { + -webkit-transform: translateX(20%) scale(.25, 1); + transform: translateX(20%) scale(.25, 1); } + + 85% { + -webkit-transform: translateX(35%) scale(.05, 1); + transform: translateX(35%) scale(.05, 1); } + + 88% { + -webkit-transform: translateX(35%) scale(.1, 1); + transform: translateX(35%) scale(.1, 1); } + + 91% { + -webkit-transform: translateX(50%) scale(.1, 1); + transform: translateX(50%) scale(.1, 1); } + + 92.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 93% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 100% { + -webkit-transform: translateX(-25%) scale(.5, 1); + transform: translateX(-25%) scale(.5, 1); } } + +@-webkit-keyframes indeterminate2 { + 0% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 25.99% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 28% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 38% { + -webkit-transform: translateX(37.5%) scale(.25, 1); + transform: translateX(37.5%) scale(.25, 1); } + + 42.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 46.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 49.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 50% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 60% { + -webkit-transform: translateX(-25%) scale(.5, 1); + transform: translateX(-25%) scale(.5, 1); } + + 70% { + -webkit-transform: translateX(25%) scale(.5, 1); + transform: translateX(25%) scale(.5, 1); } + + 79.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } } + +@keyframes indeterminate2 { + 0% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 25.99% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 28% { + -webkit-transform: translateX(-37.5%) scale(.25, 1); + transform: translateX(-37.5%) scale(.25, 1); } + + 38% { + -webkit-transform: translateX(37.5%) scale(.25, 1); + transform: translateX(37.5%) scale(.25, 1); } + + 42.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 46.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 49.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } + + 50% { + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } + + 60% { + -webkit-transform: translateX(-25%) scale(.5, 1); + transform: translateX(-25%) scale(.5, 1); } + + 70% { + -webkit-transform: translateX(25%) scale(.5, 1); + transform: translateX(25%) scale(.5, 1); } + + 79.99% { + -webkit-transform: translateX(50%) scale(0, 1); + transform: translateX(50%) scale(0, 1); } } + +@-webkit-keyframes query { + 0% { + opacity: 1; + -webkit-transform: translateX(35%) scale(.3, 1); + transform: translateX(35%) scale(.3, 1); } + + 100% { + opacity: 0; + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } } + +@keyframes query { + 0% { + opacity: 1; + -webkit-transform: translateX(35%) scale(.3, 1); + transform: translateX(35%) scale(.3, 1); } + + 100% { + opacity: 0; + -webkit-transform: translateX(-50%) scale(0, 1); + transform: translateX(-50%) scale(0, 1); } } + +@-webkit-keyframes buffer { + 0% { + opacity: 1; + background-position: 0px -23px; } + + 50% { + opacity: 0; } + + 100% { + opacity: 1; + background-position: -200px -23px; } } + +@keyframes buffer { + 0% { + opacity: 1; + background-position: 0px -23px; } + + 50% { + opacity: 0; } + + 100% { + opacity: 1; + background-position: -200px -23px; } } + +md-progress-linear .md-progress-linear-container { + background-color: #c5cae9; } +md-progress-linear .md-progress-linear-bar { + background-color: #3f51b5; } +md-progress-linear.md-warn .md-progress-linear-container { + background-color: #ffcdd2; } +md-progress-linear.md-warn .md-progress-linear-bar { + background-color: #f44336; } +md-progress-linear.md-accent .md-progress-linear-container { + background-color: #ffcdd2; } +md-progress-linear.md-accent .md-progress-linear-bar { + background-color: #ff5252; } +md-progress-linear[md-mode=buffer].md-primary .md-progress-linear-bar1 { + background-color: #c5cae9; } +md-progress-linear[md-mode=buffer].md-primary .md-progress-linear-dashed:before { + background: -webkit-radial-gradient(#c5cae9 0%, #c5cae9 16%, transparent 42%); + background: radial-gradient(#c5cae9 0%, #c5cae9 16%, transparent 42%); } +md-progress-linear[md-mode=buffer].md-warn .md-progress-linear-bar1 { + background-color: #ffcdd2; } +md-progress-linear[md-mode=buffer].md-warn .md-progress-linear-dashed:before { + background: -webkit-radial-gradient(#ffcdd2 0%, #ffcdd2 16%, transparent 42%); + background: radial-gradient(#ffcdd2 0%, #ffcdd2 16%, transparent 42%); } +md-progress-linear[md-mode=buffer].md-accent .md-progress-linear-bar1 { + background-color: #ffcdd2; } +md-progress-linear[md-mode=buffer].md-accent .md-progress-linear-dashed:before { + background: -webkit-radial-gradient(#ffcdd2 0%, #ffcdd2 16%, transparent 42%); + background: radial-gradient(#ffcdd2 0%, #ffcdd2 16%, transparent 42%); } + +.md-shadow-bottom-z-1, [md-button].md-raised:not([disabled]), [md-button].md-fab { + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); } + +.md-shadow-bottom-z-2, [md-button].md-raised:not([disabled]):focus, [md-button].md-raised:not([disabled]):hover, [md-button].md-fab:not([disabled]):focus, [md-button].md-fab:not([disabled]):hover { + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4); } + +md-radio-button { + display: block; + margin: 15px; + white-space: nowrap; + cursor: pointer; } + +md-radio-group { + border: 1px dotted transparent; + display: block; + outline: none; } + +.md-radio-container { + box-sizing: border-box; + position: relative; + top: 4px; + display: inline-block; + width: 16px; + height: 16px; + cursor: pointer; } + +.md-radio-off { + box-sizing: border-box; + position: absolute; + top: 0; + left: 0; + width: 16px; + height: 16px; + border: solid 2px; + border-radius: 50%; + -webkit-transition: border-color ease 0.28s; + transition: border-color ease 0.28s; } + +.md-radio-on { + box-sizing: border-box; + position: absolute; + top: 0; + left: 0; + width: 16px; + height: 16px; + border-radius: 50%; + -webkit-transition: -webkit-transform ease 0.28s; + transition: transform ease 0.28s; + -webkit-transform: scale(0); + -ms-transform: scale(0); + transform: scale(0); } + .md-radio-checked .md-radio-on { + -webkit-transform: scale(0.55); + -ms-transform: scale(0.55); + transform: scale(0.55); } + +.md-radio-label { + position: relative; + display: inline-block; + margin-left: 10px; + margin-right: 10px; + vertical-align: middle; + white-space: normal; + width: auto; } + +.md-radio-off { + border-color: rgba(0, 0, 0, 0.54); } + +.md-radio-on { + background-color: rgba(255, 82, 82, 0.87); } + +.md-radio-checked .md-radio-off { + border-color: rgba(255, 82, 82, 0.87); } + +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-primary .md-radio-on { + background-color: rgba(63, 81, 181, 0.87); } +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-primary.md-radio-checked .md-radio-off { + border-color: rgba(63, 81, 181, 0.87); } +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-primary.md-radio-checked .md-ink-ripple { + color: rgba(63, 81, 181, 0.87); } +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-primary .md-radio-container .md-ripple { + color: #3949ab; } +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-warn .md-radio-on { + background-color: rgba(244, 67, 54, 0.87); } +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-warn.md-radio-checked .md-radio-off { + border-color: rgba(244, 67, 54, 0.87); } +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-warn.md-radio-checked .md-ink-ripple { + color: rgba(244, 67, 54, 0.87); } +p md-radio-group:not([disabled]) md-radio:not([disabled]).md-warn .md-radio-container .md-ripple { + color: #e53935; } + +md-radio-button[disabled] .md-radio-container .md-radio-off, md-radio-button[disabled] .md-radio-container .md-radio-on, md-radio-group[disabled] md-radio-button .md-radio-container .md-radio-off, md-radio-group[disabled] md-radio-button .md-radio-container .md-radio-on { + border-color: rgba(0, 0, 0, 0.26); } + +md-radio-group { + border: 1px dotted transparent; + display: block; + outline: none; } + +md-switch { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -webkit-align-items: center; + -ms-flex-align: center; + align-items: center; + margin: 15px; + white-space: nowrap; + cursor: pointer; + outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + md-switch * { + box-sizing: border-box; } + md-switch .md-switch-container { + cursor: -webkit-grab; + cursor: grab; + width: 36px; + height: 24px; + position: relative; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + margin-right: 8px; } + md-switch:not([disabled]) .md-switch-dragging, md-switch:not([disabled]).md-switch-dragging .md-switch-container { + cursor: -webkit-grabbing; + cursor: grabbing; } + md-switch .md-switch-label { + border: 0 transparent; } + md-switch .md-switch-bar { + left: 1px; + width: 34px; + top: 5px; + height: 14px; + border-radius: 8px; + position: absolute; } + md-switch .md-switch-thumb-container { + top: 2px; + left: 0; + width: 16px; + position: absolute; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + z-index: 1; } + md-switch[aria-checked="true"] .md-switch-thumb-container { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); } + md-switch .md-switch-thumb { + position: absolute; + margin: 0; + left: 0; + top: 0; + outline: none; + height: 20px; + width: 20px; + border-radius: 50%; + box-shadow: 0px 2px 5px 0 rgba(0, 0, 0, 0.26); } + md-switch .md-switch-thumb .md-ripple-container { + position: absolute; + display: block; + width: auto; + height: auto; + left: -20px; + top: -20px; + right: -20px; + bottom: -20px; } + md-switch:not(.md-switch-dragging) .md-switch-bar, md-switch:not(.md-switch-dragging) .md-switch-thumb-container, md-switch:not(.md-switch-dragging) .md-switch-thumb { + -webkit-transition: all 0.5s cubic-bezier(0.35, 0, 0.25, 1); + transition: all 0.5s cubic-bezier(0.35, 0, 0.25, 1); + -webkit-transition-property: -webkit-transform, background-color; + transition-property: transform, background-color; } + md-switch:not(.md-switch-dragging) .md-switch-bar, md-switch:not(.md-switch-dragging) .md-switch-thumb { + -webkit-transition-delay: 0.05s; + transition-delay: 0.05s; } + +@media screen and (-ms-high-contrast: active) { + md-switch .md-switch-bar { + background-color: #666; } + md-switch[aria-checked="true"] .md-switch-bar { + background-color: #9E9E9E; } + md-switch.md-default-theme .md-switch-thumb { + background-color: #fff; } } + +md-switch .md-switch-thumb { + background-color: #fafafa; } +md-switch .md-switch-bar { + background-color: #9e9e9e; } +md-switch[aria-checked="true"] .md-switch-thumb { + background-color: #ff5252; } +md-switch[aria-checked="true"] .md-switch-bar { + background-color: rgba(255, 82, 82, 0.5); } +md-switch[aria-checked="true"].md-primary .md-switch-thumb { + background-color: #3f51b5; } +md-switch[aria-checked="true"].md-primary .md-switch-bar { + background-color: rgba(63, 81, 181, 0.5); } +md-switch[aria-checked="true"].md-warn .md-switch-thumb { + background-color: #f44336; } +md-switch[aria-checked="true"].md-warn .md-switch-bar { + background-color: rgba(244, 67, 54, 0.5); } +md-switch[disabled] .md-switch-thumb { + background-color: #bdbdbd; } +md-switch[disabled] .md-switch-bar { + background-color: rgba(0, 0, 0, 0.12); } +md-switch:focus .md-switch-label:not(:empty) { + border: 1px dotted rgba(0, 0, 0, 0.87); } diff --git a/src/public/img/memory_game/8-ball.png b/src/public/img/memory_game/8-ball.png new file mode 100644 index 0000000..bb0edfd Binary files /dev/null and b/src/public/img/memory_game/8-ball.png differ diff --git a/src/public/img/memory_game/back.png b/src/public/img/memory_game/back.png new file mode 100644 index 0000000..0ee6dff Binary files /dev/null and b/src/public/img/memory_game/back.png differ diff --git a/src/public/img/memory_game/baked-potato.png b/src/public/img/memory_game/baked-potato.png new file mode 100644 index 0000000..9f3bc12 Binary files /dev/null and b/src/public/img/memory_game/baked-potato.png differ diff --git a/src/public/img/memory_game/dinosaur.png b/src/public/img/memory_game/dinosaur.png new file mode 100644 index 0000000..878def3 Binary files /dev/null and b/src/public/img/memory_game/dinosaur.png differ diff --git a/src/public/img/memory_game/kronos.png b/src/public/img/memory_game/kronos.png new file mode 100644 index 0000000..6ec6e74 Binary files /dev/null and b/src/public/img/memory_game/kronos.png differ diff --git a/src/public/img/memory_game/rocket.png b/src/public/img/memory_game/rocket.png new file mode 100644 index 0000000..b20e848 Binary files /dev/null and b/src/public/img/memory_game/rocket.png differ diff --git a/src/public/img/memory_game/skinny-unicorn.png b/src/public/img/memory_game/skinny-unicorn.png new file mode 100644 index 0000000..d207e1c Binary files /dev/null and b/src/public/img/memory_game/skinny-unicorn.png differ diff --git a/src/public/img/memory_game/that-guy.png b/src/public/img/memory_game/that-guy.png new file mode 100644 index 0000000..b8336f2 Binary files /dev/null and b/src/public/img/memory_game/that-guy.png differ diff --git a/src/public/img/memory_game/zeppelin.png b/src/public/img/memory_game/zeppelin.png new file mode 100644 index 0000000..e8abe79 Binary files /dev/null and b/src/public/img/memory_game/zeppelin.png differ diff --git a/src/public/index.html b/src/public/index.html new file mode 100644 index 0000000..724e5bf --- /dev/null +++ b/src/public/index.html @@ -0,0 +1,49 @@ + + + + Angular 2.0 App + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/public/lib/traceur-runtime.min.js b/src/public/lib/traceur-runtime.min.js new file mode 100644 index 0000000..ec9f201 --- /dev/null +++ b/src/public/lib/traceur-runtime.min.js @@ -0,0 +1,3 @@ +!function(a){"use strict";function b(a,b,c){for(var d=[b],e=0;e0;)e.unshift("..");0===e.length&&e.push(".")}return b+e.join("/")+c}function d(b){var d=b[i.PATH]||"";return d=c(d),b[i.PATH]=d,a(b[i.SCHEME],b[i.USER_INFO],b[i.DOMAIN],b[i.PORT],b[i.PATH],b[i.QUERY_DATA],b[i.FRAGMENT])}function e(a){var c=b(a);return d(c)}function f(a,c){var e=b(c),f=b(a);if(e[i.SCHEME])return d(e);e[i.SCHEME]=f[i.SCHEME];for(var g=i.SCHEME;g<=i.PORT;g++)e[g]||(e[g]=f[g]);if("/"==e[i.PATH][0])return d(e);var h=f[i.PATH],j=h.lastIndexOf("/");return h=h.slice(0,j+1)+e[i.PATH],e[i.PATH]=h,d(e)}function g(a){if(!a)return!1;if("/"===a[0])return!0;var c=b(a);return c[i.SCHEME]?!0:!1}var h=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),i={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};$traceurRuntime.canonicalizeUrl=e,$traceurRuntime.isAbsolute=g,$traceurRuntime.removeDotSegments=c,$traceurRuntime.resolveUrl=f}(),function(a){"use strict";function b(a,b){this.url=a,this.value_=b}function c(a,b){this.message=this.constructor.name+": "+this.stripCause(b)+" in "+a,b instanceof c||!b.stack?this.stack="":this.stack=this.stripStack(b.stack)}function d(a,b){var c=[],d=b-3;0>d&&(d=0);for(var e=d;b>e;e++)c.push(a[e]);return c}function e(a,b){var c=b+1;c>a.length-1&&(c=a.length-1);for(var d=[],e=b;c>=e;e++)d.push(a[e]);return d}function f(a){for(var b="",c=0;a-1>c;c++)b+="-";return b}function g(a,c){b.call(this,a,null),this.func=c}function h(a){if(a){var b=r.normalize(a);return o[b]}}function i(a){var b=arguments[1],c=Object.create(null);return Object.getOwnPropertyNames(a).forEach(function(d){var e,f;if(b===q){var g=Object.getOwnPropertyDescriptor(a,d);g.get&&(e=g.get)}e||(f=a[d],e=function(){return f}),Object.defineProperty(c,d,{get:e,enumerable:!0})}),Object.preventExtensions(c),c}var j,k=$traceurRuntime,l=k.canonicalizeUrl,m=k.resolveUrl,n=k.isAbsolute,o=Object.create(null);j=a.location&&a.location.href?m(a.location.href,"./"):"",c.prototype=Object.create(Error.prototype),c.prototype.constructor=c,c.prototype.stripError=function(a){return a.replace(/.*Error:/,this.constructor.name+":")},c.prototype.stripCause=function(a){return a?a.message?this.stripError(a.message):a+"":""},c.prototype.loadedBy=function(a){this.stack+="\n loaded by "+a},c.prototype.stripStack=function(a){var b=[];return a.split("\n").some(function(a){return/UncoatedModuleInstantiator/.test(a)?!0:void b.push(a)}),b[0]=this.stripError(b[0]),b.join("\n")},g.prototype=Object.create(b.prototype),g.prototype.getUncoatedModule=function(){var b=this;if(this.value_)return this.value_;try{var g;return void 0!==typeof $traceurRuntime&&$traceurRuntime.require&&(g=$traceurRuntime.require.bind(null,this.url)),this.value_=this.func.call(a,g)}catch(h){if(h instanceof c)throw h.loadedBy(this.url),h;if(h.stack){var i=this.func.toString().split("\n"),j=[];h.stack.split("\n").some(function(a,c){if(a.indexOf("UncoatedModuleInstantiator.getUncoatedModule")>0)return!0;var g=/(at\s[^\s]*\s).*>:(\d*):(\d*)\)/.exec(a);if(g){var h=parseInt(g[2],10);j=j.concat(d(i,h)),1===c?j.push(f(g[3])+"^ "+b.url):j.push(f(g[3])+"^"),j=j.concat(e(i,h)),j.push("= = = = = = = = =")}else j.push(a)}),h.stack=j.join("\n")}throw new c(this.url,h)}};var p=Object.create(null),q={},r={normalize:function(a,b,c){if("string"!=typeof a)throw new TypeError("module name must be a string, not "+typeof a);if(n(a))return l(a);if(/[^\.]\/\.\.\//.test(a))throw new Error("module name embeds /../: "+a);return"."===a[0]&&b?m(b,a):l(a)},get:function(a){var b=h(a);if(!b)return void 0;var c=p[b.url];return c?c:(c=i(b.getUncoatedModule(),q),p[b.url]=c)},set:function(a,b){a=String(a),o[a]=new g(a,function(){return b}),p[a]=b},get baseURL(){return j},set baseURL(a){j=String(a)},registerModule:function(a,b,c){var d=r.normalize(a);if(o[d])throw new Error("duplicate module named "+d);o[d]=new g(d,c)},bundleStore:Object.create(null),register:function(a,b,c){b&&(b.length||c.length)?this.bundleStore[a]={deps:b,execute:function(){var a=arguments,d={};b.forEach(function(b,c){return d[b]=a[c]});var e=c.call(this,d);return e.execute.call(this),e.exports}}:this.registerModule(a,b,c)},getAnonymousModule:function(b){return new i(b.call(a),q)}},s=new i({ModuleStore:r});r.set("@traceur/src/runtime/ModuleStore.js",s);var t=$traceurRuntime.setupGlobals;$traceurRuntime.setupGlobals=function(a){t(a)},$traceurRuntime.ModuleStore=r,a.System={register:r.register.bind(r),registerModule:r.registerModule.bind(r),get:r.get,set:r.set,normalize:r.normalize}}("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this),System.registerModule("traceur-runtime@0.0.91/src/runtime/async.js",[],function(){"use strict";function a(){}function b(){}function c(a){return a.prototype=j(b.prototype),a.__proto__=b,a}function d(a,b){for(var c=[],d=2;d3?("function"==typeof d&&(a.__proto__=d),a.prototype=l(i(d),f(b))):(g(b),a.prototype=b),n(a,"prototype",{configurable:!1,writable:!1}),m(a,f(c))}function i(a){if("function"==typeof a){var b=a.prototype;if(j(b)===b||null===b)return a.prototype;throw new k("super prototype must be an Object or null")}if(null===a)return null;throw new k("Super expression must either be null or a function, not "+typeof a+".")}var j=Object,k=TypeError,l=j.create,m=$traceurRuntime.defineProperties,n=$traceurRuntime.defineProperty,o=$traceurRuntime.getOwnPropertyDescriptor,p=($traceurRuntime.getOwnPropertyNames,Object.getPrototypeOf),q=Object,r=q.getOwnPropertyNames,s=q.getOwnPropertySymbols,t={enumerable:!1};return $traceurRuntime.createClass=h,$traceurRuntime.superConstructor=b,$traceurRuntime.superGet=c,$traceurRuntime.superSet=d,{}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/destructuring.js",[],function(){"use strict";function a(a){for(var b,c=[],d=0;!(b=a.next()).done;)c[d++]=b.value;return c}return $traceurRuntime.iteratorToArray=a,{}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/generators.js",[],function(){"use strict";function a(a){return{configurable:!0,enumerable:!1,value:a,writable:!0}}function b(a){return new Error("Traceur compiler bug: invalid state in state machine: "+a)}function c(){this.state=0,this.GState=r,this.storedException=void 0,this.finallyFallThrough=void 0,this.sent_=void 0,this.returnValue=void 0,this.oldReturnValue=void 0,this.tryStack_=[]}function d(a,b,c,d){switch(a.GState){case s:throw new Error('"'+c+'" on executing generator');case u:if("next"==c)return{value:void 0,done:!0};if(d===x)return{value:a.returnValue,done:!0};throw d;case r:if("throw"===c){if(a.GState=u,d===x)return{value:a.returnValue,done:!0};throw d}if(void 0!==d)throw q("Sent value to newborn generator");case t:a.GState=s,a.action=c,a.sent=d;var e;try{e=b(a)}catch(f){if(f!==x)throw f;e=a}var g=e===a;return g&&(e=a.returnValue),a.GState=g?u:t,{value:e,done:g}}}function e(){}function f(){}function g(a,b,d){var e=k(a,d),f=new c,g=p(b.prototype);return g[y]=f,g[z]=e,g}function h(a){return a.prototype=p(f.prototype),a.__proto__=f,a}function i(){c.call(this),this.err=void 0;var a=this;a.result=new Promise(function(b,c){a.resolve=b,a.reject=c})}function j(a,b){var c=k(a,b),d=new i;return d.createCallback=function(a){return function(b){d.state=a,d.value=b,c(d)}},d.errback=function(a){l(d,a),c(d)},c(d),d.result}function k(a,b){return function(c){for(;;)try{return a.call(b,c)}catch(d){l(c,d)}}}function l(a,b){a.storedException=b;var c=a.tryStack_[a.tryStack_.length-1];return c?(a.state=void 0!==c["catch"]?c["catch"]:c["finally"],void(void 0!==c.finallyFallThrough&&(a.finallyFallThrough=c.finallyFallThrough))):void a.handleException(b)}if("object"!=typeof $traceurRuntime)throw new Error("traceur runtime not found.");var m=$traceurRuntime.createPrivateName,n=$traceurRuntime.defineProperties,o=$traceurRuntime.defineProperty,p=Object.create,q=TypeError,r=0,s=1,t=2,u=3,v=-2,w=-3,x={};c.prototype={pushTry:function(a,b){if(null!==b){for(var c=null,d=this.tryStack_.length-1;d>=0;d--)if(void 0!==this.tryStack_[d]["catch"]){c=this.tryStack_[d]["catch"];break}null===c&&(c=w),this.tryStack_.push({"finally":b,finallyFallThrough:c})}null!==a&&this.tryStack_.push({"catch":a})},popTry:function(){this.tryStack_.pop()},maybeUncatchable:function(){if(this.storedException===x)throw x},get sent(){return this.maybeThrow(),this.sent_},set sent(a){this.sent_=a},get sentIgnoreThrow(){return this.sent_},maybeThrow:function(){if("throw"===this.action)throw this.action="next",this.sent_},end:function(){switch(this.state){case v:return this;case w:throw this.storedException;default:throw b(this.state)}},handleException:function(a){throw this.GState=u,this.state=v,a},wrapYieldStar:function(a){var b=this;return{next:function(b){return a.next(b)},"throw":function(c){var d;if(c===x){if(a["return"]){if(d=a["return"](b.returnValue),!d.done)return b.returnValue=b.oldReturnValue,d;b.returnValue=d.value}throw c}if(a["throw"])return a["throw"](c);throw a["return"]&&a["return"](),q("Inner iterator does not have a throw method")}}}};var y=m(),z=m();return e.prototype=f,o(f,"constructor",a(e)),f.prototype={constructor:f,next:function(a){return d(this[y],this[z],"next",a)},"throw":function(a){return d(this[y],this[z],"throw",a)},"return":function(a){return this[y].oldReturnValue=this[y].returnValue,this[y].returnValue=a,d(this[y],this[z],"throw",x)}},n(f.prototype,{constructor:{enumerable:!1},next:{enumerable:!1},"throw":{enumerable:!1},"return":{enumerable:!1}}),Object.defineProperty(f.prototype,Symbol.iterator,a(function(){return this})),i.prototype=p(c.prototype),i.prototype.end=function(){switch(this.state){case v:this.resolve(this.returnValue);break;case w:this.reject(this.storedException);break;default:this.reject(b(this.state))}},i.prototype.handleException=function(){this.state=w},$traceurRuntime.asyncWrap=j,$traceurRuntime.initGeneratorFunction=h,$traceurRuntime.createGeneratorInstance=g,{}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/relativeRequire.js",[],function(){"use strict";function a(a,c){function d(a){return"/"===a.slice(-1)}function e(a){return"/"===a[0]}function f(a){return"."===a[0]}return b=b||"undefined"!=typeof require&&require("path"),d(c)||e(c)?void 0:f(c)?require(b.resolve(b.dirname(a),c)):require(c)}var b;return $traceurRuntime.require=a,{}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/spread.js",[],function(){"use strict";function a(){for(var a,b=[],c=0,d=0;d>>0}function b(a){return a&&("object"==typeof a||"function"==typeof a)}function c(a){return"function"==typeof a}function d(a){return"number"==typeof a}function e(a){return a=+a,u(a)?0:0!==a&&t(a)?a>0?s(a):r(a):a}function f(a){var b=e(a);return 0>b?0:w(b,y)}function g(a){return b(a)?a[Symbol.iterator]:void 0}function h(a){return c(a)}function i(a,b){return{value:a,done:b}}function j(a,b,c){b in a||Object.defineProperty(a,b,c)}function k(a,b,c){j(a,b,{value:c,configurable:!0,enumerable:!1,writable:!0})}function l(a,b,c){j(a,b,{value:c,configurable:!1,enumerable:!1,writable:!1})}function m(a,b){for(var c=0;ca;a+=2){var b=r[a],c=r[a+1];b(c),r[a]=void 0,r[a+1]=void 0}k=0}function h(){try{var a=require,b=a("vertx");return i=b.runOnLoop||b.runOnContext,c()}catch(d){return f()}}var i,j,k=0,l=({}.toString,a),m="undefined"!=typeof window?window:void 0,n=m||{},o=n.MutationObserver||n.WebKitMutationObserver,p="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),q="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,r=new Array(1e3);return j=p?b():o?d():q?e():void 0===m&&"function"==typeof require?h():f(),{get default(){return l}}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/Promise.js",[],function(){"use strict";function a(a){return a&&"object"==typeof a&&void 0!==a.status_}function b(a){return a}function c(a){throw a}function d(a){var d=void 0!==arguments[1]?arguments[1]:b,f=void 0!==arguments[2]?arguments[2]:c,g=e(a.constructor);switch(a.status_){case void 0:throw TypeError;case 0:a.onResolve_.push(d,g),a.onReject_.push(f,g);break;case 1:k(a.value_,[d,g]);break;case-1:k(a.value_,[f,g])}return g.promise}function e(a){if(this===t){var b=g(new t(r));return{promise:b,resolve:function(a){h(b,a)},reject:function(a){i(b,a)}}}var c={};return c.promise=new a(function(a,b){c.resolve=a,c.reject=b}),c}function f(a,b,c,d,e){return a.status_=b,a.value_=c,a.onResolve_=d,a.onReject_=e,a}function g(a){return f(a,0,void 0,[],[])}function h(a,b){j(a,1,b,a.onResolve_)}function i(a,b){j(a,-1,b,a.onReject_)}function j(a,b,c,d){0===a.status_&&(k(c,d),f(a,b,c))}function k(a,b){p(function(){for(var c=0;c=j)return a[e(g)]=void 0,c(void 0,!0);var k,l=b.charCodeAt(i);if(55296>l||l>56319||i+1===j)k=String.fromCharCode(l);else{var m=b.charCodeAt(i+1);k=56320>m||m>57343?String.fromCharCode(l):String.fromCharCode(l)+String.fromCharCode(m)}return a[e(h)]=i+k.length,c(k,!1)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(b,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),b),{})}();return{get createStringIterator(){return a}}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/String.js",[],function(){"use strict";function a(a){var b=String(this);if(null==this||"[object RegExp]"==o.call(a))throw TypeError();var c=b.length,d=String(a),e=(d.length,arguments.length>1?arguments[1]:void 0),f=e?Number(e):0;isNaN(f)&&(f=0);var g=Math.min(Math.max(f,0),c);return p.call(b,d,f)==g}function b(a){var b=String(this);if(null==this||"[object RegExp]"==o.call(a))throw TypeError();var c=b.length,d=String(a),e=d.length,f=c;if(arguments.length>1){var g=arguments[1];void 0!==g&&(f=g?Number(g):0,isNaN(f)&&(f=0))}var h=Math.min(Math.max(f,0),c),i=h-e;return 0>i?!1:q.call(b,d,i)==i}function c(a){if(null==this)throw TypeError();var b=String(this);if(a&&"[object RegExp]"==o.call(a))throw TypeError();var c=b.length,d=String(a),e=d.length,f=arguments.length>1?arguments[1]:void 0,g=f?Number(f):0;g!=g&&(g=0);var h=Math.min(Math.max(g,0),c);return e+h>c?!1:-1!=p.call(b,d,g)}function d(a){if(null==this)throw TypeError();var b=String(this),c=a?Number(a):0;if(isNaN(c)&&(c=0),0>c||c==1/0)throw RangeError();if(0==c)return"";for(var d="";c--;)d+=b;return d}function e(a){if(null==this)throw TypeError();var b=String(this),c=b.length,d=a?Number(a):0;if(isNaN(d)&&(d=0),0>d||d>=c)return void 0;var e,f=b.charCodeAt(d);return f>=55296&&56319>=f&&c>d+1&&(e=b.charCodeAt(d+1),e>=56320&&57343>=e)?1024*(f-55296)+e-56320+65536:f}function f(a){var b=a.raw,c=b.length>>>0;if(0===c)return"";for(var d="",e=0;;){if(d+=b[e],e+1===c)return d;d+=arguments[++e]}}function g(a){var b,c,d=[],e=Math.floor,f=-1,g=arguments.length;if(!g)return"";for(;++fh||h>1114111||e(h)!=h)throw RangeError("Invalid code point: "+h);65535>=h?d.push(h):(h-=65536,b=(h>>10)+55296,c=h%1024+56320,d.push(b,c))}return String.fromCharCode.apply(null,d)}function h(){var a=$traceurRuntime.checkObjectCoercible(this),b=String(a);return j(b)}function i(i){var j=i.String;l(j.prototype,["codePointAt",e,"endsWith",b,"includes",c,"repeat",d,"startsWith",a]),l(j,["fromCodePoint",g,"raw",f]),m(j.prototype,h,Symbol)}var j=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/StringIterator.js").createStringIterator,k=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/utils.js"),l=k.maybeAddFunctions,m=k.maybeAddIterator,n=k.registerPolyfill,o=Object.prototype.toString,p=String.prototype.indexOf,q=String.prototype.lastIndexOf;return n(i),{get startsWith(){return a},get endsWith(){return b},get includes(){return c},get repeat(){return d},get codePointAt(){return e},get raw(){return f},get fromCodePoint(){return g},get stringPrototypeIterator(){return h},get polyfillString(){return i}}}),System.get("traceur-runtime@0.0.91/src/runtime/polyfills/String.js"),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/ArrayIterator.js",[],function(){"use strict";function a(a,b){var c=f(a),d=new l;return d.iteratorObject_=c,d.arrayIteratorNextIndex_=0,d.arrayIterationKind_=b,d}function b(){return a(this,k)}function c(){return a(this,i)}function d(){return a(this,j)}var e=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/utils.js"),f=e.toObject,g=e.toUint32,h=e.createIteratorResultObject,i=1,j=2,k=3,l=function(){function a(){}var b;return $traceurRuntime.createClass(a,(b={},Object.defineProperty(b,"next",{value:function(){var a=f(this),b=a.iteratorObject_;if(!b)throw new TypeError("Object is not an ArrayIterator");var c=a.arrayIteratorNextIndex_,d=a.arrayIterationKind_,e=g(b.length);return c>=e?(a.arrayIteratorNextIndex_=1/0,h(void 0,!0)):(a.arrayIteratorNextIndex_=c+1,d==j?h(b[c],!1):d==k?h([c,b[c]],!1):h(c,!1))},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(b,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),b),{})}();return{get entries(){return b},get keys(){return c},get values(){return d}}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/Array.js",[],function(){"use strict";function a(a){var b,c,d=arguments[1],e=arguments[2],f=this,g=u(a),h=void 0!==d,i=0;if(h&&!n(d))throw TypeError();if(m(g)){b=o(f)?new f:[];var j=!0,k=!1,l=void 0;try{for(var p=void 0,q=g[$traceurRuntime.toProperty(Symbol.iterator)]();!(j=(p=q.next()).done);j=!0){var r=p.value;h?b[i]=d.call(e,r,i):b[i]=r,i++}}catch(s){k=!0,l=s}finally{try{j||null==q["return"]||q["return"]()}finally{if(k)throw l}}return b.length=i,b}for(c=t(g.length),b=o(f)?new f(c):new Array(c);c>i;i++)h?b[i]="undefined"==typeof e?d(g[i],i):d.call(e,g[i],i):b[i]=g[i];return b.length=c,b}function b(){for(var a=[],b=0;bf;f++)e[f]=a[f];return e.length=d,e}function c(a){var b=void 0!==arguments[1]?arguments[1]:0,c=arguments[2],d=u(this),e=t(d.length),f=s(b),g=void 0!==c?s(c):e;for(f=0>f?Math.max(e+f,0):Math.min(f,e),g=0>g?Math.max(e+g,0):Math.min(g,e);g>f;)d[f]=a,f++;return d}function d(a){var b=arguments[1];return f(this,a,b)}function e(a){var b=arguments[1];return f(this,a,b,!0)}function f(a,b){var c=arguments[2],d=void 0!==arguments[3]?arguments[3]:!1,e=u(a),f=t(e.length);if(!n(b))throw TypeError();for(var g=0;f>g;g++){var h=e[g];if(b.call(c,h,g,e))return d?g:h}return d?-1:void 0}function g(f){var g=f,h=g.Array,l=g.Object,m=g.Symbol,n=k;m&&m.iterator&&h.prototype[m.iterator]&&(n=h.prototype[m.iterator]),p(h.prototype,["entries",i,"keys",j,"values",n,"fill",c,"find",d,"findIndex",e]),p(h,["from",a,"of",b]),q(h.prototype,n,m),q(l.getPrototypeOf([].values()),function(){return this},m)}var h=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/ArrayIterator.js"),i=h.entries,j=h.keys,k=h.values,l=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/utils.js"),m=l.checkIterable,n=l.isCallable,o=l.isConstructor,p=l.maybeAddFunctions,q=l.maybeAddIterator,r=l.registerPolyfill,s=l.toInteger,t=l.toLength,u=l.toObject;return r(g),{get from(){return a},get of(){return b},get fill(){return c},get find(){return d},get findIndex(){return e},get polyfillArray(){return g}}}),System.get("traceur-runtime@0.0.91/src/runtime/polyfills/Array.js"),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/Object.js",[],function(){"use strict";function a(a,b){return a===b?0!==a||1/a===1/b:a!==a&&b!==b}function b(a){for(var b=1;be;e++){var g=d[e];l(g)||(a[g]=c[g])}}return a}function c(a,b){var c,d,e=k(b),f=e.length;for(c=0;f>c;c++){var g=e[c];l(g)||(d=j(b,e[c]),i(a,e[c],d))}return a}function d(d){var e=d.Object;f(e,["assign",b,"is",a,"mixin",c])}var e=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/utils.js"),f=e.maybeAddFunctions,g=e.registerPolyfill,h=$traceurRuntime,i=h.defineProperty,j=h.getOwnPropertyDescriptor,k=h.getOwnPropertyNames,l=h.isPrivateName,m=h.keys;return g(d),{get is(){return a},get assign(){return b},get mixin(){return c},get polyfillObject(){return d}}}),System.get("traceur-runtime@0.0.91/src/runtime/polyfills/Object.js"),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/Number.js",[],function(){"use strict";function a(a){return g(a)&&m(a)}function b(b){return a(b)&&k(b)===b}function c(a){return g(a)&&n(a)}function d(b){if(a(b)){var c=k(b);if(c===b)return l(c)<=o}return!1}function e(e){var f=e.Number;h(f,["MAX_SAFE_INTEGER",o,"MIN_SAFE_INTEGER",p,"EPSILON",q]),i(f,["isFinite",a,"isInteger",b,"isNaN",c,"isSafeInteger",d])}var f=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/utils.js"),g=f.isNumber,h=f.maybeAddConsts,i=f.maybeAddFunctions,j=f.registerPolyfill,k=f.toInteger,l=Math.abs,m=isFinite,n=isNaN,o=Math.pow(2,53)-1,p=-Math.pow(2,53)+1,q=Math.pow(2,-52);return j(e),{get MAX_SAFE_INTEGER(){return o},get MIN_SAFE_INTEGER(){return p},get EPSILON(){return q},get isFinite(){return a},get isInteger(){return b},get isNaN(){return c},get isSafeInteger(){return d},get polyfillNumber(){return e}}}),System.get("traceur-runtime@0.0.91/src/runtime/polyfills/Number.js"),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/fround.js",[],function(){"use strict";function a(a,b,c){function d(a){var b=k(a),c=a-b;return.5>c?b:c>.5?b+1:b%2?b+1:b}var e,f,g,h,o,p,q,r=(1<a?1:0):0===a?(f=0,g=0,e=1/a===-(1/0)?1:0):(e=0>a,a=j(a),a>=n(2,1-r)?(f=m(k(l(a)/i),1023),g=d(a/n(2,f)*n(2,c)),g/n(2,c)>=2&&(f+=1,g=1),f>r?(f=(1<>=1;return l.reverse(),g=l.join(""),h=(1<0?i*n(2,j-h)*(1+k/n(2,c)):0!==k?i*n(2,-(h-1))*(k/n(2,c)):0>i?-0:0}function c(a){return b(a,8,23)}function d(b){return a(b,8,23)}function e(a){return 0===a||!f(a)||g(a)?a:c(d(Number(a)))}var f=isFinite,g=isNaN,h=Math,i=h.LN2,j=h.abs,k=h.floor,l=h.log,m=h.min,n=h.pow;return{get fround(){return e}}}),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/Math.js",[],function(){"use strict";function a(a){if(a=x(+a),0==a)return 32;var b=0;return 0===(4294901760&a)&&(a<<=16,b+=16),0===(4278190080&a)&&(a<<=8,b+=8),0===(4026531840&a)&&(a<<=4,b+=4),0===(3221225472&a)&&(a<<=2,b+=2),0===(2147483648&a)&&(a<<=1,b+=1),b}function b(a,b){a=x(+a),b=x(+b);var c=a>>>16&65535,d=65535&a,e=b>>>16&65535,f=65535&b;return d*f+(c*f+d*e<<16>>>0)|0}function c(a){return a=+a,a>0?1:0>a?-1:a}function d(a){return.4342944819032518*F(a)}function e(a){return 1.4426950408889634*F(a)}function f(a){if(a=+a,-1>a||z(a))return NaN;if(0===a||a===1/0)return a;if(-1===a)return-(1/0);var b=0,c=50;if(0>a||a>1)return F(1+a);for(var d=1;c>d;d++)d%2===0?b-=G(a,d)/d:b+=G(a,d)/d;return b}function g(a){return a=+a,a===-(1/0)?-1:y(a)&&0!==a?D(a)-1:a}function h(a){return a=+a,0===a?1:z(a)?NaN:y(a)?(0>a&&(a=-a),a>21?D(a)/2:(D(a)+D(-a))/2):1/0}function i(a){return a=+a,y(a)&&0!==a?(D(a)-D(-a))/2:a}function j(a){if(a=+a,0===a)return a;if(!y(a))return c(a);var b=D(a),d=D(-a);return(b-d)/(b+d)}function k(a){return a=+a,1>a?NaN:y(a)?F(a+H(a+1)*H(a-1)):a}function l(a){return a=+a,0!==a&&y(a)?a>0?F(a+H(a*a+1)):-F(-a+H(a*a+1)):a}function m(a){return a=+a,-1===a?-(1/0):1===a?1/0:0===a?a:z(a)||-1>a||a>1?NaN:.5*F((1+a)/(1-a))}function n(a,b){for(var c=arguments.length,d=new Array(c),e=0,f=0;c>f;f++){var g=arguments[f];if(g=+g,g===1/0||g===-(1/0))return 1/0;g=B(g),g>e&&(e=g),d[f]=g}0===e&&(e=1);for(var h=0,i=0,f=0;c>f;f++){var g=d[f]/e,j=g*g-i,k=h+j;i=k-h-j,h=k}return H(h)*e}function o(a){return a=+a,a>0?E(a):0>a?C(a):a}function p(a){if(a=+a,0===a)return a;var b=0>a;b&&(a=-a);var c=G(a,1/3);return b?-c:c}function q(q){var s=q.Math;v(s,["acosh",k,"asinh",l,"atanh",m,"cbrt",p,"clz32",a,"cosh",h,"expm1",g,"fround",r,"hypot",n,"imul",b,"log10",d,"log1p",f,"log2",e,"sign",c,"sinh",i,"tanh",j,"trunc",o])}var r,s,t=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/fround.js").fround,u=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/utils.js"),v=u.maybeAddFunctions,w=u.registerPolyfill,x=u.toUint32,y=isFinite,z=isNaN,A=Math,B=A.abs,C=A.ceil,D=A.exp,E=A.floor,F=A.log,G=A.pow,H=A.sqrt;return"function"==typeof Float32Array?(s=new Float32Array(1),r=function(a){return s[0]=Number(a),s[0]}):r=t,w(q),{get clz32(){return a},get imul(){return b},get sign(){return c},get log10(){return d},get log2(){return e},get log1p(){return f},get expm1(){return g},get cosh(){return h},get sinh(){return i},get tanh(){return j},get acosh(){return k},get asinh(){return l},get atanh(){return m},get hypot(){return n},get trunc(){return o},get fround(){return r},get cbrt(){return p},get polyfillMath(){return q}}}),System.get("traceur-runtime@0.0.91/src/runtime/polyfills/Math.js"),System.registerModule("traceur-runtime@0.0.91/src/runtime/polyfills/polyfills.js",[],function(){"use strict";var a=System.get("traceur-runtime@0.0.91/src/runtime/polyfills/utils.js").polyfillAll;a(Reflect.global);var b=$traceurRuntime.setupGlobals;return $traceurRuntime.setupGlobals=function(c){b(c),a(c)},{}}),System.get("traceur-runtime@0.0.91/src/runtime/polyfills/polyfills.js"); +//# sourceMappingURL=traceur-runtime.min.map diff --git a/src/public/lib/traceur-runtime.min.map b/src/public/lib/traceur-runtime.min.map new file mode 100644 index 0000000..b038a54 --- /dev/null +++ b/src/public/lib/traceur-runtime.min.map @@ -0,0 +1,2 @@ + +{"version":3,"file":"traceur-runtime.min.js","sources":["traceur-runtime.js"],"names":["global","$bind","operand","thisArg","args","argArray","i","length","func","$apply","Function","prototype","bind","$construct","object","newUniqueString","Math","floor","random","counter","isPrivateName","s","privateNames","createPrivateName","createContinuation","argsArray","CONTINUATION_TYPE","isContinuation","setupProperTailCalls","isTailRecursiveName","call","initTailRecursiveFunction","result","tailCall","arguments","continuation","this","apply","isTailRecursive","construct","$traceurRuntime","$Object","Object","$TypeError","TypeError","$create","create","$defineProperties","defineProperties","$defineProperty","defineProperty","$freeze","freeze","$getOwnPropertyDescriptor","getOwnPropertyDescriptor","$getOwnPropertyNames","getOwnPropertyNames","$keys","keys","$hasOwnProperty","hasOwnProperty","$preventExtensions","toString","preventExtensions","$seal","seal","$isExtensible","isExtensible","nonEnum","value","configurable","enumerable","writable","isShimSymbol","symbol","SymbolValue","typeOf","v","Symbol","description","key","symbolDataProperty","symbolInternalProperty","symbolDescriptionProperty","symbolValues","getOwnHashObject","hashObject","hashProperty","self","hashObjectProperties","hash","hashCounter","hashPropertyDescriptor","undefined","isSymbolString","toProperty","name","removeSymbolKeys","array","rv","push","getOwnPropertySymbols","names","getOption","options","descriptor","polyfillObject","exportStar","j","mod","get","isObject","x","toObject","checkObjectCoercible","argument","polyfillSymbol","hasNativeSymbol","iterator","observer","hasNativeSymbolFunc","setupGlobals","Reflect","method","symbolValue","valueOf","typeof","window","buildFromEncodedParts","opt_scheme","opt_userInfo","opt_domain","opt_port","opt_path","opt_queryData","opt_fragment","out","join","split","uri","match","splitRe","removeDotSegments","path","leadingSlash","trailingSlash","slice","segments","up","pos","segment","pop","unshift","joinAndCanonicalizePath","parts","ComponentIndex","PATH","SCHEME","USER_INFO","DOMAIN","PORT","QUERY_DATA","FRAGMENT","canonicalizeUrl","url","resolveUrl","base","baseParts","index","lastIndexOf","isAbsolute","RegExp","UncoatedModuleEntry","uncoatedModule","value_","ModuleEvaluationError","erroneousModuleName","cause","message","constructor","stripCause","stack","stripStack","beforeLines","lines","number","first","afterLines","last","columnSpacing","columns","UncoatedModuleInstantiator","getUncoatedModuleInstantiator","ModuleStore","normalize","moduleInstantiators","Module","isLive","coatedModule","forEach","getter","liveModuleSentinel","descr","baseURL","$__3","location","href","Error","stripError","replace","loadedBy","moduleName","causeStack","some","frame","test","getUncoatedModule","$__2","relativeRequire","require","ex","evaled","indexOf","m","exec","line","parseInt","concat","moduleInstances","refererName","refererAddress","normalizedName","moduleInstance","set","module","String",{"end":{"file":"traceur-runtime.js","comments_before":[],"nlb":false,"endpos":21688,"endcol":15,"endline":660,"pos":21681,"col":8,"line":660,"value":"baseURL","type":"name"},"start":{"file":"traceur-runtime.js","comments_before":[],"nlb":false,"endpos":21688,"endcol":15,"endline":660,"pos":21681,"col":8,"line":660,"value":"baseURL","type":"name"},"name":"baseURL"},"registerModule","deps","bundleStore","register","execute","depMap","dep","registryEntry","exports","getAnonymousModule","moduleStoreModule","System","AsyncGeneratorFunction","AsyncGeneratorFunctionPrototype","initAsyncGeneratorFunction","functionObject","__proto__","createAsyncGeneratorInstance","observe","$__10","thisName","argsName","observeName","observeForEach","next","Promise","resolve","reject","generator","throw","error","return","schedule","asyncF","then","createDecoratedGenerator","onDone","DecoratedGenerator","$createPrivateName","AsyncGeneratorContext","decoratedObserver","done","inReturn","yield","e","yieldFor","observable","ctx","_generator","_onDone","Array","$__6","$__7","$__8","$__4","$__9","superDescriptor","homeObject","proto","$getPrototypeOf","superConstructor","ctor","superGet","superSet","forEachPropertyKey","f","getDescriptors","descriptors","makePropertiesNonEnumerable","createClass","staticObject","superClass","getProtoParent","getPrototypeOf","$__1","iteratorToArray","iter","tmp","getInternalError","state","GeneratorContext","GState","ST_NEWBORN","storedException","finallyFallThrough","sent_","returnValue","oldReturnValue","tryStack_","nextOrThrow","moveNext","action","ST_EXECUTING","ST_CLOSED","RETURN_SENTINEL","ST_SUSPENDED","sent","GeneratorFunction","GeneratorFunctionPrototype","createGeneratorInstance","innerFunction","getMoveNext","ctxName","moveNextName","initGeneratorFunction","AsyncFunctionContext","err","asyncWrap","createCallback","newState","errback","handleCatch","handleException","END_STATE","RETHROW_STATE","pushTry","catchState","finallyState","finally","catch","popTry","maybeUncatchable","maybeThrow","sentIgnoreThrow","end","wrapYieldStar","callerPath","requiredPath","isDirectory","isRelative","dirname","spread","iterResult","valueToSpread","getTemplateObject","raw","cooked","templateObject","map","genericType","type","argumentTypes","typeMap","typeRegister","tail","GenericType","types","any","boolean","string","void","toUint32","isCallable","isNumber","toInteger","$isNaN","$isFinite","$floor","$ceil","toLength","len","$min","MAX_SAFE_LENGTH","checkIterable","isConstructor","createIteratorResultObject","maybeDefine","maybeDefineMethod","maybeDefineConst","maybeAddFunctions","functions","maybeAddConsts","consts","maybeAddIterator","registerPolyfill","polyfills","polyfillAll","ceil","isFinite","isNaN","$pow","pow","min","lookupIndex","objectIndex_","stringIndex_","primitiveIndex_","initMap","entries_","deletedCount_","needsPolyfill","$__11","Map","entries","size","polyfillMap","$__0","deletedSentinel","$__12","$__13","iterable","objectMode","stringMode","has","delete","clear","callbackFn","$__14","$ctx","$__15","values","$__16","initSet","map_","Set","polyfillSet","$__5","item","add","$__17","$__18","asap","callback","arg","queue","scheduleFlush","useNextTick","nextTick","process","version","versions","node","isArray","setImmediate","flush","useVertxTimer","vertxNext","useMutationObserver","iterations","BrowserMutationObserver","document","createTextNode","characterData","data","useMessageChannel","channel","MessageChannel","port1","onmessage","port2","postMessage","useSetTimeout","setTimeout","attemptVertex","r","vertx","runOnLoop","runOnContext","$__default","browserWindow","browserGlobal","MutationObserver","WebKitMutationObserver","isNode","isWorker","Uint8ClampedArray","importScripts","isPromise","status_","idResolveHandler","idRejectHandler","chain","promise","onResolve","onReject","deferred","getDeferred","onResolve_","onReject_","promiseEnqueue","C","$Promise","promiseInit","promiseRaw","promiseResolve","promiseReject","promiseSet","status","promiseDone","reactions","tasks","async","promiseHandle","handler","promiseCoerce","$PromiseReject","thenableSymbol","p","polyfillPromise","resolver","that","all","resolutions","makeCountdownFunction","count","countdownFunction","race","createStringIterator","StringIterator","iteratedString","stringIteratorNextIndex","o","position","resultString","charCodeAt","fromCharCode","second","startsWith","search","$toString","stringLength","searchString","Number","start","max","$indexOf","endsWith","searchLength","$lastIndexOf","includes","repeat","n","Infinity","RangeError","codePointAt","callsite","fromCodePoint","_","highSurrogate","lowSurrogate","codeUnits","codePoint","stringPrototypeIterator","polyfillString","createArrayIterator","kind","ArrayIterator","iteratorObject_","arrayIteratorNextIndex_","arrayIterationKind_","ARRAY_ITERATOR_KIND_ENTRIES","ARRAY_ITERATOR_KIND_KEYS","ARRAY_ITERATOR_KIND_VALUES","itemKind","from","arrLike","arr","mapFn","items","mapping","k","of","fill","fillStart","fillEnd","find","predicate","findHelper","findIndex","returnIndex","polyfillArray","jsValues","is","left","right","assign","target","source","props","mixin","NumberIsFinite","isInteger","NumberIsNaN","isSafeInteger","integral","$abs","MAX_SAFE_INTEGER","polyfillNumber","MIN_SAFE_INTEGER","EPSILON","abs","packIEEE754","ebits","fbits","roundToEven","w","bits","str","bytes","bias","log","LN2","reverse","substring","unpackIEEE754","b","NaN","unpackF32","packF32","fround","clz32","imul","y","xh","xl","yh","yl","sign","log10","log2","log1p","expm1","exp","cosh","sinh","tanh","exp1","exp2","acosh","sqrt","asinh","atanh","hypot","sum","compensation","summand","preliminary","trunc","cbrt","negate","polyfillMath","f32","jsFround","Float32Array"],"mappings":"CAAA,SAAUA,GACR,YAmBA,SAASC,GAAMC,EAASC,EAASC,GAE/B,IAAK,GADDC,IAAYF,GACPG,EAAI,EAAGA,EAAIF,EAAKG,OAAQD,IAC/BD,EAASC,EAAI,GAAKF,EAAKE,EAEzB,IAAIE,GAAOC,EAAOC,SAASC,UAAUC,KAAMV,EAASG,EACpD,OAAOG,GAET,QAASK,GAAWL,EAAMH,GACxB,GAAIS,GAAS,IAAKb,EAAMO,EAAM,KAAMH,GACpC,OAAOS,GAGT,QAASC,KACP,MAAO,MAAQC,KAAKC,MAAsB,IAAhBD,KAAKE,UAAkB,OAAQC,EAAU,MAGrE,QAASC,GAAcC,GACrB,MAAOC,GAAaD,GAEtB,QAASE,KACP,GAAIF,GAAIN,GAER,OADAO,GAAaD,IAAK,EACXA,EAGT,QAASG,G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Z,GAAI4Z,QACF,MAAOA,IAET5Z,GAAIka,QACF,MAAOA,IAETla,GAAIma,SACF,MAAOA,IAETna,GAAIoa,QACF,MAAOA,IAETpa,GAAIqa,SACF,MAAOA,IAETra,GAAIsa,SACF,MAAOA,IAETta,GAAIwa,QACF,MAAOA,IAETxa,GAAIya,QACF,MAAOA,IAETza,GAAI0a,QACF,MAAOA,IAET1a,GAAI6a,SACF,MAAOA,IAET7a,GAAI+a,SACF,MAAOA,IAET/a,GAAIgb,SACF,MAAOA,IAEThb,GAAIib,SACF,MAAOA,IAETjb,GAAIsb,SACF,MAAOA,IAETtb,GAAI0Z,UACF,MAAOA,IAET1Z,GAAIub,QACF,MAAOA,IAETvb,GAAIyb,gBACF,MAAOA,OAIb7a,OAAO1I,IAAI,wDACX0I,OAAOX,eAAe,+DAAiE,WACrF,YACA,IACIgL,GAAcrK,OAAO1I,IAAI,yDAAyD+S,WACtFA,GAAYnS,QAAQ1H,OACpB,IAAIyH,GAAejF,gBAAgBiF,YAKnC,OAJAjF,iBAAgBiF,aAAe,SAASzH,GACtCyH,EAAazH,GACb6Z,EAAY7Z,SAIhBwP,OAAO1I,IAAI"} diff --git a/src/public/webpack.png b/src/public/webpack.png new file mode 100644 index 0000000..aab676b Binary files /dev/null and b/src/public/webpack.png differ diff --git a/src/typings/_custom.d.ts b/src/typings/_custom.d.ts new file mode 100644 index 0000000..c2e700f --- /dev/null +++ b/src/typings/_custom.d.ts @@ -0,0 +1,12 @@ +/* + * Our custom types + */ +/// +/// +/// + + +/* + * tsd generated types + */ +/// diff --git a/src/typings/browser.d.ts b/src/typings/browser.d.ts new file mode 100644 index 0000000..ce1c7aa --- /dev/null +++ b/src/typings/browser.d.ts @@ -0,0 +1,4 @@ +interface ObjectConstructor { + assign(target: any, ...sources: any[]): any; + observe(target: any, callback: Function, acceptList?: Array): void; +} \ No newline at end of file diff --git a/src/typings/ng2.d.ts b/src/typings/ng2.d.ts new file mode 100644 index 0000000..23562d7 --- /dev/null +++ b/src/typings/ng2.d.ts @@ -0,0 +1,1011 @@ +declare var zone: any; +declare var Zone: any; +interface Type extends Function { + new (...args: any[]): any; +} + +declare module "angular2/test" { + class TestComponentBuilder {} + class AsyncTestCompleter {} + class DebugElement {} + class By {} + function inject(args: any): any; + var browser: any; + var $: any; + function clickAll(buttonSelectors: any): void; + function verifyNoBrowserErrors(): void; +} + +declare module "angular2/pipes" { + class ObservablePipe { + constructor(ref?: any) + _subscription: any; + _observable: any; + _updateLatestValue(value: any): any; + _subscribe(obs: any): any; + transform(obs: any, args?: List): any; + onDestroy(): void; + } +} + +declare module "angular2/annotations" { + var Component: any; + var View: any; + var Directive: any; + var Query: any; +} + +declare module "angular2/http" { + class Http { + _backend: any; + _defaultOptions: any; + constructor(_backend?: any, _defaultOptions?: any); + request(url: string, options?: any): any; + get(url: string, options?: any): any; + post(url: string, body: any, options?: any): any; + put(url: string, body: any, options?: any): any; + delete(url: string, options?: any): any; + patch(url: string, body: any, options?: any): any; + head(url: string, options?: any): any; + } + class HttpFactory {} + class MockBackend { + constructor(req: any) + } + class Headers { + constructor(config: any) + } + class XHRBackend {} + class BaseRequestOptions {} + var httpInjectables: Array; +} + +declare module "angular2/src/core/life_cycle/life_cycle" { + class LifeCycle { + constructor(...args) + tick(): any; + } +} + +declare module "angular2/src/render/dom/compiler/view_loader" { + class ViewLoader {} +} + +declare module "angular2/src/render/dom/compiler/style_url_resolver" { + class StyleUrlResolver {} +} + +declare module "angular2/src/render/dom/compiler/style_inliner" { + class StyleInliner {} +} + +declare module "angular2/src/core/compiler/view_resolver" { + class ViewResolver { + resolve(appComponent: any): any + } +} + +declare module "angular2/src/services/app_root_url" { + class AppRootUrl {} +} + +declare module "angular2/src/http/backends/browser_xhr" { + class BrowserXHR {} +} + +declare module "angular2/src/core/compiler/view_listener" { + class AppViewListener {} +} + +declare module "angular2/src/render/dom/compiler/template_loader" { + class TemplateLoader { + + } +} + +declare module "angular2/src/core/compiler/template_resolver" { + class TemplateResolver { + + } +} + +declare module "angular2/src/render/xhr_impl" { + class XHRImpl {} +} + +declare module "angular2/src/services/xhr_impl" { + class XHRImpl { + + } +} + +declare module "angular2/src/render/dom/events/key_events" { + class KeyEventsPlugin { + static getEventFullKey: any + getEventFullKey: any + } +} +declare module "angular2/src/render/dom/events/hammer_gestures" { + class HammerGesturesPlugin { + + } +} +declare module "angular2/src/core/compiler/component_url_mapper" { + class ComponentUrlMapper { + + } +} +declare module "angular2/src/services/url_resolver" { + class UrlResolver { + + } + +} +declare module "angular2/src/render/dom/shadow_dom/style_inliner" { + class StyleInliner{} + +} +declare module "angular2/src/core/compiler/dynamic_component_loader" { + class ComponentRef { + constructor(newLocation: any, component: any, dispose: any) + location: any + instance: any + dispose: any + } + class DynamicComponentLoader { + loadAsRoot(appComponentType: any, bindings: any, injector: any): any + } +} +declare module "angular2/src/core/testability/testability" { + class TestabilityRegistry { + + } + class Testability { + + } +} +declare module "angular2/src/core/compiler/view_pool" { + class AppViewPool { + + } + var APP_VIEW_POOL_CAPACITY: any +} +declare module "angular2/src/core/compiler/view_manager" { + class AppViewManager { + + } + +} +declare module "angular2/src/core/compiler/view_manager_utils" { + class AppViewManagerUtils { + + } +} +declare module "angular2/src/core/compiler/proto_view_factory" { + class ProtoViewFactory { + + } +} +declare module "angular2/src/render/dom/compiler/compiler" { + class DefaultDomCompiler { + + } +} +declare module "angular2/src/core/compiler/view_ref" { + var internalView:any +} + +declare module "angular2/src/reflection/reflection" { + var reflector:any + class Reflector { + + } +} +declare module "angular2/src/reflection/reflection_capabilities" { + class ReflectionCapabilities { + + } +} + +declare module "angular2/src/render/dom/view/proto_view" { + class DomProtoView { + rootBindingOffset: any; + element: any; + isTemplateElement(): any + elementBinders(): any + } + +} + +declare module "angular2/src/render/dom/view/view_container" { + class DomViewContainer{} +} + +declare module "angular2/src/render/dom/util" { + var NG_BINDING_CLASS_SELECTOR: any; + var NG_BINDING_CLASS: any ; +} + + +declare module "angular2/src/render/dom/dom_renderer" { + class DomRenderer { + _moveViewNodesIntoParent(): any + _createGlobalEventListener(): any + _createEventListener(): any + } + var DOCUMENT_TOKEN: any; +} + +declare module "angular2/src/render/api" { + class RenderCompiler { + + } + class Renderer { + + } + class RenderViewRef { + + } + class RenderProtoViewRef { + + } + +} +declare module "angular2/src/render/dom/shadow_dom/content_tag" { + function Content(element: any, contentTagSelector:any): void; +} +declare module "angular2/src/render/dom/view/view" { + class DomViewRef { + + } + class DomView { + viewContainers(): any + } + function resolveInternalDomView(viewRef: any): any; +} +declare module "angular2/src/render/dom/shadow_dom/shadow_dom_strategy" { + class ShadowDomStrategy { + prepareShadowRoot(element: any): any + constructLightDom(lightDomView: any, el: any): any + } +} + +declare module "angular2/src/render/dom/events/event_manager" { + class EventManager { + constructor(...args) + addEventListener(element: any, eventName: string, handler: Function): any + addGlobalEventListener(target: string, eventName: string, handler: Function): any + } + class DomEventsPlugin { + + } +} + +declare module "zone.js" { + var zone: any; + var Zone: any; +} + +declare module "rtts_assert/rtts_assert" { + var assert: any; +} + +declare module "angular2/directives" { + class NgSwitch {} + class NgSwitchWhen {} + class NgSwitchDefault {} + class NgNonBindable {} + class NgIf {} + class NgFor {} + class CSSClass {} + + var formDirectives: any; + var coreDirectives: any; + +} + +declare module "angular2/src/change_detection/pipes/pipe" { + class PipeFactory { + } +} + +declare module "angular2/src/change_detection/change_detection" { + var async: any; +} + +declare module "angular2/change_detection" { + interface PipeFactory {} + interface Pipe { + supports(obj: any): boolean; + onDestroy(): void; + transform(value: any, args: List): any; + } + class Pipes { + static extend(pipes: any) + } + class NullPipeFactory {} + class PipeRegistry { + constructor(pipes: any); + } + class WrappedValue { + static wrap(...args): any + } + class ChangeDetectorRef { + requestCheck(): void; + } + class ObservablePipe implements Pipe { + constructor(ref: any); + _subscription: any; + _observable: any; + _updateLatestValue(value: any): any; + _subscribe(obs: any): void; + + _latestValue: any; + _latestReturnedValue: any; + + _dispose(): void; + + supports(obj: any): boolean; + onDestroy(): void; + transform(value: any, args: List): any; + } + var defaultPipeRegistry: any; + var defaultPipes: any; + class Parser { + + } + class Lexer { + + } + class ChangeDetection { + + } + class DynamicChangeDetection { + + } + class PreGeneratedChangeDetection { + static isSupported(): boolean; + } + class JitChangeDetection { + static isSupported(): boolean; + } +} + +declare module "angular2/src/core/zone/ng_zone" { + class NgZone { + constructor(config: any) + initCallbacks(config: any): any + runOutsideAngular(context: any): any; + run(context: any): any + } +} + + +declare module "angular2/src/core/compiler/element_ref" { + class ElementRef { + constructor(host: any, location?: any) + nativeElement: any; + } +} + +declare module "angular2/src/core/exception_handler" { + class ExceptionHandler { + + } +} + +declare module "angular2/src/render/xhr" { + class XHR { + + } +} + +declare module "angular2/src/core/application_tokens" { + var appComponentRefToken: any; + var appComponentTypeToken: any; +} + +declare module "angular2/src/core/compiler/compiler" { + class Compiler { + + } + class CompilerCache { + + } +} + +declare module "angular2/forms" { + var formDirectives: any; + var formInjectables: any; + class FormBuilder { + group(config: any): any + array(): any + } + class Validators { + static required(): any + } + class ControlGroup { + value: any + controls: any + include(): any + exclude(): any + } + class Control { + valueChanges(): any + } + class ControlArray { + push(): any + removeAt(): any + } + + class NgControlName { + + } + class NgControlGroup { + + } + class NgFormControl { + + } + class NgModel { + + } + class NgFormModel { + + } + class NgForm { + + } + class NgSelectOption { + + } + class NgRequiredValidator { + + } + class NgControl { + control: any; + valueAccessor: any; + } + +} + +declare module "angular2/src/render/dom/shadow_dom/emulated_unscoped_shadow_dom_strategy" { + class EmulatedUnscopedShadowDomStrategy { + styleHost: any; + constructor(styleHost: any); + hasNativeContentElement(): boolean; + prepareShadowRoot(el: any): any; + constructLightDom(lightDomView: any, el: any): any; + processStyleElement(hostComponentId: string, templateUrl: string, styleEl: any): void; + + } +} + +declare module "angular2/core" { + class ElementRef { + constructor(host: any, location?: any) + nativeElement: any; + } + class QueryList { + onChange(callback: any): void; + } + class DirectiveResolver { + resolve(appComponent: any): any + } +} + +declare module "angular2/render" { + class ShadowDomStrategy { + hasNativeContentElement(): boolean; + prepareShadowRoot(el: any): any; + constructLightDom(lightDomView: any, el: any): any; + processStyleElement(hostComponentId: string, templateUrl: string, styleElement: any): void; + processElement(hostComponentId: string, elementComponentId: string, element: any): void; + } + class NativeShadowDomStrategy extends ShadowDomStrategy { + prepareShadowRoot(el: any): any; + } + class EmulatedUnscopedShadowDomStrategy extends ShadowDomStrategy { + styleHost: any; + constructor(styleHost: any); + hasNativeContentElement(): boolean; + prepareShadowRoot(el: any): any; + constructLightDom(lightDomView: any, el: any): any; + processStyleElement(hostComponentId: string, templateUrl: string, styleEl: any): void; + + } + class EmulatedScopedShadowDomStrategy extends EmulatedUnscopedShadowDomStrategy { + constructor(styleHost: any); + processStyleElement(hostComponentId: string, templateUrl: string, styleEl: any): void; + _moveToStyleHost(styleEl: any): void; + processElement(hostComponentId: string, elementComponentId: string, element: any): void; + + } + class Renderer { +/** + * Creates a root host view that includes the given element. + * @param {RenderProtoViewRef} hostProtoViewRef a RenderProtoViewRef of type + * ProtoViewDto.HOST_VIEW_TYPE + * @param {any} hostElementSelector css selector for the host element (will be queried against the + * main document) + * @return {RenderViewRef} the created view + */ + createRootHostView(hostProtoViewRef: any, hostElementSelector: string): any; + /** + * Creates a regular view out of the given ProtoView + */ + createView(protoViewRef: any): any; + /** + * Destroys the given view after it has been dehydrated and detached + */ + destroyView(viewRef: any): void; + /** + * Attaches a componentView into the given hostView at the given element + */ + attachComponentView(location: any, componentViewRef: any): void; + /** + * Detaches a componentView into the given hostView at the given element + */ + detachComponentView(location: any, componentViewRef: any): void; + /** + * Attaches a view into a ViewContainer (in the given parentView at the given element) at the + * given index. + */ + attachViewInContainer(location: any, atIndex: number, viewRef: any): void; + /** + * Detaches a view into a ViewContainer (in the given parentView at the given element) at the + * given index. + */ + detachViewInContainer(location: any, atIndex: number, viewRef: any): void; + /** + * Hydrates a view after it has been attached. Hydration/dehydration is used for reusing views + * inside of the view pool. + */ + hydrateView(viewRef: any): void; + /** + * Dehydrates a view after it has been attached. Hydration/dehydration is used for reusing views + * inside of the view pool. + */ + dehydrateView(viewRef: any): void; + /** + * Returns the native element at the given location. + * Attention: In a WebWorker scenario, this should always return null! + */ + getNativeElementSync(location: any): any; + /** + * Sets a property on an element. + */ + setElementProperty(location: any, propertyName: string, propertyValue: any): void; + /** + * Sets an attribute on an element. + */ + setElementAttribute(location: any, attributeName: string, attributeValue: string): void; + /** + * Sets a class on an element. + */ + setElementClass(location: any, className: string, isAdd: boolean): void; + /** + * Sets a style on an element. + */ + setElementStyle(location: any, styleName: string, styleValue: string): void; + /** + * Calls a method on an element. + */ + invokeElementMethod(location: any, methodName: string, args: List): void; + /** + * Sets the value of a text node. + */ + setText(viewRef: any, textNodeIndex: number, text: string): void; + /** + * Sets the dispatcher for all events of the given view + */ + setEventDispatcher(viewRef: any, dispatcher: any): void; + } +} + +declare module "angular2/src/render/dom/shadow_dom/style_url_resolver" { + class StyleUrlResolver { + + } +} + +declare module "angular2/src/facade/async" { + class ObservableWrapper { + static callNext(next:any): any; + static subscribe(observer:any): any; + } + class Promise { + then(pro:any): any; + all(all:any): any; + } + class PromiseWrapper { + static completer(): any; + static all(all: any): any; + static then(pro:any, sucess?: any, failure?: any): any; + static wrap(pro:any): any; + } +} + +declare module "angular2/src/facade/collection" { + var List: Array; + var Map: any; + var ListWrapper: any; + var MapWrapper: any; + var StringMapWrapper: any; +} + +declare module "angular2/src/facade/browser" { + var __esModule: boolean; + var win: any; + var window: any; + var document: any; + var location: any; + var gc: () => void; + var Event: any; + var MouseEvent: any; + var KeyboardEvent: any; +} + +declare module "angular2/src/facade/lang" { + var int: any; + var Type: Function; + var assertionsEnabled: any; + function isPresent(bool: any): boolean; + function isBlank(bool: any): boolean; + function isString(bool: any): boolean; + class BaseException { + + } + class RegExpWrapper { + + } + class NumberWrapper { + + } + class StringWrapper { + static toLowerCase(str: string): string; + static toUpperCase(str: string): string; + } + function print(str: any):any; + function stringify(str: any):any; +} + +declare module "angular2/src/core/compiler/directive_resolver" { + class DirectiveResolver { + resolve(appComponent: any): any + } +} + +declare module "angular2/src/router/route_registry" { + class RouteRegistry {} +} + +declare module "angular2/src/router/pipeline" { + class Pipeline {} +} + +declare module "angular2/src/router/instruction" { + class Instruction { + component: any; + params: any; + reuse: any; + child: any; + } +} + +declare module "angular2/src/dom/browser_adapter" { + class BrowserDomAdapter { + static makeCurrent(): void; + logError(error: any): void; + attrToPropMap: any; + query(selector: string): any; + querySelector(el: any, selector: string): Node; + querySelectorAll(el: any, selector: string): List; + on(el: any, evt: any, listener: any): void; + onAndCancel(el: any, evt: any, listener: any): Function; + dispatchEvent(el: any, evt: any): void; + createMouseEvent(eventType: string): MouseEvent; + createEvent(eventType: any): Event; + getInnerHTML(el: any): any; + getOuterHTML(el: any): any; + nodeName(node: Node): string; + nodeValue(node: Node): string; + type(node: HTMLInputElement): string; + content(node: Node): Node; + firstChild(el: any): Node; + nextSibling(el: any): Node; + parentElement(el: any): any; + childNodes(el: any): List; + childNodesAsList(el: any): List; + clearNodes(el: any): void; + appendChild(el: any, node: any): void; + removeChild(el: any, node: any): void; + replaceChild(el: Node, newChild: any, oldChild: any): void; + remove(el: any): any; + insertBefore(el: any, node: any): void; + insertAllBefore(el: any, nodes: any): void; + insertAfter(el: any, node: any): void; + setInnerHTML(el: any, value: any): void; + getText(el: any): any; + setText(el: any, value: string): void; + getValue(el: any): any; + setValue(el: any, value: string): void; + getChecked(el: any): any; + setChecked(el: any, value: boolean): void; + createTemplate(html: any): HTMLElement; + createElement(tagName: any, doc?: Document): HTMLElement; + createTextNode(text: string, doc?: Document): Text; + createScriptTag(attrName: string, attrValue: string, doc?: Document): HTMLScriptElement; + createStyleElement(css: string, doc?: Document): HTMLStyleElement; + createShadowRoot(el: HTMLElement): DocumentFragment; + getShadowRoot(el: HTMLElement): DocumentFragment; + getHost(el: HTMLElement): HTMLElement; + clone(node: Node): Node; + hasProperty(element: any, name: string): boolean; + getElementsByClassName(element: any, name: string): any; + getElementsByTagName(element: any, name: string): any; + classList(element: any): List; + addClass(element: any, classname: string): void; + removeClass(element: any, classname: string): void; + hasClass(element: any, classname: string): any; + setStyle(element: any, stylename: string, stylevalue: string): void; + removeStyle(element: any, stylename: string): void; + getStyle(element: any, stylename: string): any; + tagName(element: any): string; + attributeMap(element: any): any; + hasAttribute(element: any, attribute: string): any; + getAttribute(element: any, attribute: string): any; + setAttribute(element: any, name: string, value: string): void; + removeAttribute(element: any, attribute: string): any; + templateAwareRoot(el: any): any; + createHtmlDocument(): Document; + defaultDoc(): Document; + getBoundingClientRect(el: any): any; + getTitle(): string; + setTitle(newTitle: string): void; + elementMatches(n: any, selector: string): boolean; + isTemplateElement(el: any): boolean; + isTextNode(node: Node): boolean; + isCommentNode(node: Node): boolean; + isElementNode(node: Node): boolean; + hasShadowRoot(node: any): boolean; + isShadowRoot(node: any): boolean; + importIntoDoc(node: Node): Node; + isPageRule(rule: any): boolean; + isStyleRule(rule: any): boolean; + isMediaRule(rule: any): boolean; + isKeyframesRule(rule: any): boolean; + getHref(el: Element): string; + getEventKey(event: any): string; + getGlobalEventTarget(target: string): EventTarget; + getHistory(): History; + getLocation(): Location; + getBaseHref(): any; + } +} + +declare module "angular2/src/dom/dom_adapter" { + class DomAdapter { + static makeCurrent(): void; + logError(error: any): void; + attrToPropMap: any; + query(selector: string): any; + querySelector(el: any, selector: string): Node; + querySelectorAll(el: any, selector: string): List; + on(el: any, evt: any, listener: any): void; + onAndCancel(el: any, evt: any, listener: any): Function; + dispatchEvent(el: any, evt: any): void; + createMouseEvent(eventType: string): MouseEvent; + createEvent(eventType: any): Event; + getInnerHTML(el: any): any; + getOuterHTML(el: any): any; + nodeName(node: Node): string; + nodeValue(node: Node): string; + type(node: HTMLInputElement): string; + content(node: Node): Node; + firstChild(el: any): Node; + nextSibling(el: any): Node; + parentElement(el: any): any; + childNodes(el: any): List; + childNodesAsList(el: any): List; + clearNodes(el: any): void; + appendChild(el: any, node: any): void; + removeChild(el: any, node: any): void; + replaceChild(el: Node, newChild: any, oldChild: any): void; + remove(el: any): any; + insertBefore(el: any, node: any): void; + insertAllBefore(el: any, nodes: any): void; + insertAfter(el: any, node: any): void; + setInnerHTML(el: any, value: any): void; + getText(el: any): any; + setText(el: any, value: string): void; + getValue(el: any): any; + setValue(el: any, value: string): void; + getChecked(el: any): any; + setChecked(el: any, value: boolean): void; + createTemplate(html: any): HTMLElement; + createElement(tagName: any, doc?: Document): HTMLElement; + createTextNode(text: string, doc?: Document): Text; + createScriptTag(attrName: string, attrValue: string, doc?: Document): HTMLScriptElement; + createStyleElement(css: string, doc?: Document): HTMLStyleElement; + createShadowRoot(el: HTMLElement): DocumentFragment; + getShadowRoot(el: HTMLElement): DocumentFragment; + getHost(el: HTMLElement): HTMLElement; + clone(node: Node): Node; + hasProperty(element: any, name: string): boolean; + getElementsByClassName(element: any, name: string): any; + getElementsByTagName(element: any, name: string): any; + classList(element: any): List; + addClass(element: any, classname: string): void; + removeClass(element: any, classname: string): void; + hasClass(element: any, classname: string): any; + setStyle(element: any, stylename: string, stylevalue: string): void; + removeStyle(element: any, stylename: string): void; + getStyle(element: any, stylename: string): any; + tagName(element: any): string; + attributeMap(element: any): any; + hasAttribute(element: any, attribute: string): any; + getAttribute(element: any, attribute: string): any; + setAttribute(element: any, name: string, value: string): void; + removeAttribute(element: any, attribute: string): any; + templateAwareRoot(el: any): any; + createHtmlDocument(): Document; + defaultDoc(): Document; + getBoundingClientRect(el: any): any; + getTitle(): string; + setTitle(newTitle: string): void; + elementMatches(n: any, selector: string): boolean; + isTemplateElement(el: any): boolean; + isTextNode(node: Node): boolean; + isCommentNode(node: Node): boolean; + isElementNode(node: Node): boolean; + hasShadowRoot(node: any): boolean; + isShadowRoot(node: any): boolean; + importIntoDoc(node: Node): Node; + isPageRule(rule: any): boolean; + isStyleRule(rule: any): boolean; + isMediaRule(rule: any): boolean; + isKeyframesRule(rule: any): boolean; + getHref(el: Element): string; + getEventKey(event: any): string; + getGlobalEventTarget(target: string): EventTarget; + getHistory(): History; + getLocation(): Location; + getBaseHref(): any; + } + var DOM: DomAdapter; +} +declare module "angular2/src/dom/parse5_adapter" { + class Parse5DomAdapter { + static makeCurrent(): void; + logError(error: any): void; + attrToPropMap: any; + query(selector: string): any; + querySelector(el: any, selector: string): Node; + querySelectorAll(el: any, selector: string): List; + on(el: any, evt: any, listener: any): void; + onAndCancel(el: any, evt: any, listener: any): Function; + dispatchEvent(el: any, evt: any): void; + createMouseEvent(eventType: string): MouseEvent; + createEvent(eventType: any): Event; + getInnerHTML(el: any): any; + getOuterHTML(el: any): any; + nodeName(node: Node): string; + nodeValue(node: Node): string; + type(node: HTMLInputElement): string; + content(node: Node): Node; + firstChild(el: any): Node; + nextSibling(el: any): Node; + parentElement(el: any): any; + childNodes(el: any): List; + childNodesAsList(el: any): List; + clearNodes(el: any): void; + appendChild(el: any, node: any): void; + removeChild(el: any, node: any): void; + replaceChild(el: Node, newChild: any, oldChild: any): void; + remove(el: any): any; + insertBefore(el: any, node: any): void; + insertAllBefore(el: any, nodes: any): void; + insertAfter(el: any, node: any): void; + setInnerHTML(el: any, value: any): void; + getText(el: any): any; + setText(el: any, value: string): void; + getValue(el: any): any; + setValue(el: any, value: string): void; + getChecked(el: any): any; + setChecked(el: any, value: boolean): void; + createTemplate(html: any): HTMLElement; + createElement(tagName: any, doc?: Document): HTMLElement; + createTextNode(text: string, doc?: Document): Text; + createScriptTag(attrName: string, attrValue: string, doc?: Document): HTMLScriptElement; + createStyleElement(css: string, doc?: Document): HTMLStyleElement; + createShadowRoot(el: HTMLElement): DocumentFragment; + getShadowRoot(el: HTMLElement): DocumentFragment; + getHost(el: HTMLElement): HTMLElement; + clone(node: Node): Node; + hasProperty(element: any, name: string): boolean; + getElementsByClassName(element: any, name: string): any; + getElementsByTagName(element: any, name: string): any; + classList(element: any): List; + addClass(element: any, classname: string): void; + removeClass(element: any, classname: string): void; + hasClass(element: any, classname: string): any; + setStyle(element: any, stylename: string, stylevalue: string): void; + removeStyle(element: any, stylename: string): void; + getStyle(element: any, stylename: string): any; + tagName(element: any): string; + attributeMap(element: any): any; + hasAttribute(element: any, attribute: string): any; + getAttribute(element: any, attribute: string): any; + setAttribute(element: any, name: string, value: string): void; + removeAttribute(element: any, attribute: string): any; + templateAwareRoot(el: any): any; + createHtmlDocument(): Document; + defaultDoc(): Document; + getBoundingClientRect(el: any): any; + getTitle(): string; + setTitle(newTitle: string): void; + elementMatches(n: any, selector: string): boolean; + isTemplateElement(el: any): boolean; + isTextNode(node: Node): boolean; + isCommentNode(node: Node): boolean; + isElementNode(node: Node): boolean; + hasShadowRoot(node: any): boolean; + isShadowRoot(node: any): boolean; + importIntoDoc(node: Node): Node; + isPageRule(rule: any): boolean; + isStyleRule(rule: any): boolean; + isMediaRule(rule: any): boolean; + isKeyframesRule(rule: any): boolean; + getHref(el: Element): string; + getEventKey(event: any): string; + getGlobalEventTarget(target: string): EventTarget; + getHistory(): History; + getLocation(): Location; + getBaseHref(): any; + } +} + + + +declare module "angular2/src/di/binding" { + class Binding { + + } +} + +declare module "angular2/di" { + class Binding {} + function bind(token: any): any; + class Injector { + resolveAndCreateChild(bindings: [any]): Injector; + static resolveAndCreate(bindings: any): any; + static fromResolvedBindings(bindings: any): any; + asyncGet(di: any):any + get(di: any):any + } + var Inject: any; + var Injectable: any; + var Dependency: any; + var Optional: any; + + var ResolvedBinding: any; + var Key: any; + var KeyRegistry: any; + var TypeLiteral: any; + var NoBindingError: any; + var AbstractBindingError: any; + var AsyncBindingError: any; + var CyclicDependencyError: any; + var InstantiationError: any; + var InvalidBindingError: any; + var NoAnnotationError: any; + var OpaqueToken: any; + var ___esModule: any; + var InjectAnnotation: any; + var InjectPromiseAnnotation: any; + var InjectLazyAnnotation: any; + var OptionalAnnotation: any; + var InjectableAnnotation: any; + var DependencyAnnotation: any; +} diff --git a/src/typings/webpack.d.ts b/src/typings/webpack.d.ts new file mode 100644 index 0000000..530f652 --- /dev/null +++ b/src/typings/webpack.d.ts @@ -0,0 +1,5 @@ +declare var require: any; +declare var __filename: string; +declare var __dirname: string; +declare var global: any; +declare var module: any; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e1e340d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "version": "1.5.0", + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "declaration": false, + "noImplicitAny": false, + "removeComments": true, + "noLib": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "sourceMap": true, + "listFiles": true, + "outDir": "dist" + }, + "files": [ + "node_modules/typescript/bin/lib.dom.d.ts", + "src/typings/_custom.d.ts", + "src/app/components/app.ts", + "src/app/bootstrap.ts" + ] +} diff --git a/tsd.json b/tsd.json new file mode 100644 index 0000000..db4def1 --- /dev/null +++ b/tsd.json @@ -0,0 +1,33 @@ +{ + "version": "v4", + "repo": "borisyankov/DefinitelyTyped", + "ref": "master", + "path": "tsd_typings", + "bundle": "tsd_typings/tsd.d.ts", + "installed": { + "jasmine/jasmine.d.ts": { + "commit": "f6c8ca47193fb67947944a3170912672ac3e908e" + }, + "angular-protractor/angular-protractor.d.ts": { + "commit": "f6c8ca47193fb67947944a3170912672ac3e908e" + }, + "selenium-webdriver/selenium-webdriver.d.ts": { + "commit": "f6c8ca47193fb67947944a3170912672ac3e908e" + }, + "es6-promise/es6-promise.d.ts": { + "commit": "f6c8ca47193fb67947944a3170912672ac3e908e" + }, + "rx/rx.d.ts": { + "commit": "f6c8ca47193fb67947944a3170912672ac3e908e" + }, + "rx/rx-lite.d.ts": { + "commit": "f6c8ca47193fb67947944a3170912672ac3e908e" + }, + "angular2/angular2.d.ts": { + "commit": "284c2b8828f06bdde1f949a22ad174f5221d57f9" + }, + "angular2/router.d.ts": { + "commit": "284c2b8828f06bdde1f949a22ad174f5221d57f9" + } + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..4aff47f --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,222 @@ +// @AngularClass + +// Helper +var sliceArgs = Function.prototype.call.bind(Array.prototype.slice); +var NODE_ENV = process.env.NODE_ENV || 'development'; + +// Node +var webpack = require('webpack'); +var path = require('path'); +var pkg = require('./package.json'); + +// Webpack Plugins +var OccurenceOrderPlugin = webpack.optimize.OccurenceOrderPlugin; +var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin; +var UglifyJsPlugin = webpack.optimize.UglifyJsPlugin; +var DedupePlugin = webpack.optimize.DedupePlugin; +var DefinePlugin = webpack.DefinePlugin; +var BannerPlugin = webpack.BannerPlugin; + + +/* + * Config + */ + +var config = { + devtool: 'source-map', + // devtool: 'eval', + watch: true, + debug: true, + cache: true, + // our Development Server configs + /*devServer: { + inline: true, + colors: true, + historyApiFallback: true, + contentBase: 'src/public', + publicPath: '/__build__', + hot: true + },*/ + + // + entry: { + 'angular2': [ + // Angular 2 Deps + 'zone.js', + 'reflect-metadata', + 'rtts_assert/rtts_assert', + 'angular2/angular2' + ], + 'app': [ + // App + 'webpack-dev-server/client?http://localhost:8080', + 'webpack/hot/dev-server', + './src/app/bootstrap' + ] + }, + + // Config for our build files + output: { + path: root('__build__'), + filename: 'app.js', + // filename: '[name].[hash].js', + sourceMapFilename: 'app.js.map', + chunkFilename: '[id].chunk.js', + publicPath: '/__build__/' + }, + + resolve: { + root: __dirname, + extensions: ['', '.ts', '.js', '.json'], + alias: { + // we can switch between development and production + // 'angular2': 'node_modules/angular2/ts', + // 'angular2': 'angular2/ts/dev', + + 'app': 'src/app', + 'common': 'src/common', + + // 'components': 'src/app/components' + // 'services': '/app/services/*.js', + // 'stores/*': '/app/stores/*.js' + // 'angular2': 'angular2/es6/dev' + } + }, + + /* + * When using `templateUrl` and `styleUrls` please use `__filename` + * rather than `module.id` for `moduleId` in `@View` + */ + node: { + __filename: true + }, + + module: { + loaders: [ + // Support for *.json files. + { + test: /\.json$/, + loader: 'json' + }, + + // Support for CSS as raw text + { + test: /\.css$/, + loader: 'raw' + }, + + // support for .html as raw text + { + test: /\.html$/, + loader: 'raw' + }, + + // Support for .ts files. + { + test: /\.ts$/, + loader: 'typescript-simple?ignoreWarnings[]=2345', + exclude: [ + /\.spec\.ts$/, + /\.e2e\.ts$/, + /web_modules/, + /node_modules/ + ] + } + ], + noParse: [ + /rtts_assert\/src\/rtts_assert/ + ] + }, + context: __dirname, + stats: { + colors: true, + reasons: true + } +}; + + +var commons_chunks_plugins = [ + { + name: 'angular2', + minChunks: Infinity, + filename: 'angular2.js' + }, + { + name: 'common', + filename: 'common.js' + } +] + + +// +var environment_plugins = { + + all: [ + new DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify(NODE_ENV), + 'VERSION': pkg.version + }), + new OccurenceOrderPlugin(), + new DedupePlugin(), + ], + + production: [ + new UglifyJsPlugin({ + compress: { + warnings: false, + drop_debugger: false + }, + output: { + comments: false + }, + beautify: false + }), + new BannerPlugin(getBanner(), { + entryOnly: true + }) + ], + + development: [ + /* Dev Plugin */ + new webpack.HotModuleReplacementPlugin(), + ] + + } //env + +if (NODE_ENV === 'production') { + // replace filename `.js` with `.min.js` + config.output.filename = config.output.filename.replace('.js', '.min.js'); + config.output.sourceMapFilename = config.output.sourceMapFilename.replace('.js', '.min.js'); + commons_chunks_plugins = commons_chunks_plugins.map(function (chunk) { + return chunk.filename.replace('.js', '.min.js'); + }); +} else if (NODE_ENV === 'development') { + // any development actions here +} + +// create CommonsChunkPlugin instance for each config +var combine_common_chunks = commons_chunks_plugins.map(function (config) { + return new CommonsChunkPlugin(config); +}); + +console.log('NODE_ENV', NODE_ENV); +// conbine everything +config.plugins = [].concat(combine_common_chunks, environment_plugins.all, environment_plugins[NODE_ENV]); + + +module.exports = config; + +// Helper functions +function getBanner() { + return 'Angular2.0 App v' + pkg.version; +} + +function root(args) { + args = sliceArgs(arguments, 0); + return path.join.apply(path, [__dirname].concat(args)); +} + +function rootNode(args) { + args = sliceArgs(arguments, 0); + return root.apply(path, ['node_modules'].concat(args)); +}