You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			37 lines
		
	
	
		
			726 B
		
	
	
	
		
			JavaScript
		
	
			
		
		
	
	
			37 lines
		
	
	
		
			726 B
		
	
	
	
		
			JavaScript
		
	
| /* global Whisper, i18n */
 | |
| 
 | |
| // eslint-disable-next-line func-names
 | |
| (function() {
 | |
|   'use strict';
 | |
| 
 | |
|   window.Whisper = window.Whisper || {};
 | |
| 
 | |
|   Whisper.LastSeenIndicatorView = Whisper.View.extend({
 | |
|     className: 'module-last-seen-indicator',
 | |
|     templateName: 'last-seen-indicator-view',
 | |
|     initialize(options = {}) {
 | |
|       this.count = options.count || 0;
 | |
|     },
 | |
| 
 | |
|     increment(count) {
 | |
|       this.count += count;
 | |
|       this.render();
 | |
|     },
 | |
| 
 | |
|     getCount() {
 | |
|       return this.count;
 | |
|     },
 | |
| 
 | |
|     render_attributes() {
 | |
|       const unreadMessages =
 | |
|         this.count === 1
 | |
|           ? i18n('unreadMessage')
 | |
|           : i18n('unreadMessages', [this.count]);
 | |
| 
 | |
|       return {
 | |
|         unreadMessages,
 | |
|       };
 | |
|     },
 | |
|   });
 | |
| })();
 |