Fossil User Forum

Ajaxified wiki editor: does this Sandbox page handling make sense?
Login

Ajaxified wiki editor: does this Sandbox page handling make sense?

Ajaxified wiki editor: does this Sandbox page handling make sense?

(1) By Stephan Beal (stephan) on 2020-07-30 22:00:48 [link] [source]

The newly-ajaxified wiki editor is very nearly feature-complete (just minor cleanups left), but i'm a bit torn on the handling of the sandbox pseudo-page...

The new editor, when serving up the list of pages, always adds one called "sandbox" to the list. It treats that page (or any page for which is_sandbox(pageName) is true) more or less as a real page, and allows anyone to preview edits made to it, but it does not allow a sandbox page to be saved, under the theory that the sandbox page is just a place to tinker with wiki formatting using a transient page. The editor keeps a copy of any edits in its browser-local storage, so the edits are not immediately lost if the page is reloaded, but it currently intentionally offers no way to really save a sandbox page.

Does that make sense, or should saving of sandbox pages be allowed (perhaps only for an admin or setup user)?

(2) By Stephan Beal (stephan) on 2020-07-30 22:13:49 in reply to 1 [source]

Follow-up: the current (non-ajax) implementation only supports a single version of a sandbox page, saving it with:

  db_set("sandbox",zBody,0);
  db_set("sandbox-mimetype",zMimetype, 0);

It would be trivial to have the ajax editor do so, but my Bauchgefühl is that editing of the sandbox page should be a fairly restricted operation (limited to non-anonymous users with g.perm.WrWiki, at the least, and perhaps only to a setup user).

My "vision" of the sandbox is that a setup user populates it, if desired, with helpful info or a demo, maybe a page template, and then any user can use that to "practice" their markup without making any db-side changes.

(3) By Richard Hipp (drh) on 2020-07-31 00:14:49 in reply to 2 [link] [source]

My original intent with Sandbox was to give everybody a place to experiment. I didn't really think through the case of what happens if two or more people are experimenting at the same time :-\

(4) By Stephan Beal (stephan) on 2020-07-31 00:24:20 in reply to 3 [link] [source]

My original intent with Sandbox was to give everybody a place to experiment. I didn't really think through the case of what happens if two or more people are experimenting at the same time :-

If you're happy with (or not upset by) my "re-imagining" of the sandbox semantics, i'll run with that. In short, the sandbox behaves like a normal page except that it has laxer permissions (for purposes of running the preview) but any attempt to save it via that page (as opposed to the CLI) will fail.

(5) By Richard Hipp (drh) on 2020-07-31 01:01:15 in reply to 4 [link] [source]

ok