Remove momentjs

MomentJS was only used in a single javascript function,
to do Seconds → (Minutes, Seconds). This commit
replaces this with a hand-rolled version, and removes
MomentJS.

Signed-off-by: jvoisin <julien.voisin@dustri.org>
master
jvoisin 6 years ago
parent 143a220719
commit f501bfd5e1
  1. 1
      airsonic-main/src/main/webapp/WEB-INF/jsp/playQueue.jsp
  2. 7
      airsonic-main/src/main/webapp/script/moment-2.18.1.min.js
  3. 505
      airsonic-main/src/main/webapp/script/moment-with-locales-2.18.1.min.js
  4. 11
      airsonic-main/src/main/webapp/script/playQueue/javaJukeboxPlayerControlBar.js

@ -3,7 +3,6 @@
<html><head> <html><head>
<%@ include file="head.jsp" %> <%@ include file="head.jsp" %>
<%@ include file="jquery.jsp" %> <%@ include file="jquery.jsp" %>
<script type="text/javascript" src="<c:url value="/script/moment-2.18.1.min.js"/>"></script>
<link type="text/css" rel="stylesheet" href="<c:url value="/script/webfx/luna.css"/>"> <link type="text/css" rel="stylesheet" href="<c:url value="/script/webfx/luna.css"/>">
<script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script> <script type="text/javascript" src="<c:url value="/script/scripts-2.0.js"/>"></script>
<script type="text/javascript" src="<c:url value="/dwr/interface/nowPlayingService.js"/>"></script> <script type="text/javascript" src="<c:url value="/dwr/interface/nowPlayingService.js"/>"></script>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -68,13 +68,10 @@ function updateJavaJukeboxPlayerControlBar(song){
} }
function songTimeAsString(timeInSeconds) { function songTimeAsString(timeInSeconds) {
var m = moment.duration(timeInSeconds, 'seconds'); var minutes = Math.floor(timeInSeconds / 60);
var seconds = m.seconds(); var seconds = seconds - minutes * 60;
var secondsAsString = seconds;
if (seconds < 10) { return minutes + ":" + ("00" + seconds).slice(-2);
secondsAsString = "0" + seconds;
}
return m.minutes() + ":" + secondsAsString;
} }
function newSongPlaying(song) { function newSongPlaying(song) {

Loading…
Cancel
Save