jquery.mentionsInput and ckEditor

2019-05-10 12:41发布

问题:

This is just to help the people who is looking for something like mentions in ckeditor.

I modified jquery.mentionsInput to work together with ckEditor and .. It is working :)

You can see this online: http://jsfiddle.net/us6qo3Lc/ (type: @ken)

<head>
    <meta charset="utf-8">
    <script src="jquery-1.11.0.min.js"></script>
    <script src="ckeditor.js"></script>
    <link href="sample.css" rel="stylesheet">

    <link href='jquery.mentionsInput.css' rel='stylesheet' type='text/css'>
    <script src='underscore-min.js' type='text/javascript'></script>

    <script src='autocomplete.js' type='text/javascript'></script>
</head>
<body>
    <form action="sample_posteddata.php" method="post">
        <textarea class="mention" cols="80" id="editor1" name="editor1" rows="10">
            teste <b>teste</b> teste <em>teste</em> teste
        </textarea>
        <p style="overflow: hidden">
            <input style="float: left" type="submit" value="Submit">
        </p>
    </form>
</body>
</html>

autocomplete.js is the code I created and it is in fiddle, ok ?

Well if someone with time, and knowledge, improve the code and maybe create a specific plugin with this .. I think the entire comunity will love.

I know the code is a mess .. so there are some space to improve it :)

I hope this help somebody .. thanks :)

回答1:

I'm also interested in this so as a first step I added back all the comments from jquery.mentionsInput.js into your source.

http://jsfiddle.net/45k0ypwr/1/

I tried adding it as an embedded sample but stacksnippets.net does not like it

<form action="sample_posteddata.php" method="post">
    <textarea class="mention" cols="80" id="editor1" name="editor1" rows="10">
        teste <b>teste</b> teste <em>teste</em> teste
    </textarea>

    <p style="overflow: hidden">
        <input style="float: left" type="submit" value="Submit">
    </p>
</form>