ElkArte Community

Elk Development => Feature Discussion => Topic started by: emanuele on September 01, 2015, 02:46:20 pm

Title: ILA drafts and attachments
Post by: emanuele on September 01, 2015, 02:46:20 pm
Adding ILA to 1.1, I feel it would be "expected" to have attachments be saved for drafts as well as for normal posts.
What do you think?

What do you think would be the best approach for that?
I'm unsure between the "have a new table for a quick and dirty workaround" and the "add a new column to the attachments table and fix all the functions dealing with attachments to understand this new field" approaches.
Title: Re: ILA drafts and attachments
Post by: radu81 on September 01, 2015, 04:01:08 pm
I like the idea of inline images in the core. Imo it's not a must have attachments saved as drafts. I'm also curious to know what the others think about this

What is strange is that I still have some users who asks how to add attachments, so if inline images will be in the core I think the interface should be simple to use, from desktop and mobile ;)
Title: Re: ILA drafts and attachments
Post by: Jorin on September 02, 2015, 03:00:28 am
Yep, it should be as simple as possible if it is in the core. I like the idea too.

Maybe drag&drop would work? I don't know, you are the experts. I would like it if I could drag an image on any folder on my computer and drop it right in the text where I want it to be shown after posting.

But that's no souliton for mobile devices. There has to be another way.
Title: Re: ILA drafts and attachments
Post by: wintstar on September 02, 2015, 03:31:50 am
Here you can the difference between the previous attachment and see the planned inline-attachment in 1.1. *.  These are just a few examples of the planned inline-attachment.

http://elkarte.scaricare.de/110/index.php?topic=3.0

Sorry, must still set the permissions for guests
Title: Re: ILA drafts and attachments
Post by: radu81 on September 02, 2015, 08:36:51 am
http://www.elkarte.net/community/index.php?topic=1450.msg19146#msg19146

could be an example of simple interface ;)
Title: Re: ILA drafts and attachments
Post by: Flavio93Zena on September 02, 2015, 09:34:58 am
Since it's italian...

"Reply to topic" "Upload images or documents" "Preview..." (upper buttons)
Attachments
ep.jpg
insert (which is "inserisci" if you got lost)
"Thumbnail" "Full dimensions image" "Delete" (lower buttons)

That's what they mean :)
Title: Re: ILA drafts and attachments
Post by: radu81 on September 02, 2015, 10:43:05 am
Maybe this is more useful ;)
Title: Re: ILA drafts and attachments
Post by: emanuele on September 05, 2015, 08:26:48 am
Sorry for hijacking the discussion, but the original intent was not really to talk about the interface (that can be changed almost at any time from now to the final version of 1.1), but about how to implement a specific feature. :P

I guess I can add a column to the database and then implement the rest of the feature while heading towards the final version... Hoping a column is enough. O:-)
Title: Re: ILA drafts and attachments
Post by: Bloc on September 05, 2015, 12:07:45 pm
IMHO its great feature. The attachment routine is often easier to add pictures with and adding them to the post by BBC tag even better. Thats what I would suggest though, as a BBC tag. Does it mean attachments must be free from its topic? Does Elkarte link it to topic as SMF does?

I have dabbled with themes that take the first attachment(or any really) and make that as an "illustration": meaning the theme puts that on top of the post like a blog post. Having it inline makes a lot of sense to add your own "blog-thing" then. Its of course ONLY relevant for picture attachments. Normal files are treated as regular attachments.

Going a bit off-topic here(because this is interesting stuff for me lol) but I even tried "preset" containers at one time. Meaning if I put a BBC tag of a certain kind, the theme would hide it in the textarea(but add it back when saving) and rather show a dedicated input form for it. For example: a category or tag used, or some other info that could be made into malleable "items" in the same theme. The code would still save it as BBC tags, but the layout could be totally different and you didn't have to make the carefully crafted posts again and again, when you added new ones. The data would also already be there when you decide to change the whole layout(imagine changing 100's of posts if you like to change the post-layout abit.) And..since its just BBC code, other themes would preserve the data, although not using it actively.

