Giter Club home page Giter Club logo

Comments (7)

jjtykkyl avatar jjtykkyl commented on July 24, 2024

I'm adding this functionality to the library ASAP as there have been several requests about this matter. However, it's going to take some time since the library needs to support mobile use as well but hopefully I get it done this month. Please note that you still need to implement the attachment uploading to your backend to get it working.

from jquery-comments.

erichard avatar erichard commented on July 24, 2024

@jjtykkyl Very pleased to hear that.

My project is going live in january. Hope you will have time to release something.
Tell me if you need help.

from jquery-comments.

jjtykkyl avatar jjtykkyl commented on July 24, 2024

@erichard I've implemented the MVP of this feature to branch feature/attachments (https://github.com/Viima/jquery-comments/tree/feature/attachments) if you wish to start using it already. There's still a lot to do but the basic functionalities are in place.

The idea is that the attachments are treated as comments but they have two extra fields: "file" and "file_mime_type". You should define new callback function called "uploadAttachment" which takes the same parameters as the "postComment" callback. However, the "file" attribute provided in commentJSON is the actual file to be uploaded and it's up to your server logic to upload that file and transform the value of the attribute to the URL of the file instead. The commentJSON contains also the "file_mime_type" but you may want to validate this on your backend as well. This is used for showing preview of the file whenever possible (works only for images and videos so far).

P.S. the feature will be disabled by default when merged to master branch so I recommend you to set the "enableAttachments" flag true already at this point.

from jquery-comments.

erichard avatar erichard commented on July 24, 2024

@jjtykkyl Can you rebase from the master branch with the reply button fix please ?

from jquery-comments.

erichard avatar erichard commented on July 24, 2024

I use the File API from HTML5 to upload file on the server, it work great.
Great and fast work, thank you !

from jquery-comments.

jjtykkyl avatar jjtykkyl commented on July 24, 2024

@erichard I can do even better, I just merged the functionality to master branch

from jquery-comments.

jjtykkyl avatar jjtykkyl commented on July 24, 2024

I'm happy to let you know that this feature has been implemented to version 1.1.0. The functionality can be enabled by setting the new variable "enableAttachments" to true

from jquery-comments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.