New window when you upload music mod.

Third-party modifications and add-ons, Apps and Clients

Moderator: moderators

New window when you upload music mod.

Postby cyclopes » Sun Apr 19, 2009 2:20 am

Last edited by cyclopes on Mon Jul 20, 2009 11:57 pm, edited 1 time in total.
User avatar
cyclopes
 
Posts: 51
Joined: Thu Mar 12, 2009 11:33 pm
Location: Norway

Postby jonathanroz » Wed Jun 10, 2009 8:28 pm

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>
jonathanroz
 
Posts: 172
Joined: Thu Dec 18, 2008 8:54 pm
Location: Frisco, TX USA

Postby cyclopes » Thu Jun 11, 2009 9:50 am

Thanks.

8) [/b]
Vote Confirmation ;)
User avatar
cyclopes
 
Posts: 51
Joined: Thu Mar 12, 2009 11:33 pm
Location: Norway

Postby jonathanroz » Mon Jun 15, 2009 4:49 pm

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>
jonathanroz
 
Posts: 172
Joined: Thu Dec 18, 2008 8:54 pm
Location: Frisco, TX USA


Return to Mods, Apps and Clients

Who is online

Users browsing this forum: No registered users and 3 guests