diff options
Diffstat (limited to 'id/ConfigWebTool/src')
-rw-r--r-- | id/ConfigWebTool/src/main/webapp/js/common.js | 11 | ||||
-rw-r--r-- | id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp | 8 |
2 files changed, 12 insertions, 7 deletions
diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js index ff9509895..e6fcdf977 100644 --- a/id/ConfigWebTool/src/main/webapp/js/common.js +++ b/id/ConfigWebTool/src/main/webapp/js/common.js @@ -177,4 +177,13 @@ function oaOnLoad() { ); return true; -}
\ No newline at end of file +} +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]); + 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'); + target.parentNode.appendChild(clone); +} diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp index 686b10c12..1b87ffc57 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp @@ -229,19 +229,15 @@ <div class="oa_config_block"> <h3><%=LanguageHelper.getGUIString("webpages.oaconfig.stork.header", request) %></h3> <h4><%=LanguageHelper.getGUIString("webpages.moaconfig.stork.pepslist", request) %></h4> - <table> + <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> - <tr id="template" style="display: none;"><td><s:textfield name="countryCode" value="%{countryCode}" cssClass="textfield_short"/></td> - <td><s:textfield name="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> - </table> - <input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.newpeps", request) %>" onclick='var target = document.getElementById("template"); var clone = target.cloneNode(true); clone.style=""; target.parentNode.appendChild(clone);' /> + <input type="button" value="<%=LanguageHelper.getGUIString("webpages.moaconfig.stork.newpeps", request) %>" onclick='newPeps();' /> </div> <div class="oa_config_block"> |