X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/efe36f4f1b5df351eeb4d40a54c3900cf9a7079b..8358d608397b9531d9d0b72c7b21ab78d078f066:/src/editor/modules/documentCanvas/canvas/widgets.js

diff --git a/src/editor/modules/documentCanvas/canvas/widgets.js b/src/editor/modules/documentCanvas/canvas/widgets.js
index 408d2c0..aecb199 100644
--- a/src/editor/modules/documentCanvas/canvas/widgets.js
+++ b/src/editor/modules/documentCanvas/canvas/widgets.js
@@ -9,7 +9,7 @@ return {
     labelWidget: function(tag, klass) {
         return $('<span>')
             .addClass('canvas-widget canvas-widget-label')
-            .text(wlxmlUtils.wlxmlTagNames[tag] + (klass ? ' / ' + wlxmlUtils.wlxmlClassNames[klass] : ''));
+            .text(wlxmlUtils.getTagLabel(tag) + (klass ? ' / ' + wlxmlUtils.getClassLabel(klass) : ''));
     },
 
     footnoteHandler: function(clickHandler) {
@@ -34,6 +34,30 @@ return {
             clickHandler();
         });
         return mydom;
+    },
+
+    commentAdnotation: function(node) {
+        var widget = {
+            DOM: $('<div>').addClass('canvas-widget canvas-widget-comment-adnotation'),
+            update: function(node) {
+                var parts = [],
+                    metadata = node.getMetadata(),
+                    dt;
+                metadata.forEach(function(row) {
+                    parts.push(row.getValue());
+                }, 'creator');
+                metadata.some(function(row) {
+                    dt = row.getValue();
+                    return true; // break
+                }, 'date');
+                if(dt) {
+                    parts.push(dt);
+                }
+                this.DOM.text(parts.join(', '));
+            }
+        };
+        widget.update(node);
+        return widget;
     }
 
 };