4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
11 /*global tinymce:true */
13 tinymce.PluginManager.add('emoticons', function(editor, url) {
15 ["cool", "cry", "embarassed", "foot-in-mouth"],
16 ["frown", "innocent", "kiss", "laughing"],
17 ["money-mouth", "sealed", "smile", "surprised"],
18 ["tongue-out", "undecided", "wink", "yell"]
24 emoticonsHtml = '<table role="presentation" class="mce-grid">';
26 tinymce.each(emoticons, function(row) {
27 emoticonsHtml += '<tr>';
29 tinymce.each(row, function(icon) {
30 var emoticonUrl = url + '/img/smiley-' + icon + '.gif';
32 emoticonsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + '" tabindex="-1"><img src="' +
33 emoticonUrl + '" style="width: 18px; height: 18px"></a></td>';
36 emoticonsHtml += '</tr>';
39 emoticonsHtml += '</table>';
44 editor.addButton('emoticons', {
46 popoverAlign: 'bc-tl',
50 onclick: function(e) {
51 var linkElm = editor.dom.getParent(e.target, 'a');
54 editor.insertContent('<img src="' + linkElm.getAttribute('data-mce-url') + '" />');
62 editor.addButton('emoticons', {
64 popoverAlign: 'bc-tl',
71 {type: 'textbox', label: 'Url'},
72 {type: 'button', text: 'OK'}