Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2024-11-16 10:03:05

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,208
Website

Re: Should an article preview parse 'txp:' tags?

etc wrote #338216:

I have added a Tester Egg, to fold/unfold sanitized elements and txp tags in text preview mode. Currently it works by ctrl+click on Sanitize button, replacing these elements with abbreviated versions.

Do I have to toggle some setting somewhere?

At present, absolutely nothing special happens with a ctrl+click on the “sanitise button” – the default action is triggered: show the relevant context menu on both Safari and Firefox.

(I presume by “sanitise button” you mean the label + input type=checkbox combo near the top of the Preview panel…)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#14 2024-11-16 10:27:22

etc
Developer
Registered: 2010-11-11
Posts: 5,210
Website GitHub

Re: Should an article preview parse 'txp:' tags?

No luck:

on a Mac, a click combined with the control key is intercepted by the operating system and used to open a context menu, so ctrlKey is not detectable on click events.

I guess metaKey is more appropriate on Macs, will test.

Please try again, with key.

Offline

#15 2024-11-17 00:36:43

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,208
Website

Re: Should an article preview parse 'txp:' tags?

etc wrote #338241:

I guess metaKey is more appropriate on Macs, will test.

Please try again, with key.

Yes, metaKey works as expected (with e.PrevenDefault… else Safari would not like it I think).

etc wrote #338216:

[…] but it can certainly be improved UX-wise. Testers welcome.

I don’t think you need to do much more. Your sample <txp:php /> block collapses as indicated, as do all the other <txp:…/>, one liners such as <txp:image id=“xx” />or multi-line blocks. I would certainly not hide them completely, else what is the point of previewing with sanitising?


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#16 2024-11-17 08:57:42

etc
Developer
Registered: 2010-11-11
Posts: 5,210
Website GitHub

Re: Should an article preview parse 'txp:' tags?

phiw13 wrote #338250:

Yes, metaKey works as expected (with e.PrevenDefault… else Safari would not like it I think).

I don’t think you need to do much more.

I don’t like preventing defaults in such cases, a dedicated trigger would be better. But let it be.

Your sample <txp:php /> block collapses as indicated, as do all the other <txp:…/>, one liners such as <txp:image id=“xx” />or multi-line blocks. I would certainly not hide them completely, else what is the point of previewing with sanitising?

One-liners can be very long, and blocks might need to be previewed too. But

  1. They get a title with the full code for a quick glance
  2. You can fold/unfold them individually, still with ctrl/cmd+click.

Offline

#17 2024-11-17 09:29:00

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,208
Website

Re: Should an article preview parse 'txp:' tags?

etc wrote #338256:

One-liners can be very long, and blocks might need to be previewed too. But

  1. They get a title with the full code for a quick glance
  2. You can fold/unfold them individually, still with ctrl/cmd+click.

I wasn’t referring to collapsing or not collapsing but you mentioning fully hiding with some CSS (part which I accidentally deleted from the quoted text).

You can (un)fold them individually ? I will need to test that… that might be much more useful than folding everything at once.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#18 2024-11-17 09:53:18

etc
Developer
Registered: 2010-11-11
Posts: 5,210
Website GitHub

Re: Should an article preview parse 'txp:' tags?

phiw13 wrote #338259:

I wasn’t referring to collapsing or not collapsing but you mentioning fully hiding with some CSS (part which I accidentally deleted from the quoted text).

That’s what I have understood later, sorry.

You can (un)fold them individually ? I will need to test that… that might be much more useful than folding everything at once.

Unless Safari intervenes :-)

Offline

#19 2024-11-17 09:59:10

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,208
Website

Re: Should an article preview parse 'txp:' tags?

etc wrote #338261:

Unless Safari intervenes :-)

Safari does what is asked: fold a 3 line <txp:php>…</txp:php> into a short <txp:php…>.

Last edited by phiw13 (2024-11-17 09:59:26)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB