Changeset 3851


Ignore:
Timestamp:
Oct 17, 2007, 8:56:14 AM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #721: Filter on file extension when selecting platform data files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/common/datafiles/select_files.jsp

    r3820 r3851  
    1 <%-- $Id$
     1<%-- $Id:select_files.jsp 3820 2007-10-12 10:03:18Z nicklas $
    22  ------------------------------------------------------------------
    33  Copyright (C) 2005 Nicklas Nordborg
     
    137137  }
    138138  var lastFileInputName;
    139   function browseOnClick(inputName)
     139  function browseOnClick(inputName, extension)
    140140  {
    141141    var frm = document.forms['datafiles'];
    142142    var url = '../../filemanager/index.jsp?ID=<%=ID%>&cmd=SelectOne&callback=setFileCallback';
     143    if (extension)
     144    {
     145      url += '&filter:STRING:name='+escape('%.' + extension);
     146    }
     147    else
     148    {
     149      url += '&filter:STRING:name=';
     150    }
    143151    lastFileInputName = inputName;
    144152    Main.openPopup(url, 'SelectFile', 1000, 700);
     
    211219        File file = null;
    212220        boolean deniedFile = false;
     221        String extension = dft.getExtension();
    213222        if (member != null)
    214223        {
     
    249258              <td><base:button
    250259                  title="Browse&hellip;"
    251                   onclick="<%="browseOnClick('"+inputName+"')"%>"
     260                  onclick="<%="browseOnClick('"+inputName+"', '" + HTML.javaScriptEncode(extension) + "')"%>"
    252261                  disabled="<%=deniedFile || deniedPlatform %>"
    253262                  />
Note: See TracChangeset for help on using the changeset viewer.