rdfdesc.append('\n ');
rdf.append('\n ');
}
+ if (field.filter && field.filter.startswith) {
+ span.text(field.filter.startswith[0]);
+ }
span.appendTo(rdfdesc);
rdfdesc.append('\n ');
$.ajax({
url: field.value_type.chooser.source,
+ data: field.filter ? {'filter': JSON.stringify(field.filter)} : '',
success: function(data) {
add_options(body, data, input.val());
}
// lang
}
+ applyFilter(filter, text) {
+ if (filter.not) {
+ return !this.applyFilter(filter.not, text)
+ } else if (filter.startswith) {
+ for (prefix of filter.startswith) {
+ if (text.startsWith(prefix))
+ return true;
+ }
+ return false;
+ }
+ }
+
displayMetaProperty($fg) {
let self = this;
let ns = $fg.data('ns');
selector += "[x-ns='"+ns+"']";
}
$(selector, self.$edited).each(function() {
+ if (field.filter) {
+ let text = $(this).text();
+ if (!self.applyFilter(field.filter, text))
+ return;
+ }
self.addMetaInput(
$('.c', $fg),
field,