{"action":"created","issue":{"url":"https://api.github.com/repos/SimpleMachines/SMF2.1/issues/2839","labels_url":"https://api.github.com/repos/SimpleMachines/SMF2.1/issues/2839/labels{/name}","comments_url":"https://api.github.com/repos/SimpleMachines/SMF2.1/issues/2839/comments","events_url":"https://api.github.com/repos/SimpleMachines/SMF2.1/issues/2839/events","html_url":"https://github.com/SimpleMachines/SMF2.1/pull/2839","id":69141358,"number":2839,"title":"Attachment uploads and inline attachment display","user":{"login":"MissAllSunday","id":3420756,"avatar_url":"https://avatars.githubusercontent.com/u/3420756?v=3","gravatar_id":"","url":"https://api.github.com/users/MissAllSunday","html_url":"https://github.com/MissAllSunday","followers_url":"https://api.github.com/users/MissAllSunday/followers","following_url":"https://api.github.com/users/MissAllSunday/following{/other_user}","gists_url":"https://api.github.com/users/MissAllSunday/gists{/gist_id}","starred_url":"https://api.github.com/users/MissAllSunday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MissAllSunday/subscriptions","organizations_url":"https://api.github.com/users/MissAllSunday/orgs","repos_url":"https://api.github.com/users/MissAllSunday/repos","events_url":"https://api.github.com/users/MissAllSunday/events{/privacy}","received_events_url":"https://api.github.com/users/MissAllSunday/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SimpleMachines/SMF2.1/labels/Attachments","name":"Attachments","color":"fad8c7"},{"url":"https://api.github.com/repos/SimpleMachines/SMF2.1/labels/Feature%20Request","name":"Feature Request","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/SimpleMachines/SMF2.1/milestones/5","html_url":"https://github.com/SimpleMachines/SMF2.1/milestones/Beta%203","labels_url":"https://api.github.com/repos/SimpleMachines/SMF2.1/milestones/5/labels","id":1203187,"number":5,"title":"Beta 3","description":"","creator":{"login":"live627","id":431799,"avatar_url":"https://avatars.githubusercontent.com/u/431799?v=3","gravatar_id":"","url":"https://api.github.com/users/live627","html_url":"https://github.com/live627","followers_url":"https://api.github.com/users/live627/followers","following_url":"https://api.github.com/users/live627/following{/other_user}","gists_url":"https://api.github.com/users/live627/gists{/gist_id}","starred_url":"https://api.github.com/users/live627/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/live627/subscriptions","organizations_url":"https://api.github.com/users/live627/orgs","repos_url":"https://api.github.com/users/live627/repos","events_url":"https://api.github.com/users/live627/events{/privacy}","received_events_url":"https://api.github.com/users/live627/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":72,"state":"open","created_at":"2015-07-11T01:16:53Z","updated_at":"2015-09-30T18:40:57Z","due_on":null,"closed_at":null},"comments":27,"created_at":"2015-04-17T13:40:39Z","updated_at":"2015-10-05T17:58:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SimpleMachines/SMF2.1/pulls/2839","html_url":"https://github.com/SimpleMachines/SMF2.1/pull/2839","diff_url":"https://github.com/SimpleMachines/SMF2.1/pull/2839.diff","patch_url":"https://github.com/SimpleMachines/SMF2.1/pull/2839.patch"},"body":"PR this so it can be further tested. I got my head so stuffed with this stuff that I am probably missing some serious but quite easy to find errors :laughing: :\r\n\r\n- Adds minimal inline attachment support, can be expanded pretty easily but it all depends on what we want.\r\n- Adds [dropzone.js](https://github.com/enyo/dropzone) to upload attachments before posting. The user can upload the attachments and then leave them as is and the post will act as 2.0.x does, however, if there are multiple attachments and you upload 1 and leave the rest, only the one uploaded previously will be taken into consideration, this is the way the script works and haven't found a way around that.\r\n\r\n- Leaves the \"regular\" attachment process (almost) intact, as documented on the topic at SMF, I did have to change a few things here and there but the idea was to left the process as \"untouched\" as possible.\r\n\r\n- Has UI issues, I'm not good building user interfaces, just tried to add classes to everything so it can all be handled via css, its all documented on the relevant topic at SMF.\r\n\r\n- Needs testing! specially the delete part as it is somehow fragile and perhaps should be re-written to properly handle any errors. There is also the things I raised on SMF and how are we gonna handle it."},"comment":{"url":"https://api.github.com/repos/SimpleMachines/SMF2.1/issues/comments/145614666","html_url":"https://github.com/SimpleMachines/SMF2.1/pull/2839#issuecomment-145614666","issue_url":"https://api.github.com/repos/SimpleMachines/SMF2.1/issues/2839","id":145614666,"user":{"login":"MissAllSunday","id":3420756,"avatar_url":"https://avatars.githubusercontent.com/u/3420756?v=3","gravatar_id":"","url":"https://api.github.com/users/MissAllSunday","html_url":"https://github.com/MissAllSunday","followers_url":"https://api.github.com/users/MissAllSunday/followers","following_url":"https://api.github.com/users/MissAllSunday/following{/other_user}","gists_url":"https://api.github.com/users/MissAllSunday/gists{/gist_id}","starred_url":"https://api.github.com/users/MissAllSunday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MissAllSunday/subscriptions","organizations_url":"https://api.github.com/users/MissAllSunday/orgs","repos_url":"https://api.github.com/users/MissAllSunday/repos","events_url":"https://api.github.com/users/MissAllSunday/events{/privacy}","received_events_url":"https://api.github.com/users/MissAllSunday/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T17:58:26Z","updated_at":"2015-10-05T17:58:26Z","body":"yes it is by design, \"session attachments\" are considered as \"uploaded attachments\", they have a unique attach ID and for all purposes they are valid attachments the only difference is that those attachments aren't assigned to any message.\r\n\r\nsession attachments will indeed show just as if they were uploaded on every new message or reply page that particular user tries to make until the session is over or the attachments are assigned to a message or the attachment are deleted.\r\n\r\n\r\n2.0.x does exactly the same, it shows \"already attached\" files as checkboxes and the user can \"un-check\" those checkboxes if they do not want to assign those attachments on the message the user is currently creating.  this is the same but instead of adding checkboxes, the attachments are fully displayed and with a link to delete each file.\r\n\r\nThis same principle can be used to store \"draft attachments\", if someone saves a draft and that draft has some attachments, when the user loads the draft, load the attachments associated with that draft too."}}