source: trunk/www/filemanager/save_as.jsp @ 5953

Last change on this file since 5953 was 5953, checked in by Nicklas Nordborg, 10 years ago

References #1655: GUI improvements

Select file/directory and "save as" dialogs.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 3.0 KB
Line 
1<%-- $Id: save_as.jsp 5953 2012-02-10 13:35:22Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg
4
5  This file is part of BASE - BioArray Software Environment.
6  Available at http://base.thep.lu.se/
7
8  BASE is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 3
11  of the License, or (at your option) any later version.
12
13  BASE is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  GNU General Public License for more details.
17
18  You should have received a copy of the GNU General Public License
19  along with BASE. If not, see <http://www.gnu.org/licenses/>.
20  ------------------------------------------------------------------
21
22  @author Nicklas
23  @version 2.0
24--%>
25<%@ page pageEncoding="UTF-8" session="false"
26  import="net.sf.basedb.core.*"
27  import="net.sf.basedb.clients.web.*"
28  import="net.sf.basedb.util.Values"
29  import="net.sf.basedb.clients.web.util.HTML"
30%>
31<%@ taglib
32  prefix="base" uri="/WEB-INF/base.tld"
33%>
34<%
35SessionControl sc = Base.getExistingSessionControl(pageContext, Permission.DENIED, Item.FILE);
36String ID = sc.getId();
37String requestTitle = request.getParameter("title");
38String callback = request.getParameter("callback");
39String fileName = Values.getStringOrNull(request.getParameter("fileName"));
40
41%>
42<base:page title="Save as" type="popup">
43<base:head >
44  <script language="JavaScript">
45  var defaultFileName = '<%=HTML.javaScriptEncode(fileName)%>';
46
47  function setSelected(fileId, path)
48  {
49    var frm = document.forms['file'];
50    if (!fileId)
51    {
52      if (defaultFileName)
53      {
54        if (path.substring(path.length-1) != '/') path += '/';
55        path += defaultFileName;
56      }
57    }
58    else
59    {
60      var i = path.lastIndexOf('/');
61      if (i >= 0) defaultFileName = path.substring(i+1);
62    }
63    frm.file_id.value = fileId;
64    frm.path.value = path;
65  }
66 
67  function returnSelected()
68  {
69    var frm = document.forms['file'];
70    if (frm.path.value)
71    {
72      window.opener.<%=callback%>(frm.path.value);
73    }
74    window.close();
75  }
76  </script>
77</base:head>
78<base:body>
79  <h1>Save as</h1>
80  <form name="file">
81  <input type="hidden" name="file_id" value="">
82
83  <div class="content bottomborder">
84    <div id="f1" class="absolutefull" style="bottom: 3em;"><iframe name="manager" id="idManager" 
85      src="frameset.jsp?ID=<%=ID%>&mode=selectone" 
86      style="width: 100%; height: 100%;"></iframe></div>
87     
88    <div class="absolutefull topborder" style="top: auto; height: 3em;">
89      <table class="fullform input100">
90        <tr>
91          <th>Save as</th>
92          <td><input type="text" class="text" name="path" value=""></td>
93        </tr>
94      </table>
95    </div>
96  </div>
97  </form>
98
99  <base:buttongroup subclass="dialogbuttons">
100    <base:button onclick="returnSelected();" title="Ok"  />
101    <base:button onclick="window.top.close();" title="Cancel" />
102  </base:buttongroup>
103 
104</base:body>
105</base:page>
Note: See TracBrowser for help on using the repository browser.