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

Last change on this file since 5426 was 5426, checked in by Nicklas Nordborg, 11 years ago

References #1514: Fix character encoding of jsp files

  • Add pageEncoding="UTF-8" to all JSP files.
  • Add @charset="UTF-8"; to all CSS files.
  • Add charset="UTF-8" to all <script> tags

This should at least make Eclipse happy and hopefully allow other editors to automatically select the correct encoding.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 4.1 KB
Line 
1<%-- $Id: save_as.jsp 5426 2010-09-24 09:18:50Z 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 timer = 0;
46  var inCall = false;
47  var defaultFileName = '<%=HTML.javaScriptEncode(fileName)%>';
48  function adjustIFrameSize()
49  {
50    if (inCall) return;
51    inCall = true;
52    var iframeElement = document.getElementById("idManager");
53    // Find the top coordinate of the IFrame
54    var offsetTop = 1;
55    var offsetTrail = iframeElement;
56    while (offsetTrail)
57    {
58      offsetTop += offsetTrail.offsetTop;
59      offsetTrail = offsetTrail.offsetParent;
60    }
61
62    // Find the browser window height
63    var windowHeight = Main.getWindowHeight();
64    iframeElement.height = windowHeight-offsetTop-120;
65
66    // Adjust the height of the frames
67    var iframe = window.frames['manager'];
68    var directories = iframe.frames['directories'].document.getElementById('main');
69    if (directories) directories.style.height = (iframeElement.height-1)+'px';
70    var joust = iframe.frames['directories'].document.getElementById('joust');
71    if (joust) joust.style.height = (iframeElement.height-1-30)+'px';
72    var files = iframe.frames['files'].document.getElementById('main');
73    if (files) files.style.height = iframeElement.height+'px';
74    inCall = false;
75  }
76  function setTimer()
77  {
78    if (inCall) return;
79    if (timer) clearTimeout(timer);
80    timer = setTimeout('adjustIFrameSize()', 150);
81  }
82  function setSelected(fileId, path)
83  {
84    var frm = document.forms['file'];
85    if (!fileId)
86    {
87      if (defaultFileName)
88      {
89        if (path.substring(path.length-1) != '/') path += '/';
90        path += defaultFileName;
91      }
92    }
93    else
94    {
95      var i = path.lastIndexOf('/');
96      if (i >= 0) defaultFileName = path.substring(i+1);
97    }
98    frm.file_id.value = fileId;
99    frm.path.value = path;
100  }
101 
102  function returnSelected()
103  {
104    var frm = document.forms['file'];
105    if (frm.path.value)
106    {
107      window.opener.<%=callback%>(frm.path.value);
108    }
109    window.close();
110  }
111  </script>
112</base:head>
113<base:body attributes="onresize='setTimer();'">
114  <h3>Save as</h3>
115  <iframe name="manager" id="idManager" src="frameset.jsp?ID=<%=ID%>&mode=selectone" width="100%" 
116    frameborder="0" vspace="0" hspace="0"
117    marginwidth="0" marginheight="0" scrolling="no" style="overflow: visible"></iframe>
118
119  <div style="border-top: 1px solid #666666" >
120  <form name="file">
121  <input type="hidden" name="file_id" value="">
122 
123  <p>
124  <table class="form" align="center">
125  <tr>
126    <td class="prompt">Save as</td>
127    <td><input type="text" class="text" name="path" size="100" value=""></td>
128  </tr>
129  </table>
130  </form>
131  </div>
132 
133  <table align="center">
134  <tr>
135    <td width="50%"><base:button onclick="returnSelected();" title="Ok"  /></td>
136    <td width="50%"><base:button onclick="window.top.close();" title="Cancel" /></td>
137  </tr>
138  </table>
139</base:body>
140</base:page>
Note: See TracBrowser for help on using the repository browser.