From: Ben Klang Date: Sun, 3 Jan 2010 05:12:16 +0000 (-0500) Subject: Shout: Tweak the page data initializtion and fix edit form X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d983e96edbd2bf9cd4b7d2731598711fcae13474;p=horde.git Shout: Tweak the page data initializtion and fix edit form --- diff --git a/shout/templates/extensions/list.inc b/shout/templates/extensions/list.inc index 5ac07edd5..de149e49f 100644 --- a/shout/templates/extensions/list.inc +++ b/shout/templates/extensions/list.inc @@ -93,25 +93,6 @@ var device_image = "getImageDir() . '/shout.png'; ?>"; var number_image = "getImageDir() . '/telephone-pole.png'; ?>"; var destinations = new Array(); - $info) -{ - echo "destinations[${extension}] = {"; - if (count($info['devices'])) { - echo 'devices: ["' . implode('","', $info['devices']) . '"],'; - } - if (count($info['numbers'])) { - echo 'numbers: ["' . implode('","', $info['numbers']) . '"],'; - } - echo "};\n"; - - echo "contract('${extension}');\n"; -} -?> - -var destX101 = { - numbers: [] -} function resetDestInfo(exten) { @@ -148,9 +129,9 @@ function resetDestInfo(exten) a = document.createElement('a'); a.id = 'destX'+exten+'addDest'; - a.class = 'addDest'; + a['className'] = 'addDest'; a.href='#'; - a.onclick='addDest('+exten+')'; + a.setAttribute('onclick', 'addDest('+exten+')'); t = document.createTextNode('Add more destinations...'); a.appendChild(t); $('destX'+exten+'info').appendChild(a); @@ -198,5 +179,25 @@ function addDest(exten) Event.observe($('destX'+exten+'form'), 'submit', function(event) {processForm(event);}); } + $info) +{ + echo "destinations[${extension}] = {"; + if (count($info['devices'])) { + echo 'devices: ["' . implode('","', $info['devices']) . '"],'; + } + if (count($info['numbers'])) { + echo 'numbers: ["' . implode('","', $info['numbers']) . '"],'; + } + echo "};\n"; +} +?> + +// Initialize the data. +for (var i in destinations) { + resetDestInfo(i); + contract(i); +} + // -->