To tie that in with ILA...that BBC tag could easily be made into select lists then. By adding some sort of class to the tag, you could re-use the ILA for different purposes in the theme - just by adding the BBC tags.(prob. first time you need to save it and then re-open to select attachments etc, though JS could be used to transform it on the fly. IMO Its not important that the user sees the transfomation either, in fact that would be helpful to understand the relationship)

Sorry for the off-topic lol.
Title: Re: ILA drafts and attachments
Post by: Bloc on September 05, 2015, 12:11:29 pm
Oh my, I see now I was a bit hasty lol.

You mean attachments for drafts. I would think an extra "draft" column would be enough. Might need some cleaning out routines though, I assume most people don't want attachments in abandoned draft posts lingering on the server.
Title: Re: ILA drafts and attachments
Post by: radu81 on September 05, 2015, 04:06:16 pm
Quote from: Bloc – I assume most people don't want attachments in abandoned draft posts lingering on the server.

In Elkarte there is an option to autodelete drafts after some time. I set it to 30 days, I think this can also be used for attachments
Title: Re: ILA drafts and attachments
Post by: emanuele on September 06, 2015, 10:08:15 am
Well, I think people would be more upset by writing down a nicely formatted post, with inline attachments just to discover that the draft didn't save the attachments and messed with the inline images.
It's not that people will start saving drafts with attachments all over the place just to fill the server, but as usual, measures can be taken to "reduce" the impact, for example limit the number of drafts a user can save (see the other topic about distinguish between "saved" drafts and "autosaved" ones).
Title: Re: ILA drafts and attachments
Post by: radu81 on September 06, 2015, 01:37:41 pm
I agree with you Emanuele
Title: Re: ILA drafts and attachments
Post by: emanuele on September 16, 2015, 05:52:51 pm
I started looking into save attachments for drafts. What scares me is that it looks too easy... :-\
Something is definitely wrong. nods
Title: Re: ILA drafts and attachments
Post by: Jorin on September 21, 2015, 02:14:31 am
Try to add a bug. This would make it much more complicated!  ;)
Title: Re: ILA drafts and attachments
Post by: emanuele on September 21, 2015, 08:06:40 am
LOL

Good idea! :D
Title: Re: ILA drafts and attachments
Post by: emanuele on December 15, 2015, 02:40:44 am
After three months and quite some work on it, I have to say I'm very lost. Furthermore the new BBC parser changed the situation even more.

I'm not sure I can fix ILA and the drafts any time soon. I've reached the point I start thinking that propose to drop ILA from 1.1 and have the release is better than try to fix it "somehow" with potentially lost of bugs. Then, once 1.1 is out, ILA and attachments can be re-worked and made it work properly.
Title: Re: ILA drafts and attachments
Post by: ahrasis on December 15, 2015, 03:34:51 am
Agreed.
Title: Re: ILA drafts and attachments
Post by: radu81 on December 15, 2015, 09:15:03 am
I know you are working on this from long time, attachments in drafts is a nice feature, but I can live without them well ;)
Title: Re: ILA drafts and attachments
Post by: Spuds on December 15, 2015, 09:45:11 am
I'm kind of so so on that idea TBH ... I can see not having the save draft attachments as part of B1, but to not have ILA as part of B1 seems more like an Alpha1 .. kind of a major feature to not be in the first beta.  
Title: Re: ILA drafts and attachments
Post by: emanuele on December 15, 2015, 12:05:10 pm
The meaning of my post was more "not have ILA in 1.1", actually.
But I guess that's a bit too much?
Title: Re: ILA drafts and attachments
Post by: Spuds on December 15, 2015, 12:18:45 pm
Well if we don't think its doable I guess we punt ... and if we can't get it to work in the core, there is no chance the addon way will work either which is a bit of a problem as well.  Anyway sounds like I'm the only no vote anyway :P
Title: Re: ILA drafts and attachments
Post by: radu81 on December 15, 2015, 04:19:46 pm
Quote from: emanuele – The meaning of my post was more "not have ILA in 1.1", actually.
But I guess that's a bit too much?
Imo yes, but it's not me to decide :)
Title: Re: ILA drafts and attachments
Post by: Joshua Dickerson on December 16, 2015, 01:38:50 am
Tough decision.

