Skip to content

Commit 676fc83

Browse files
committed
[bibtex] enable editing in view and fix drag and drop bug
SQUASHED: bibtex-enable-editing-in-view,
1 parent 800d526 commit 676fc83

File tree

4 files changed

+26
-16
lines changed

4 files changed

+26
-16
lines changed

demos/bibliographie/_other.bib

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
21
@inproceedings{Krahn2009LWD,
32
author = {Robert Krahn and Dan Ingalls and Robert Hirschfeld and Jens Lincke and Krzysztof Palacz},
4-
title = {Lively Wiki a development environment for creating and sharing active web content},
5-
year = {2009},
6-
microsoftid = {2166901142},
73
booktitle = {Proceedings of the 5th International Symposium on Wikis and Open Collaboration},
8-
doi = {10.1145/1641309.1641324}
4+
doi = {10.1145/1641309.1641324},
5+
microsoftid = {2166901142},
6+
title = {Lively Wiki a development environment for creating and sharing active web content},
7+
year = {2009}
98
}
109

10+
@misc{Cunningham2014WDP,
11+
author = {Cunningham, Ward},
12+
file = {Wiki Design Principles:/Users/simonstadlinger/Zotero/storage/P5H3QGLM/wiki.c2.com.html:text/html},
13+
journal = {Wiki Design Principles},
14+
title = {Wiki {Design} {Principles}},
15+
type = {Wiki},
16+
url = {https://wiki.c2.com/?WikiDesignPrinciples},
17+
urldate = {2020-07-29},
18+
year = {2014}
19+
}
1120

1221
@inproceedings{Appeltauer2009IDC,
1322
author = {Malte Appeltauer and Robert Hirschfeld and Hidehiko Masuhara},
14-
title = {Improving the development of context-dependent Java applications with ContextJ},
15-
year = {2009},
16-
microsoftid = {2172169742},
1723
booktitle = {International Workshop on Context-Oriented Programming},
18-
doi = {10.1145/1562112.1562117}
19-
}
24+
doi = {10.1145/1562112.1562117},
25+
microsoftid = {2172169742},
26+
title = {Improving the development of context-dependent Java applications with ContextJ},
27+
year = {2009}
28+
}
29+

src/client/draganddrop.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ const dropOnDocumentBehavior = {
279279

280280
new DropOnBodyHandler('text/plain', async text => {
281281
// test for bibtex content
282-
if (text.match(/^\s*(@[a-zA-Z]+\{/)) {
282+
if (text.match(/^\s*@[a-zA-Z]+\{/)) {
283283
const comp = await (<lively-bibtex style="width:700px"></lively-bibtex>);
284284
comp.innerHTML = text;
285285
await comp.updateView();

src/components/tools/lively-container.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,8 +1884,8 @@ export default class Container extends Morph {
18841884
// title: "saved HTML",
18851885
// color: "green"});
18861886
});
1887-
} else if (contentElement && contentElement.livelySource) {
1888-
var source = contentElement.livelySource()
1887+
} else if (contentElement && contentElement.childNodes[0] && contentElement.childNodes[0].livelySource) {
1888+
var source = contentElement.childNodes[0].livelySource()
18891889
if (source.then) source = await source; // maybe some elements take a while to generate their source
18901890
return this.saveSource(url, source);
18911891
} else {

src/components/widgets/lively-bibtex-editor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,9 @@ export default class LivelyBibtexEditor extends Morph {
730730
this.get("#finishButton").hidden = true
731731
}
732732

733-
// livelySource() {
734-
// return Array.from(this.querySelectorAll("lively-bibtex-entry")).map(ea => ea.textContent).join("")
735-
// }
733+
livelySource() {
734+
return thiss.toBibtex()
735+
}
736736

737737
async livelyExample() {
738738
// this customizes a default instance to a pretty example

0 commit comments

Comments
 (0)