]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/debian/missing-sources/framework/Web/Javascripts/source/tinymce-405/plugins/emoticons/plugin.js
baculum: Add missing-sources directory in debian metadata structure
[bacula/bacula] / gui / baculum / debian / missing-sources / framework / Web / Javascripts / source / tinymce-405 / plugins / emoticons / plugin.js
1 /**
2  * plugin.js
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                 ["cool", "cry", "embarassed", "foot-in-mouth"],
16                 ["frown", "innocent", "kiss", "laughing"],
17                 ["money-mouth", "sealed", "smile", "surprised"],
18                 ["tongue-out", "undecided", "wink", "yell"]
19         ];
20
21         function getHtml() {
22                 var emoticonsHtml;
23
24                 emoticonsHtml = '<table role="presentation" class="mce-grid">';
25
26                 tinymce.each(emoticons, function(row) {
27                         emoticonsHtml += '<tr>';
28
29                         tinymce.each(row, function(icon) {
30                                 var emoticonUrl = url + '/img/smiley-' + icon + '.gif';
31
32                                 emoticonsHtml += '<td><a href="#" data-mce-url="' + emoticonUrl + '" tabindex="-1"><img src="' +
33                                         emoticonUrl + '" style="width: 18px; height: 18px"></a></td>';
34                         });
35
36                         emoticonsHtml += '</tr>';
37                 });
38
39                 emoticonsHtml += '</table>';
40
41                 return emoticonsHtml;
42         }
43
44         editor.addButton('emoticons', {
45                 type: 'panelbutton',
46                 popoverAlign: 'bc-tl',
47                 panel: {
48                         autohide: true,
49                         html: getHtml,
50                         onclick: function(e) {
51                                 var linkElm = editor.dom.getParent(e.target, 'a');
52
53                                 if (linkElm) {
54                                         editor.insertContent('<img src="' + linkElm.getAttribute('data-mce-url') + '" />');
55                                         this.hide();
56                                 }
57                         }
58                 },
59                 tooltip: 'Emoticons'
60         });
61 /*
62         editor.addButton('emoticons', {
63                 type: 'panelbutton',
64                 popoverAlign: 'bc-tl',
65                 panel: {
66                         layout: 'flex',
67                         spacing: 5,
68                         padding: 5,
69                         autohide: true,
70                         items: [
71                                 {type: 'textbox', label: 'Url'},
72                                 {type: 'button', text: 'OK'}
73                         ]
74                 },
75                 tooltip: 'Emoticons'
76         });*/
77 });