Updated flowchart lib

This commit is contained in:
benweet 2014-11-02 17:17:42 +00:00
parent 1cc2363f0e
commit f6f1125bb4
4 changed files with 31 additions and 9 deletions

View File

@ -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"

View File

@ -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) {
}

View File

@ -1,5 +1,15 @@
<p>Creates UML diagrams from plain text description.</p>
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-4 control-label" for="textarea-umldiagram-flowchart-options">Flow charts options (JSON)
</label>
<div class="col-sm-7">
<textarea id="textarea-umldiagram-flowchart-options" class="form-control"></textarea>
</div>
</div>
</div>
<br>
<p>Sequence diagrams:</p>
<pre><div class="help-block pull-right"><a target="_blank" href="http://bramp.github.io/js-sequence-diagrams/">More info</a></div><code>```sequence
Alice->Bob: Hello Bob, how are you?
@ -21,4 +31,3 @@ cond(no)->op
<blockquote>
<p><b>Note:</b> Markdown Extra extension has to be enabled with GFM fenced code blocks option.</p>
</blockquote>

View File

@ -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',