Modify ↓
Opened 8 years ago
Closed 8 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
10 10 import uuid 11 11 from genshi.core import escape 12 12 from trac.core import implements 13 from trac.web.chrome import add_script, add_script_data, ITemplateProvider13 from trac.web.chrome import add_script, add_script_data, Chrome, ITemplateProvider 14 14 from trac.web.main import IRequestHandler 15 15 from trac.wiki.api import IWikiPageManipulator 16 16 from trac.wiki.macros import WikiMacroBase … … 21 21 22 22 def expand_macro(self, formatter, name, content, args=None): 23 23 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, 27 29 { 28 30 '_tracmermaid': { 29 'submit': formatter.req.href + '/mermaid/submit', 30 } 31 'submit': req.href + '/mermaid/submit', 32 }, 33 'form_token': req.form_token, 31 34 } 32 35 ) 33 36 if args == None or 'id' not in args:
Attachments (1)
Change History (2)
Changed 8 years ago by
Attachment: | 0001-TH13037-Live-editor-doesn-t-work-in-TracMermaid-v0.2.patch added |
---|
Note: See
TracTickets for help on using
tickets.
proper patch for this issue