aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool
diff options
context:
space:
mode:
authorBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-02-20 19:05:28 +0100
committerBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-02-20 19:05:28 +0100
commitca6f0622237cf5ca1b330886eea197a554dc71fd (patch)
treeab7f2d12562aae1f1a46f2b0a1ee52022fc3b707 /id/ConfigWebTool
parent69475d1ca29ac530df84153635119adf908cbb53 (diff)
downloadmoa-id-spss-ca6f0622237cf5ca1b330886eea197a554dc71fd.tar.gz
moa-id-spss-ca6f0622237cf5ca1b330886eea197a554dc71fd.tar.bz2
moa-id-spss-ca6f0622237cf5ca1b330886eea197a554dc71fd.zip
fixing peps configuration
Diffstat (limited to 'id/ConfigWebTool')
-rw-r--r--id/ConfigWebTool/src/main/webapp/js/common.js7
-rw-r--r--id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp9
2 files changed, 13 insertions, 3 deletions
diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js
index 384e40509..98f7bdacb 100644
--- a/id/ConfigWebTool/src/main/webapp/js/common.js
+++ b/id/ConfigWebTool/src/main/webapp/js/common.js
@@ -210,7 +210,12 @@ function oaOnLoad() {
function newPeps() {
var target = $(document.getElementById("stork_pepslist").getElementsByTagName("tr")).last()[0];
var clone = target.cloneNode(true);
- var lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d)/)[1]);
+ try {
+ var lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d)/)[1]);
+ } catch (err) {
+
+ var lastindex = 1;
+ }
var nextindex = lastindex + 1;
clone.innerHTML = clone.innerHTML.replace(/name="storkconfig.cpepslist\[\d/g, 'name="storkconfig.cpepslist[' + nextindex);
clone.innerHTML = clone.innerHTML.replace(/(.*" value=").*?(".*)/g, '$1$2');
diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp
index 1bb429afa..604080d21 100644
--- a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp
+++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp
@@ -234,14 +234,19 @@
key="webpages.moaconfig.stork.qaa.default"
labelposition="left" />
<h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.pepslist", request) %></h4>
- <table id="stork_pepslist">
+ <table id="stork_pepslist">
<tr><th>Country Shortcode</th><th>PEPS URL</th>
<s:iterator value="storkconfig.cpepslist" status="stat">
<tr><td><s:textfield name="storkconfig.cpepslist[%{#stat.index}].countryCode" value="%{countryCode}" cssClass="textfield_short"/></td>
<td><s:textfield name="storkconfig.cpepslist[%{#stat.index}].URL" value="%{URL}" cssClass="textfield_long"/></td>
<td><input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.removepeps", request) %>" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr>
</s:iterator>
- </table>
+ <s:if test="%{storkconfig.cpepslist == null}">
+ <tr><td><s:textfield name="storkconfig.cpepslist[0].countryCode" value="CC" cssClass="textfield_short"/></td>
+ <td><s:textfield name="storkconfig.cpepslist[0].URL" value="http://" cssClass="textfield_long"/></td>
+ <td><input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.removepeps", request) %>" onclick='this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);'/></td></tr>
+ </s:if>
+ </table>
<input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.newpeps", request) %>" onclick='newPeps();' />
<h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.attributes.heading", request) %></h4>
<table id="stork_attributelist">