Modify

Opened 7 years ago

Closed 7 years ago

#13037 closed defect (fixed)

Live editor doesn't work in TracMermaid v0.2.0

Reported by: Christian Boos Owned by: tkob-trac
Priority: normal Component: MermaidMacro
Severity: normal Keywords:
Cc: Trac Release:

Description

Here's a very crude patch, but it got things working for me:

  • tracmermaid/mermaid.py

     
    1010import uuid
    1111from genshi.core import escape
    1212from trac.core import implements
    13 from trac.web.chrome import add_script, add_script_data, ITemplateProvider
     13from trac.web.chrome import add_script, add_script_data, Chrome, ITemplateProvider
    1414from trac.web.main import IRequestHandler
    1515from trac.wiki.api import IWikiPageManipulator
    1616from trac.wiki.macros import WikiMacroBase
     
    2121
    2222    def expand_macro(self, formatter, name, content, args=None):
    2323        self.log.debug("content=%s" % content)
    24         add_script(formatter.req, 'mermaid/mermaid.min.js')
    25         add_script(formatter.req, 'mermaid/tracmermaid.js')
    26         add_script_data(formatter.req,
     24        req = formatter.req
     25        Chrome(self.env).add_jquery_ui(req)
     26        add_script(req, 'mermaid/mermaid.min.js')
     27        add_script(req, 'mermaid/tracmermaid.js')
     28        add_script_data(req,
    2729                {
    2830                    '_tracmermaid': {
    29                         'submit': formatter.req.href + '/mermaid/submit',
    30                     }
     31                        'submit': req.href + '/mermaid/submit',
     32                    },
     33                    'form_token': req.form_token,
    3134                }
    3235        )
    3336        if args == None or 'id' not in args:

Attachments (1)

0001-TH13037-Live-editor-doesn-t-work-in-TracMermaid-v0.2.patch (2.1 KB) - added by Christian Boos 7 years ago.
proper patch for this issue

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by Christian Boos

proper patch for this issue

comment:1 Changed 7 years ago by tkob-trac

Resolution: fixed
Status: newclosed

In 16174:

Apply a patch from cboos, closes #13037

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain tkob-trac.
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.