Skip to content

Commit

Permalink
Fixed styles choice dropdown for 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanyella committed Oct 3, 2020
1 parent e0cf3f5 commit ed4b3e6
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.1.2

- Fixed styles dropdown not showing Custom Journal's unique styles for Foundry version 7.3. This change is still compatible with the current stable release (0.6.6).

# 1.1.1

- Added changelog
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ to fix something.
- **Bug**: The drop down for the "default" journal sheet doesn't currently work. I have yet to
find out why, so please be patient. Rest assured, individual sheet themes *are* working.

- **Compatibility issue**: The button for MINDMAP doesn't show when using Custom Journal. There
is also a know issue with Data Toolbox.
- **Compatibility issue**: The button for MINDMAP doesn't show when using Custom Journal. MEME is problematic in the way of formatting provided by Custom Journal. There is also a know issue with Data Toolbox.

*Theme-specific issues aren't going to be listed here, but will be available and appropriately
tagged in the GitHub issues.*
Expand Down
8 changes: 4 additions & 4 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "custom-journal",
"title": "Custom Journal",
"description": "A custom take on the appearance of journal entries.",
"version": "1.1.1",
"version": "1.1.2",
"author": "Sanyella",
"scripts": [],
"styles": [
Expand All @@ -20,8 +20,8 @@
"packs": [],
"url": "https://github.com/Sanyella/FVTT-Custom-Journal-Theming",
"manifest": "https://raw.githubusercontent.com/Sanyella/FVTT-Custom-Journal-Theming/master/module.json",
"download": "https://github.com/Sanyella/FVTT-Custom-Journal-Theming/releases/download/1.1.1/custom-journal.zip",
"download": "https://github.com/Sanyella/FVTT-Custom-Journal-Theming/releases/download/1.1.2/custom-journal.zip",
"bugs": "https://github.com/Sanyella/FVTT-Custom-Journal-Theming/issues",
"compatibleCoreVersion": "0.7.1",
"minimumCoreVersion": "0.6.5"
"compatibleCoreVersion": "0.7.3",
"minimumCoreVersion": "0.6.6"
}
64 changes: 61 additions & 3 deletions scripts/custom-journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ class CustomJournalSheet extends JournalSheet {
}

//Include the option for the Drop Cap style in the editor styles' menu
//For compatibility with 6.6, to be removed when 7.x hits stable,
//replaced with activateEditor
_createEditor(target, editorOptions, initialContent) {
if (!editorOptions.style_formats)
{
if (!editorOptions.style_formats) {
editorOptions.style_formats = [
{
title: "Custom",
Expand All @@ -33,6 +34,63 @@ class CustomJournalSheet extends JournalSheet {
];
}
editorOptions.style_formats.push(
{
title: "Custom Journal",
items: [
{
title: "Drop Cap",
inline: 'span',
classes: 'drop-cap'
},
{
title: "Simple Block",
block: 'section',
classes: 'simple-block',
wrapper: true
},
{
title: "Simple Block Float",
block: 'section',
classes: 'simple-block-float',
wrapper: true
},
{
title: "Ridged Block",
block: 'section',
classes: 'ridged-block',
wrapper: true
},
{
title: "Ridged Block Float",
block: 'section',
classes: 'ridged-block-float',
wrapper: true
}
]
}
);
super._createEditor(target, editorOptions, initialContent);
}

//Include the option for the Drop Cap style in the editor styles' menu
activateEditor(name, options={}, ...args) {
if (!options.style_formats)
{
options.style_formats = [
{
title: "Custom",
items: [
{
title: "Secret",
block: 'section',
classes: 'secret',
wrapper: true
}
]
}
];
}
options.style_formats.push(
{
title: "Custom Journal",
items: [
Expand Down Expand Up @@ -68,7 +126,7 @@ class CustomJournalSheet extends JournalSheet {
]
}
);
super._createEditor(target,editorOptions, initialContent);
super.activateEditor(name, options, ...args);
}

/*
Expand Down

0 comments on commit ed4b3e6

Please sign in to comment.