equal
deleted
inserted
replaced
44 IriSP.secondsToTime = function(secs) { |
44 IriSP.secondsToTime = function(secs) { |
45 var hours = Math.abs(parseInt( secs / 3600 ) % 24); |
45 var hours = Math.abs(parseInt( secs / 3600 ) % 24); |
46 var minutes = Math.abs(parseInt( secs / 60 ) % 60); |
46 var minutes = Math.abs(parseInt( secs / 60 ) % 60); |
47 var seconds = parseFloat(Math.abs(secs % 60).toFixed(0)); |
47 var seconds = parseFloat(Math.abs(secs % 60).toFixed(0)); |
48 |
48 |
49 return {"hours" : hours, "minutes" : minutes, "seconds" : seconds}; |
49 var toString_fn = function() { |
|
50 var ret = ""; |
|
51 if (hours > 0) |
|
52 ret = IriSP.padWithZeros(this.hours) + ":"; |
|
53 ret += IriSP.padWithZeros(this.minutes) + ":" + IriSP.padWithZeros(this.seconds); |
|
54 |
|
55 return ret; |
|
56 } |
|
57 return {"hours" : hours, "minutes" : minutes, "seconds" : seconds, toString: toString_fn}; |
50 }; |
58 }; |
|
59 |
|
60 IriSP.secondsToString |
51 |
61 |
52 /* format a tweet - replaces @name by a link to the profile, #hashtag, etc. */ |
62 /* format a tweet - replaces @name by a link to the profile, #hashtag, etc. */ |
53 IriSP.formatTweet = function(tweet) { |
63 IriSP.formatTweet = function(tweet) { |
54 var rNickname = /@(\w+)/gi; // matches a @handle |
64 var rNickname = /@(\w+)/gi; // matches a @handle |
55 var rHashtag = /#(\w+)/gi; // matches a hashtag |
65 var rHashtag = /#(\w+)/gi; // matches a hashtag |