Changeset 3395

Show
Ignore:
Timestamp:
11/15/06 23:48:38 (2 years ago)
Author:
rinoa
Message:

Fixes #72. Adds the option to display hostmasks in parts/joins in the following styles: Standard, Bland, Fiat, Synapse, DecafBland? and other third-party styles that default to our xsl file. Option found in Customize Style. Also added the ability to see the hostmask when hovering over a nick inside the chat room.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Resources/Styles/DecafBland.colloquyStyle/Contents/Resources/main.xsl

    r3362 r3395  
    124124                        <span class="timestamp hidden">] </span> 
    125125                        <span class="message"> 
    126                                 <xsl:apply-templates select="message/child::node()" mode="copy" /> 
     126                                <xsl:apply-templates select="message/child::node()" mode="event" /> 
    127127                                <xsl:if test="string-length(reason)"> 
    128128                                        <span class="reason"> 
     
    134134                        </span> 
    135135                </div> 
     136        </xsl:template> 
     137 
     138        <xsl:template match="span[contains(@class,'member')]" mode="event"> 
     139                <xsl:variable name="nickname" select="current()" /> 
     140                <xsl:choose> 
     141                        <xsl:when test="../../node()[node() = $nickname]/@hostmask"> 
     142                                <xsl:variable name="hostmask" select="../../node()[node() = $nickname]/@hostmask" /> 
     143                                <a href="member:{$nickname}" title="{$hostmask}" class="member"><xsl:value-of select="$nickname" /></a> 
     144                                <xsl:if test="../../@name = 'memberJoined' or ../../@name = 'memberParted'"> 
     145                                        <span class="hostmask"> 
     146                                                <xsl:text> (</xsl:text> 
     147                                                <xsl:value-of select="$hostmask" /> 
     148                                                <xsl:text>) </xsl:text> 
     149                                        </span> 
     150                                </xsl:if> 
     151                        </xsl:when> 
     152                        <xsl:otherwise> 
     153                                <a href="member:{$nickname}" class="member"><xsl:value-of select="$nickname" /></a> 
     154                        </xsl:otherwise> 
     155                </xsl:choose> 
    136156        </xsl:template> 
    137157 
  • trunk/Resources/Styles/Fiat.colloquyStyle/Contents/Resources/main.xsl

    r3384 r3395  
    168168                <span class="hidden">] </span> 
    169169                        <span class="message"> 
    170                         <xsl:apply-templates select="message/child::node()" mode="copy" /> 
     170                        <xsl:apply-templates select="message/child::node()" mode="event" /> 
    171171                        <xsl:if test="string-length( reason )"> 
    172172                                <span class="reason"> 
     
    206206                        <xsl:otherwise> 
    207207                                <xsl:copy-of select="current()"/> 
     208                        </xsl:otherwise> 
     209                </xsl:choose> 
     210        </xsl:template> 
     211 
     212        <xsl:template match="span[contains(@class,'member')]" mode="event"> 
     213                <xsl:variable name="nickname" select="current()" /> 
     214                <xsl:choose> 
     215                        <xsl:when test="../../node()[node() = $nickname]/@hostmask"> 
     216                                <xsl:variable name="hostmask" select="../../node()[node() = $nickname]/@hostmask" /> 
     217                                <a href="member:{$nickname}" title="{$hostmask}" class="member"><xsl:value-of select="$nickname" /></a> 
     218                                <xsl:if test="../../@name = 'memberJoined' or ../../@name = 'memberParted'"> 
     219                                        <span class="hostmask"> 
     220                                                <xsl:text> (</xsl:text> 
     221                                                <xsl:value-of select="$hostmask" /> 
     222                                                <xsl:text>) </xsl:text> 
     223                                        </span> 
     224                                </xsl:if> 
     225                        </xsl:when> 
     226                        <xsl:otherwise> 
     227                                <a href="member:{$nickname}" class="member"><xsl:value-of select="$nickname" /></a> 
    208228                        </xsl:otherwise> 
    209229                </xsl:choose> 
  • trunk/Resources/Styles/Synapse.colloquyStyle/Contents/Resources/main.xsl

    r3385 r3395  
    2525                <span class="event"> 
    2626                        <span class="hidden">[<xsl:value-of select="$timestamp" />] </span> 
    27                         <xsl:apply-templates select="message/child::node()" mode="copy" /> 
     27                        <xsl:apply-templates select="message/child::node()" mode="event" /> 
    2828                        <xsl:text> (</xsl:text> 
    2929                        <xsl:value-of select="$timestamp" /> 
     
    164164                        </span> 
    165165                </xsl:if> 
     166        </xsl:template> 
     167 
     168        <xsl:template match="span[contains(@class,'member')]" mode="event"> 
     169                <xsl:variable name="nickname" select="current()" /> 
     170                <xsl:choose> 
     171                        <xsl:when test="../../node()[node() = $nickname]/@hostmask"> 
     172                                <xsl:variable name="hostmask" select="../../node()[node() = $nickname]/@hostmask" /> 
     173                                <a href="member:{$nickname}" title="{$hostmask}" class="member"><xsl:value-of select="$nickname" /></a> 
     174                                <xsl:if test="../../@name = 'memberJoined' or ../../@name = 'memberParted'"> 
     175                                        <span class="hostmask"> 
     176                                                <xsl:text> (</xsl:text> 
     177                                                <xsl:value-of select="$hostmask" /> 
     178                                                <xsl:text>) </xsl:text> 
     179                                        </span> 
     180                                </xsl:if> 
     181                        </xsl:when> 
     182                        <xsl:otherwise> 
     183                                <a href="member:{$nickname}" class="member"><xsl:value-of select="$nickname" /></a> 
     184                        </xsl:otherwise> 
     185                </xsl:choose> 
    166186        </xsl:template> 
    167187 
  • trunk/Resources/default.css

    r3328 r3395  
    3333} 
    3434 
     35.hostmask { 
     36        display: none; 
     37} 
     38 
    3539/* For the display mark */ 
    3640hr#mark { 
  • trunk/Resources/default.xsl

    r3247 r3395  
    5555                </xsl:variable> 
    5656 
     57                <xsl:variable name="hostmask" select="sender/@hostmask | ../sender/@hostmask"/> 
     58                 
    5759                <div id="{message[1]/@id | @id}" class="{$envelopeClasses}"> 
    5860                        <span class="timestamp hidden">[</span> 
     
    6668                                <span class="hidden">• </span> 
    6769                        </xsl:if> 
    68                         <a href="{$memberLink}" class="{$senderClasses}"><xsl:value-of select="sender | ../sender" /></a> 
     70                        <a href="{$memberLink}" title="{$hostmask}" class="{$senderClasses}"><xsl:value-of select="sender | ../sender" /></a> 
    6971                        <xsl:choose> 
    7072                                <xsl:when test="message[1]/@action = 'yes' or @action = 'yes'"> 
     
    99101                        </span> 
    100102                        <span class="timestamp hidden">] </span> 
    101                         <xsl:apply-templates select="message/child::node()" mode="copy" /> 
     103                        <xsl:apply-templates select="message/child::node()" mode="event" /> 
    102104                        <xsl:if test="string-length( reason )"> 
    103105                                <span class="reason"> 
     
    108110                        </xsl:if> 
    109111                </div> 
     112        </xsl:template> 
     113 
     114        <xsl:template match="span[contains(@class,'member')]" mode="event"> 
     115                <xsl:variable name="nickname" select="current()" /> 
     116                <xsl:choose> 
     117                        <xsl:when test="../../node()[node() = $nickname]/@hostmask"> 
     118                                <xsl:variable name="hostmask" select="../../node()[node() = $nickname]/@hostmask" /> 
     119                                <a href="member:{$nickname}" title="{$hostmask}" class="member"><xsl:value-of select="$nickname" /></a> 
     120                                <xsl:if test="../../@name = 'memberJoined' or ../../@name = 'memberParted'"> 
     121                                        <span class="hostmask"> 
     122                                                <xsl:text> (</xsl:text> 
     123                                                <xsl:value-of select="$hostmask" /> 
     124                                                <xsl:text>) </xsl:text> 
     125                                        </span> 
     126                                </xsl:if> 
     127                        </xsl:when> 
     128                        <xsl:otherwise> 
     129                                <a href="member:{$nickname}" class="member"><xsl:value-of select="$nickname" /></a> 
     130                        </xsl:otherwise> 
     131                </xsl:choose> 
    110132        </xsl:template> 
    111133 
  • trunk/Resources/styleOptions.plist

    r2678 r3395  
    111111        <dict> 
    112112                <key>style</key> 
     113                <array> 
     114                        <string>.hostmask { display: inline; }</string> 
     115                        <string>.hostmask { display: none; }</string> 
     116                </array> 
     117                <key>default</key> 
     118                <integer>1</integer> 
     119                <key>description</key> 
     120                <string>Display hostmasks</string> 
     121                <key>type</key> 
     122                <string>list</string> 
     123                <key>options</key> 
     124                <array> 
     125                        <string>Yes</string> 
     126                        <string>No</string> 
     127                </array> 
     128        </dict> 
     129        <dict> 
     130                <key>style</key> 
    113131                <string>.searchHighlight { color: %@ !important; }</string> 
    114132                <key>default</key>