Skip to content

Commit

Permalink
added workflows
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-components-tools-lively-container.js,AUTO-COMMIT-src-components-tools-lively-container.js.l4a,AUTO-COMMIT-src-components-widgets-lively-iframe.html,AUTO-COMMIT-src-components-widgets-lively-window.html,AUTO-COMMIT-src-components-widgets-ubg-card.js,
  • Loading branch information
onsetsu committed Aug 20, 2024
1 parent 0f19fc0 commit 2445453
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
26 changes: 23 additions & 3 deletions src/components/tools/lively-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,8 @@ export default class Container extends Morph {
}
// this.showNavbar();
this.updateNavbarDetails()

this.runWorkflows()

// something async...
lively.sleep(5000).then(() => {
this.__ignoreUpdates = false
Expand Down Expand Up @@ -2409,10 +2410,29 @@ export default class Container extends Morph {


// await lively.sleep(100)


}

async runWorkflows() {
const navbar = this.navbar();
if (!navbar) {
return
}
const that = navbar
const allWorkflowURLs = that.getAllSubmorphs('a').map(a => a.href).compact().filter(href => typeof href === 'string' && href.endsWith('_workflow.js'))
if (allWorkflowURLs.length === 0) {
return
}
if (allWorkflowURLs.length >= 2) {
lively.warn('found multiple workflows', 'exec only first')
}
try {
const workflow = await System.import(allWorkflowURLs.first)
workflow.default(this, this.getURL())
} catch (e) {
lively.error(e, 'error during workflow')
}
}

/*MD ## Content Navigation MD*/

async scrollToAnchor(anchor, preventRecursion=false) {
Expand Down
5 changes: 0 additions & 5 deletions src/components/widgets/lively-iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,3 @@
</iframe>
</div>
</template>





3 changes: 3 additions & 0 deletions src/components/widgets/lively-window.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
.window-button .fa {
padding: 2px;
}
.window-controls .window-button {
min-width: 35px;
}
.focused .window-button {
color: white;
background-color: rgba(0,0,0,0);
Expand Down
4 changes: 4 additions & 0 deletions src/components/widgets/ubg-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,10 @@ ${SVG.elementSymbol(others[2], lively.pt(12.5, 8.5), 1.5)}`, lively.rect(0, 0, 1
return 'Casting a card with a stun counter removes the counter instead of the effect.'
},

synchro: (...args) => {
return 'Play this as a free action by trashing 2+ cards from field with total cost equal to this card\'s.'
},

tiny: () => {
return 'Tiny cards do not count for triggering the game end.'
},
Expand Down

0 comments on commit 2445453

Please sign in to comment.