Modify

Opened 7 years ago

Closed 7 years ago

#13184 closed defect (wontfix)

Not work in FullBlog

Reported by: Alexey Owned by: Peter Suter
Priority: normal Component: FoldMacroProcessorMacro
Severity: normal Keywords: FullBlogPlugin
Cc: Trac Release: 1.2

Description (last modified by Alexey)

Macros not work if using in blog article in FullBlogPlugin

Attachments (1)

t13184.diff (1.5 KB) - added by Ryan J Ollos 7 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 7 years ago by Alexey

Description: modified (diff)
Keywords: FullBlogPlugin added
Summary: Not compatible with TRAC 1.2Not work in FullBlog

comment:2 Changed 7 years ago by Alexey

Description: modified (diff)

comment:3 Changed 7 years ago by Peter Suter

Can you give more information? What is not working? What are you trying to do? Is there an error?

I don't know anything about FullBlogPlugin.

Changed 7 years ago by Ryan J Ollos

Attachment: t13184.diff added

comment:4 Changed 7 years ago by Ryan J Ollos

See trac:#11550. Two things need to happen:

  • Add folding.js to the page
  • Execute $(".foldable").enableFolding(true, true);

This is a little challenging because we cannot execute $(".foldable").enableFolding(true, true); more than once.

Proposed fix: t13184.diff.

comment:5 Changed 7 years ago by Alexey

Fix from comment:4 works fine

comment:6 Changed 7 years ago by Peter Suter

Ah, nice catch, thanks. So in Trac 1.3.2+ it would work? Or FullBlogPlugin should call enableFolding? The patch seems rather complex (34 lines of code) for this simple plugin (10 lines of code).

comment:7 Changed 7 years ago by Ryan J Ollos

It will not work in Trac 1.3.2+. trac:#11550 adds report.css to the page, but does not call enableFolding on every page.

I don't think FullBlogPlugin should call enableFolding. Calling enableFolding without knowing how/why it is used is problematic because it shouldn't be executed more than once on page load, and different features utilizing folding may want different arguments to the function. If you want the macro to work in any wiki textarea it will need to take responsibility for loading reports.css for Trac < 1.3.2 and it will need to call enableFolding.

comment:8 in reply to:  7 Changed 7 years ago by Ryan J Ollos

Replying to Ryan J Ollos:

Calling enableFolding without knowing how/why it is used is problematic because it shouldn't be executed more than once on page load, and different features utilizing folding may want different arguments to the function.

We should even avoid using the foldable class, so that if the processor is used in a context that executes enableFolding on items with the foldable class it won't affect the fold state of the processor. The only reason for continuing to use the foldable class is to get the styling, so the processor would also need to add the stylesheet snippet.

comment:9 in reply to:  7 ; Changed 7 years ago by Peter Suter

Replying to Ryan J Ollos:

trac:#11550 adds report.css to the page

take responsibility for loading reports.css

report.css? I'm lost.

IMO it would be very helpful if Trac always provided the foldable class behavior automatically (and collapsed to start collapsed initially).

comment:10 in reply to:  9 Changed 7 years ago by Ryan J Ollos

Replying to Peter Suter:

report.css? I'm lost.

Typo. folding.js.

IMO it would be very helpful if Trac always provided the foldable class behavior automatically (and collapsed to start collapsed initially).

So I guess this is a wontfix. Whether you commit the patch or not makes no difference to me, I just wanted to help out the original reporter.

comment:11 Changed 7 years ago by Peter Suter

Resolution: wontfix
Status: newclosed

Thanks for investigating!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Suter.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.