diff options
| author | Teddy Wing | 2013-11-10 01:56:55 -0500 | 
|---|---|---|
| committer | Teddy Wing | 2013-11-10 01:56:55 -0500 | 
| commit | a0b372e4e3268f478963d43ccf40b5cee1f6e082 (patch) | |
| tree | 73a766ea8f73b7d7e8cbadda686a87a5d1e55fd5 /assets/js/models/sample.js | |
| parent | e174c16db3fe84f9d69e756a533f784dac546482 (diff) | |
| download | clip-play-a0b372e4e3268f478963d43ccf40b5cee1f6e082.tar.bz2 | |
Add time values to the drag handles
Time in mm:ss appears on the drag handles. Drag them around and the
time changes accordingly.
NOTE: this version is kind of borked because for some reason in my
      testing the start of the video displayed as 24 seconds.
Diffstat (limited to 'assets/js/models/sample.js')
| -rw-r--r-- | assets/js/models/sample.js | 24 | 
1 files changed, 24 insertions, 0 deletions
diff --git a/assets/js/models/sample.js b/assets/js/models/sample.js index 79cbace..d059f6b 100644 --- a/assets/js/models/sample.js +++ b/assets/js/models/sample.js @@ -10,6 +10,30 @@ ClipPlay.Models.Sample = Backbone.Model.extend({  	}, +	in_minutes_and_seconds: function(seconds) { +		var minutes = Math.floor(seconds / 60); +		seconds = Math.floor(seconds); +		var seconds = seconds - minutes * 60; +		 +		if (seconds < 10) { +			seconds = '0' + seconds; +		} +		console.log(minutes + ':' + seconds); +		return { +			minutes: minutes, +			seconds: seconds +		}; +	}, +	 +	start_in_minutes_and_seconds: function() { +		return this.in_minutes_and_seconds(this.get('start')); +	}, +	 +	stop_in_minutes_and_seconds: function() { +		return this.in_minutes_and_seconds(this.get('stop')); +	}, +	 +	  	play: function() {  	}  | 
