|
Lines 109-115
Link Here
|
| 109 |
<input type="text" size="30" name="q" title="Enter search terms" value="" /> |
109 |
<input type="text" size="30" name="q" title="Enter search terms" value="" /> |
| 110 |
[% IF ( expanded_options ) %] |
110 |
[% IF ( expanded_options ) %] |
| 111 |
<!-- [% IF ( search_box.scan_index ) %]<input type="checkbox" name="scan" id="scan" value="1" /> Scan Indexes[% END %] --> |
111 |
<!-- [% IF ( search_box.scan_index ) %]<input type="checkbox" name="scan" id="scan" value="1" /> Scan Indexes[% END %] --> |
| 112 |
[% IF ( search_box.add_field ) %]<a href="JavaScript:add_field();" id="ButtonPlus" title="Add another field">[+]</a>[% END %] |
112 |
[% IF ( !loop.first ) %] |
|
|
113 |
<a href="JavaScript:;" class="ButtonPlus" name="ButtonPlus" title="Add another field" onclick="add_field(this)">[+]</a> |
| 114 |
<a href="JavaScript:;" class="ButtonLess" title="Remove field" onclick="remove_field(this)">[-]</a> |
| 115 |
[% END %] |
| 113 |
[% END %] |
116 |
[% END %] |
| 114 |
</p> |
117 |
</p> |
| 115 |
[% END %] |
118 |
[% END %] |
|
Lines 315-325
Link Here
|
| 315 |
<script type="text/javascript" language="javascript"> |
318 |
<script type="text/javascript" language="javascript"> |
| 316 |
/* This function allows to display a new field to search. |
319 |
/* This function allows to display a new field to search. |
| 317 |
*/ |
320 |
*/ |
| 318 |
function add_field() { |
321 |
function add_field(button) { |
| 319 |
var ButtonPlus = document.getElementById('ButtonPlus'); |
322 |
$('.ButtonLess').show(); |
| 320 |
var line = ButtonPlus.parentNode; |
323 |
var $thisLine = $(button).parent(); |
| 321 |
line.parentNode.appendChild(line.cloneNode(true)); |
324 |
var $newLine = $(button).parent().clone(); |
| 322 |
line.removeChild(ButtonPlus); |
325 |
$thisLine.after($newLine); |
|
|
326 |
} |
| 327 |
|
| 328 |
function remove_field(button) { |
| 329 |
if($(button).parent().siblings().length <= 3 ) { |
| 330 |
$('.ButtonLess').hide(); |
| 331 |
} |
| 332 |
$(button).parent().remove(); |
| 323 |
} |
333 |
} |
| 324 |
</script> |
334 |
</script> |
| 325 |
|
335 |
|
| 326 |
- |
|
|