I don't think we should be allowed to remove hooks in minor versions but we can certainly add new ones and add passed parameters to the hooks. So, if you can continue working on it in a plugin that would be great and it would allow the development of 1.1 to continue. Then, when we start working on 1.2 or whatever is next, the first thing that goes in to it would be ILA (assuming that it's been created as a plugin).

I really think this is the best way to go with features in general. It allows features to constantly be created but not get in the way of refactoring or bug fixing. I proposed it once or twice at SMF but I realized it takes a lot more work and slows the development of features so I didn't really push it. It's why I ask people whenever I see them making code edits where we can add in a hook. They are easy to add and don't break anything if you add more.
Title: Re: ILA drafts and attachments
Post by: emanuele on December 16, 2015, 02:10:59 am
Quote from: Joshua Dickerson – I don't think we should be allowed to remove hooks in minor versions
All the bbc hooks changed somehow. :P
Title: Re: ILA drafts and attachments
Post by: ahrasis on December 16, 2015, 04:03:15 am
I can see 2.1 having more hooks compared to ElkArte sometimes ago.
Title: Re: ILA drafts and attachments
Post by: emanuele on December 16, 2015, 08:37:50 am
Quote from: Spuds – Well if we don't think its doable I guess we punt ... and if we can't get it to work in the core, there is no chance the addon way will work either which is a bit of a problem as well.
I'm not saying it is not possible to make it work. ;)
What I'm saying is that to have ILA working there is to:
1) change ILA so that it accepts the attach_id instead of the upload order of the message,
2) either change the posting of attachments so that when D&D'ed the return is the attach_id (and that would mean support ILA only with javascript enabled at posting time) or make it so an unique placeholder is used and then replaced at POSTing time with the proper attach BBC,
3) check whether is is (still) possible to hide attachments when using the ILA BBC.

1 should be kind of easy (just a new BBCode not to interfere with the previous behaviour, otherwise it would require some upgrade processing as well, and that would require quite a bit of testing I think).
2 is tricky to me. Both the solutions have some implication I'm not fully sure about. Okay, we can just pick one and go for it. :P
3 is something to check, not really that important for beta 1.

I'm worried about point 2 TBH.
I'm quite busy until the new year, so I'm not sure I can put together the necessary code before January.
Also it would require at least some testing (and uploading here for live would be quite necessary), so... another month at least before the release (unless other issues arise).
Dunno.
Title: Re: ILA drafts and attachments
Post by: Spuds on December 16, 2015, 09:23:41 am
I've only been looking at it for a short while and I'm not seeing an "easy" addon solution ATM but have not looked in depth.  Even the current 1.0 version does not have an interface, so its only 1/2 baked really.

I'm less concerned about the JS only solution, without JS you don't even have an editor, D&D, auto saving, etc

changing to the attach_id vs post attach_count should be easy enough, and as a bonus it simplifies things since the current code worked on the post attachment as a fifo rotation queue.  All of that can be dropped (you could keep it but why?) and just make the user provide the specificity of this attachment here.

Title: Re: ILA drafts and attachments
Post by: Joshua Dickerson on December 16, 2015, 06:10:20 pm
Yeah, screw people that don't keep Javascript enabled. If it means screwing everyone else because <1% of the users don't want to enabled JS, screw that minority.
Title: Re: ILA drafts and attachments
Post by: Flavio93Zena on December 16, 2015, 07:14:45 pm
I like it, although I don't have js enabled myself on my Opera Mini, on phone :P
Title: Re: ILA drafts and attachments
Post by: Jorin on December 18, 2015, 03:01:54 am
Some thoughts about the UI...

What about an image/attachment BBC icon in the editor? You set your cursor in the text field at the position you want to insert an image/attachment, then you click on the icon. A windows opens, asking you what image/attachment you want to insert, which size you want it to be (optional, otherwise uses original size), and what should happen with the text around the image/attachment (floating or not) and should the image/attachment be left or right aligned. Same with other attachments than images, there should be a little graphic for them (a word page for a text document for example).

If you edit your post, you can delete the image/attachment by clicking on it. Then you will be asked to change the image/attachment (same window as described above opens) or to delete it.

Would be the same feeling as in blog software, word, etc.