Changes between Version 21 and Version 22 of TopMacro


Ignore:
Timestamp:
Mar 27, 2022, 8:06:06 AM (2 years ago)
Author:
figaro
Comment:

Cosmetic changes, typos

Legend:

Unmodified
Added
Removed
Modified
  • TopMacro

    v21 v22  
    77This macro inserts a "top of page" link in your Trac wiki page. The only option is a string that is inserted into the content of the markup. This defaults to a single circumflex "!^" character (more commonly known as a caret), surrounded by square brackets. The anchor element returned includes a "Top of Page" title attribute so the user knows its purpose, and a "topofpage" class so the Wiki author may apply their preferred style rules.
    88
    9 Inserting the macro in your wiki page would be ass follows:
     9Inserting the macro in your wiki page would be as follows:
    1010{{{
    1111[[Top]]
     
    4141=== Styling
    4242
    43 If you like the caret, but prefer to omit the brackets and style the link yourself
    44 with CSS, try something like this:
     43If you like the caret, but prefer to omit the brackets and style the link yourself with CSS, try something like this:
    4544
    4645{{{#!css
     
    6564}}}
    6665
    67 '''Note''': If you're going to style the anchor like this you should also pass an argument to the macro or you'll end up with the default brackets in addition to the styling.
     66'''Note''': If you're going to style the anchor like this, you should also pass an argument to the macro or you'll end up with the default brackets in addition to the styling.
    6867
    6968=== Behavior
    7069
    71 If you want to get really fancy you can use jQuery to create a smooth scrolling effect when the link is clicked. In your site.html template add:
     70If you want to get really fancy, you can use jQuery to create a smooth scrolling effect when the link is clicked. In your `site.html` template add:
    7271
    73 {{{#!html
     72{{{#!xml
    7473<html xmlns="http://www.w3.org/1999/xhtml"
    7574      xmlns:py="http://genshi.edgewall.org/" py:strip="">
     
    8887}}}
    8988
    90 '''Note''': Returning false from the lambda, or anonymous, function prevents the browser from kicking in it's own event model. However, it degrades nicely and still works even if the user has !JavaScript disabled.
     89'''Note''': Returning false from the lambda, or anonymous, function prevents the browser from kicking in its own event model. However, it degrades nicely and still works even if the user has !JavaScript disabled.
    9190
    9291== Bugs/Feature Requests