adding zend project folders into old campcaster.
This commit is contained in:
parent
56abfaf28e
commit
7ef0c18b26
4045 changed files with 1054952 additions and 0 deletions
42
public/js/campcaster/library/advancedsearch.js
Normal file
42
public/js/campcaster/library/advancedsearch.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
function addRemove(el) {
|
||||
var id, span;
|
||||
|
||||
id = $(el).attr("id").split("_").pop();
|
||||
|
||||
span = $('<span id="search_remove_'+id+'">Remove</span>').click(function(){
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
$(el).find("dl input").after(span);
|
||||
}
|
||||
|
||||
function ajaxAddField() {
|
||||
|
||||
var id = $("#search_next_id").val();
|
||||
|
||||
var url = '/Search/newfield';
|
||||
url = url + '/format/html';
|
||||
url = url + '/id/' + id;
|
||||
|
||||
$.post(url, function(newElement) {
|
||||
|
||||
var el = $(newElement);
|
||||
addRemove(el);
|
||||
|
||||
$(".zend_form").append(el);
|
||||
$("#search_next_id").val(++id);
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#search_add").click(ajaxAddField);
|
||||
$("#search_submit").click(function(){
|
||||
$("form").submit();
|
||||
});
|
||||
|
||||
$('[id^="fieldset-row_"]').each(function(i, el){
|
||||
addRemove(el);
|
||||
});
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue