source: trunk/www/common/columns/save_preset.jsp @ 5971

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

References #1655: GUI improvements

  • Started to create screen shots with the new design for the user documentation.
  • Got rid of old .gif icons in the documentation and replaced them with .png versions.
  • Fixed some issues with placement of 'required information' in two dialogs.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.7 KB
Line 
1<%-- $Id: save_preset.jsp 5971 2012-02-17 10:30:22Z nicklas $
2  ------------------------------------------------------------------
3  Copyright (C) 2005 Nicklas Nordborg
4  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
5
6  This file is part of BASE - BioArray Software Environment.
7  Available at http://base.thep.lu.se/
8
9  BASE is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License
11  as published by the Free Software Foundation; either version 3
12  of the License, or (at your option) any later version.
13
14  BASE is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  GNU General Public License for more details.
18
19  You should have received a copy of the GNU General Public License
20  along with BASE. If not, see <http://www.gnu.org/licenses/>.
21  ------------------------------------------------------------------
22
23  Ask for confirmation to delete a preset.
24
25
26  @author Nicklas
27  @version 2.0
28--%>
29<%@ page pageEncoding="UTF-8" session="false"
30  import="net.sf.basedb.core.SessionControl"
31  import="net.sf.basedb.core.Item"
32  import="net.sf.basedb.clients.web.Base"
33  import="net.sf.basedb.clients.web.util.HTML"
34  import="net.sf.basedb.util.Values"
35%>
36<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %>
37<%
38final SessionControl sc = Base.getExistingSessionControl(pageContext, true);
39final String ID = sc.getId();
40final Item itemType = Item.valueOf(request.getParameter("item_type"));
41final String subContext = Values.getString(request.getParameter("subcontext"), "");
42final String columns = request.getParameter("columns");
43final String settingName = Values.getString(request.getParameter("settingName"), "columns");
44%>
45<base:page type="popup" title="Save preset">
46<base:head>
47  <script language="JavaScript">
48  // Initialise - set focus to name field
49  function init()
50  {
51    var frm = document.forms["preset"];
52    frm.name.focus();
53  }
54
55  // Validate the form
56  function validateForm()
57  {
58    var frm = document.forms["preset"];
59    if (Main.trimString(frm.name.value) == '')
60    {
61      frm.name.focus();
62      alert("Please enter a name");
63      return false;
64    }
65    var presets = window.opener.document.forms['columns'].presets;
66    for (var i = 0; i < presets.length; i++) // >
67    {
68      if (presets[i].text == frm.name.value)
69      {
70        return confirm('Another preset with the same name already exists. Do want to replace it?');
71      }
72    }
73    return true;
74  }
75
76  // Submit the form
77  function savePreset()
78  {
79    var frm = document.forms["preset"];
80    if (validateForm())
81    {
82      frm.submit();
83    }
84  }
85  </script>
86</base:head>
87<base:body onload="init()">
88  <h1>Save preset <base:help helpid="columns.configure.saveas" /></h1>
89
90  <form name="preset" action="submit_preset.jsp" method="post" onsubmit="return validateForm();">
91  <input type="hidden" name="ID" value="<%=ID%>">
92  <input type="hidden" name="cmd" value="Save">
93  <input type="hidden" name="columns" value="<%=HTML.encodeTags(columns)%>">
94  <input type="hidden" name="item_type" value="<%=itemType.name()%>">
95  <input type="hidden" name="subcontext" value="<%=subContext%>">
96  <input type="hidden" name="settingName" value="<%=settingName%>">
97
98 
99  <div class="content filled">
100    <table class="fullform input100 smaller">
101    <tr>
102      <th>Name</th>
103      <td><input class="text required" type="text" name="name" value="" maxlength="40"></td>
104    </tr>
105    <tr class="dynamic">
106      <th></th>
107      <td></td>
108    </tr>
109    </table>
110  </div>
111  </form>
112
113  <div class="legend">
114    <base:icon image="required.png" />= required information
115  </div>
116
117  <base:buttongroup subclass="dialogbuttons">
118    <base:button onclick="savePreset();" title="Ok" />
119    <base:button onclick="window.close();" title="Cancel" />
120  </base:buttongroup>
121
122</base:body>
123</base:page>
Note: See TracBrowser for help on using the repository browser.