Skip to content

Commit

Permalink
💩 Fix notebook saving issue (#277)
Browse files Browse the repository at this point in the history
* some thingies

* back to plutoui 0.5.2 because i messed up the registry

* fix notebook saving bug

* bump
  • Loading branch information
fonsp authored Aug 12, 2020
1 parent ee708f0 commit 07d6b80
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "Pluto"
uuid = "c3e4b0f8-55cb-11ea-2926-15256bba5781"
license = "MIT"
authors = ["Fons van der Plas <[email protected]>", "Mikołaj Bochenski <[email protected]>"]
version = "0.11.4"
version = "0.11.5"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ The Pluto project is an ambition to [_rethink what a programming environment sho
### You can chat with us

- contact me (fonsi) **[via email](mailto:[email protected])** or on my <a href="https://meet.jit.si/Pluto.jl"><b>video chat room</b></a>
- send your funky notebooks to the **[Zulip chat room](https://julialang.zulipchat.com/#narrow/stream/243342-pluto.2Ejl)**
- send your funky notebooks to the **[Zulip chat room](https://julialang.zulipchat.com/#narrow/stream/243342-pluto.2Ejl)** (_search for the `pluto.jl` stream_)
- use Pluto's **[built-in feedback system:](https://github.com/fonsp/Pluto.jl/issues/182#issue-637726414)**

<img alt="feedback screencap" src="https://user-images.githubusercontent.com/6933510/84502876-6f08db00-acb9-11ea-84c3-f5daaba29273.png" width="100%">
Expand Down
2 changes: 2 additions & 0 deletions frontend/components/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,8 @@ export class Editor extends Component {
}
break
case 82: // r
// I commonly have a test notebook that I want to re-run after changing something to the backend
// if I would just reload the page, then the new Pluto session would be asked to open notebook with uuid=b1d2cbdb1c2bb12d, which does not exist in the new session
if (e.ctrlKey) {
if (this.state.notebook.path !== default_path) {
document.location.href = link_open(this.state.notebook)
Expand Down
14 changes: 7 additions & 7 deletions frontend/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<script src="common/RegisterSW.js"></script>

<script src="https://cdn.jsdelivr.net/npm/@observablehq/[email protected]/dist/stdlib.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/lib/codemirror.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/mode/julia/julia.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/addon/hint/show-hint.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/addon/display/placeholder.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/addon/edit/matchbrackets.min.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/lib/codemirror.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/addon/hint/show-hint.min.css">
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/mode/julia/julia.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/addon/hint/show-hint.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/addon/display/placeholder.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/addon/edit/matchbrackets.min.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/addon/hint/show-hint.min.css">


<link rel="stylesheet" href="editor.css" type="text/css" />
Expand Down
10 changes: 5 additions & 5 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<script src="common/RegisterSW.js"></script>

<script src="https://cdn.jsdelivr.net/npm/@observablehq/[email protected]/dist/stdlib.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/lib/codemirror.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/addon/hint/show-hint.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/addon/display/placeholder.min.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/lib/codemirror.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.55.0/addon/hint/show-hint.min.css">
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/addon/hint/show-hint.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/addon/display/placeholder.min.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/lib/codemirror.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5.56.0/addon/hint/show-hint.min.css">


<link rel="stylesheet" href="index.css">
Expand Down
9 changes: 4 additions & 5 deletions sample/PlutoUI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ md"In the future, Pluto might do this automatically for all packages. The goal i
dog_url = "https://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Welsh_Springer_Spaniel.jpg/640px-Welsh_Springer_Spaniel.jpg"

# ╔═╡ 9ac7921c-c75e-11ea-30f5-c35e6ee370cb
t_rex_url = "https://interactive-examples.mdn.mozilla.net/media/examples/t-rex-roar.mp3"
t_rex_url = "https://upload.wikimedia.org/wikipedia/commons/transcoded/6/62/Meow.ogg/Meow.ogg.mp3"

# ╔═╡ a8c57442-c75e-11ea-1913-7d82cbd2c69c
flower_url = "https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm"
flower_url = "https://upload.wikimedia.org/wikipedia/commons/4/41/Sunflower_Flower_Opening_Time_Lapse.ogv"

# ╔═╡ f743076c-cc57-11ea-1a8e-8799d9db985a

Expand Down Expand Up @@ -341,10 +341,9 @@ begin
import Pkg
Pkg.activate(env)
Pkg.update()
Pkg.add(Pkg.PackageSpec(;name="PlutoUI", version=v"0.5.1"))
Pkg.add(Pkg.PackageSpec(;name="PlutoUI", version=v"0.5.2"))
end
import PlutoUI
import PlutoUI: Slider, NumberField, CheckBox, TextField, Select, Button, FilePicker, Clock, DownloadButton, Resource, LocalResource
using PlutoUI
end

# ╔═╡ 34ebf81e-c760-11ea-05bb-376173e7ed10
Expand Down
3 changes: 2 additions & 1 deletion src/webserver/Dynamic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ end
responses[:run_multiple_cells] = (session::ServerSession, body, notebook::Notebook; initiator::Union{Initiator,Missing}=missing) -> let
indices = cell_index_from_id.([notebook], UUID.(body["cells"]))
cells = [notebook.cells[i] for i in indices if i !== nothing]
update_save_run!(session, notebook, cells; run_async=true, save=false)
# save=true fixes the issue where "Submit all changes" or `Ctrl+S` has no effect.
update_save_run!(session, notebook, cells; run_async=true, save=true)
end

responses[:getinput] = (session::ServerSession, body, notebook::Notebook, cell::Cell; initiator::Union{Initiator,Missing}=missing) -> let
Expand Down

2 comments on commit 07d6b80

@fonsp
Copy link
Owner Author

@fonsp fonsp commented on 07d6b80 Aug 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/19404

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.5 -m "<description of version>" 07d6b80c47cd0639b03fc27d2e2e3a59359555cb
git push origin v0.11.5

Please sign in to comment.