diff --git a/bower.json b/bower.json index ce3c3116..f59c636e 100644 --- a/bower.json +++ b/bower.json @@ -30,7 +30,7 @@ "hammerjs": "~1.0.10", "raphael": "~2.1.2", "js-sequence-diagrams": "https://github.com/benweet/js-sequence-diagrams.git#d60c973aa0ff148dc588c7ceee0b41e59dff3f9f", - "flowchart": "https://github.com/adrai/flowchart.js.git#~1.2.10", + "flowchart": "https://github.com/adrai/flowchart.js.git#751717d3db6437def9a5f8b1cb73e8bb81b5833a", "monetizejs": "~0.2.0", "MathJax": "~2.4.0", "alertify.js": "https://github.com/fabien-d/alertify.js.git#fc2e06fa39873363dda199204b8544119ab060bf" diff --git a/public/res/extensions/umlDiagrams.js b/public/res/extensions/umlDiagrams.js index f1d5f3ec..5b0e9c15 100644 --- a/public/res/extensions/umlDiagrams.js +++ b/public/res/extensions/umlDiagrams.js @@ -12,6 +12,23 @@ define([ var umlDiagrams = new Extension("umlDiagrams", "UML Diagrams", true); umlDiagrams.settingsBlock = umlDiagramsSettingsBlockHTML; + umlDiagrams.defaultConfig = { + flowchartOptions: [ + '{', + ' "line-width": 2,', + ' "font-family": "sans-serif",', + ' "font-weight": "normal"', + '}' + ].join('\n') + }; + + umlDiagrams.onLoadSettings = function() { + utils.setInputValue("#textarea-umldiagram-flowchart-options", umlDiagrams.config.flowchartOptions); + }; + + umlDiagrams.onSaveSettings = function(newConfig, event) { + newConfig.flowchartOptions = utils.getInputJSONValue("#textarea-umldiagram-flowchart-options", event); + }; umlDiagrams.onPagedownConfigure = function(editor) { var previewContentsElt = document.getElementById('preview-contents'); @@ -39,11 +56,7 @@ define([ class: 'flow-chart' }); preElt.parentNode.replaceChild(containerElt, preElt); - chart.drawSVG(containerElt, { - 'line-width': 2, - 'font-family': 'sans-serif', - 'font-weight': 'normal' - }); + chart.drawSVG(containerElt, JSON.parse(umlDiagrams.config.flowchartOptions)); } catch(e) { } diff --git a/public/res/html/umlDiagramsSettingsBlock.html b/public/res/html/umlDiagramsSettingsBlock.html index ad19ff1d..cab84425 100644 --- a/public/res/html/umlDiagramsSettingsBlock.html +++ b/public/res/html/umlDiagramsSettingsBlock.html @@ -1,5 +1,15 @@
Creates UML diagrams from plain text description.
+Sequence diagrams:
```sequence
Alice->Bob: Hello Bob, how are you?
@@ -21,4 +31,3 @@ cond(no)->op
Note: Markdown Extra extension has to be enabled with GFM fenced code blocks option.
-
diff --git a/public/res/main.js b/public/res/main.js
index 0edd199a..8b199bd8 100644
--- a/public/res/main.js
+++ b/public/res/main.js
@@ -65,8 +65,8 @@ requirejs.config({
Diagram: 'bower-libs/js-sequence-diagrams/src/sequence-diagram',
'diagram-grammar': 'bower-libs/js-sequence-diagrams/build/diagram-grammar',
raphael: 'bower-libs/raphael/raphael',
- 'flow-chart': 'bower-libs/flowchart/release/flowchart.amd-1.2.10.min',
- flowchart: 'bower-libs/flowchart/release/flowchart-1.2.10.min',
+ 'flow-chart': 'bower-libs/flowchart/release/flowchart.amd-1.3.4.min',
+ flowchart: 'bower-libs/flowchart/release/flowchart-1.3.4.min',
monetizejs: 'bower-libs/monetizejs/src/monetize',
'to-markdown': 'bower-libs/to-markdown/src/to-markdown',
waitForImages: 'bower-libs/waitForImages/dist/jquery.waitforimages',