This file contains 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'; | |
import {AuthService} from './infrastructure/auth-service'; | |
import {inject} from 'aurelia-framework'; | |
import 'fetch'; | |
export function configure(aurelia) { | |
aurelia.use | |
.standardConfiguration() | |
.developmentLogging() | |
.plugin('aurelia-validation'); |
This file contains 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 {computedFrom} from 'aurelia-framework'; | |
import {Container} from 'aurelia-dependency-injection'; | |
import {ensure} from 'aurelia-validation'; | |
import {Validation} from 'aurelia-validation'; | |
export class Project { | |
@ensure(function(it) { it.isNotEmpty().hasLengthBetween(3, 100) }) | |
_title = null; | |
@ensure(function(it) { it.isNotEmpty().hasLengthBetween(5, 300) }) |
This file contains 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
Save() { | |
let me = this; | |
this.project.validation.validate() | |
.then(() => { | |
$("#new-card").modal('hide'); | |
me.state.addOrUpdateProject(me.project); | |
me.router.navigateToRoute('overview'); | |
}).catch(error => { | |
This file contains 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 {inject} from 'aurelia-framework'; | |
import {computedFrom} from 'aurelia-framework'; | |
import {ApplicationState} from './infrastructure/application-state'; | |
@inject(ApplicationState) | |
export class Overview { | |
_projects = []; | |
constructor(state) { | |
state.getProjects() |
This file contains 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
<template> | |
<require from="./idea-card"></require> | |
<section> | |
<div class="card-columns"> | |
<idea-card project.bind="project" repeat.for="project of projects" /> | |
</div> | |
</section> | |
</template> |
This file contains 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 {inject} from "aurelia-framework"; | |
import {_} from 'lodash'; | |
import {Tooltips} from '../data/tooltips' | |
@inject(Tooltips) | |
export class TooltipService { | |
_storageToken = "HackathonPlanner_Tooltips"; | |
_tooltips = []; | |
_tooltipState = [ |
This file contains 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
export class Tooltips { | |
data = [{ | |
type: "Overview", | |
tips: [{ | |
select: ".navbar", | |
title: "Welcome to Hackathon Planner!", | |
content: "These tips are designed to help you get up and running in seconds and then they'll get out of the way. Click or tap on a tooltip to move forward.", | |
placement: "bottom" | |
}, { | |
select: "button", |
This file contains 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 {Aurelia} from 'aurelia-framework'; | |
import {inject} from 'aurelia-framework'; | |
import {HttpClient} from 'aurelia-http-client'; | |
@inject(Aurelia, HttpClient) | |
export class AuthService { | |
// As soon as the AuthService is created, we query local storage to | |
// see if the login information has been stored. If so, we immediately | |
// load it into the session object on the AuthService. | |
constructor(Aurelia, HttpClient) { |
This file contains 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 HID = require('node-hid'); | |
var bitwise = require('bitwise'); | |
var socket = require('socket.io-client')('https://frill-crafter.hyperdev.space'); | |
device.on("data", function(data) { | |
// Interpret data buffer and figure out which buttons on which controllers are being pressed | |
// ... Visit https://github.com/hakant/NfieldQuizGame to see the actual code | |
// Then emit the following message to the socket.io server running on hyperdev (for each controller) | |
socket.emit('button-clicked', `{ "ControllerId": ${controllerId}, "ButtonId": ${buttonId} }`); |
OlderNewer