diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-10-27 12:42:54 +0100 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2014-10-27 12:42:54 +0100 |
commit | 531fab97aa55264cd1f1cd7c4d66f9c03eea8a1d (patch) | |
tree | b13c56e75098b9a16323c33075493242addfaee1 | |
parent | f60a335c80350daa6ff8e0db49dc761188043982 (diff) | |
parent | a36f28e84cd86196c8b750cbaa4f61977996aa6e (diff) | |
download | moa-id-spss-531fab97aa55264cd1f1cd7c4d66f9c03eea8a1d.tar.gz moa-id-spss-531fab97aa55264cd1f1cd7c4d66f9c03eea8a1d.tar.bz2 moa-id-spss-531fab97aa55264cd1f1cd7c4d66f9c03eea8a1d.zip |
Merge branch 'moa-2.1-Snapshot' of gitlab.iaik.tugraz.at:afitzek/moa-idspss into moa-2.1-Snapshot
-rw-r--r-- | id/ConfigWebTool/src/main/webapp/js/common.js | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/id/ConfigWebTool/src/main/webapp/js/common.js b/id/ConfigWebTool/src/main/webapp/js/common.js index 24702807f..9f19e88a2 100644 --- a/id/ConfigWebTool/src/main/webapp/js/common.js +++ b/id/ConfigWebTool/src/main/webapp/js/common.js @@ -223,19 +223,36 @@ function oaOnLoad() { function newPeps() { var target = $(document.getElementById("stork_pepslist").getElementsByTagName("tr")).last()[0]; var clone = target.cloneNode(true); + var lastindex; try { - var lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d)/)[1]); + lastindex = parseInt(clone.innerHTML.match(/name="storkconfig.cpepslist\[(\d*)\]/)[1]); } catch (err) { - - var lastindex = 1; + lastindex = 1; } var nextindex = lastindex + 1; - - clone.innerHTML = clone.innerHTML.replace(/[A-Z]{2}</, '<'); - clone.innerHTML = clone.innerHTML.replace(/<input.*type="hidden" name.*>/, '<div id="wwgrp_loadGeneralConfig_storkconfig_cpepslist_0__countryCode" class="wwgrp"> <div id="wwctrl_loadGeneralConfig_storkconfig_cpepslist_0__countryCode" class="wwctrl"> <input id="loadGeneralConfig_storkconfig_cpepslist_0__countryCode" class="textfield_short" type="text" value="IT" name="storkconfig.cpepslist[0].countryCode"> </div> </div>'); - clone.innerHTML = clone.innerHTML.replace(/name="storkconfig.cpepslist\[\d/g, 'name="storkconfig.cpepslist[' + nextindex); - clone.innerHTML = clone.innerHTML.replace(/name="wwgrp_loadGeneralConfig_storkconfig_cpepslist_\d/g, 'name="wwgrp_loadGeneralConfig_storkconfig_cpepslist_' + nextindex); - clone.innerHTML = clone.innerHTML.replace(/(.*" value=").*?(".*)/g, '$1$2'); + clone.innerHTML = '<tr>\ + <td>\ + <div id="wwgrp_loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__countryCode" class="wwgrp">\ + <div id="wwctrl_loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__countryCode" class="wwctrl">\ + <input id="loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__countryCode" class="textfield_short" type="text" value="" name="storkconfig.cpepslist['+nextindex+'].countryCode"></div>\ + </div>\ + </td>\ + <td>\ + <div id="wwgrp_loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__URL" class="wwgrp">\ + <div id="wwctrl_loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__URL" class="wwctrl">\ + <input type="text" name="storkconfig.cpepslist['+nextindex+'].URL" value="" id="loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__URL" class="textfield_long"></div>\ + </div>\ + </td>\ + <td>\ + <div id="wwgrp_loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__supportsXMLSignature" class="wwgrp">\ + <div id="wwctrl_loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__supportsXMLSignature" class="wwctrl">\ + <input type="checkbox" name="storkconfig.cpepslist['+nextindex+'].supportsXMLSignature" value="true" checked="checked" id="loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__supportsXMLSignature">\ + <input type="hidden" id="__checkbox_loadGeneralConfig_storkconfig_cpepslist_'+nextindex+'__supportsXMLSignature" name="__checkbox_storkconfig.cpepslist['+nextindex+'].supportsXMLSignature" value=""></div>\ + </div>\ + </td>\ + <td>\ + <input type="button" value="löschen" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);"></td>\ + </tr>'; target.parentNode.appendChild(clone); } function newStorkAttribute() { |