diff options
Diffstat (limited to 'sources/plugins/smiley/plugin.js')
-rw-r--r-- | sources/plugins/smiley/plugin.js | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/sources/plugins/smiley/plugin.js b/sources/plugins/smiley/plugin.js new file mode 100644 index 00000000..be8b20db --- /dev/null +++ b/sources/plugins/smiley/plugin.js | |||
@@ -0,0 +1,98 @@ | |||
1 | /** | ||
2 | * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license | ||
4 | */ | ||
5 | |||
6 | CKEDITOR.plugins.add( 'smiley', { | ||
7 | requires: 'dialog', | ||
8 | // jscs:disable maximumLineLength | ||
9 | lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE% | ||
10 | // jscs:enable maximumLineLength | ||
11 | icons: 'smiley', // %REMOVE_LINE_CORE% | ||
12 | hidpi: true, // %REMOVE_LINE_CORE% | ||
13 | init: function( editor ) { | ||
14 | editor.config.smiley_path = editor.config.smiley_path || ( this.path + 'images/' ); | ||
15 | editor.addCommand( 'smiley', new CKEDITOR.dialogCommand( 'smiley', { | ||
16 | allowedContent: 'img[alt,height,!src,title,width]', | ||
17 | requiredContent: 'img' | ||
18 | } ) ); | ||
19 | editor.ui.addButton && editor.ui.addButton( 'Smiley', { | ||
20 | label: editor.lang.smiley.toolbar, | ||
21 | command: 'smiley', | ||
22 | toolbar: 'insert,50' | ||
23 | } ); | ||
24 | CKEDITOR.dialog.add( 'smiley', this.path + 'dialogs/smiley.js' ); | ||
25 | } | ||
26 | } ); | ||
27 | |||
28 | /** | ||
29 | * The base path used to build the URL for the smiley images. It must end with a slash. | ||
30 | * | ||
31 | * config.smiley_path = 'http://www.example.com/images/smileys/'; | ||
32 | * | ||
33 | * config.smiley_path = '/images/smileys/'; | ||
34 | * | ||
35 | * @cfg {String} [smiley_path=CKEDITOR.basePath + 'plugins/smiley/images/'] | ||
36 | * @member CKEDITOR.config | ||
37 | */ | ||
38 | |||
39 | /** | ||
40 | * The file names for the smileys to be displayed. These files must be | ||
41 | * contained inside the URL path defined with the {@link #smiley_path} setting. | ||
42 | * | ||
43 | * // This is actually the default value. | ||
44 | * config.smiley_images = [ | ||
45 | * 'regular_smile.png','sad_smile.png','wink_smile.png','teeth_smile.png','confused_smile.png','tongue_smile.png', | ||
46 | * 'embarrassed_smile.png','omg_smile.png','whatchutalkingabout_smile.png','angry_smile.png','angel_smile.png','shades_smile.png', | ||
47 | * 'devil_smile.png','cry_smile.png','lightbulb.png','thumbs_down.png','thumbs_up.png','heart.png', | ||
48 | * 'broken_heart.png','kiss.png','envelope.png' | ||
49 | * ]; | ||
50 | * | ||
51 | * @cfg | ||
52 | * @member CKEDITOR.config | ||
53 | */ | ||
54 | CKEDITOR.config.smiley_images = [ | ||
55 | 'regular_smile.png', 'sad_smile.png', 'wink_smile.png', 'teeth_smile.png', 'confused_smile.png', 'tongue_smile.png', | ||
56 | 'embarrassed_smile.png', 'omg_smile.png', 'whatchutalkingabout_smile.png', 'angry_smile.png', 'angel_smile.png', 'shades_smile.png', | ||
57 | 'devil_smile.png', 'cry_smile.png', 'lightbulb.png', 'thumbs_down.png', 'thumbs_up.png', 'heart.png', | ||
58 | 'broken_heart.png', 'kiss.png', 'envelope.png' | ||
59 | ]; | ||
60 | |||
61 | /** | ||
62 | * The description to be used for each of the smileys defined in the | ||
63 | * {@link CKEDITOR.config#smiley_images} setting. Each entry in this array list | ||
64 | * must match its relative pair in the {@link CKEDITOR.config#smiley_images} | ||
65 | * setting. | ||
66 | * | ||
67 | * // Default settings. | ||
68 | * config.smiley_descriptions = [ | ||
69 | * 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', | ||
70 | * 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', | ||
71 | * 'yes', 'heart', 'broken heart', 'kiss', 'mail' | ||
72 | * ]; | ||
73 | * | ||
74 | * // Use textual emoticons as description. | ||
75 | * config.smiley_descriptions = [ | ||
76 | * ':)', ':(', ';)', ':D', ':/', ':P', ':*)', ':-o', | ||
77 | * ':|', '>:(', 'o:)', '8-)', '>:-)', ';(', '', '', '', | ||
78 | * '', '', ':-*', '' | ||
79 | * ]; | ||
80 | * | ||
81 | * @cfg | ||
82 | * @member CKEDITOR.config | ||
83 | */ | ||
84 | CKEDITOR.config.smiley_descriptions = [ | ||
85 | 'smiley', 'sad', 'wink', 'laugh', 'frown', 'cheeky', 'blush', 'surprise', | ||
86 | 'indecision', 'angry', 'angel', 'cool', 'devil', 'crying', 'enlightened', 'no', | ||
87 | 'yes', 'heart', 'broken heart', 'kiss', 'mail' | ||
88 | ]; | ||
89 | |||
90 | /** | ||
91 | * The number of columns to be generated by the smilies matrix. | ||
92 | * | ||
93 | * config.smiley_columns = 6; | ||
94 | * | ||
95 | * @since 3.3.2 | ||
96 | * @cfg {Number} [smiley_columns=8] | ||
97 | * @member CKEDITOR.config | ||
98 | */ | ||