• 
      

    [WIP] Drag 'n Drop Inline Images

    Review Request #6351 — Created Sept. 21, 2014 and discarded

    Information

    Review Board
    master

    Reviewers

    Adding support for dragging and dropping images into the markdown editor. Instead of having upload their image first and then link to that image, users can simply drag-and-drop their image file into the markdown editor. This will upload the image to reviewboard and insert a link to that image in the editor.

    To accomplish this, a new resource for uesr file attachments was added (see https://reviews.reviewboard.org/r/6220/ for initial work) and some modifications to the markdown editor JS were made to support drag-and-drop (see https://reviews.reviewboard.org/r/5954/ for initial work).

    Still a work-in-progress.
    Ignore all the JavaScript files for now please

    
     
    Description From Last Updated

    Make sure to keep the includes in alphabetical order. so put this under fileAttachmentCommentReplyModel.js

    ML mloyzer

    Alphabetical order again.

    ML mloyzer

    'FILE_ALREADY_EXISTS' imported but unused

    reviewbotreviewbot

    Col: 9 E265 block comment should start with '# '

    reviewbotreviewbot

    Col: 9 E265 block comment should start with '# '

    reviewbotreviewbot

    Col: 80 E501 line too long (81 > 79 characters)

    reviewbotreviewbot

    Col: 18 E251 unexpected spaces around keyword / parameter equals

    reviewbotreviewbot

    Col: 19 E502 the backslash is redundant between brackets

    reviewbotreviewbot

    Col: 18 E251 unexpected spaces around keyword / parameter equals

    reviewbotreviewbot
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
    2. 
        
    chipx86
    1. Hey David.

      I haven't looked at the change yet, but can you change the description to first summarize what this feature provides and how it's implemented, and then later in the description, refer to the other review requests?

      Every review request filed should strive to convey enough information for the reviewers to know exactly what the change is about without having to click on any other links. These descriptions are also used for commit messages, which we try to keep detailed and individually descriptive.

    2. 
        
    dkus
    ML
    1. Some minor nitpicky alphabetical ordering fixes.

    2. reviewboard/staticbundles.py (Diff revision 1)
       
       
      Show all issues

      Make sure to keep the includes in alphabetical order. so put this under fileAttachmentCommentReplyModel.js

      1. Should they be in alphabetical order or dependency order? There is a note saying to keep em in dependency order.

      2. I was under the impression it was alphabetical but maybe wait for someone else to confirm

      3. FYI: I did ask last meeting (forgot to update here) but they did say the ordering is alphabetical. There are 3 groups (Django imports, reviewboard imports, and Python imports [i think]) and within each of those groups they are sorted alphabetically.

      4. Ah, so that answer was for python imports. For these, they're in dependency order (and alphabetical when it doesn't matter).

    3. reviewboard/staticbundles.py (Diff revision 1)
       
       
      Show all issues

      Alphabetical order again.

    4. 
        
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
    2. Show all issues
       'FILE_ALREADY_EXISTS' imported but unused
      
    3. Show all issues
      Col: 9
       E265 block comment should start with '# '
      
    4. Show all issues
      Col: 9
       E265 block comment should start with '# '
      
    5. 
        
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
    2. 
        
    dkus
    dkus
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
    2. Show all issues
      Col: 80
       E501 line too long (81 > 79 characters)
      
    3. 
        
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
    2. Show all issues
      Col: 18
       E251 unexpected spaces around keyword / parameter equals
      
    3. Show all issues
      Col: 19
       E502 the backslash is redundant between brackets
      
    4. 
        
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
    2. Show all issues
      Col: 18
       E251 unexpected spaces around keyword / parameter equals
      
    3. 
        
    dkus
    reviewbot
    1. Tool: Pyflakes
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
      
      Tool: PEP8 Style Checker
      Processed Files:
          reviewboard/webapi/resources/root.py
          reviewboard/webapi/resources/base_file_attachment.py
          reviewboard/webapi/resources/draft_file_attachment.py
          reviewboard/webapi/resources/diff_file_attachment.py
          reviewboard/attachments/models.py
          reviewboard/webapi/errors.py
          reviewboard/attachments/evolutions/__init__.py
          reviewboard/attachments/mimetypes.py
          reviewboard/attachments/evolutions/file_attachment_ownership.py
          reviewboard/webapi/resources/file_attachment.py
          reviewboard/webapi/resources/file_attachment_user.py
          reviewboard/webapi/resources/base_review_request_file_attachment.py
          reviewboard/attachments/forms.py
          reviewboard/staticbundles.py
      
      Ignored Files:
          reviewboard/static/rb/js/views/dndUploaderView.js
          reviewboard/static/rb/js/resources/models/fileAttachmentUserModel.js
          reviewboard/static/rb/js/views/reviewRequestEditorView.js
          reviewboard/static/rb/js/resources/models/apiTokenModel.js
          reviewboard/static/rb/js/views/commentDialogView.js
          reviewboard/static/rb/js/views/markdownEditorView.js
      
      
    2. 
        
    dkus
    Review request changed
    Status:
    Discarded
    Change Summary:
    Splitting this into two seperate review requests, one for backend and one for frontend.
    See https://reviews.reviewboard.org/r/6454/