Changes between Version 21 and Version 22 of TopMacro
- Timestamp:
- Mar 27, 2022, 8:06:06 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TopMacro
v21 v22 7 7 This 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. 8 8 9 Inserting the macro in your wiki page would be as sfollows:9 Inserting the macro in your wiki page would be as follows: 10 10 {{{ 11 11 [[Top]] … … 41 41 === Styling 42 42 43 If you like the caret, but prefer to omit the brackets and style the link yourself 44 with CSS, try something like this: 43 If you like the caret, but prefer to omit the brackets and style the link yourself with CSS, try something like this: 45 44 46 45 {{{#!css … … 65 64 }}} 66 65 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. 68 67 69 68 === Behavior 70 69 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.htmltemplate add:70 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: 72 71 73 {{{#! html72 {{{#!xml 74 73 <html xmlns="http://www.w3.org/1999/xhtml" 75 74 xmlns:py="http://genshi.edgewall.org/" py:strip=""> … … 88 87 }}} 89 88 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. 91 90 92 91 == Bugs/Feature Requests