-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from Qaw/master
Add v11 compatibility, remove v10 warnings, fix minor error on select custom location
- Loading branch information
Showing
4 changed files
with
33 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
import ImportWindow from "./lib/ImportWindow.js"; | ||
|
||
Hooks.on("renderSidebarTab", async (app, html) => { | ||
// Version 11 | ||
if (foundry.utils.isNewerVersion(game.release.generation, 10)) { | ||
if (app?.id === "journal") { | ||
createButton(html); | ||
} | ||
} | ||
// Version 10 | ||
else if (foundry.utils.isNewerVersion(game.release.generation, 9)) { | ||
if (app?.options?.id === "journal") { | ||
let buttonDiv = $("<div class='action-buttons header-actions flexrow'></div>"); | ||
let button = $("<button class='import-markdown'><i class='fas fa-file-import'></i>EEEG Import</button>"); | ||
button.on('click', ()=> { | ||
new ImportWindow().render(true); | ||
}); | ||
buttonDiv.append(button); | ||
html.find(".header-actions").after(buttonDiv); | ||
createButton(html); | ||
} | ||
}) | ||
} | ||
}); | ||
|
||
function createButton(html) { | ||
let buttonDiv = $("<div class='action-buttons header-actions flexrow'></div>"); | ||
let button = $("<button class='import-markdown'><i class='fas fa-file-import'></i>EEEG Import</button>"); | ||
button.on("click", () => { | ||
new ImportWindow().render(true); | ||
}); | ||
buttonDiv.append(button); | ||
html.find(".header-actions").after(buttonDiv); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters