# HG changeset patch # User hamidouk # Date 1319098740 -7200 # Node ID 912f100fecb0079f452e2e50b44bea3e48791853 # Parent ed4ac18baf0709f106d59fbe75741e9de4302888 added a small utility function to convert a time to a progression percentage. diff -r ed4ac18baf07 -r 912f100fecb0 src/js/utils.js --- a/src/js/utils.js Wed Oct 19 15:00:34 2011 +0200 +++ b/src/js/utils.js Thu Oct 20 10:19:00 2011 +0200 @@ -23,6 +23,11 @@ } } +/* convert a time to a percentage in the media */ +IriSP.timeToPourcent = function(time,timetotal){ + return (parseInt(Math.round(time/timetotal*100))); +}; + /* for ie compatibility if (Object.prototype.__defineGetter__&&!Object.defineProperty) { Object.defineProperty=function(obj,prop,desc) {