');
+ 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,
+ 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');
});
-
- oldCallback.call(this);
- };
- $.wiki.SidebarPerspective.call(this, options);
- }
+ self.$pane.on('click', '.current-convert', function() {
+ self.convert($(this).attr('data-to'));
+ });
+ self.$pane.on('click', '#current-delete', function() {
+ self.delete();
+ });
+ }
+
+ edit(element) {
+ let self = this;
+
+ $("#parents", self.$pane).empty();
+ $("#bubbles").empty();
+
+ let $f = $("#properties-form", self.$pane);
+ $f.empty();
+
+ 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);
+
+ $node.parents('[x-node]').each(function() {
+ let a = $("
").text($(this).attr('x-node'));
+ a.data('node', this);
+ $("#parents", self.$pane).prepend(a)
- PropertiesPerspective.prototype = new $.wiki.SidebarPerspective();
-
- PropertiesPerspective.prototype.edit = function(element) {
- let self = this;
-
- let $node = $(element);
- $("#parents", self.$pane).empty();
- $node.parents('[x-node]').each(function() {
- let a = $("").text($(this).attr('x-node'));
- a.data('node', this);
- $("#parents", self.$pane).prepend(a)
- })
- // It's a tag.
- node = $(element).attr('x-node');
- $("h1", self.$pane).text(node);
-
- $f = $("#properties-form", self.$pane);
- $f.empty();
- self.$edited = $(element);
-
- let nodeDef = elementDefs[node];
- if (nodeDef && nodeDef.attributes) {
- $.each(nodeDef.attributes, function(i, a) {
- self.addEditField(a, $(element).attr('data-wlf-' + a.name)); // ...
+ let b = $("").text($(this).attr('x-node'));
+ b.data('node', this);
+ $("#bubbles").append(b);
})
+
+ // It's a tag.
+ let node = $(element).attr('x-node');
+ $("h1", self.$pane).text(node);
+
+ 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)); // ...
+ })
+ }
+
+ // Only utwor can has matadata now.
+ if (node == 'utwor') {
+ $('
').appendTo($("#properties-form", self.$pane))
+ META_FIELDS.forEach(function(field) {
+ let $fg = $("