Giter VIP home page Giter VIP logo

Comments (5)

stefanneculai avatar stefanneculai commented on May 26, 2024

@StefanNeuser could you please provide more details on the code you're using there?

from vue-froala-wysiwyg.

StefanNeuser avatar StefanNeuser commented on May 26, 2024

Hi, sure! I'm using your plugin example to get into. What i'm trying is this:

// Add an option for your plugin.
$.FroalaEditor.DEFAULTS = $.extend($.FroalaEditor.DEFAULTS, {
    myOption: false
});

// Define the plugin.
// The editor parameter is the current instance.
$.FroalaEditor.PLUGINS.myPlugin = function (editor) {
    // Private variable visible only inside the plugin scope.
    var private_var = 'My awesome plugin';

    // Private method that is visible only inside plugin scope.
    function _privateMethod () {
        console.log (private_var);
    }

    // Public method that is visible in the instance scope.
    function publicMethod () {
        console.log (_privateMethod());
    }

    // The start point for your plugin.
    function _init () {
        // You can access any option from documentation or your custom options.
        console.log (editor)

        // Call any method from documentation.
        // editor.methodName(params);

        // You can listen to any event from documentation.
        editor.events.add('contentChanged', function (params) {});
    }

    // Expose public methods. If _init is not public then the plugin won't be initialized.
    // Public method can be accessed through the editor API:
    // $('.selector').froalaEditor('myPlugin.publicMethod');
    return {
        _init: _init,
        publicMethod: publicMethod
    }
}

This first console.log ist working.

from vue-froala-wysiwyg.

stefanneculai avatar stefanneculai commented on May 26, 2024

Could you put together a quick repo that we could fork and check it?

from vue-froala-wysiwyg.

stefanneculai avatar stefanneculai commented on May 26, 2024

@StefanNeuser have you managed to fix this?

from vue-froala-wysiwyg.

alexsilva avatar alexsilva commented on May 26, 2024

froala_editor v3.1.1

I had the same problem. Analyzing the events object I noticed that it has only 'on'. It must be because of the version. The documentation froala should make this clearer, informing the version of when the 'add' method was introduced.

editor.events.on('paste.before', function (params) {
console.log(params);
})

from vue-froala-wysiwyg.

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.