MediaWiki talk:Intercomnotice

From RationalWiki
Jump to navigation Jump to search

My table aligns things nicely, but borks with "white" borders and I can't fix it right now. Also, can we get rid of the dark orange borders around next/prev/mark? ħumanUser talk:Human 05:39, 1 May 2009 (UTC)

Thanks for fixing it up, Nx. And thanks for the docs below! ħumanUser talk:Human 19:07, 1 May 2009 (UTC)

Documentation[edit]

This page is used to render the intercom messages for both registered and anonymous users. The page is parsed first, so it may contain wikitext, but it cannot depend on the parameters (the dollar thingies), because those are replaced after parsing. So you cannot, for example, use {{#if:}} with one of the parameters, because it would always return the same result. Then, the parameters and buttons are inserted:

  • $1 : summary
  • $2 : message text
  • $3 : sender's name, with link to userpage and talkpage
  • $4 : group name
  • $5 : message time
  • $6 : next button
  • $7 : previous button
  • $8 : mark read button

The buttons look like this:

"<span class='intercombutton'><a" . "href='javascript:nextMessage({$mId},{$mTime})'>{$mNext}</a></span>";
"<span class='intercombutton'><a" . "href='javascript:prevMessage({$mId},{$mTime})'>{$mPrev}</a></span>";
"<span class='intercombutton'><a" . "href='javascript:markRead({$mId},{$mTime})'>{$mMark}</a></span>";

For anonymous users, the mark read button is ommitted. Captions for the buttons ($mNext, $mPrev, $mMark) are taken from MediaWiki:intercom-next, MediaWiki:intercom-prev and MediaWiki:intercom-markread. Since they're given the intercombutton class, they can be styled in MediaWiki:Common.css. Finally, the resulting html code is inserted into a div:

"<div id='intercommessage' class='usermessage' style='text-align:left; font-weight: normal;'>" . Intercom::_rendermessage($mess,$userid) . '</div>';

This div is in the extension source to ensure it's not removed accidentally. It has the usermessage class used by the new talk messages notification, but it can also be styled using its id, intercommessage. In addition, it has a class based on the group name, in the form of intercom-groupname, where groupname is the escaped name of the group the message was sent to, so messages sent to different groups can be styled separately.

For displaying messages in Special:Intercom, MediaWiki:intercommessage is used instead.

Feel free to edit this post for grammar/spelling/clarity. --  Nx/talk  08:19, 1 May 2009 (UTC)