Skip to content

Commit a5971cb

Browse files
committed
11.09 changes
1 parent 2bbe192 commit a5971cb

26 files changed

+110
-53
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# Version 11.09
2+
3+
Fixed issue where the header buttons wouldn't refresh when changing between MEJ pages and Foundry pages.
4+
5+
Added support for using Prose Mirror editing in MEJ templates.
6+
7+
Fixed issue with the default page icon when exporting to compendium.
8+
9+
Fixed issues where notes were no longer editable
10+
11+
Added alternating shading for currency groups to better differentiate what name goes with what value.
12+
113
# Version 11.08
214

315
Updated the page settings to allow for multiple setting options.

apps/enhanced-journal.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,12 @@ export class EnhancedJournal extends Application {
288288

289289
this.activateFooterListeners(this.element);
290290

291+
$('> header a.subsheet', this.element).remove();
291292
if (this.subsheet._getHeaderButtons && this.object.id && !(this.object instanceof JournalEntry)) {
292293
let buttons = this.subsheet._getHeaderButtons();
293294
buttons.findSplice(b => b.class == "share-image");
294295
Hooks.call(`getDocumentSheetHeaderButtons`, this.subsheet, buttons);
295296

296-
$('> header a.subsheet', this.element).remove();
297297
let first = true;
298298
let a;
299299
for (let btn of buttons) {
@@ -575,12 +575,12 @@ export class EnhancedJournal extends Application {
575575
}
576576

577577
activateEditor() {
578-
$('.nav-button.edit i', this.element).removeClass('fa-pencil-alt').addClass('fa-download').attr('title', i18n("MonksEnhancedJournal.SaveChanges"));
578+
$('.nav-button.edit i', this.element).removeClass('fa-pencil-alt').addClass(setting("editor-engine") == "tinymce" ? 'fa-download' : 'fa-save').attr('title', i18n("MonksEnhancedJournal.SaveChanges"));
579579
$('.nav-button.split', this.element).addClass('disabled');
580580
}
581581

582582
saveEditor(name) {
583-
$('.nav-button.edit i', this.element).addClass('fa-pencil-alt').removeClass('fa-download').attr('title', i18n("MonksEnhancedJournal.EditDescription"));
583+
$('.nav-button.edit i', this.element).addClass('fa-pencil-alt').removeClass('fa-download').removeClass('fa-save').attr('title', i18n("MonksEnhancedJournal.EditDescription"));
584584
$('.nav-button.split', this.element).removeClass('disabled');
585585
const editor = this.subsheet.editors[name];
586586
if (editor)

assets/journalentry.png

7.61 KB
Loading

assets/list.png

1.28 KB
Loading

assets/slideshow.png

8.28 KB
Loading

css/monks-enhanced-journal.css

+1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
--mej-slideshow-duration-color: rgb(255, 255, 255);
131131
--mej-list-progress-border: rgb(178, 195, 255);
132132
--mej-list-progress-background: rgb(93, 73, 255);
133+
--mej-currency-background: rgba(var(--mej-light-5), 0.5);
133134
--mej-request-card-border: rgb(255, 255, 255);
134135
--mej-request-card-img-border: 1px solid #c0c0c0;
135136
--mej-active-color: rgb(255, 100, 0);

css/monks-journal-sheet.css

+14-8
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ body:not(.system-pf2e) .monks-journal-sheet .sheet-container .tag {
537537
display: none;
538538
}
539539

540-
.monks-journal-sheet .journal-subsheet[editable='false'] .editor-edit {
540+
.monks-journal-sheet .journal-subsheet[editable='false'] .tab[data-tab]:not([data-tab="notes"]) .editor-edit {
541541
display: none !important;
542542
}
543543

@@ -887,28 +887,30 @@ body:not(.system-pf2e) .monks-journal-sheet .sheet-container .tag {
887887
/* Currency Group */
888888
.monks-journal-sheet .currency-group {
889889
font-size: var(--font-size-12);
890-
flex: 0 0 64px;
890+
flex: 0 0 60px;
891+
}
892+
893+
.monks-journal-sheet .currency-group .item-header {
894+
margin-bottom: 0px;
891895
}
892896

893897
.monks-journal-sheet .currency-group .form-fields {
894-
margin-left: 10px;
895-
padding-top: 2px;
898+
margin-left: 5px;
899+
padding: 3px 0px;
900+
max-width: 155px;
896901
}
897902

898903
.monks-journal-sheet .currency-group .form-fields label {
899904
font-weight: bold;
900905
padding-top: 2px;
906+
padding-left: 10px;
901907
max-width: 75px;
902908
white-space: nowrap;
903909
overflow: hidden;
904910
text-overflow: ellipsis;
905911
line-height: 26px;
906912
}
907913

908-
.monks-journal-sheet .currency-group .form-fields label:not(:first-child) {
909-
padding-left: 10px;
910-
}
911-
912914
.monks-journal-sheet .currency-group .form-fields input {
913915
flex: 2;
914916
text-align: right;
@@ -919,6 +921,10 @@ body:not(.system-pf2e) .monks-journal-sheet .sheet-container .tag {
919921
border: var(--mej-sheet-input-border);
920922
}
921923

924+
.monks-journal-sheet .currency-group .currency-row :nth-child(even) {
925+
background: var(--mej-currency-background);
926+
}
927+
922928
/* Additional */
923929
.monks-journal-sheet .sheet-container .sheet-body .no-character-alert {
924930
background: rgba(214, 150, 0, 0.8);

lang/en.json

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
"MonksEnhancedJournal.customise-pages.hint": "Customise the pages that are shown in the journal",
8383
"MonksEnhancedJournal.use-generic-price.name": "Use Original Price",
8484
"MonksEnhancedJournal.use-generic-price.hint": "After purchasing, set price of purchased item back to the original non-adjusted price. I would not recommend this. USE AT YOUR OWN RISK!",
85+
"MonksEnhancedJournal.editor-engine.name": "Editor Engine",
86+
"MonksEnhancedJournal.editor-engine.hint": "Which editor should be used for editing journal entries",
8587

8688
"MonksEnhancedJournal.SlideConfiguration": "Slide Configuration",
8789
"MonksEnhancedJournal.DCConfiguration": "DC Configuration",

module.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Monk's Enhanced Journal",
33
"description": "Treat the journal like it's going to be popped out and used as a digital guide book. Add extra information to summarize an encounter. Show summaries of people and places. Allow for bookmarking of commonly used pages",
4-
"version": "11.08",
4+
"version": "11.09",
55
"authors": [
66
{
77
"name": "IronMonk",
@@ -95,7 +95,7 @@
9595
"css/apsjournal.css"
9696
],
9797
"url": "https://github.com/ironmonk88/monks-enhanced-journal",
98-
"download": "https://github.com/ironmonk88/monks-enhanced-journal/archive/11.08.zip",
98+
"download": "https://github.com/ironmonk88/monks-enhanced-journal/archive/11.09.zip",
9999
"manifest": "https://github.com/ironmonk88/monks-enhanced-journal/releases/latest/download/module.json",
100100
"bugs": "https://github.com/ironmonk88/monks-enhanced-journal/issues",
101101
"allowBugReporter": true,

monks-enhanced-journal.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,7 @@ export class MonksEnhancedJournal {
11261126
if (type == "base" || type == "oldentry") type = "journalentry";
11271127
let types = MonksEnhancedJournal.getDocumentTypes();
11281128
if (types[type]) {
1129+
setProperty(document, "_source.flags.monks-enhanced-journal.pagetype", type);
11291130
setProperty(document, "_source.flags.monks-enhanced-journal.img", document.pages.contents[0].src);
11301131
}
11311132
}
@@ -4857,11 +4858,11 @@ Hooks.on("renderJournalPageSheet", (sheet, html, data) => {
48574858

48584859
Hooks.on("renderCompendium", async (app, html, data) => {
48594860
if (app.collection.documentName == "JournalEntry") {
4861+
let types = MonksEnhancedJournal.getDocumentTypes();
48604862
await app.collection.getIndex({ fields: ["img", "flags.monks-enhanced-journal"] });
48614863
for (let index of app.collection.index) {
48624864
let img = $(`li[data-document-id="${index._id}"] > img.thumbnail`, html);
48634865
let pagetype = getProperty(index, "flags.monks-enhanced-journal.pagetype");
4864-
let types = MonksEnhancedJournal.getDocumentTypes();
48654866
let imgFile = index.img || getProperty(index, "flags.monks-enhanced-journal.img") || (pagetype && types[pagetype] != undefined ? `modules/monks-enhanced-journal/assets/${pagetype}.png` : "icons/svg/book.svg");
48664867
if (img.length) {
48674868
img.attr("src", imgFile)

settings.js

+15
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export const registerSettings = function () {
2525
'false': "Core Foundry"
2626
};
2727

28+
let engineOptions = {
29+
'tinymce': "TinyMCE",
30+
'prosemirror': "ProseMirror",
31+
};
32+
2833
let backgroundImages = {
2934
'none': "None",
3035
'darkParchment': "Parchment - Dark",
@@ -95,6 +100,16 @@ export const registerSettings = function () {
95100
type: CustomisePages
96101
});
97102

103+
game.settings.register(modulename, 'editor-engine', {
104+
name: i18n("MonksEnhancedJournal.editor-engine.name"),
105+
hint: i18n("MonksEnhancedJournal.editor-engine.hint"),
106+
scope: 'world',
107+
config: true,
108+
default: "tinymce",
109+
choices: engineOptions,
110+
type: String,
111+
});
112+
98113
game.settings.register(modulename, 'background-colour', {
99114
name: i18n('APSJournal.background-colour.name'),
100115
hint: i18n('APSJournal.background-colour.hint'),

sheets/EnhancedJournalSheet.js

+19-7
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ export class EnhancedJournalSheet extends JournalPageSheet {
159159
})
160160
});
161161

162+
data.editor = {
163+
engine: setting("editor-engine"),
164+
collaborate: setting("editor-engine") == "prosemirror"
165+
}
166+
162167
//this._convertFormats(data);
163168
data.enrichedText = await TextEditor.enrichHTML(data.document?.text?.content, {
164169
relativeTo: this.object,
@@ -331,6 +336,10 @@ export class EnhancedJournalSheet extends JournalPageSheet {
331336

332337
new EnhancedJournalContextMenu($(html), (this.constructor.type == "text" ? ".editor-parent" : ".tab.description .tab-inner"), this._getDescriptionContextOptions());
333338

339+
if (!this.isEditable) {
340+
html.find(".tab.notes .editor-content[data-edit]").each((i, div) => this._activateEditor(div));
341+
}
342+
334343
$("a.picture-link", html).click(MonksEnhancedJournal._onClickPictureLink.bind(this));
335344
$("img:not(.nopopout)", html).click(this._onClickImage.bind(this));
336345

@@ -420,13 +429,16 @@ export class EnhancedJournalSheet extends JournalPageSheet {
420429
game.polyglot.activeEditorLogic(options);
421430
}
422431

423-
options = foundry.utils.mergeObject(options, {
424-
contextmenu: 'link createlink',
425-
plugins: CONFIG.TinyMCE.plugins + ' createlink background dcconfig soundeffect template anchor',
426-
toolbar: CONFIG.TinyMCE.toolbar + ' background dcconfig soundeffect template anchor',
427-
templates: CONFIG.TinyMCE.templates
428-
//font_formats: "Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Oswald=oswald; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats;Anglo Text=anglo_textregular;Lovers Quarrel=lovers_quarrelregular;Play=Play-Regular"
429-
});
432+
if (this.editors[name].options.engine == "tinymce") {
433+
options = foundry.utils.mergeObject(options, {
434+
contextmenu: 'link createlink',
435+
plugins: CONFIG.TinyMCE.plugins + ' createlink background dcconfig soundeffect template anchor',
436+
toolbar: CONFIG.TinyMCE.toolbar + ' background dcconfig soundeffect template anchor',
437+
templates: CONFIG.TinyMCE.templates,
438+
font_formats: CONFIG.TinyMCE.font_formats //"Andale Mono=andale mono,times; Arial=arial,helvetica,sans-serif; Arial Black=arial black,avant garde; Book Antiqua=book antiqua,palatino; Comic Sans MS=comic sans ms,sans-serif; Courier New=courier new,courier; Georgia=georgia,palatino; Helvetica=helvetica; Impact=impact,chicago; Oswald=oswald; Symbol=symbol; Tahoma=tahoma,arial,helvetica,sans-serif; Terminal=terminal,monaco; Times New Roman=times new roman,times; Trebuchet MS=trebuchet ms,geneva; Verdana=verdana,geneva; Webdings=webdings; Wingdings=wingdings,zapf dingbats;Anglo Text=anglo_textregular;Lovers Quarrel=lovers_quarrelregular;Play=Play-Regular"
439+
});
440+
} else if (this.editors[name].options.engine == "prosemirror") {
441+
}
430442

431443
MonksEnhancedJournal.fixType(this.object);
432444
if (this.object.type == 'text' || this.object.type == 'journalentry' || this.object.type == 'oldentry' || setting("show-menubar")) {

templates/make-offering.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ <h3 class="noborder">{{actor.name}}</h3>
1616
<div class="item-header flexrow">
1717
<h3 class="item-name noborder">{{localize 'MonksEnhancedJournal.Currency'}}</h3>
1818
</div>
19-
<div class="flexrow form-fields">
19+
<div class="flexrow currency-row">
2020
{{#each currency}}
21-
<label>{{localize this.name}}</label>
22-
<input type="text" class="currency-field" name="{{this.id}}" placeholder="0" value="{{lookup @root.coins this.id}}" data-dtype="Number" />
21+
<div class="form-fields flexrow">
22+
<label data-tooltip="{{localize this.name}}">{{localize this.name}}</label>
23+
<input type="text" class="currency-field" name="{{this.id}}" placeholder="0" value="{{lookup @root.coins this.id}}" data-dtype="Number" />
24+
</div>
2325
{{/each}}
2426
</div>
2527
</div>

templates/objectives.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</div>
2828
</div>
2929
<div class="editor-container">
30-
{{editor enrichedText target="content" editable=true button=true owner=owner}}
30+
{{editor enrichedText target="content" editable=true button=true owner=owner engine=editor.engine collaborate=editor.collaborate }}
3131
</div>
3232
<button type="submit" name="submit" value="1"><i class="far fa-save"></i> {{localize "MonksEnhancedJournal.Update"}}</button>
3333
</form>

templates/sheets/encounter.html

+7-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<section class="sheet-body">
2222
<div class="tab description active" data-group="primary" data-tab="description">
2323
<div class="tab-inner flexcol">
24-
{{editor enrichedText target="text.content" editable=true button=true owner=owner}}
24+
{{editor enrichedText target="text.content" editable=true button=true owner=owner engine=editor.engine collaborate=editor.collaborate }}
2525
</div>
2626
</div>
2727
{{#if owner}}
@@ -89,10 +89,12 @@ <h4>{{this.name}}</h4>
8989
<div class="item-header flexrow">
9090
<h3 class="item-name noborder flexrow">{{localize 'MonksEnhancedJournal.Currency'}}</h3>
9191
</div>
92-
<div class="flexrow form-fields">
92+
<div class="flexrow currency-row">
9393
{{#each currency}}
94-
<label>{{localize this.name}}</label>
95-
<input type="text" name="flags.monks-enhanced-journal.currency.{{this.id}}" placeholder="0" value="{{this.value}}" data-dtype="Number" />
94+
<div class="form-fields flexrow">
95+
<label data-tooltip="{{localize this.name}}">{{localize this.name}}</label>
96+
<input type="text" name="flags.monks-enhanced-journal.currency.{{this.id}}" placeholder="0" value="{{this.value}}" data-dtype="Number" />
97+
</div>
9698
{{/each}}
9799
</div>
98100
</div>
@@ -260,7 +262,7 @@ <h4>{{this.name}}</h4>
260262
<div class="tab-inner flexcol">
261263
<div style="flex-grow: 0;">{{localize 'MonksEnhancedJournal.OnlyViewable'}}{{#unless hasGM}}<span style="color:darkred;font-weight:bold;"> {{localize 'MonksEnhancedJournal.msg.CannotEditNotesWithoutGM'}}</span>{{/unless}}</div>
262264
<div class="notes-container">
263-
{{editor userdata.enrichedText target=notesTarget editable=true button=true owner=owner}}
265+
{{editor userdata.enrichedText target=notesTarget editable=true button=true owner=owner engine=editor.engine collaborate=editor.collaborate }}
264266
</div>
265267
</div>
266268
</div>

templates/sheets/event.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h1 class="eventname header-name flexrow">
3232
<section class="sheet-body">
3333
<div class="tab description" data-group="primary" data-tab="description">
3434
<div class="tab-inner flexcol">
35-
{{editor enrichedText target="text.content" editable=true button=true owner=owner}}
35+
{{editor enrichedText target="text.content" editable=true button=true owner=owner engine=editor.engine collaborate=editor.collaborate }}
3636
</div>
3737
</div>
3838
<div class="tab relationships" data-group="primary" data-tab="relationships">
@@ -82,7 +82,7 @@ <h4><a>{{#if this.pack}}<i class="fas fa-atlas" title="{{localize 'MonksEnhanced
8282
<div class="tab-inner flexcol">
8383
<div style="flex-grow: 0;">{{localize 'MonksEnhancedJournal.OnlyViewable'}}{{#unless hasGM}}<span style="color:darkred;font-weight:bold;"> {{localize 'MonksEnhancedJournal.msg.CannotEditNotesWithoutGM'}}</span>{{/unless}}</div>
8484
<div class="notes-container">
85-
{{editor userdata.enrichedText target=notesTarget editable=true button=true owner=owner}}
85+
{{editor userdata.enrichedText target=notesTarget editable=true button=true owner=owner engine=editor.engine collaborate=editor.collaborate }}
8686
</div>
8787
</div>
8888
</div>

templates/sheets/listitem.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020

2121
<div style="height: 302px; border: 1px solid rgb(var(--mej-light-6)); border-radius: 4px;">
22-
{{editor data.enrichedText target="text" editable=true button=true owner=data.owner}}
22+
{{editor data.enrichedText target="text" editable=true button=true owner=data.owner engine=editor.engine collaborate=editor.collaborate }}
2323
</div>
2424

2525
{{#if (or (eq hasNumber "count") (eq hasNumber "full"))}}

templates/sheets/loot.html

+5-3
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ <h3 class="item-name noborder flexrow">{{localize 'MonksEnhancedJournal.Currency
5757
</a>
5858
</div>
5959
</div>
60-
<div class="flexrow form-fields">
60+
<div class="flexrow currency-row">
6161
{{#each currency}}
62-
<label>{{localize this.name}}</label>
63-
<input type="text" name="flags.monks-enhanced-journal.currency.{{this.id}}" placeholder="0" value="{{this.value}}" data-dtype="Number" />
62+
<div class="form-fields flexrow">
63+
<label data-tooltip="{{localize this.name}}">{{localize this.name}}</label>
64+
<input type="text" name="flags.monks-enhanced-journal.currency.{{this.id}}" placeholder="0" value="{{this.value}}" data-dtype="Number" />
65+
</div>
6466
{{/each}}
6567
</div>
6668
</div>

templates/sheets/organization.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h1 class="organizationname header-name flexrow">
4141
<section class="sheet-body">
4242
<div class="tab description active" data-group="primary" data-tab="description">
4343
<div class="tab-inner flexcol">
44-
{{editor enrichedText target="text.content" editable=true button=true owner=owner}}
44+
{{editor enrichedText target="text.content" editable=true button=true owner=owner engine=editor.engine collaborate=editor.collaborate }}
4545
</div>
4646
</div>
4747
<div class="tab relationships" data-group="primary" data-tab="relationships">
@@ -161,7 +161,7 @@ <h3 class="item-name nopopout flexrow">
161161
<div class="tab-inner flexcol">
162162
<div style="flex-grow: 0;">{{localize 'MonksEnhancedJournal.OnlyViewable'}}{{#unless hasGM}}<span style="color:darkred;font-weight:bold;"> {{localize 'MonksEnhancedJournal.msg.CannotEditNotesWithoutGM'}}</span>{{/unless}}</div>
163163
<div class="notes-container">
164-
{{editor userdata.enrichedText target=notesTarget editable=true button=true owner=owner}}
164+
{{editor userdata.enrichedText target=notesTarget editable=true button=true owner=owner engine=editor.engine collaborate=editor.collaborate }}
165165
</div>
166166
</div>
167167
</div>

0 commit comments

Comments
 (0)