mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	| @@ -653,6 +653,14 @@ Emacs Lisp: | |||||||
|   - .el |   - .el | ||||||
|   - .emacs |   - .emacs | ||||||
|  |  | ||||||
|  | EmberScript: | ||||||
|  |   type: programming | ||||||
|  |   color: "#f64e3e" | ||||||
|  |   lexer: CoffeeScript | ||||||
|  |   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