Skip to content

Commit

Permalink
Merge pull request #11025 from quarto-dev/fix/blur-revealjs
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Oct 10, 2024
2 parents 07f55ab + 5f75624 commit eaa878a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/resources/formats/revealjs/plugins/chalkboard/plugin.js b/src/resources/formats/revealjs/plugins/chalkboard/plugin.js
index 6dfb4b5a5..543ee101f 100644
--- a/src/resources/formats/revealjs/plugins/chalkboard/plugin.js
+++ b/src/resources/formats/revealjs/plugins/chalkboard/plugin.js
@@ -444,6 +444,8 @@ const initChalkboard = function ( Reveal ) {
container.style.visibility = 'visible';
container.style.pointerEvents = 'none';
container.style['backdrop-filter'] = 'none';
+ // for older safari
+ container.style["-webkit-backdrop-filter"] = "none";

var slides = document.querySelector( '.slides' );
var aspectRatio = Reveal.getConfig().width / Reveal.getConfig().height;
7 changes: 6 additions & 1 deletion package/src/common/update-html-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ export async function updateHtmlDependencies(config: Configuration) {
},
true, // true if commit, false otherwise
false, // no v prefix,
// FIXME: Patch waiting for fix upstream to be merged
// https://github.com/rajgoel/reveal.js-plugins/pull/184
resolvePatches([
"revealjs-plugin-0001-chakboard-backdrop-filter.patch"
])
);

// revealjs-menu
Expand Down Expand Up @@ -1123,7 +1128,7 @@ async function updateGithubSourceCodeDependency(
await unzip(zipFile, working);

await onDownload(working, version);
if (patches) await applyGitPatches(patches);
if (patches) applyGitPatches(patches);
} else {
throw new Error(`${versionEnvVar} is not defined`);
}
Expand Down
44 changes: 21 additions & 23 deletions package/src/util/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,28 +97,26 @@ async function clone(workingDir: string, url: string) {


export async function applyGitPatches(patches: string[]) {
if (!patches) return undefined
if (!patches) return undefined;
info(`Applying Git patches...`);
await Promise.all(
patches.map( async (patch) => {
info(` - patch ${colors.blue(patch)}`)
const gitCmd: string[] = [];
gitCmd.push("git");
gitCmd.push("apply");
gitCmd.push(patch);
// this helps with newline handling in patch
gitCmd.push("--ignore-space-change");
// this helps debug when patch goes wrong
// https://git-scm.com/docs/git-apply#Documentation/git-apply.txt---reject
gitCmd.push("--reject");
const p = Deno.run({
cmd: gitCmd,
stderr: "piped",
});
const status = await p.status();
if (status.code !== 0) {
throw Error(`Failed to apply patch: '${patch}'`);
}
})
)
for (const patch of patches) {
info(` - patch ${colors.blue(patch)}`);
const gitCmd: string[] = [];
gitCmd.push("git");
gitCmd.push("apply");
gitCmd.push(patch);
// this helps with newline handling in patch
gitCmd.push("--ignore-space-change");
// this helps debug when patch goes wrong
// https://git-scm.com/docs/git-apply#Documentation/git-apply.txt---reject
gitCmd.push("--reject");
const p = Deno.run({
cmd: gitCmd,
stderr: "piped",
});
const status = await p.status();
if (status.code !== 0) {
throw Error(`Failed to apply patch: '${patch}'`);
}
}
}
2 changes: 2 additions & 0 deletions src/resources/formats/revealjs/plugins/chalkboard/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ const initChalkboard = function ( Reveal ) {
container.style.visibility = 'visible';
container.style.pointerEvents = 'none';
container.style['backdrop-filter'] = 'none';
// for older safari
container.style["-webkit-backdrop-filter"] = "none";

var slides = document.querySelector( '.slides' );
var aspectRatio = Reveal.getConfig().width / Reveal.getConfig().height;
Expand Down

0 comments on commit eaa878a

Please sign in to comment.