PluginProbe ʕ •ᴥ•ʔ
Advanced Editor Tools / 4.3.8
Advanced Editor Tools v4.3.8
trunk 1.0 1.0.1 2.0 2.2 3.0 3.0.1 3.1 3.2 3.2.4 3.2.7 3.3.9 3.3.9.1 3.3.9.2 3.4.2 3.4.2.1 3.4.5 3.4.5.1 3.4.9 3.5.8 3.5.9 3.5.9.1 4.0 4.0.1 4.0.2 4.1 4.1.1 4.1.7 4.1.9 4.2.3 4.2.3.1 4.2.5 4.2.8 4.3.10 4.3.10.1 4.3.8 4.4.1 4.4.3 4.5.6 4.6.3 4.6.7 4.7.11 4.8.0 4.8.1 4.8.2 5.0.0 5.0.1 5.1.0 5.2 5.2.1 5.3 5.4.0 5.5.0 5.5.1 5.6.0 5.9.0 5.9.1 5.9.2
tinymce-advanced / mce / emoticons / plugin.js
tinymce-advanced / mce / emoticons Last commit date
img 12 years ago plugin.js 10 years ago plugin.min.js 10 years ago
plugin.js
88 lines
1 /**
2 * plugin.js (edited for WP)
3 *
4 * Copyright, Moxiecode Systems AB
5 * Released under LGPL License.
6 *
7 * License: http://www.tinymce.com/license
8 * Contributing: http://www.tinymce.com/contributing
9 */
10
11 /*global tinymce:true */
12
13 tinymce.PluginManager.add('emoticons', function(editor, url) {
14 var emoticons = [{
15 smile: ':-)',
16 razz: ':-P',
17 cool: '8-)',
18 wink: ';-)',
19 biggrin: ':-D'
20 },
21 {
22 twisted: ':twisted:',
23 mrgreen: ':mrgreen:',
24 lol: ':lol:',
25 rolleyes: ':roll:',
26 confused: ':-?'
27 },
28 {
29 cry: ':cry:',
30 surprised: ':-o',
31 evil: ':evil:',
32 neutral: ':-|',
33 redface: ':oops:'
34 },
35 {
36 mad: ':-x',
37 eek: '8-O',
38 sad: ':-(',
39 arrow: ':arrow:',
40 idea: ':idea:'
41 }];
42
43 function getHtml() {
44 var emoticonsHtml;
45
46 emoticonsHtml = '<table role="list" class="mce-grid">';
47
48 tinymce.each(emoticons, function( row ) {
49 emoticonsHtml += '<tr>';
50
51 tinymce.each( row, function( icon, name ) {
52 var emoticonUrl = url + '/img/icon_' + name + '.gif';
53
54 emoticonsHtml += '<td><a href="#" data-mce-alt="' + icon + '" tabindex="-1" ' +
55 'role="option" aria-label="' + icon + '"><img src="' +
56 emoticonUrl + '" style="width: 15px; height: 15px; padding: 3px;" role="presentation" alt="' + icon + '" /></a></td>';
57 });
58
59 emoticonsHtml += '</tr>';
60 });
61
62 emoticonsHtml += '</table>';
63
64 return emoticonsHtml;
65 }
66
67 editor.addButton('emoticons', {
68 type: 'panelbutton',
69 panel: {
70 role: 'application',
71 autohide: true,
72 html: getHtml,
73 onclick: function(e) {
74 var linkElm = editor.dom.getParent( e.target, 'a' );
75
76 if ( linkElm ) {
77 editor.insertContent(
78 ' ' + linkElm.getAttribute('data-mce-alt') + ' '
79 );
80
81 this.hide();
82 }
83 }
84 },
85 tooltip: 'Emoticons'
86 });
87 });
88