mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-13 18:37:07 +00:00
d5376e28fc
Change-Id: Ia266fc22b02af0edbb32f356b4e0d92fe3a4da5f
36 lines
979 B
JavaScript
36 lines
979 B
JavaScript
/**
|
|
* @external CommentItem
|
|
*/
|
|
|
|
/**
|
|
* A thread item, either a heading or a comment
|
|
*
|
|
* @class ThreadItem
|
|
* @constructor
|
|
* @param {string} type `heading` or `comment`
|
|
* @param {number} level Item level in the thread tree
|
|
* @param {Object} range Object describing the extent of the comment, including the
|
|
* signature and timestamp. It has the same properties as a Range object: `startContainer`,
|
|
* `startOffset`, `endContainer`, `endOffset` (we don't use a real Range because they change
|
|
* magically when the DOM structure changes).
|
|
*/
|
|
function ThreadItem( type, level, range ) {
|
|
this.type = type;
|
|
this.level = level;
|
|
this.range = range;
|
|
|
|
/**
|
|
* @member {string} Unique ID (within the page) for this comment, intended to be used to
|
|
* find this comment in other revisions of the same page
|
|
*/
|
|
this.id = null;
|
|
/**
|
|
* @member {CommentItem[]} Replies to this thread item
|
|
*/
|
|
this.replies = [];
|
|
}
|
|
|
|
OO.initClass( ThreadItem );
|
|
|
|
module.exports = ThreadItem;
|