1 | /*
|
---|
2 | Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
---|
3 | For licensing, see LICENSE.html or http://ckeditor.com/license
|
---|
4 | */
|
---|
5 |
|
---|
6 | CKEDITOR.plugins.add( 'smiley',
|
---|
7 | {
|
---|
8 | requires : [ 'dialog' ],
|
---|
9 |
|
---|
10 | init : function( editor )
|
---|
11 | {
|
---|
12 | editor.config.smiley_path = editor.config.smiley_path || ( this.path + 'images/' );
|
---|
13 | editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley' ) );
|
---|
14 | editor.ui.addButton( 'Smiley',
|
---|
15 | {
|
---|
16 | label : editor.lang.smiley.toolbar,
|
---|
17 | command : 'smiley'
|
---|
18 | });
|
---|
19 | CKEDITOR.dialog.add( 'smiley', this.path + 'dialogs/smiley.js' );
|
---|
20 | }
|
---|
21 | } );
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The base path used to build the URL for the smiley images. It must end with
|
---|
25 | * a slash.
|
---|
26 | * @name CKEDITOR.config.smiley_path
|
---|
27 | * @type String
|
---|
28 | * @default <code><em>CKEDITOR.basePath</em> + 'plugins/smiley/images/'</code>
|
---|
29 | * @example
|
---|
30 | * config.smiley_path = 'http://www.example.com/images/smileys/';
|
---|
31 | * @example
|
---|
32 | * config.smiley_path = '/images/smileys/';
|
---|
33 | */
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * The file names for the smileys to be displayed. These files must be
|
---|
37 | * contained inside the URL path defined with the
|
---|
38 | * {@link CKEDITOR.config.smiley_path} setting.
|
---|
39 | * @type Array
|
---|
40 | * @default (see example)
|
---|
41 | * @example
|
---|
42 | * // This is actually the default value.
|
---|
43 | * config.smiley_images = [
|
---|
44 | * 'regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif',
|
---|
45 | * 'embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif',
|
---|
46 | * 'devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif',
|
---|
47 | * 'broken_heart.gif','kiss.gif','envelope.gif'];
|
---|
48 | */
|
---|
49 | CKEDITOR.config.smiley_images = [
|
---|
50 | 'regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif',
|
---|
51 | 'embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif',
|
---|
52 | 'devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif',
|
---|
53 | 'broken_heart.gif','kiss.gif','envelope.gif'];
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * The description to be used for each of the smileys defined in the
|
---|
57 | * {@link CKEDITOR.config.smiley_images} setting. Each entry in this array list
|
---|
58 | * must match its relative pair in the {@link CKEDITOR.config.smiley_images}
|
---|
59 | * setting.
|
---|
60 | * @type Array
|
---|
61 | * @default The textual descriptions of smiley.
|
---|
62 | * @example
|
---|
63 | * // Default settings.
|
---|
64 | * config.smiley_descriptions =
|
---|
65 | * [
|
---|
66 | * 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise',
|
---|
67 | * 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no',
|
---|
68 | * 'yes', 'heart', 'broken heart', 'kiss', 'mail'
|
---|
69 | * ];
|
---|
70 | * @example
|
---|
71 | * // Use textual emoticons as description.
|
---|
72 | * config.smiley_descriptions =
|
---|
73 | * [
|
---|
74 | * ':)', ':(', ';)', ':D', ':/', ':P', ':*)', ':-o',
|
---|
75 | * ':|', '>:(', 'o:)', '8-)', '>:-)', ';(', '', '', '',
|
---|
76 | * '', '', ':-*', ''
|
---|
77 | * ];
|
---|
78 | */
|
---|
79 | CKEDITOR.config.smiley_descriptions =
|
---|
80 | [
|
---|
81 | 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise',
|
---|
82 | 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no',
|
---|
83 | 'yes', 'heart', 'broken heart', 'kiss', 'mail'
|
---|
84 | ];
|
---|
85 |
|
---|
86 | /**
|
---|
87 | * The number of columns to be generated by the smilies matrix.
|
---|
88 | * @name CKEDITOR.config.smiley_columns
|
---|
89 | * @type Number
|
---|
90 | * @default 8
|
---|
91 | * @since 3.3.2
|
---|
92 | * @example
|
---|
93 | * config.smiley_columns = 6;
|
---|
94 | */
|
---|