Changeset 262

Show
Ignore:
Timestamp:
03/06/06 16:58:56
Author:
johnsa
Message:

added better search template for javascript feed to replace apostrophes with properly escaped apostrophes. Apostrophes are now preserved correctly in js feeds.

Added a "description" class to the description of an event

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/deployment/webpublic/webapp/resources/demoskins/default/default/default.xsl

    r222 r262  
    582582      <tr> 
    583583        <td class="fieldname">Description:</td> 
    584         <td colspan="2" class="fieldval"> 
     584        <td colspan="2" class="fieldval description"> 
    585585          <xsl:value-of select="description"/> 
    586586        </td> 
  • trunk/calendar3/deployment/webpublic/webapp/resources/demoskins/default/default/jsToday.xsl

    r259 r262  
    3333  </xsl:template> 
    3434  <xsl:template match="event"> 
    35     <xsl:variable name="strippedSummary" select='translate(translate(summary,"&apos;",""),"&#xA;"," ")'/> 
     35    <!--<xsl:variable name="strippedSummary" select='translate(translate(summary,"&apos;",""),"&#xA;"," ")'/>--> 
     36    <xsl:variable name="aposStrippedSummary"> 
     37      <xsl:call-template name="replace"> 
     38        <xsl:with-param name="string" select="summary"/> 
     39        <xsl:with-param name="pattern" select='"&apos;"'/> 
     40        <xsl:with-param name="replacement" select='"\&apos;"'/> 
     41      </xsl:call-template> 
     42    </xsl:variable> 
     43    <xsl:variable name="strippedSummary" select='translate($aposStrippedSummary,"&#xA;"," ")'/> 
    3644    <xsl:text disable-output-escaping="yes">document.writeln('&lt;li&gt;');</xsl:text> 
    3745    <xsl:text disable-output-escaping="yes">document.writeln('    &lt;a href="</xsl:text><xsl:value-of select="$urlprefix"/><xsl:text disable-output-escaping="yes">/eventView.do?subid=</xsl:text><xsl:value-of select="subscription/id"/><xsl:text disable-output-escaping="yes">&amp;guid=</xsl:text><xsl:value-of select="guid"/><xsl:text disable-output-escaping="yes">&amp;recurrenceId=</xsl:text><xsl:value-of select="recurrenceId"/><xsl:text disable-output-escaping="yes">&amp;calid=</xsl:text><xsl:value-of select="calendar/id"/><xsl:text disable-output-escaping="yes">&amp;skinName=default" target="_top"&gt;</xsl:text><xsl:value-of select="$strippedSummary" disable-output-escaping="yes"/><xsl:text disable-output-escaping="yes">&lt;/a&gt;');</xsl:text> 
    3846    <xsl:text disable-output-escaping="yes">document.writeln('&lt;/li&gt;');</xsl:text> 
    3947  </xsl:template> 
     48  <xsl:template name="replace"> 
     49    <xsl:param name="string" select="''"/> 
     50    <xsl:param name="pattern" select="''"/> 
     51    <xsl:param name="replacement" select="''"/> 
     52    <xsl:choose> 
     53      <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)"> 
     54        <xsl:value-of select="substring-before($string, $pattern)"/> 
     55        <xsl:copy-of select="$replacement"/> 
     56        <xsl:call-template name="replace"> 
     57          <xsl:with-param name="string" select="substring-after($string, $pattern)"/> 
     58          <xsl:with-param name="pattern" select="$pattern"/> 
     59          <xsl:with-param name="replacement" select="$replacement"/> 
     60        </xsl:call-template> 
     61      </xsl:when> 
     62      <xsl:otherwise> 
     63        <xsl:value-of select="$string"/> 
     64      </xsl:otherwise> 
     65    </xsl:choose> 
     66  </xsl:template> 
    4067</xsl:stylesheet>