});
-var Canvas = function(wlxmlDocument, elements) {
+var Canvas = function(wlxmlDocument, elements, metadata) {
+ this.metadata = metadata || {};
this.elementsRegister = new ElementsRegister(documentElement.DocumentNodeElement, nullElement);
elements = [
});
return {
- fromXMLDocument: function(wlxmlDocument, elements) {
- return new Canvas(wlxmlDocument, elements);
+ fromXMLDocument: function(wlxmlDocument, elements, metadata) {
+ return new Canvas(wlxmlDocument, elements, metadata);
}
};
}
}.bind(this));
- this.commentsView = new CommentsView(this.wlxmlNode, {});
+ this.commentsView = new CommentsView(this.wlxmlNode, this.canvas.metadata.user);
this.addToGutter(this.commentsView);
this.commentTip = $('<div class="comment-tip"><i class="icon-comment"></i></div>');
this.addWidget(this.commentTip);
canvasElements = canvasElements.concat(plugin.canvasElements || []);
});
- var canvas = canvas3.fromXMLDocument(null, canvasElements);
+ var canvas = canvas3.fromXMLDocument(null, canvasElements, {
+ user: sandbox.getConfig().user
+ });
var canvasWrapper = $(template);
var shownAlready = false;
var scrollbarPosition = 0,