4.9.beta2 - Remove Add Next / Add Last

Tutorials, tips and tricks.

Moderator: moderators

4.9.beta2 - Remove Add Next / Add Last

Postby mikekay » Tue Nov 26, 2013 6:53 pm

Hello sorry found the little box annoying after a while so I decided to mod -- here is the snippet for anyone else.

Navigate to : C:\subsonic\jetty\3636\webapp\WEB-INF\jsp\playAddDownload.jsp



Code: Select all
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="iso-8859-1" %>
<%@ include file="include.jsp" %>

<%--
PARAMETERS
  id: ID of file.
  video: Whether the file is a video (default false).
  playEnabled: Whether the current user is allowed to play songs (default true).
  addEnabled: Whether the current user is allowed to add songs to the playlist (default true).
  downloadEnabled: Whether the current user is allowed to download songs (default false).
  starEnabled: Whether to show star/unstar controls (default false).
  starred: Whether the file is currently starred.
  asTable: Whether to put the images in td tags.
--%>

<sub:url value="/download.view" var="downloadUrl">
    <sub:param name="id" value="${param.id}"/>
</sub:url>
<c:if test="${param.starEnabled}">
    <c:if test="${param.asTable}"><td></c:if>
    <a href="#" onclick="toggleStar(${param.id}, '#starImage${param.id}'); return false;">
        <c:choose>
            <c:when test="${param.starred}">
                <img id="starImage${param.id}" src="<spring:theme code="ratingOnImage"/>" alt="">
            </c:when>
            <c:otherwise>
                <img id="starImage${param.id}" src="<spring:theme code="ratingOffImage"/>" alt="">
            </c:otherwise>
        </c:choose>
    </a>
    <c:if test="${param.asTable}"></td></c:if>
</c:if>

<c:if test="${param.asTable}"><td></c:if>
<c:if test="${empty param.playEnabled or param.playEnabled}">
    <c:choose>
        <c:when test="${param.video}">
            <sub:url value="/videoPlayer.view" var="videoUrl">
                <sub:param name="id" value="${param.id}"/>
            </sub:url>
            <a href="${videoUrl}" target="main">
                <img src="<spring:theme code="playImage"/>" alt="<fmt:message key="common.play"/>"
                     title="<fmt:message key="common.play"/>"></a>
        </c:when>
        <c:otherwise>
            <a href="javascript:noop()" onclick="top.playQueue.onPlay(${param.id});">
                <img src="<spring:theme code="playImage"/>" alt="<fmt:message key="common.play"/>"
                     title="<fmt:message key="common.play"/>"></a>
        </c:otherwise>
    </c:choose>
</c:if>
<c:if test="${param.asTable}"></td></c:if>

<c:if test="${param.asTable}"><td></c:if>
<c:if test="${(empty param.addEnabled or param.addEnabled) and not param.video}">
    <a href="javascript:noop()" onclick="top.playQueue.onAdd(${param.id});">
<img id="add${param.id}" src="<spring:theme code="addImage"/>" alt="<fmt:message key="common.add"/>"
         title="<fmt:message key="common.add"/>"></a>
</c:if>
<c:if test="${param.asTable}"></td></c:if>

<c:if test="${param.asTable}"><td></c:if>
<c:if test="${param.downloadEnabled}">
    <a href="${downloadUrl}">
        <img src="<spring:theme code="downloadImage"/>" alt="<fmt:message key="common.download"/>"
             title="<fmt:message key="common.download"/>"></a>
</c:if>
<c:if test="${param.asTable}"></td></c:if>


Code: Select all
<a href="javascript:noop()" onclick="top.playQueue.onAdd(${param.id});">
<-- Adds Last Automatically -->

Can be changed to if preffered

Code: Select all
<a href="javascript:noop()" onclick="top.playQueue.onAddNext(${param.id});">
<-- Adds Next Automatically -->
Last edited by mikekay on Tue Nov 26, 2013 7:12 pm, edited 1 time in total.
mikekay
 
Posts: 9
Joined: Tue Nov 26, 2013 2:59 pm

Re: 4.9.beta2 - Remove Add Next / Add Last

Postby mikekay » Tue Nov 26, 2013 7:02 pm

Songs on the left.view dont work to add only main -- trying to find the code associated.

Thanks,

Any help?
mikekay
 
Posts: 9
Joined: Tue Nov 26, 2013 2:59 pm

Re: 4.9.beta2 - Remove Add Next / Add Last

Postby mikekay » Tue Nov 26, 2013 7:11 pm

All Works as expected nothing needed to be changed on the left.view it imports playAddDownload.jsp.

I forgot to link it to the noop so that it could pass the param id.

All works now,,,

Enjoy,

MikeKay
mikekay
 
Posts: 9
Joined: Tue Nov 26, 2013 2:59 pm


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest