Coder Social home page Coder Social logo

Comments (5)

brookemckim avatar brookemckim commented on August 11, 2024

I am doing it in a hacky matter. I store the uuid of the image as a database column and also use that for the image name. Then on removal I extract the uuid from the image and send that to rails for deletion.

from medium-editor-insert-plugin.

tezzataz avatar tezzataz commented on August 11, 2024

That sounds like the most logical way, how do you extract the uuid from the image? 

That's the only thing I can't work out, how to obtain data for a specific image.

On Thu, Jul 24, 2014 at 10:36 PM, Brooke McKim [email protected]
wrote:

I am doing it in a hacky matter. I store the uuid of the image as a database column and also use that for the image name. Then on removal I extract the uuid from the image and send that to rails for deletion.

Reply to this email directly or view it on GitHub:
#70 (comment)

from medium-editor-insert-plugin.

brookemckim avatar brookemckim commented on August 11, 2024

I pull it out of the file path that is passed to the deleteFile function.

  $editable.mediumInsert({
    editor: editor,
    addons: {
      images: {
        imagesUploadScript: "/attachments",,
        deleteFile: function(file, that) {
          var fileParts = file.split("/");
          var uuid = fileParts[fileParts.length - 1].split(".")[0];

          $.ajax({
            type: "delete",
            url: "/attachments/" + uuid,
          });
        }
      }
    }

from medium-editor-insert-plugin.

tezzataz avatar tezzataz commented on August 11, 2024

Worked like a charm, cheers Brooke

from medium-editor-insert-plugin.

tezzataz avatar tezzataz commented on August 11, 2024

@brookemckim Doesn't work with the new version anymore :(

from medium-editor-insert-plugin.

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.