This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function webpackUniversalModuleDefinition(root, factory) { | |
if(typeof exports === 'object' && typeof module === 'object') | |
module.exports = factory(); | |
else if(typeof define === 'function' && define.amd) | |
define([], factory); | |
else if(typeof exports === 'object') | |
exports["fun"] = factory(); | |
else | |
root["fun"] = factory(); | |
})(this, function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var five = require("johnny-five"), | |
TesselIO = require("tessel-io"), | |
board = new five.Board({ | |
io: new TesselIO() | |
}); | |
// Initial Red color to start with. | |
// Decent transitions are easier with RGB vs HEX. | |
var startingColorObject = { | |
r: 255, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {DomEventsPlugin} from 'angular2/platform/common_dom'; | |
// Have to pull DOM from src because platform/common_dom returns DOM as null. | |
// I believe its a TS bug. | |
import {DOM} from 'angular2/src/platform/dom/dom_adapter'; | |
import {Injectable} from 'angular2/core'; | |
import {noop} from 'angular2/src/facade/lang'; | |
@Injectable() | |
export class DOMOutsideEventPlugin extends DomEventsPlugin { | |
eventMap: Object = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {bootstrap} from 'angular2/platform/browser'; | |
import {DIRECTIVES, PIPES, PROVIDERS, ENV_PROVIDERS, PLUGINS} from './platform/browser'; | |
import {App, APP_PROVIDERS} from './app'; | |
bootstrap(App, [ | |
...PROVIDERS, | |
...ENV_PROVIDERS, | |
...DIRECTIVES, | |
...PIPES, | |
...APP_PROVIDERS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {bootstrap} from 'angular2/platform/browser'; | |
import {DIRECTIVES, PIPES, PROVIDERS, ENV_PROVIDERS, PLUGINS} from './platform/browser'; | |
import {App, APP_PROVIDERS} from './app'; | |
bootstrap(App, [ | |
...PROVIDERS, | |
...ENV_PROVIDERS, | |
...DIRECTIVES, | |
...PIPES, | |
...APP_PROVIDERS, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {CONST_EXPR} from 'angular2/src/facade/lang'; | |
import {BaseException, WrappedException} from 'angular2/src/facade/exceptions'; | |
import {Injectable, Inject, OpaqueToken} from 'angular2/src/core/di'; | |
import {NgZone} from 'angular2/src/core/zone/ng_zone'; | |
import {ListWrapper} from 'angular2/src/facade/collection'; | |
export const EVENT_MANAGER_PLUGINS: OpaqueToken = | |
CONST_EXPR(new OpaqueToken("EventManagerPlugins")); | |
@Injectable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listen(renderElement: any, name: string, callback: Function): Function { | |
return this._rootRenderer.eventManager.addEventListener(renderElement, name, | |
decoratePreventDefault(callback)); | |
} | |
listenGlobal(target: string, name: string, callback: Function): Function { | |
return this._rootRenderer.eventManager.addGlobalEventListener(target, name, | |
decoratePreventDefault(callback)); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function { | |
var plugin = this._findPluginFor(eventName); | |
return plugin.addEventListener(element, eventName, handler); | |
} | |
addGlobalEventListener(target: string, eventName: string, handler: Function): Function { | |
var plugin = this._findPluginFor(eventName); | |
return plugin.addGlobalEventListener(target, eventName, handler); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { OpaqueToken } from 'angular2/src/core/di'; | |
import { NgZone } from 'angular2/src/core/zone/ng_zone'; | |
export declare const EVENT_MANAGER_PLUGINS: OpaqueToken; | |
export declare class EventManager { | |
private _zone; | |
private _plugins; | |
constructor(plugins: EventManagerPlugin[], _zone: NgZone); | |
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function; | |
addGlobalEventListener(target: string, eventName: string, handler: Function): Function; | |
getZone(): NgZone; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getMultiEventArray(eventName: string): string[] { | |
return eventName.split(",") | |
.filter((item, index): boolean => { return item && item != '' }) | |
} | |
supports(eventName: string): boolean { | |
return this.getMultiEventArray(eventName).length > 1 | |
} |