New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for read-only vs. edit modes #1213

Open
Jermolene opened this Issue Dec 10, 2014 · 17 comments

Comments

Projects
None yet
8 participants
@Jermolene
Owner

Jermolene commented Dec 10, 2014

Currently, support for read-only mode is limited to a theme that hides some of the editing apparatus. It's a clumsy arrangement:

  • Once read-only mode is engaged it's hard to save changes or perform editing tasks
  • It makes it impossible to choose a theme other than the hard-coded Snow White, despite the fact that the changes introduced by the read-only theme could work with any theme
  • It doesn't support the scenario of an author having full access but published versions being read-only

It is proposed to replace the current implementation with a new system whereby:

  • The wiki has distinct modes for "view" and "edit" (stored in $:/mode)
  • "view" mode would hide editing features via <$reveal state="$:/mode">
  • "edit" mode would also optionally make tranclusions visible and directly editable
  • Modes can be switched automatically according to customisable rules involving:
    • the URL used to load the wiki
    • the username (if any)

In view mode the following features would be hidden or disabled:

  • Page control buttons: new tiddler, new journal, import, set password, save changes
  • Tiddler toolbar buttons: edit, clone, new here, new journal here,
  • Importing via drag and drop
  • Navigating to missing tiddlers
@tobibeer

This comment has been minimized.

Contributor

tobibeer commented Dec 10, 2014

👍 that reads like a very nice draft

@pmario

This comment has been minimized.

Contributor

pmario commented Dec 10, 2014

ok

@felixhayashi

This comment has been minimized.

Contributor

felixhayashi commented Dec 16, 2014

+1 Great idea. The design science department of my university will use tw5 as website now (in combination with taskgraph) and a readonly theme would be great (we could use it as prototype for our own read only theme). I will report back some ideas when we start building a read only theme.

Also some tiddler actions need to be hidden in read only (clone tiddler etc.).

Regards
Felix

@felixhayashi

This comment has been minimized.

Contributor

felixhayashi commented Feb 10, 2015

I just noticed it is really confusing when a a website user is asked to create a tiddler if it doesn't exist in read only mode.

edit sorry I see it is already on the list (the last point)

@pmario

This comment has been minimized.

Contributor

pmario commented Feb 10, 2015

IMO read only mode TWs need to check the "missing" tab prior to publishing to prevent this behaviour. ... So there is some more work + knowledge + responsibility left for the editor.

@Jermolene

This comment has been minimized.

Owner

Jermolene commented Feb 10, 2015

I think the best solution to making it impossible to navigate links to missing tiddlers might be to not render them as links, but as static text.

@reflectionalist

This comment has been minimized.

Contributor

reflectionalist commented Apr 17, 2015

I was just about to propose supporting exporting to an read-only html and found this. I really like it!

@lukehsiao

This comment has been minimized.

lukehsiao commented May 7, 2015

This would really bring TiddlyWiki to a new level. Has there been any updates on this issue?

@Jermolene

This comment has been minimized.

Owner

Jermolene commented May 7, 2015

Hi @lukehsiao no updates as yet, no. Too much to do!

@lukehsiao

This comment has been minimized.

lukehsiao commented May 7, 2015

Fair enough. For now, one workaround I've been using is to set the theme as ReadOnly, save the TiddyWiki, then afterwords, edit the HTML file to include this tiddler to have the sidebar hidden by default:

<div created="[timestamp]" creator="[author]" modified="[timestamp]" modifier="[author]" title="$:/state/sidebar">
<pre>no</pre>
</div>

Then I host this file on my public server. Although it still allows viewers to get to the functions if they try, people rarely notice the small '<<' for the sidebar and happily navigate around the Wiki as if it was read-only.

@Jermolene

This comment has been minimized.

Owner

Jermolene commented May 14, 2015

Hi @lukehsiao there is another trick you can use: make a custom "save changes" button that also adjusts the sidebar state:

<$button>
<$action-setfield $tiddler="$:/state/sidebar" $value="no"/>
<$action-sendmessage $message="tm-save-wiki"/>
<$action-setfield $tiddler="$:/state/sidebar" $value="yes"/>
publish changes
</$button>
@danielo515

This comment has been minimized.

Contributor

danielo515 commented May 14, 2015

Dear @Jermolene,

That's a very neat trick! What about adding a tiddler to TW.com called saving to read only mode

@lukehsiao

This comment has been minimized.

lukehsiao commented May 14, 2015

@Jermolene I'd love this sort of button. However, I'm admittedly not familiar enough with TiddlyWiki yet to know where I should place that code. Can you give me a pointer?

@danielo515

This comment has been minimized.

Contributor

danielo515 commented May 14, 2015

Just place it in any tiddler. Then open that tiddler when you want to press that button. You can also tag that tiddler appropriately if you want to place it in the sidebar for example

@lukehsiao

This comment has been minimized.

lukehsiao commented May 14, 2015

@danielo515 So to accomplish the same thing I was doing above, I believe my button should be:

<$button>
<$action-setfield $tiddler="$:/state/sidebar" $value="no"/>
<$action-sendmessage $message="tm-save-wiki"/>
publish changes
</$button>

However, when I click this button, I see the sidebar disappear and it saves the Wiki, but when I open the wiki again, the sidebar is visible. It doesn't seem to properly make it not visible be default.

@danielo515

This comment has been minimized.

Contributor

danielo515 commented May 14, 2015

Yes, that is correct. How is the TW saved? By downloading it as a new copy or overriding the current tiddler one? Please note that maybe you unhide the sidebar and save again.

@gernert

This comment has been minimized.

Contributor

gernert commented May 18, 2015

@lukehsiao
A long time ago (12/30/2013) a post in the group [1] let me think about making TW5 readonly which resulted in my guide 'TW5 read-only' at http://tw5readonly.tiddlyspot.com/. As of 7/16/2014 there is a readonly plugin. It is not state-of-the-art but it does work.

[1] https://groups.google.com/forum/#!msg/tiddlywiki/hF30Y9WD9lE/YbZHrUK_c2kJ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment