Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2023-03-28 09:21:56

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

Re: Any solution to find and use the uploaded images in article?

Thank you for testing and proposals, gentlemen, will integrate it in the next iteration.

Pat64 wrote #335179:

And the corresponding input could have this CSS rule:

#article-file-name{padding-right: calc(.3076923077em + 34px)}...

Aren’t these dimensions theme-related? I would like (you) to find a nifty way to insert a button ‘inside’ a text input that would work independently of the input style.

phiw13 wrote #335181:

bonus: set tabindex="0" on the image containers (.com-image-container), similar to what is done on the list panels around the table.

This makes them focusable, why?

Another question: shortcuts. Currently, Shift+Enter on the article image field triggers the images preview update, Alt+Enter on the image search triggers ‘invert’, and so on. What would be most useful shortcuts?

Offline

#50 2023-03-28 09:30:25

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

Re: Any solution to find and use the uploaded images in article?

etc wrote #335183:

This makes them focusable, why?

See my follow-on post.


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

Offline

#51 2023-03-30 08:19:54

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

Re: Any solution to find and use the uploaded images in article?

version 0.9

  • thanks for simplifying the UI a little !
  • one issue I noticed – with Safari (16.4) – but not with Firefox & Brave (Blink): dragging an image from another webpage (site) inserts the image twice in preview and after saving (one is saved as image.ext, the other as some_name.ext where some_name is what the originating server has set. Nothing interesting in the error console.

PS – one possible improvement: align the images to the bottom of their individual containers (by default images are aligned on the baseline, leaving a small gap below).

@#txp-image-group-content img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom; /* <-- add */
}

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

Offline

#52 2023-03-30 16:52:27

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

Re: Any solution to find and use the uploaded images in article?

phiw13 wrote #335203:

thanks for simplifying the UI a little !

Thanks for testing, I think it’s close to its final shape now.

one issue I noticed – with Safari (16.4) – but not with Firefox & Brave (Blink): dragging an image from another webpage (site) inserts the image twice in preview and after saving (one is saved as image.ext, the other as some_name.ext where some_name is what the originating server has set. Nothing interesting in the error console.

Yep. I thought browsers dully behave consistently, since IE retirement, but the fun is still there. It looks like Safari adds a temporary image file to the package when dragging from a web page, but only if the data contains one image (try dragging multiple images before the plugin update, it should work ok). The plugin thus creates one image from URL and another one from this added file. I have sort of fixed it, as much as Safari console allows to see.

PS – one possible improvement: align the images to the bottom of their individual containers (by default images are aligned on the baseline, leaving a small gap below).

Will do, thanks.

Offline

#53 2023-03-31 01:20:44

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

Re: Any solution to find and use the uploaded images in article?

etc wrote #335205:

Thanks for testing, I think it’s close to its final shape now.

Yes, it looks quite good now.

Yep. I thought browsers dully behave consistently, since IE retirement, but the fun is still there. It looks like Safari adds a temporary image file to the package when dragging from a web page, but only if the data contains one image (try dragging multiple images before the plugin update, it should work ok). The plugin thus creates one image from URL and another one from this added file. I have sort of fixed it, as much as Safari console allows to see.

seems to work now. I “feels” a little slower – before the preview blob is generated – when adding from remote server. That might be subjective though.


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

Offline

#54 2023-03-31 07:59:32

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

Re: Any solution to find and use the uploaded images in article?

phiw13 wrote #335207:

I “feels” a little slower – before the preview blob is generated – when adding from remote server. That might be subjective though.

Really? It’s a usual lazy image load (possibly from cache), as before. No explicit blob is created from remote images by the plugin (just inspect the preview src).

Were you able to configure a strict CSP without breaking some plugin features?

Offline

#55 2023-03-31 09:34:12

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

Re: Any solution to find and use the uploaded images in article?

etc wrote #335210:

Really? It’s a usual lazy image load (possibly from cache), as before. No explicit blob is created from remote images by the plugin (just inspect the preview src).

Hmm, maybe my impression was wrong, I have not timed anything.

Were you able to configure a strict CSP without breaking some plugin features?

I think all is working correctly (compared to a non-CSP install) and I have not seen any error in the console (Safari / Brave, two different level users) it. I am not clear what Firefox (beta) is trying with its error reporting regarding CSP (lots of noise), but things work… the preview for fetching of images from remote websites is (of course) blocked at first (the remote site is not in the allowed list for img-src), and once the article is saved and the image uploaded, all is fine.


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

Offline

#56 2023-03-31 09:40:17

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

Re: Any solution to find and use the uploaded images in article?

I had to add blob: to img-src to enable file preview, and comment out style-src-attr and style-src-elem to suppress warnings.

Offline

#57 2023-03-31 09:47:38

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

Re: Any solution to find and use the uploaded images in article?

etc wrote #335213:

I had to add blob: to img-src to enable file preview, and comment out style-src-attr and style-src-elem to suppress warnings.

Yes, blob: is needed( I had that for some time in my set); it should probably be part of the default set. The style-src-* are the ones that cause lots of noise in the Firefox console, but not in Safari & Brave. I have no clue what is wrong according to Firefox.


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

Offline

#58 2023-03-31 10:30:32

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

Re: Any solution to find and use the uploaded images in article?

phiw13 wrote #335214:

The style-src-* are the ones that cause lots of noise in the Firefox console, but not in Safari & Brave. I have no clue what is wrong according to Firefox.

Yes, they come from FF own NetUtil.jsm module (and another plugin in my case).

A nifty plugin it has become, I might even use it myself :-)

BTW, the plugin in question was etc_date_picker. But why don’t we use standard date inputs?

Offline

#59 2023-03-31 11:30:08

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

Re: Any solution to find and use the uploaded images in article?

etc wrote #335216:

A nifty plugin it has become, I might even use it myself :-)

Yes, com_article_image has become quite a nice little tool!

But why don’t we use standard date inputs?

With the 4.9 branch it should be possible. <input type="date" /> (and time) are well supported cross browser. I vaguely remember Phil Wareham talking about some compatibility issues with the expected date format expected by Textpattern (??), but all details are missing from my memory.


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

Offline

#60 2023-03-31 20:26:32

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

Re: Any solution to find and use the uploaded images in article?

Another CSP-related round of small changes, to make blocked images preview more readable. Also got rid of unnecessary remote image request when dragging them on body/excerpt.

Offline

Board footer

Powered by FluxBB