Changeset 5569


Ignore:
Timestamp:
Feb 16, 2011, 9:47:22 AM (11 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1580: Select MIME type from list of registered types

Location:
trunk/www/filemanager/files
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/filemanager/files/edit_file.jsp

    r5501 r5569  
    215215      %>
    216216    }
     217    function mimeTypeOnClick()
     218    {
     219      var frm = document.forms['file'];
     220      var url = '../../admin/mimetypes/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setMimeTypeCallback';
     221      Main.openPopup(url, 'SelectMimeType', 1000, 700);
     222    }
     223    function setMimeTypeCallback(id, name)
     224    {
     225      var frm = document.forms['file'];
     226      frm.mime_type.value = name;
     227    }
    217228    </script>
    218229  </base:head>
     
    311322      <tr>
    312323        <td class="prompt">MIME type</td>
    313         <td><input <%=clazz%> type="text" name="mime_type"
    314           value="<%=HTML.encodeTags(file == null ? Values.getString(cc.getPropertyValue("mimeType")) : file.getMimeType())%>"
    315           size="40" maxlength="<%=File.MAX_MIMETYPE_LENGTH%>"></td>
     324        <td><table border="0" cellspacing="0" cellpadding="0">
     325          <tr>
     326            <td><input <%=clazz%> type="text" name="mime_type"
     327              value="<%=HTML.encodeTags(file == null ? Values.getString(cc.getPropertyValue("mimeType")) : file.getMimeType())%>"
     328              size="40" maxlength="<%=File.MAX_MIMETYPE_LENGTH%>">&nbsp;</td>
     329            <td><base:button onclick="mimeTypeOnClick()" title="Select&hellip;"/></td>
     330          </tr>
     331          </table>
     332        </td>
    316333      </tr>
    317334      <tr>
  • trunk/www/filemanager/files/edit_multiple_file.jsp

    r5568 r5569  
    105105      if (!frm.mimeType.disabled) frm.mimeType.focus();
    106106    }
     107   
     108    function mimeTypeOnClick()
     109    {
     110      var frm = document.forms['file'];
     111      var url = '../../admin/mimetypes/index.jsp?ID=<%=ID%>&cmd=UpdateContext&mode=selectone&callback=setMimeTypeCallback';
     112      Main.openPopup(url, 'SelectMimeType', 1000, 700);
     113    }
     114    function setMimeTypeCallback(id, name)
     115    {
     116      var frm = document.forms['file'];
     117      frm.mimeType.value = name;
     118      frm.mimeType.disabled = false;
     119      frm.keepMimeType.checked = false;
     120    }
    107121    </script>
    108122  </base:head>
     
    151165        <td>
    152166          <input type="checkbox" name="keepMimeType" value="1" checked onclick="keepMimeTypeOnClick()"><a
    153             href="javascript:document.forms['file'].keepMimeType.click();">No change<br>
    154         <input <%=clazz%> type="text" name="mimeType" disabled
    155           value="" size="40" maxlength="<%=File.MAX_MIMETYPE_LENGTH%>"></td>
     167            href="javascript:document.forms['file'].keepMimeType.click();">No change</a><br>
     168          <table border="0" cellspacing="0" cellpadding="0">
     169          <tr>
     170            <td><input <%=clazz%> type="text" name="mimeType" disabled
     171              value="" size="40" maxlength="<%=File.MAX_MIMETYPE_LENGTH%>">&nbsp;</td>
     172            <td><base:button onclick="mimeTypeOnClick()" title="Select&hellip;"/></td>
     173          </tr>
     174          </table>
     175        </td>
    156176      </tr>
    157177      <tr>
Note: See TracChangeset for help on using the changeset viewer.