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
hsc.models.initStore = -> | |
server = require('com.obscure.TiTouchDB'); | |
hsc.models.db = db = server.databaseNamed('hackersc'); | |
db.ensureCreated(); | |
hsc.models.design = design = db.designDocumentWithName 'hsc' | |
currentRoundMap = " | |
function(doc) { | |
if (doc.type === 'round' && doc.status === 'current') |
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
if 9 >= holeNumber >= 1 | |
outScore += holeScore if holeScore | |
outToPar += holeScore - par if par.length and holeScore | |
else | |
inScore += holeScore if holeScore | |
inToPar += holeScore - par if par.length and holeScore |
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
calculateScore: -> | |
totalToPar = 0 | |
holes = @get 'holes' | |
score = 0 | |
outScore = 0 | |
outToPar = 0 | |
inScore = 0 | |
inToPar = 0 | |
for hole in holes |
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
owView = hsc.ui.View.create | |
contentDisplayProperties: ['description'] | |
createChildViews: (container) -> | |
container.left = 0 | |
container.right = 0 | |
container.top = 0 | |
container.bottom = 0 | |
@label = Ti.UI.createLabel |
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
{{#my-modal}} | |
{{my-form saveComplete=(action 'hideModal')}} | |
{{/my-modal}} |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
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
In comp-a | |
Ember.extend(... | |
didSave(){ | |
// default implementation | |
} | |
actions: { | |
onSave() { |
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
In component Chainer | |
Ember.extend.... { | |
first(){}, | |
second(){}, | |
actions: { | |
chain(){ |
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 Ember from 'ember'; | |
import Chainer from 'app/components/my-chainer' | |
export default Chainer.extend({ | |
first(){ | |
console.log('subclass first', this) | |
} | |
}); |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
scope: 'inner', | |
actions: { | |
fromOuter(){}, | |
clicked(){ | |
console.log('clicked', this.get('scope')); | |
this.get('fromOuter')(); | |
} |