Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2016-05-13 09:05:19

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,205
Website

Re: [feedback] Image upload directly in the write tab

Simply amazing Oleg ;)


Patrick.
G+
Github | CodePen

Offline

#22 2016-05-13 09:50:01

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

Re: [feedback] Image upload directly in the write tab

Merci les gars, that was amazing to do too. I will push it to the master soon, happy plugin writing!


etc_[ query | search | pagination | date | tree | cache ]

Offline

#23 2016-05-26 15:59:11

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,205
Website

Re: [feedback] Image upload directly in the write tab

Hi Oleg ;)

I don’t know if that is very difficult: maybe you could add the current article title as a default “alt text” to image. What about multiple images? Better it will be to have a same “alt text” for all different images than nothing at all.


Patrick.
G+
Github | CodePen

Offline

#24 2016-05-26 16:36:51

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

Re: [feedback] Image upload directly in the write tab

Pat64 wrote #299302:

maybe you could add the current article title as a default “alt text” to image. What about multiple images? Better it will be to have a same “alt text” for all different images than nothing at all.

Hi Patrick,

valid point, thanks. I have updated the code adding image name as alt (see $meta = array('alt' => $file['name']); line). Feel free to replace it with article title ('alt' => $rs['Title']) or whatever you want — I don’t know what is the most pertinent choice here.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#25 2016-05-27 07:29:05

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 746
Website

Re: [feedback] Image upload directly in the write tab

Hi Oleg,

Don’t work with the last 4.6 dev.
Normal ?

Edit : I understand now : I must save the article to see the image !

Last edited by jpdupont (2016-05-27 07:40:22)

Offline

#26 2016-05-27 10:25:38

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

Re: [feedback] Image upload directly in the write tab

Hi Jean-Pol

jpdupont wrote #299313:

I understand now : I must save the article to see the image !

Yes, as with other fields. It’s not difficult to add auto-saving or image preview with few lines of js, though. I have updated the code for preview illustration (needs a browser with FileReader support), but don’t make me write a fully-featured image upload plugin, diy. ;)


etc_[ query | search | pagination | date | tree | cache ]

Offline

#27 2016-05-27 10:47:40

etc
Developer
Registered: 2010-11-11
Posts: 2,949
Website

Re: [feedback] Image upload directly in the write tab

Incidentally, it would be great to place the Save button at some fixed position, say in theme’s <header />. Scrolling to the top to save changes is unpractical with long articles.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#28 2016-05-28 01:19:14

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

Re: [feedback] Image upload directly in the write tab

etc wrote #299316:

Incidentally, it would be great to place the Save button at some fixed position, say in theme’s <header />. Scrolling to the top to save changes is unpractical with long articles.

For my own theme, I’ve been thinkering with setting the whole sidebar on the Write panel to position:sticky for larger displays (desktop browsers, larger iPad type devices).

Offline

#29 2016-05-28 08:46:58

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,160
Website

Re: [feedback] Image upload directly in the write tab

etc wrote #299316:

Incidentally, it would be great to place the Save button at some fixed position, say in theme’s <header />. Scrolling to the top to save changes is unpractical with long articles.

I have to say, I like the predictability of having all the save buttons at the top but totally understand your thinking. In the thinner viewport widths, it’s currently not at the top of the page but at the top of the sidebar / bottom of the main column.

phiw13 wrote #299327:

For my own theme, I’ve been thinkering with setting the whole sidebar on the Write panel to position:sticky for larger displays (desktop browsers, larger iPad type devices).

Sounds good too. Can there be problems with lengthy sidebars that are longer than the viewport height, or am I muddling that with position:fixed?

Phil, is Oleg’s suggestion feasible at this late juncture? Even if it still scrolled in Hive for the meantime, it would be good to allow others to be able theme it stuck if they so wished.


TXP Builders – finely-crafted code, design and txp

Offline

#30 2016-05-28 09:32:13

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

Re: [feedback] Image upload directly in the write tab

jakob wrote #299332:

I have to say, I like the predictability of having all the save buttons at the top but totally understand your thinking. In the thinner viewport widths, it’s currently not at the top of the page but at the top of the sidebar / bottom of the main column.

which is quite good. It is easily accessible on not-so-wide displays. Making it position: fixed on those displays will only get it in the way (cover) editing fields.

Sounds good too. Can there be problems with lengthy sidebars that are longer than the viewport height, or am I muddling that with position:fixed?

Partly, with position: sticky you still can scroll the whole thing. My first test a couple of day ago worked reasonably well, but I had all sub panels in the sidebar collapsed. Once I tested on a real install, with a number of sub panels open, it didn’t work that well.

But this worked well – for me, with my theme:

@media (min-width: 1025px) {
	#article_form  .txp-layout-4col-cell-4alt {
		position: relative; /*position: -webkit-sticky; top: 10em;*/
	}

	#article_form .txp-save {
		position: -webkit-sticky; top: 0.7em; z-index: 100;
	}
}

The save button sticks over the header once one scroll down the page. I think something similar would work for Hive, modulo some adjustment to the top value. Add -moz- prefix for Firefox of course (or did they unprefix it already? I don’t think so). Chrome and Edge do no support it yet (it is in the work for Edge, afaik).

—-

Phil, is Oleg’s suggestion feasible at this late juncture? Even if it still scrolled in Hive for the meantime, it would be good to allow others to be able theme it stuck if they so wished.

one thing: PLEASE do not move the save button in the <header>, code wise. It would 1/ not be very semantic and 2/ pretty poor in terms of accessibility. Think keyboard users and screen readers alike.

Offline

Board footer

Powered by FluxBB