Page 1 of 1

New window when you upload music mod.

PostPosted: Sun Apr 19, 2009 2:20 am
by cyclopes

PostPosted: Wed Jun 10, 2009 8:28 pm
by jonathanroz
Cyclopes,

Thanks for putting this mod together. I found a few things that can be updated.

1) Your image names dont match the instructions on what to put in the default theme file.
Code: Select all
loadImage_mini = icons/updisk_mini.png


should be

Code: Select all
loadImage_mini = icons/up.png


2) Rename upwin.jsp to headup.jsp

3) It might make sense to remove the other upload option that is still listed under "More" to do that just open more.jsp and delete the following lines

Code: Select all
<c:if test="${model.user.uploadRole}">

    <h2><img src="<spring:theme code="uploadImage"/>" alt=""/>&nbsp;<fmt:message key="more.upload.title"/></h2>

    <form method="post" enctype="multipart/form-data" action="upload.view">
        <table>
            <tr>
                <td><fmt:message key="more.upload.source"/></td>
                <td colspan="2"><input type="file" id="file" name="file" size="40"/></td>
            </tr>
            <tr>
                <td><fmt:message key="more.upload.target"/></td>
                <td><input type="text" id="dir" name="dir" size="37" value="${model.uploadDirectory}"/></td>
                <td><input type="submit" value="<fmt:message key="more.upload.ok"/>"/></td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="checkbox" checked name="unzip" id="unzip" class="checkbox"/>
                    <label for="unzip"><fmt:message key="more.upload.unzip"/></label>
                </td>
            </tr>
        </table>
    </form>


    <p class="detail" id="progressText"/>

    <div id="progressBar">
        <div id="progressBarContent"/>
    </div>

</c:if>


4) The formatting at the top is a little ugly for the new icon. If you update the code that you are adding to top.jsp to what I have below it looks cleaner

Code: Select all
<c:if test="${model.user.uploadRole}">
            <td style="width:4em;padding-right:1.5em"> <A HREF="javascript:newwindow()" ><img src="<spring:theme code="loadImage_mini"/>" title="Upload" alt="${more}"><br>Upload</a></td>
</c:if>

PostPosted: Thu Jun 11, 2009 9:50 am
by cyclopes
Thanks.

8) [/b]

PostPosted: Mon Jun 15, 2009 4:49 pm
by jonathanroz
I noticed one other thing if you want to remove the upload function from the "more" so it is not in 2 places.

You need to remove the following code from the top of the more.jsp file as well or it will give you an error when you open it.


Code: Select all
   <script type="text/javascript">
        function refreshProgress() {
            transferService.getUploadInfo(updateProgress);
        }

        function updateProgress(uploadInfo) {

            var progressBar = document.getElementById("progressBar");
            var progressBarContent = document.getElementById("progressBarContent");
            var progressText = document.getElementById("progressText");


            if (uploadInfo.bytesTotal > 0) {
                var percent = Math.ceil((uploadInfo.bytesUploaded / uploadInfo.bytesTotal) * 100);
                var width = parseInt(percent * 3.5) + 'px';
                progressBarContent.style.width = width;
                progressText.innerHTML = percent + "<fmt:message key="more.upload.progress"/>";
                progressBar.style.display = "block";
                progressText.style.display = "block";
                window.setTimeout("refreshProgress()", 1000);
            } else {
                progressBar.style.display = "none";
                progressText.style.display = "none";
                window.setTimeout("refreshProgress()", 5000);
            }
        }
    </script>