mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-28 17:20:22 +00:00
added emberscript and provided sample
This commit is contained in:
@@ -612,6 +612,13 @@ Emacs Lisp:
|
||||
- .el
|
||||
- .emacs
|
||||
|
||||
EmberScript:
|
||||
type: programming
|
||||
color: "#f64e3e"
|
||||
extensions:
|
||||
- .em
|
||||
- .emberscript
|
||||
|
||||
Erlang:
|
||||
type: programming
|
||||
color: "#0faf8d"
|
||||
|
||||
23
samples/EmberScript/momentComponent.em
Normal file
23
samples/EmberScript/momentComponent.em
Normal file
@@ -0,0 +1,23 @@
|
||||
class App.FromNowView extends Ember.View
|
||||
tagName: 'time'
|
||||
template: Ember.Handlebars.compile '{{view.output}}'
|
||||
output: ~>
|
||||
return moment(@value).fromNow()
|
||||
|
||||
didInsertElement: ->
|
||||
@tick()
|
||||
|
||||
tick: ->
|
||||
f = ->
|
||||
@notifyPropertyChange 'output'
|
||||
@tick()
|
||||
|
||||
nextTick = Ember.run.later(this, f, 1000)
|
||||
@set 'nextTick', nextTick
|
||||
|
||||
willDestroyElement: ->
|
||||
nextTick = @nextTick
|
||||
Ember.run.cancel nextTick
|
||||
|
||||
Ember.Handlebars.helper 'fromNow', App.FromNowView
|
||||
|
||||
Reference in New Issue
Block a user