New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements new attachments UI #7676
Implements new attachments UI #7676
Conversation
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
04fd744
to
84a166c
Compare
Overall I like it, it would be a great step up. |
Also, to expand this. Is it possible to make it so dragging the thumbnail to the post would do the inline attachment as well? |
@DiegoAndresCortes: Part of my overall goal has been to make this new layout as similar as possible to the layout used to show attachments in the topic display. That's why I intentionally did not enable a full flex layout in the section showing the current attachments. I see what you mean about wanting to keep the drop zone area as large and as consistent as possible. However, I think I might be able to do you one better in that regard. I will need to experiment with it to see if it will work, but I might just designate the entire attachments container div as the drop zone area. Then padding, positioning of the instructional text, etc., will not matter. @jdarwood007: All things are possible. But that kind of drag and drop interaction between the attachments area and the editor would probably require a significant amount of new JavaScript. Implementing it would also unequivocally cross over the line from revamping an existing feature to introducing an entirely new feature. I'm not in charge of anything anymore, but unless @sbulen has changed the SMF development policies, that means adding something like that would need to wait for SMF 2.2. |
84a166c
to
a4bbc7d
Compare
I have now updated this PR according to the previous comments and discussion.
I have updated the screenshots in the original post to reflect these changes. |
e78c50e
to
1022bb1
Compare
I'll be testing this over the next day or two. |
The two themes I've tested with that I see the above issue on are Hextech & Starflight. |
This is so much cleaner... |
I probably can. It will most likely require changing some class names on the affected elements, which will in turn require more changes in the JavaScript, but it ought to be possible. I'll see what I can do as soon as I have a few spare minutes for it. |
One question, @sbulen: Do the themes you saw problems with use their own versions of Post.template.php, or do they just fall through to the default theme's version? |
I know that Starflight uses the default version. No computer access to look at the other atm... That's why this is interesting! |
Thanks. That's helpful information. It is interesting, I suppose, particularly if "interesting" is defined as "an example of why we normally avoid changes to theme files in patch releases," or "a pain in Sesquipedalian's butt." But c'est la vie. 😉 |
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
1022bb1
to
c6f4d48
Compare
Try this version, @sbulen.
Putting the CSS changes into a new file should solve the inconsistency issues for custom themes that use the default Post.template.php but their own index.css file (which is the case for most custom themes). This approach seems to work for the Starflight theme, at any rate. |
Signed-off-by: Jon Stovell <jonstovell@gmail.com>
Latest commit fixes #7682. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Testing looks good in all browsers I've tried. Even with alt themes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Should this go into a new issue so that it isn't forgotten? |
I suppose so. |
As requested by @sbulen for 2.1.4, here is a new, more streamlined UI for the attachments system.
$txt['attach_drop_zone']
to reflect the new reality.Because changes to theme templates in a patch release have a high likelihood of causing problems for existing custom themes, I took extra precautions in order to avoid breaking them. In particular, the changes to smf_fileUpload.js and Post.php include steps to ensure that they remain fully backward compatible with theme files from SMF 2.1.3 and earlier. Those extra tests and fallbacks can safely be removed in SMF 2.2.
UI when there are no attachments:
Demonstrating all UI changes (note: mouse cursor isn't visible in the screenshot, but it is dragging the RIS file):
Improved UI when JavaScript is disabled:
This PR also fixes #7682.