Defined links

The plugin adds select input to the link inserting popup and from it you can select predefined links.

    Demo

    Add a link to the text by selecting it from a predefined list in the link popup.

    Code

    <!DOCTYPE html>
    <html>
        <head>
            <title>Article Editor</title>
            <meta charset="utf-8">
    
            <!-- css -->
            <link rel="stylesheet" href="/your-article-dist-path/article-editor.css" />
        </head>
        <body>
            <!-- element -->
            <textarea id="entry">...</textarea>
    
            <!-- js -->
            <script src="/your-article-dist-path/article-editor.js"></script>
            <script src="/your-article-dist-path/plugins/definedlinks.js"></script>
    
            <!-- call -->
            <script>
            ArticleEditor('#entry', {
                plugins: ['definedlinks'],
                css: '/your-article-dist-path/',
                definedlinks: {
                    items: [
                        { "name": "Select...", "url": false },
                        { "name": "Google", "url": "http://google.com" },
                        { "name": "Home", "url": "/" },
                        { "name": "About", "url": "/about/" },
                        { "name": "Contact", "url": "/contact/" }
                    ]
                }
            });
            </script>
        </body>
    </html>