diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-07-02 21:24:02 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-07-02 21:24:02 -0700 |
commit | a1a18f77a50804e0127dfa4b0f5240c49c541184 (patch) | |
tree | 19a38880afe505beddb5590379a8134d7730a277 /subsonic-main/src/main/webapp/WEB-INF/jsp/lyrics.jsp | |
parent | b61d787706979e7e20f4c3c4f93c1f129d92273f (diff) | |
download | dsub-a1a18f77a50804e0127dfa4b0f5240c49c541184.tar.gz dsub-a1a18f77a50804e0127dfa4b0f5240c49c541184.tar.bz2 dsub-a1a18f77a50804e0127dfa4b0f5240c49c541184.zip |
Initial Commit
Diffstat (limited to 'subsonic-main/src/main/webapp/WEB-INF/jsp/lyrics.jsp')
-rw-r--r-- | subsonic-main/src/main/webapp/WEB-INF/jsp/lyrics.jsp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/subsonic-main/src/main/webapp/WEB-INF/jsp/lyrics.jsp b/subsonic-main/src/main/webapp/WEB-INF/jsp/lyrics.jsp new file mode 100644 index 00000000..82d5ce37 --- /dev/null +++ b/subsonic-main/src/main/webapp/WEB-INF/jsp/lyrics.jsp @@ -0,0 +1,79 @@ +<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1"%>
+
+<html><head>
+ <%@ include file="head.jsp" %>
+ <title><fmt:message key="lyrics.title"/></title>
+ <script type="text/javascript" src="<c:url value="/dwr/interface/lyricsService.js"/>"></script>
+ <script type="text/javascript" src="<c:url value="/dwr/engine.js"/>"></script>
+ <script type="text/javascript" src="<c:url value="/dwr/util.js"/>"></script>
+
+ <script type="text/javascript" language="javascript">
+
+ dwr.engine.setErrorHandler(null);
+
+ function init() {
+ getLyrics('${model.artist}', '${model.song}');
+ }
+
+ function getLyrics(artist, song) {
+ $("wait").style.display = "inline";
+ $("lyrics").style.display = "none";
+ $("noLyricsFound").style.display = "none";
+ lyricsService.getLyrics(artist, song, getLyricsCallback);
+ }
+
+ function getLyricsCallback(lyricsInfo) {
+ dwr.util.setValue("lyricsHeader", lyricsInfo.artist + " - " + lyricsInfo.title);
+ var lyrics;
+ if (lyricsInfo.lyrics != null) {
+ lyrics = lyricsInfo.lyrics.replace(/\n/g, "<br>");
+ }
+ dwr.util.setValue("lyricsText", lyrics, { escapeHtml:false });
+ $("wait").style.display = "none";
+ if (lyrics != null) {
+ $("lyrics").style.display = "inline";
+ } else {
+ $("noLyricsFound").style.display = "inline";
+ }
+ }
+ </script>
+
+</head>
+<body class="mainframe bgcolor1" onload="init();">
+
+<table>
+ <tr>
+ <td><fmt:message key="lyrics.artist"/></td>
+ <td style="padding-left:0.50em"><input id="artist" type="text" size="40" value="${model.artist}" tabindex="1"/></td>
+ <td style="padding-left:0.75em"><input type="submit" value="<fmt:message key="lyrics.search"/>" style="width:6em"
+ onclick="getLyrics(dwr.util.getValue('artist'), dwr.util.getValue('song'))" tabindex="3"/></td>
+ </tr>
+ <tr>
+ <td><fmt:message key="lyrics.song"/></td>
+ <td style="padding-left:0.50em"><input id="song" type="text" size="40" value="${model.song}" tabindex="2"/></td>
+ <td style="padding-left:0.75em"><input type="submit" value="<fmt:message key="common.close"/>" style="width:6em"
+ onclick="self.close()" tabindex="4"/></td>
+ </tr>
+</table>
+
+<hr/>
+<h2 id="wait"><fmt:message key="lyrics.wait"/></h2>
+<h2 id="noLyricsFound" style="display:none"><fmt:message key="lyrics.nolyricsfound"/></h2>
+
+<div id="lyrics" style="display:none;">
+ <h2 id="lyricsHeader" style="text-align:center;margin-bottom:1em"></h2>
+
+ <div id="lyricsText"></div>
+
+ <p class="detail" style="text-align:right">
+ <fmt:message key="lyrics.courtesy"/>
+ </p>
+</div>
+
+<hr/>
+<p style="text-align:center">
+ <a href="javascript:self.close()">[<fmt:message key="common.close"/>]</a>
+</p>
+
+</body>
+</html>
|