1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
/*
* jQuery UI Autocomplete HTML Extension
*
* Copyright 2010, Scott González (http://scottgonzalez.com)
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* http://github.com/scottgonzalez/jquery-ui-extensions
*/
(function( $ ) {
var proto = $.ui.autocomplete.prototype,
initSource = proto._initSource;
function filter( array, term ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
return $.grep( array, function(value) {
return matcher.test( $( "<div>" ).html( value.label || value.value || value ).text() );
});
}
$.extend( proto, {
_initSource: function() {
if ( this.options.html && $.isArray(this.options.source) ) {
this.source = function( request, response ) {
response( filter( this.options.source, request.term ) );
};
} else {
initSource.call( this );
}
},
_renderItem: function( ul, item) {
return $( "<li></li>" )
.data( "item.autocomplete", item )
.append( $( "<a></a>" )[ this.options.html ? "html" : "text" ]( item.label ) )
.appendTo( ul );
}
});
})( jQuery );
/*
webtrees: Web based Family History software
Copyright (C) 2013 webtrees development team.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// INDI
jQuery("#spouseid, input[id*=pid], input[id*=PID], input[id^=gedcomid], input[id^=rootid], input[id$=ROOT_ID], input[name^=FATHER], input[name^=MOTHER], input[name^=CHIL]").autocomplete({
source: "autocomplete.php?field=INDI",
html: true
});
// ASSO
jQuery(".ASSO").autocomplete({
source: function(request, response) {jQuery.getJSON("autocomplete.php?field=ASSO", {term:request.term, pid:jQuery("input[name=pid]").val(), event_date:jQuery("input[id$=_DATE]").val()}, response);},
html: true
});
// FAM
jQuery(".FAM, input[id*=famid], input[id*=FAMC], #famid").autocomplete({
source: "autocomplete.php?field=FAM",
html: true
});
// NOTE
jQuery(".NOTE, .SHARED_NOTE").autocomplete({
source: "autocomplete.php?field=NOTE",
html: true
});
// SOUR
jQuery(".SOUR, input[id*=sid]").autocomplete({
source: "autocomplete.php?field=SOUR"
});
// SOUR:PAGE
jQuery(".PAGE").autocomplete({
source: function(request, response) {jQuery.getJSON("autocomplete.php?field=SOUR_PAGE", {term:request.term, sid:jQuery("input[class^=SOUR]").val()}, response);}
});
// SOUR:TITL
jQuery("#TITL").autocomplete({
source: "autocomplete.php?field=SOUR_TITL"
});
// REPO
jQuery(".REPO, #REPO").autocomplete({
source: "autocomplete.php?field=REPO"
});
// REPO:NAME
jQuery("#REPO_NAME").autocomplete({
source: "autocomplete.php?field=REPO_NAME"
});
// OBJE
jQuery(".OBJE, #OBJE, #mediaid, #filter").autocomplete({
source: "autocomplete.php?field=OBJE",
html: true
});
// INDI or FAM or SOUR or REPO or NOTE or OBJE
jQuery("input[id$=xref], input[name^=gid], #cart_item_id").autocomplete({
source: "autocomplete.php?field=IFSRO",
html: true
});
// PLAC : with hierarchy
jQuery(".PLAC, #place, input[name=place], input[id=place], input[name*=PLACS], input[name*=PLAC3], input[name^=PLAC], input[name$=PLAC]").autocomplete({
source: "autocomplete.php?field=PLAC"
});
// PLAC : without hierarchy
jQuery("input[name=place2], input[id=birthplace], input[id=marrplace], input[id=deathplace], input[id=bdmplace]").autocomplete({
source: "autocomplete.php?field=PLAC2"
});
// INDI:BURI:CEME
jQuery("input[id*=_CEME]").autocomplete({
source: "autocomplete.php?field=CEME"
});
// GIVN
jQuery("#GIVN, input[name*=GIVN], input[name*=firstname]").autocomplete({
source: "autocomplete.php?field=GIVN"
});
// SURN
jQuery("#SURN, input[name*=SURN], input[name*=lastname], #NAME, input[id=name]").autocomplete({
source: "autocomplete.php?field=SURN"
});
|