S2:EntryLite/Comment

From No LJ Ads Wiki

Jump to: navigation, search

Child class of EntryLite. A comment to a journal entry, or to another comment.

S2 - EntryLite

[edit] Members

string anchor Direct link to comment, via HTML name anchors (Read-only)
bool comment_posted True if comment was just posted by the current user. (Read-only)
bool deleted True if comment has been deleted. Deleted comments still show up if they are the parent of a thread. (Read-only)
int depth Visual depth of entry. Top-level journal entries are always depth zero. Comments have a depth greater than or equal to one, depending on where the thread is rooted at.
string dom_id The DOM 'id' attribute you should put on your outer-most element (Read-only)
bool edited True if the comment has been edited. (Read-only)
DateTime edittime The GMT time the comment was edited. Or undef if the comment hasn't been edited. (Read-only)
DateTime edittime_poster The local time the comment was edited, in the commenter's timezone. Or undef if anonymous comment, or commenter's timezone is unknown, or the comment hasn't been edited. (Read-only)
DateTime edittime_remote The local time the comment was edited, in the remote user's (reader's) timezone. Or undef if no remote user, or remote user hasn't set their timezone, or the comment hasn't been edited. (Read-only)
bool frozen True if comment is in frozen state. (Read-only)
bool full True if all information is available for this comment. False if only the subject, poster, and date are available. (collapsed threads)
UserLite journal Journal the comment has been posted to.
string[] link_keyseq An array of keys which you should pass to Comment.get_link(string) to produce a comment 'toolbar'. (Array elements.)
string{} metadata Comment metadata. (Array keys.) (Read-only)
string parent_url URL to parent comment, or blank if a top-level comment. (Read-only)
string permalink_url A URL at which this specific entry can be viewed, for linking purposes. (Read-only)
UserLite poster Author of the comment, or null if an anonymous comment.
Comment[] replies Subject. May contain HTML. Don't do substring chops on this. (Read-only)
string reply_url URL to reply to this comment. (Read-only)
bool screened True if comment is in screened state. (Read-only)
int seconds_since_entry The number of elapsed seconds from the time of the journal entry until he comment was made. (Read-only)
string subject Subject. May contain HTML. Don't do substring chops on this. (Read-only)
Image subject_icon Subject icon, or null.
DateTime system_time The system time (in GMT) this entry or comment was posted.
Tag[] tags Array of tags applied to this comment. (Read-only)
string talkid Server stored ID number for this comment.
string text Comment Text; Use Comment.print_text() to print this so that the entry's trust level is not affected by your layer's trust level. (Read-only)
bool text_must_print_trusted Indicates that this comment's text contains some content that must be printed trusted, with Comment.print_text(), rather than printed directly from an untrusted context. Use this to fall back to a plain trusted print if you are doing something unusual with Comment.text. Most layers can just ignore this and always use Comment.print_text(). (Read-only)
string thread_url URL to view threaded rooted at this comment, or blank if comment has no children. (Read-only)
DateTime time GMT time.
DateTime time_poster The local time the comment appeared, in the commenter's timezone. Or undef if no anonymous comment, or commenter's timezone is unknown. (Read-only)
DateTime time_remote The local time the comment appeared, in the remote user's (reader's) timezone. Or undef if no remote user, or remote user hasn't set their timezone. (Read-only)
Image userpic The userpic selected to relate to this entry.

[edit] Methods

edittime_display() : string Show the time that this comment was edited, with most useful information for user. Empty string if the comment hasn't been edited.
edittime_display(string datefmt, string timefmt) : string edittime_display, with customized date/time formats.
get_link(string key) : Link Get a link to some action related to this comment. You can iterate over Comment.link_keyseq to get keys to pass in here to produce a 'toolbar' of links.
get_plain_subject() : string For Entries that can contain HTML subjects, this returns the subjeft without HTML. Comments can't have HTML in subjects, so this is equivalent to just using $.subject. The returned 'plain' subject may still contain HTML entities, so don't do substring chops on it either.
get_tags_text() : string Returns a string containing a <div> of class 'ljtags' with the tags for the entry. If there are no tags on the entry, returns a blank string. The string is formatted according to the 'text_tags' property.
print_edit_text() : void Print the text that says when this comment was edited.
print_linkbar() : void Print the linkbar for this comment.
print_multiform_check() : void Prints the select checkbox in CSS class 'ljcomsel' with DOM id 'ljcomsel_talkid' for a multi-action form started with EntryPage.print_multiform_start().
print_text() : void Print the entry text. Doesn't print anything in some contexts, such in a collapsed comment.
print_reply_container() : void Prints the area in which the quickreply box will go. If no container is available, quickreply will not work.
print_reply_container(string{} opts) : void Same as Comment.print_reply_container() but with more options. (See Quick Reply for usage.)
print_reply_link(string{} opts) : void Prints a link to reply to the comment. You may specify the link text in the 'linktext' option, and the link CSS class in 'class'. You may also specify the url of an image to use as a button in 'img_url'. (See Quick Reply for usage.)
time_display() : string Show the time of this entry, with most useful information for user, and with tooltip for more.
time_display(string datefmt, string timefmt) : string Same as Comment.time_display() but with custom date format support.