mirror of
				https://github.com/optim-enterprises-bv/control-pane.git
				synced 2025-11-04 03:47:49 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			423 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			423 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
define(
 | 
						|
	"Message",
 | 
						|
	[],
 | 
						|
	function() {
 | 
						|
 | 
						|
		function Message(model) {
 | 
						|
			if (model !== undefined) {
 | 
						|
				this.author = ko.observable(model.author);
 | 
						|
				this.body = ko.observable(model.body);
 | 
						|
			} else {
 | 
						|
				this.author = ko.observable("Anonymous");
 | 
						|
				this.body = ko.observable("");
 | 
						|
			}
 | 
						|
 | 
						|
			this.toModel = function() {
 | 
						|
				return {
 | 
						|
					author: this.author(),
 | 
						|
					body: this.body()
 | 
						|
				};
 | 
						|
			}
 | 
						|
		}
 | 
						|
 | 
						|
		return Message;
 | 
						|
	}
 | 
						|
);
 |