Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2020-04-27 08:17:44

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,978
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Nice to bring this back to life! TY. Overall it seems to work fine.

A few things:

  • when you add the form button (nice to have !), it inserts the first short-code form available I think. A subsequent click, without moving the insertion point, inserts (replaces first insert) with the 2nd, etc. In an ideal world this possibly could be a select widget. Right now it feels a bit odd – it probably get more predictable after a few times of use.
  • but you knew this one already… Dark mode support is non-existent – and the actual result in Hive is… ahem…

sidenote – it would be nice if the admin themes use a standard set of CSS custom properties / variables. Extension(s) could the used those as well an integrate with a theme. I’ve mentioned that in the past, I dunno if anybody ever noticed. (I know, one of the issues: support for IE 11)

Offline

#12 2020-04-27 08:23:38

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,903
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

phiw13 wrote #322712:

Nice to bring this back to life! TY. Overall it seems to work fine.

A few things:

  • when you add the form button (nice to have !), it inserts the first short-code form available I think. A subsequent click, without moving the insertion point, inserts (replaces first insert) with the 2nd, etc. In an ideal world this possibly could be a select widget. Right now it feels a bit odd – it probably get more predictable after a few times of use.

Not quite. Every time you click the button, the next form is inserted. The issue is that it means very little when using it for short codes, which they would be much more accessible with this plugin, if they were under their own parent category.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#13 2020-04-27 08:26:40

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,978
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

colak wrote #322713:

Not quite. Every time you click the button, the next form is inserted.

isn’t it what I am saying ? while adding that for someone who makes heavy use of that button, the behaviour will become more predictable.

Offline

#14 2020-04-27 08:40:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,326
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

I could do a dropdown for the form insertion, I expect. Would have to play. I nearly did the same for the Hx heading cycler but chickened out. Perhaps if it’s possible to add an arrow to the right, like we do with the Search box, that might work? Click the main button to insert/cycle but click the adjacent arrow to drop down options.

I’d probably have to consult my SVG guru(!) to come up with an icon or some solution here. If anyone has any ideas on how to add this in CSS/JS terms for maximum accessibility, that’d be grand. I guess copying what we do in the HTML for Search is a start, but with some different styling to take up less space?

Unless you have some insight, I’ll also have to defer to Julian for the Dark Mode snafu. Thanks for the nudge. I know we were talking about styling SVG as we developed this, so we’ll need to do some tweaks and experiments I expect.

Some consistent, reusable style hooks would be an absolute boon here. Maybe Phil has some thoughts on this?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#15 2020-04-27 08:48:53

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,978
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Bloke wrote #322715:

Unless you have some insight, I’ll also have to defer to Julian for the Dark Mode snafu. Thanks for the nudge. I know we were talking about styling SVG as we developed this, so we’ll need to do some tweaks and experiments I expect. Some consistent, reusable style hooks would be an absolute boon here. Maybe Phil has some thoughts on this?

For starter, you could ease the problem by setting the color of the <a /> to inherit, and then do something for the background in dark mode. Dunno what Hive does nowadays with it, I fear it is not set in a screen and (prefers-color-scheme: dark) block though. there might be other issues and specificity problems though, don’t feel going through Hive to figure it out.

Last edited by phiw13 (2020-04-27 08:49:15)

Offline

#16 2020-04-27 09:23:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,903
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

phiw13 wrote #322714:

isn’t it what I am saying ? while adding that for someone who makes heavy use of that button, the behaviour will become more predictable.

Indeed. My apologies. Note to self. Read whole post next time:)


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#17 2020-04-27 10:17:38

etc
Developer
Registered: 2010-11-11
Posts: 3,651
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Bloke wrote #322711:

Or not… sigh

Or is it probably input, not change?

Offline

#18 2020-04-27 11:49:11

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,810
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Good point about dark mode. That should be doable. Phil sets a darkmode class so that should be straightforward. The svg are referenced as symbols so it should just be a case of changing the color with css.

The toolbar uses the same styling as phil’s heading element from the design pattern, and the button variant is the standard button styling, just slightly smaller. I don’t think there are any toolbar or tooltip styles in the design patterns but I’ll look at adjusting that so that we use the design pattern classes with overrides where necessary (though strictly speaking a toolbar is not a heading). That would make it at least better for others to theme. BTW: for those who would prefer/want to use other icons, you can switch out the symbols in the /textpattern/plugins/smd_textile_bar/data.txp file after installing.

I have a busy week ahead. Will see if I get some time in the coming evenings.


TXP Builders – finely-crafted code, design and txp

Offline

#19 2020-04-27 14:05:21

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,280
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

Hi all, sorry for silence – busy times. Hope everyone is well and safe.

I’ve just seen this project, thanks for resurrecting it Stef! I think a lot of the style issues can be negated by using the UI we already have for buttons, button icons, etc (class names such as txp-button, ui-icon and so forth). That would make the plugin less reliant on a specific theme too.

If the SVG icons stored in the same way we do for the standard icon set in Textpattern too (as CSS background-image data URIs) then they use the same filtering to achieve dark mode/light mode.

Leave it with me for a few days and I’ll refactor some of the code in the plugin to achieve the above.

Offline

#20 2020-04-27 14:41:45

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,326
Website

Re: smd_textile_bar: Simple Textile insertion for the Write panel

philwareham wrote #322722:

If the SVG icons stored in the same way we do for the standard icon set in Textpattern too (as CSS background-image data URIs)

Ah. They’re not right now. We’re injecting them as SVG data elements directly.

But Julian did export them as PNGs I think, so that’s an option. Might be easier to figure out internationalising them that way, but that does mean installation is trickier, as it needs to be a zip bundle (which means 4.8 only) or a heavy plugin file with all the data: elements/base64-encoded chunks wrapped in it for installation.

I kinda like using the plugin table data column, so if we can keep that, great. But usability beats storage so if we need to encode the icons differently, that’s cool.

Would using such background elements affect the ability to use .txp-dropdown? I’ve got a halfway working prototype (with mismatched styling right now) in my local dev copy that adds a down-arrow to the right of the Form button that lets you pick a direct form for insertion. I’m exploring that and will commit the experiment if it works out, even if the styling needs tidying up.

Thank you in advance for any insight/code that meshes this better with core.

Last edited by Bloke (2020-04-27 14:42:40)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB