-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c53ed4b
commit 384e4c0
Showing
9 changed files
with
214 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
/libpeerconnection.log | ||
npm-debug.log | ||
testem.log | ||
.DS_Store |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Component.extend({ | ||
|
||
value: null, | ||
|
||
label: null, | ||
|
||
actions: { | ||
press() { | ||
this.get('onPress')(this.get('value')); | ||
} | ||
} | ||
}); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,76 @@ | ||
<div id="display"> | ||
{{#if isOn}} | ||
{{#if (eq mode 'settings')}} | ||
{{format-operator operator}} | ||
L | ||
{{level}} | ||
{{else if (eq mode 'game')}} | ||
{{#if isComplete}} | ||
<span class="blink"> | ||
{{correctAnswerCount}} | ||
</span> | ||
{{else}} | ||
{{#if isIncorrect}} | ||
EEE | ||
{{else}} | ||
{{problem.termOne}} | ||
{{format-operator problem.operator}} | ||
{{problem.termTwo}} | ||
= | ||
{{answer}} | ||
<div id="little-professor"> | ||
<div id="display"> | ||
<div class="display-characters"> | ||
{{#if isOn}} | ||
{{#if (eq mode 'settings')}} | ||
{{format-operator operator}} | ||
L | ||
{{level}} | ||
{{else if (eq mode 'game')}} | ||
{{#if isComplete}} | ||
<span class="blink"> | ||
{{correctAnswerCount}} | ||
</span> | ||
{{else}} | ||
{{#if isIncorrect}} | ||
EEE | ||
{{else}} | ||
{{problem.termOne}} | ||
{{format-operator problem.operator}} | ||
{{problem.termTwo}} | ||
= | ||
{{answer}} | ||
{{/if}} | ||
{{/if}} | ||
{{/if}} | ||
{{else}} | ||
| ||
{{/if}} | ||
{{/if}} | ||
{{else}} | ||
| ||
{{/if}} | ||
</div> | ||
|
||
<button {{action 'turnOff'}}> | ||
OFF | ||
</button> | ||
|
||
<button {{action 'turnOn'}}> | ||
ON | ||
</button> | ||
|
||
<button {{action 'nextLevel'}}> | ||
LEVEL | ||
</button> | ||
|
||
<button {{action 'go'}}> | ||
GO | ||
</button> | ||
|
||
<button {{action 'changeSettings'}}> | ||
SET | ||
</button> | ||
</div> | ||
</div> | ||
<div id="main"> | ||
<div id="face"> | ||
| ||
</div> | ||
<div id="buttons"> | ||
<div class="button-row"> | ||
{{labeled-button label='OFF' onPress=(action 'turnOff')}} | ||
<div class="button-item"> </div> | ||
{{labeled-button label='SET' onPress=(action 'changeSettings')}} | ||
{{labeled-button label='LEVEL' onPress=(action 'nextLevel')}} | ||
</div> | ||
|
||
{{change-operator-button operator='+' onClick=(action 'changeOperator')}} | ||
<div class="button-row"> | ||
{{labeled-button value=7 onPress=(action 'pressDigit')}} | ||
{{labeled-button value=8 onPress=(action 'pressDigit')}} | ||
{{labeled-button value=9 onPress=(action 'pressDigit')}} | ||
{{labeled-button value='/' label=(format-operator '/') onPress=(action 'changeOperator')}} | ||
</div> | ||
|
||
{{change-operator-button operator='-' onClick=(action 'changeOperator')}} | ||
<div class="button-row"> | ||
{{labeled-button value=4 onPress=(action 'pressDigit')}} | ||
{{labeled-button value=5 onPress=(action 'pressDigit')}} | ||
{{labeled-button value=6 onPress=(action 'pressDigit')}} | ||
{{labeled-button value='*' label=(format-operator '*') onPress=(action 'changeOperator')}} | ||
</div> | ||
|
||
{{change-operator-button operator='/' onClick=(action 'changeOperator')}} | ||
<div class="button-row"> | ||
{{labeled-button value=1 onPress=(action 'pressDigit')}} | ||
{{labeled-button value=2 onPress=(action 'pressDigit')}} | ||
{{labeled-button value=3 onPress=(action 'pressDigit')}} | ||
{{labeled-button value='-' label=(format-operator '-') onPress=(action 'changeOperator')}} | ||
</div> | ||
|
||
{{change-operator-button operator='*' onClick=(action 'changeOperator')}} | ||
<div class="button-row"> | ||
{{labeled-button label='ON' onPress=(action 'turnOn')}} | ||
{{labeled-button value=0 onPress=(action 'pressDigit')}} | ||
{{labeled-button label='GO' onPress=(action 'go')}} | ||
{{labeled-button value='+' label=(format-operator '+') onPress=(action 'changeOperator')}} | ||
</div> | ||
|
||
<div> | ||
{{#each digits as |digit|}} | ||
<button {{action 'pressDigit' digit}}> | ||
{{digit}} | ||
</button> | ||
{{/each}} | ||
<div id="product-name"> | ||
Little Professor ™ | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="button-item"> | ||
<div class="button-label"> | ||
{{#if label}} | ||
{{label}} | ||
{{else}} | ||
{{value}} | ||
{{/if}} | ||
</div> | ||
<button {{action 'press'}}></button> | ||
</div> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { moduleForComponent, test } from 'ember-qunit'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
moduleForComponent('labeled-button', 'Integration | Component | labeled button', { | ||
integration: true | ||
}); | ||
|
||
test('it renders', function(assert) { | ||
|
||
// Set any properties with this.set('myProperty', 'value'); | ||
// Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL + | ||
|
||
this.render(hbs`{{labeled-button}}`); | ||
|
||
assert.equal(this.$().text().trim(), ''); | ||
|
||
// Template block usage:" + EOL + | ||
this.render(hbs` | ||
{{#labeled-button}} | ||
template block text | ||
{{/labeled-button}} | ||
`); | ||
|
||
assert.equal(this.$().text().trim(), 'template block text'); | ||
}); |