Skip to content

Commit

Permalink
Fix edit error (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCoder authored Aug 12, 2020
1 parent 3596784 commit a345781
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.zenuml</groupId>
<artifactId>confluence-addon</artifactId>
<version>1.0.8</version>
<version>1.0.9</version>
<organization>
<name>P and D Vision</name>
<url>https://www.zenuml.com/</url>
Expand Down
19 changes: 11 additions & 8 deletions src/main/resources/atlassian-plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@
</web-panel>
<!-- add our web resources -->
<web-resource key="active-sequence-resources" name="sequence Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<dependency>com.atlassian.auiplugin:dialog2</dependency>
<dependency>confluence.editor.actions:editor-macro-browser</dependency>
<resource type="download" name="demo.html" location="/demo.html" value="enabled"/>
<resource type="download" name="sequence.css" location="/css/sequence.css" value="enabled"/>
<resource type="download" name="vue.js" location="/js/vue.js" value="enabled"/>
<resource type="download" name="md5.min.js" location="/js/md5.min.js" value="enabled"/>
<resource type="download" name="dom-to-image.min.js" location="/js/dom-to-image.min.js" value="enabled"/>
<resource type="download" name="zen-sequence-vendor.js" location="/js/zen-sequence-vendor.js" value="enabled"/>
<resource type="download" name="zen-sequence-app.js" location="/js/zen-sequence-app.js" value="enabled"/>
<resource type="download" name="macro-customise.js" location="/js/macro-customise.js" value="enabled"/>
<resource type="download" name="images/" location="/images" value="enabled"/>
<resource type="download" name="analytics.js" location="/js/analytics.js" value="enabled"/>
<resource type="download" name="diagram-as-code.js" location="/META-INF/resources/webjars/diagram-as-code.js/0.1.14/dist/diagram-as-code.min.js" value="enabled"/>
<context>editor</context>
</web-resource>

<web-resource key="active-sequence-resources-editor" name="sequence Web Resources for editor">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<dependency>com.atlassian.auiplugin:dialog2</dependency>
<dependency>confluence.editor.actions:editor-macro-browser</dependency>
<resource type="download" name="sequence.css" location="/css/sequence.css" value="enabled"/>
<resource type="download" name="vue.js" location="/js/vue.js" value="enabled"/>
<resource type="download" name="macro-customise.js" location="/js/macro-customise.js" value="enabled"/>
<resource type="download" name="diagram-as-code.js" location="/META-INF/resources/webjars/diagram-as-code.js/0.1.14/dist/diagram-as-code.min.js" value="enabled"/>
<context>atl.general</context>
</web-resource>
<xhtml-macro name="active-sequence" class="com.zenuml.confluence.macro.SequenceMacro" icon="/download/resources/${atlassian.plugin.key}:active-sequence-resources/images/zenuml_logo.png" key="active-sequence-macro">
<description key="sequence.macro.desc"/>
Expand Down
25 changes: 11 additions & 14 deletions src/main/resources/js/macro-customise.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ AJS.$(document).ready(function () {
// return a dom node list
function getAllShadowElements() {
var elements = [];
AJS.$('sequence-diagram').each(function () {
if (this.shadowRoot.querySelector(".sequence-diagram-container")) {
elements.push(this.shadowRoot.querySelector(".sequence-diagram-container"))
AJS.$('diagram-as-code').each(function () {
if (this.shadowRoot.querySelector(".diagram-as-code.noEditor>.split>.sequence-diagram")) {
elements.push(this.shadowRoot.querySelector(".sequence-diagram"))
}
});
return elements;
Expand All @@ -62,17 +62,14 @@ AJS.$(document).ready(function () {
if (doms.length > 0) {
var dslList = [];
doms.forEach(function (dom) {
var dslEls = AJS.$(dom).find('.zenuml-dsl');
if (dslEls.length > 0) {
var dslText = dslEls.text();
// remove duplicate when upload mutiple same uml at the same time
if (dslList.indexOf(dslText) < 0) {
objects.push({
dsl: dslText,
domtoimagePromise: domtoimage.toBlob(dom, { bgcolor: 'white' })
});
dslList.push(dslText);
}
var dslText = dom.__vue__.$store.state.code;
// remove duplicate when upload mutiple same uml at the same time
if (dslList.indexOf(dslText) < 0) {
objects.push({
dsl: dslText,
domtoimagePromise: domtoimage.toBlob(dom, { bgcolor: 'white' })
});
dslList.push(dslText);
}
})
}
Expand Down

0 comments on commit a345781

Please sign in to comment.