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