Skip to content

Commit

Permalink
[editable] ]Hide paused overlay when editing in presenter mode (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Jul 16, 2022
1 parent 1ebc5ea commit 6d37940
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 11 deletions.
13 changes: 8 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# xaringanExtra (development version)

* Embedding slides via `embed_xaringan()` no longer requires that you set
`self_contained: false` in the R Markdown document. `embed_xaringan()` now
automatically sets the `data-external="1"` attribute on the element embedding
the xaringan slides (thanks @jhelvy, @drfurtado, #177).

* **scribble** can now be disabled on an individual slide by adding
`class: no-scribble` to the slide (@mattwarkentin #166).

* BREAKING CHANGE: All arguments to `use_banner()` must be named. `use_banner()`
now takes `...` earlier since you may want to include `style_banner()` style
arguments without having to specify all the other arguments (#169).

* Embedding slides via `embed_xaringan()` no longer requires that you set
`self_contained: false` in the R Markdown document. `embed_xaringan()` now
automatically sets the `data-external="1"` attribute on the element embedding
the xaringan slides (thanks @jhelvy, @drfurtado, #177).

* **editable** now hides remark's "Paused" overlay when editing slides in
presenter mode (#178).

# xaringanExtra 0.6.0 (2022-06-07)

* First release available on CRAN! Read about it at [garrickadenbuie.com/blog/xaringanextra-v0.6.0/](https://www.garrickadenbuie.com/blog/xaringanextra-v0.6.0/).
Expand Down
13 changes: 8 additions & 5 deletions docs/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# xaringanExtra (development version)

* Embedding slides via `embed_xaringan()` no longer requires that you set
`self_contained: false` in the R Markdown document. `embed_xaringan()` now
automatically sets the `data-external="1"` attribute on the element embedding
the xaringan slides (thanks [@jhelvy](https://github.com/jhelvy), [@drfurtado](https://github.com/drfurtado), [#177](https://github.com/gadenbuie/xaringanExtra/issues/177)).

* **scribble** can now be disabled on an individual slide by adding
`class: no-scribble` to the slide ([@mattwarkentin](https://github.com/mattwarkentin) [#166](https://github.com/gadenbuie/xaringanExtra/issues/166)).

* BREAKING CHANGE: All arguments to `use_banner()` must be named. `use_banner()`
now takes `...` earlier since you may want to include `style_banner()` style
arguments without having to specify all the other arguments ([#169](https://github.com/gadenbuie/xaringanExtra/issues/169)).

* Embedding slides via `embed_xaringan()` no longer requires that you set
`self_contained: false` in the R Markdown document. `embed_xaringan()` now
automatically sets the `data-external="1"` attribute on the element embedding
the xaringan slides (thanks [@jhelvy](https://github.com/jhelvy), [@drfurtado](https://github.com/drfurtado), [#177](https://github.com/gadenbuie/xaringanExtra/issues/177)).

* **editable** now hides remark's "Paused" overlay when editing slides in
presenter mode ([#178](https://github.com/gadenbuie/xaringanExtra/issues/178)).

# xaringanExtra 0.6.0 (2022-06-07)

* First release available on CRAN! Read about it at [garrickadenbuie.com/blog/xaringanextra-v0.6.0/](https://www.garrickadenbuie.com/blog/xaringanextra-v0.6.0/).
Expand Down
5 changes: 5 additions & 0 deletions docs/editable/libs/editable/editable.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@
outline-offset: 10px;
transition: outline-offset 0.5s linear;
}

.xe-editable_is-editing.remark-container.remark-presenter-mode.remark-pause-mode .remark-pause,
.xe-editable_is-editing.remark-container.remark-presenter-mode.remark-pause-mode .remark-backdrop {
display: none;
}
10 changes: 10 additions & 0 deletions docs/editable/libs/editable/editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
el.innerHTML = json2html(stored[key])
}

function setIsEditingClass () {
document.body.classList.add('xe-editable_is-editing')
}

function removeIsEditingClass() {
document.body.classList.remove('xe-editable_is-editing')
}

window.editable = {
clearCookies () {
Cookies.remove(docId.id)
Expand All @@ -73,6 +81,7 @@
editables.forEach(function (el) {
el.addEventListener('focus', function () {
if (window.editable.debug) console.log('[editable] blocking shortcuts')
setIsEditingClass()
slideshow.pause()
el.addEventListener('keyup', blockEvents)
el.addEventListener('keydown', blockEvents)
Expand All @@ -84,6 +93,7 @@
el.addEventListener('blur', function () {
if (window.editable.debug) console.log('[editable] unblocking shortcuts')
slideshow.resume()
removeIsEditingClass()
el.removeEventListener('keyup', blockEvents)
el.removeEventListener('keydown', blockEvents)
el.removeEventListener('keypress', blockEvents)
Expand Down
2 changes: 1 addition & 1 deletion docs/share-again/index.html

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions inst/editable/editable.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@
outline-offset: 10px;
transition: outline-offset 0.5s linear;
}

.xe-editable_is-editing.remark-container.remark-presenter-mode.remark-pause-mode .remark-pause,
.xe-editable_is-editing.remark-container.remark-presenter-mode.remark-pause-mode .remark-backdrop {
display: none;
}
10 changes: 10 additions & 0 deletions inst/editable/editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@
el.innerHTML = json2html(stored[key])
}

function setIsEditingClass () {
document.body.classList.add('xe-editable_is-editing')
}

function removeIsEditingClass() {
document.body.classList.remove('xe-editable_is-editing')
}

window.editable = {
clearCookies () {
Cookies.remove(docId.id)
Expand All @@ -73,6 +81,7 @@
editables.forEach(function (el) {
el.addEventListener('focus', function () {
if (window.editable.debug) console.log('[editable] blocking shortcuts')
setIsEditingClass()
slideshow.pause()
el.addEventListener('keyup', blockEvents)
el.addEventListener('keydown', blockEvents)
Expand All @@ -84,6 +93,7 @@
el.addEventListener('blur', function () {
if (window.editable.debug) console.log('[editable] unblocking shortcuts')
slideshow.resume()
removeIsEditingClass()
el.removeEventListener('keyup', blockEvents)
el.removeEventListener('keydown', blockEvents)
el.removeEventListener('keypress', blockEvents)
Expand Down

0 comments on commit 6d37940

Please sign in to comment.