Modify

Opened 7 years ago

Closed 6 years ago

#2377 closed enhancement (fixed)

Separate CSS stylesheet

Reported by: qwp0 Owned by: qwp0
Priority: normal Component: ProgressMeterMacro
Severity: normal Keywords:
Cc: androsis@… Trac Release: 0.11

Description

Actually, ProgressMeterMacro puts the required CSS styles into a wiki page every time the macro is called. Solve this by importing separate stylesheet for CSS styles used by macro.

Attachments (0)

Change History (4)

comment:1 follow-up: Changed 6 years ago by qwp0

  • Resolution set to wontfix
  • Status changed from new to closed

This enhancement can't be done, AFAIK, because importing of separate CSS styles is possible just for plugins which define new URL handlers. And because this is _macro_ plugin, it is used within wiki pages -- but they (the wiki pages) have predefined handler (the wiki handler handle all '/wiki/*' requests) so we don't define new handler and because of that we can't import the separate CSS stylesheets.

If you know any other way how to solve this, let me know ;-)

comment:2 in reply to: ↑ 1 Changed 6 years ago by osimons

Replying to qwp0:

If you know any other way how to solve this, let me know ;-)

I know nothing about this plugin, just wanting to mention that adding a stylesheet from a macro is doable and supported - Trac does this itself for many purposes. Like if you add a {{{#!diff}}} processor (=macro), it will also add the stylesheet needed to support inline viewing of patches regardless of what handler it is in.

from trac.web.chrome import add_stylesheet 
add_stylesheet(formatter.req, 'myplugin/css/mysheet.css')

You also need to extend the ITemplateProvider interface to make a named htdocs location available so your sheet can be located (if not done already).

As an example, I also add a stylesheet in a macro that is part of the fullblogplugin.

comment:3 Changed 6 years ago by qwp0

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Thanks for information and pointing at your plugin -- I have looked for a macro which includes separate stylesheets! I will look at this problem again, trying to get it done using your solution. Thanks!

comment:4 Changed 6 years ago by qwp0

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [3298]) ProgressMeterMacro: Using separate CSS, fixes #2377 (v0.1)

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from qwp0. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.