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