Skip to content

Commit a63044e

Browse files
committed
Merge branch 'gh-pages' of https://github.com/LivelyKernel/lively4-core into gh-pages
2 parents d48c5c7 + cd76d67 commit a63044e

File tree

7 files changed

+23
-11
lines changed

7 files changed

+23
-11
lines changed

demos/contraints/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# #EUD20 Lively Contraints
1+
# #EUD20 Lively Constraints

doc/journal/2020-09-01.md/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var lastWindow;
2525
})()
2626
```
2727

28-
## Turning Wiki-pages into Tools (#PaperIdea)
28+
## Turning Wiki-pages into Tools ( #PaperIdea )
2929

3030
We used markdown pages to prototype tools and visualizations a lot. But to use it, one had to navigate to that specific page and interact with the tool there. A good and working example of the setup are these journal pages and their index page that allows to create new entries. But markdown pages are not easy to integrate into a workflow with other tools. E.g. using the git graph visualization tool directly from our sync tools is not possible.
3131

src/client/fetch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ export async function installAuthorizedFetch() {
140140
}
141141
}
142142

143-
if (isWriting && baseUrlsAuthNeededForWriting.find(ea => url.startsWith(ea))) {
143+
if (isWriting && baseUrlsAuthNeededForWriting.find(
144+
ea => url.startsWith(ea) && !url.startsWith(lively4url + "/.transpiled/") )) {
144145
return {
145146
result: (async () => {
146147
console.log("AuthorizedFetch Write: " + url)

src/client/morphic/selecting.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,40 @@ export default class Selecting {
109109
// lively.showElement(e.composedPath()[0],1300).textContent = "path: " + e.composedPath().map(ea => ea.tagName).join(",")
110110

111111

112-
var rootNode = this.findRootNode(document.body)
113112

114113
var path = this.slicePathIfContainerContent(e.composedPath());
115114

116-
// var rootNode = lively.findWorldContext(path)
117115

118116
// workaround weird toplevel event issues... the halo should not get the event
119117
// lively.notify("path " + e.composedPath().map(ea => ea.tagName))
120118
if (e.composedPath().find(ea => ea.tagName == "LIVELY-HALO")) {
121119
path = this.lastPath || e.composedPath()
122120
}
121+
122+
// some inception: deal with containers that should behave as if they are their own document
123+
// if we have found one, treat them as root
124+
var worldContexts = path
125+
.map(ea => lively.findWorldContext(ea))
126+
.filter(ea => ea)
127+
.filter(ea => ea.id == "container-root")
128+
if (worldContexts.length > 0) {
129+
var rootNode = this.findRootNode(worldContexts[0])
130+
} else {
131+
rootNode = this.findRootNode(document.body)
132+
}
133+
123134
this.lastPath = path
124135
path = path
125136
// .reverse()
126137
.filter(ea => ! this.isIgnoredOnMagnify(ea))
127138

139+
140+
128141
if (e.shiftKey) {
129142
var idx = e.composedPath().indexOf(document.body);
130143
path= path
131144
} else {
145+
debugger
132146
// by default: don't go into the shadows
133147
path = path.filter(ea => rootNode === this.findRootNode(ea))
134148
}

src/client/reactive/active-expression-rewriting/active-expression-rewriting.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,7 @@ const DependenciesToAExprs = {
378378
associate(dep, aexpr) {
379379
const location = aexpr.meta().get("location");
380380
if(location && location.file) {
381-
if (!this._AEsPerFile.has(location.file)) {
382-
this._AEsPerFile.set(location.file, new Set());
383-
}
384-
this._AEsPerFile.get(location.file).add(aexpr);
381+
this._AEsPerFile.getOrCreate(location.file, () => new Set()).add(aexpr);
385382
}
386383
this._depsToAExprs.associate(dep, aexpr);
387384
dep.updateTracking();

src/client/reactive/components/rewritten/aexpr-test-component.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { AExprRegistry } from 'src/client/reactive/active-expression/active-expr
55
import Poll from 'src/client/reactive/components/rewritten/poll.js';
66
export default class AexprTest extends Morph {
77
async initialize() {
8-
this.c = 10;
8+
this.c = 100;
99
this.windowTitle = "Active Expression Testing";
1010
this.aes = [];
11+
1112
this.y = 4;
1213
this.x = new Poll(4);
1314
this.createButton.addEventListener('click', () => this.addAE());

src/components/tools/lively-container-navbar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ export default class LivelyContainerNavbar extends Morph {
437437
return ((a.title || a.name) >= (b.title || b.name)) ? 1 : -1;
438438
})
439439
.filter(ea => ! ea.name.match(/^\./));
440-
debugger
441440
files.unshift({name: "..", type: "directory", url: stats.parent});
442441
return files
443442
}

0 commit comments

Comments
 (0)