Skip to content

Commit

Permalink
Merge branch 'gh-pages' of https://github.com/LivelyKernel/lively4-core
Browse files Browse the repository at this point in the history
… into gh-pages
  • Loading branch information
JensLincke committed Jan 17, 2024
2 parents 50445b7 + bcc4932 commit dd0efdd
Show file tree
Hide file tree
Showing 5 changed files with 317 additions and 188 deletions.
8 changes: 8 additions & 0 deletions src/client/paperjs-wrapper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* global paper */

const paperJSURL = lively4url + '/src/external/paper-core.js';
await lively.loadJavaScriptThroughDOM("paper-core.js", paperJSURL);
const canvas = document.createElement('canvas')
paper.setup(canvas);

export {paper as default};
15 changes: 14 additions & 1 deletion src/components/widgets/ubg-cards-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class UBGCardEntry extends Morph {
keep: 'green',
unsure: 'yellow',
remove: 'red',
}[card.getRating()] || 'gray');
}[card.getRating()] || 'lightgray');
id.innerHTML = card.id || '???';

const type = v.type && v.type.toLowerCase();
Expand All @@ -142,6 +142,19 @@ export default class UBGCardEntry extends Morph {
this.get('#art').innerHTML = card.getArtDirection() || '-';
}

isVisible() {
return !this.classList.contains('hidden') && !this.classList.contains('out-of-range')
}

updateToRange(start, end) {
const card = this.card;
const id = +card.getId();

const inRange = (!start || start <= id) && (!end || id <= end);
this.classList.toggle('in-range', inRange);
this.classList.toggle('out-of-range', !inRange);
}

updateToFilter(filter) {
filter = filter.toLowerCase();

Expand Down
11 changes: 8 additions & 3 deletions src/components/widgets/ubg-cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,22 @@
background: var(--sort-background);
}

input#rangeStart, input#rangeEnd {
width: 4ex;
}
</style>
<div id='layout'>
<div id="buttons">
<input id="filter" title="Ctrl+/" placeholder="filter, e.g. fire\b"/>
<button id="sortById" title="sort cards by id"><i class="fa fa-sort" aria-hidden="true"></i>by id</button>
<button id="sortByName" title="sort cards by name"><i class="fa fa-sort" aria-hidden="true"></i>by name</button>
<input id="rangeStart" title="min id" placeholder="min"/>
<input id="rangeEnd" title="max id" placeholder="max"/>
<button id="copyIDs" title="copy ids for next 100 cards"><i class="fa fa-upload"></i></button>
<button id="import new cards" class="shortcut-supported" title="import new cards (Ctrl+I)">import <i class="fa fa-download"></i></button>
<button id="artDesc" class="shortcut-supported" title="copy to clipboard art descriptions of card that do not have art yet">art <i class="fa fa-clipboard"></i></button>
<button id="printAll" title="print all cards (Ctrl+Shift+P)">all <i class="fa fa-print"></i></button>
<button id="printSelected" title="print all filtered cards"><i class="fa fa-filter"></i> <i class="fa fa-print"></i></button>
<button id="printChanges" title="print changed cards (Ctrl+P)">changes <i class="fa fa-print"></i></button>
<button id="printSelected" class="shortcut-supported" title="print filtered cards in range (Ctrl+P)">filtered <i class="fa fa-print"></i></button>
<button id="printChanges" class="shortcut-supported" title="print changed cards (Ctrl+Alt+P)">changes <i class="fa fa-print"></i></button>
<button id="saveJSON" class="shortcut-supported" title="save json (Ctrl+S)">json <i class="fa fa-floppy-o"></i></button>
<button id="savePDF" title="save pdf">pdf <i class="fa fa-floppy-o"></i></button>
<button id="showPreview" title="show preview"><i class="fa fa-eye"></i></button>
Expand Down
Loading

0 comments on commit dd0efdd

Please sign in to comment.