4

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 :)

Diogo
  • 41
  • 3
  • 2
    How to answer to such *question*? – ZygD May 08 '15 at 20:04
  • I didn't know where to put this information (ckeditor forum is read only). So I created a post here just to help other people. Sorry if I did something wrong. – Diogo May 10 '15 at 13:40
  • Hi i was trying to get autocompletion inside ckeditor , but its not working , i given mention class for the textarea and giveb the js you given in the fiddle as 'jquery_mention.js' and included in the same file . Actually the textarea is hidden under the ckeditor iframe right ? how does it work ? – KTM Sep 16 '15 at 12:48
  • Did you look the example ? http://jsfiddle.net/us6qo3Lc/ – Diogo Sep 17 '15 at 13:32

1 Answers1

2

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>
Ballsacian1
  • 17,214
  • 2
  • 26
  • 25
  • how can i modify the added name with `@` (which will be easy other user to identify that someone has tagged) and also adding link to the name( link to user profile) – Rohan Khude Nov 06 '17 at 14:10