');
+ elem.append(subT);
+ elem.append(sub);
+ subT.on('click', () => {
+ sub.toggle()
+ });
+ add_options(sub, item.sub, valueMatch ? value : null);
+ }
+ elem.appendTo(cnt);
+ });
+ };
+
+ $.ajax({
+ url: field.value_type.chooser.source,
+ data: field.filter ? {'filter': JSON.stringify(field.filter)} : '',
+ success: function(data) {
+ add_options(body, data, input.val());
+ }
+ });
+ })
+ $('#meta-chooser .ctrl-ok').on('click', function (event) {
+ $('#meta-chooser').data('target-input').val(
+ $('#meta-chooser :checked').val()
+ ).trigger('change');
+ $('#meta-chooser').modal('hide');
+ });
- PropertiesPerspective.prototype = new $.wiki.SidebarPerspective();
+ self.$pane.on('click', '.current-convert', function() {
+ self.convert($(this).attr('data-to'));
+ });
+ self.$pane.on('click', '#current-delete', function() {
+ self.delete();
+ });
+ }
- PropertiesPerspective.prototype.edit = function(element) {
- let self = this;
+ edit(element) {
+ let self = this;
- let $node = $(element);
- $("#parents", self.$pane).empty();
- $("#bubbles").empty();
+ $("#parents", self.$pane).empty();
+ $("#bubbles").empty();
- let b = $("
").text($node.attr('x-node'));
- b.data('node', element);
- $("#bubbles").append(b);
+ let $f = $("#properties-form", self.$pane);
+ $f.empty();
- $node.parents('[x-node]').each(function() {
- let a = $("
").text($(this).attr('x-node'));
- a.data('node', this);
- $("#parents", self.$pane).prepend(a)
+ if (element === null) {
+ self.$edited = null;
+ $("h1", self.$pane).text('');
+ return;
+ }
- let b = $("").text($(this).attr('x-node'));
- b.data('node', this);
+ let $node = $(element);
+ let b = $("").text($node.attr('x-node'));
+ b.data('node', element);
$("#bubbles").append(b);
- })
-
- // It's a tag.
- node = $(element).attr('x-node');
- $("h1", self.$pane).text(node);
- $f = $("#properties-form", self.$pane);
- $f.empty();
- self.$edited = $(element);
+ $node.parents('[x-node]').each(function() {
+ let a = $("").text($(this).attr('x-node'));
+ a.data('node', this);
+ $("#parents", self.$pane).prepend(a)
- let nodeDef = elementDefs[node];
- if (nodeDef && nodeDef.attributes) {
- $.each(nodeDef.attributes, function(i, a) {
- self.addEditField(a, $(element).attr('x-a-wl-' + a.name)); // ...
+ let b = $("").text($(this).attr('x-node'));
+ b.data('node', this);
+ $("#bubbles").append(b);
})
- }
- // Only utwor can has matadata now.
- if (node == 'utwor') {
- $('
').appendTo($("#properties-form", self.$pane))
- META_FIELDS.forEach(function(field) {
- let $fg = $("