Permalink
Browse files

Fix for dropped matches

  • Loading branch information...
1 parent bd2cbe1 commit 0c5c5bd56c853bffd25739ef0af644932463e119 @chadsmith committed Sep 16, 2011
Showing with 18 additions and 6 deletions.
  1. +6 −0 applets/match/script.js
  2. +3 −3 applets/match/ui.php
  3. +6 −0 applets/regex/script.js
  4. +3 −3 applets/regex/ui.php
View
@@ -1,6 +1,12 @@
$(function() {
$('.match-applet tr.hide input').prop('disabled', true);
+ $('.match-applet input.keypress').live('keyup', function(event) {
+ var row = $(this).closest('tr');
+ $('input[name^="keys"]', row).attr('name', 'keys['+$(this).val()+']');
+ $('input[name^="responses"]', row).attr('name', 'responses['+$(this).val()+']');
+ });
+
$('.match-applet .action.add').live('click', function(event) {
event.preventDefault();
var row = $(this).closest('tr');
View
@@ -33,16 +33,16 @@
</tr>
</tfoot>
<tbody>
- <?php foreach($keys as $id => $key): ?>
+ <?php foreach($keys as $i => $key): ?>
<tr>
<td>
<fieldset class="vbx-input-container">
- <input class="keypress small" type="text" name="keys[]" value="<?php echo $key ?>" autocomplete="off" />
+ <input class="keypress small" type="text" name="keys[<?php echo $key; ?>]" value="<?php echo $key ?>" autocomplete="off" />
</fieldset>
</td>
<td>then</td>
<td>
- <?php echo AppletUI::dropZone('responses['.($id).']', 'Drop applet here'); ?>
+ <?php echo AppletUI::dropZone('responses[' . $i . ']', 'Drop applet here'); ?>
</td>
<td>
<a href="" class="add action"><span class="replace">Add</span></a> <a href="" class="remove action"><span class="replace">Remove</span></a>
View
@@ -1,6 +1,12 @@
$(function() {
$('.regex-applet tr.hide input').prop('disabled', true);
+ $('.regex-applet input.keypress').live('keyup', function(event) {
+ var row = $(this).closest('tr');
+ $('input[name^="keys"]', row).attr('name', 'keys['+$(this).val()+']');
+ $('input[name^="responses"]', row).attr('name', 'responses['+$(this).val()+']');
+ });
+
$('.regex-applet .action.add').live('click', function(event) {
event.preventDefault();
var row = $(this).closest('tr');
View
@@ -33,16 +33,16 @@
</tr>
</tfoot>
<tbody>
- <?php foreach($keys as $id => $key): ?>
+ <?php foreach($keys as $i => $key): ?>
<tr>
<td>
<fieldset class="vbx-input-container">
- <input class="keypress small" type="text" name="keys[]" value="<?php echo $key ?>" autocomplete="off" />
+ <input class="keypress small" type="text" name="keys[<?php echo $key; ?>]" value="<?php echo $key ?>" autocomplete="off" />
</fieldset>
</td>
<td>then</td>
<td>
- <?php echo AppletUI::dropZone('responses['.($id).']', 'Drop applet here'); ?>
+ <?php echo AppletUI::dropZone('responses[' . $i . ']', 'Drop applet here'); ?>
</td>
<td>
<a href="" class="add action"><span class="replace">Add</span></a> <a href="" class="remove action"><span class="replace">Remove</span></a>

3 comments on commit 0c5c5bd

I believe the original applet code was fine - I think the problem is in the core.

See:
http://getsatisfaction.com/openvbx/topics/cant_save_more_than_2_keywords_when_setting_up_flows

Owner

chadsmith replied Sep 16, 2011

You're correct, the problem was in the core.

This fix converts the arrays to objects so people don't have to wait for the next OpenVBX to be released.

Please sign in to comment.