mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
added emberscript and provided sample
This commit is contained in:
@@ -612,6 +612,13 @@ Emacs Lisp:
|
|||||||
- .el
|
- .el
|
||||||
- .emacs
|
- .emacs
|
||||||
|
|
||||||
|
EmberScript:
|
||||||
|
type: programming
|
||||||
|
color: "#f64e3e"
|
||||||
|
extensions:
|
||||||
|
- .em
|
||||||
|
- .emberscript
|
||||||
|
|
||||||
Erlang:
|
Erlang:
|
||||||
type: programming
|
type: programming
|
||||||
color: "#0faf8d"
|
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