Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

jpdupont
Member
Registered: 2004-10-01
Posts: 752

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: 5,189
Website GitHub

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. ;)

Offline

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

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

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.

Offline

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

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,190
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).


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

Offline

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
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: 3,190
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.


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

Offline

#31 2016-05-28 09:47:54

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

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

phiw13 wrote #299336:

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.

Yes, sure. Well, you get the idea.

Offline

#32 2016-05-28 14:02:54

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

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

@Oleg:

I tried your new version. Grabbing the filename is a SEO inconsistency which come from the default feature within WordPress, IMHO.
So I changed $meta = array(‘alt’ => $file[‘Title’]); without any results because article’s title is not populated into the $file array.
Because your efficient code calls some ajax manipulations, maybe it will be cool to intercept the Title field from the DOM even if the title is changed by the writer (live changes).


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#33 2016-05-28 16:06:01

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

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

Patrick, although I’ve not tried it, but I don’t think your variant can work as it can only populate the $meta array with data available in the article pane, so $file['Title'] won’t be accessible (the name is only accessible as it came with the uploaded file). Did you try Oleg’s suggestion of 'alt' => $rs['Title'] which, if I’ve understood it correctly, should populate it with the data from the Title field when the article is saved/published, i.e. submitted to the database.


TXP Builders – finely-crafted code, design and txp

Offline

#34 2016-05-29 07:27:45

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

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

@Jakob:

You’re right. TL;)DR

Works perfectly ;)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#35 2016-09-17 09:12:06

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

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

Since 4.6 is here, I have revisited abc_article_image plugin, to experiment with possible image upload workflows. Now it features drag and drop/sort support (only partly in IE/Edge). Suggestions welcome.

Offline

#36 2016-09-17 09:49:52

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

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

Please open an issue for this on GitHub. I have planned work for this in 4.7 and we can discuss further. Cheers!

Offline

Board footer

Powered by FluxBB