glebtv-ckeditor 4.0.2.4 → 4.0.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  module Ckeditor
2
2
  module Version
3
- GEM = "4.0.2.4".freeze
3
+ GEM = "4.0.2.5".freeze
4
4
  EDITOR = "4.0.2".freeze
5
5
  end
6
6
  end
@@ -28,7 +28,7 @@ CKEDITOR.editorConfig = function( config )
28
28
  config.filebrowserUploadUrl = "/ckeditor/attachment_files";
29
29
 
30
30
  config.stylesSet = [];
31
- config.extraPlugins = "colordialog,font,magicline,codemirror,mediaembed,stylesheetparser,LoremIpsum,CKCss";
31
+ config.extraPlugins = "colorbutton,colordialog,font,magicline,codemirror,mediaembed,stylesheetparser,LoremIpsum,CKCss";
32
32
  config.contentsCss = "<%= stylesheet_path('ckcontent.css') %>";
33
33
 
34
34
  // Rails CSRF token
@@ -51,7 +51,7 @@ CKEDITOR.editorConfig = function( config )
51
51
  config.toolbar_CMS =
52
52
  [
53
53
  ['Source'], ['RemoveFormat'], ['PasteText','PasteFromWord'], ['Undo','Redo'],
54
- ['Styles','Format','Font','FontSize'],
54
+ ['Styles','Format','Font','FontSize', 'TextColor', 'BGColor'],
55
55
  ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
56
56
  '/',
57
57
  ['Bold','Italic','Underline'], ['NumberedList','BulletedList','Blockquote'],
@@ -0,0 +1,53 @@
1
+ /*
2
+ Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+ CKEDITOR.plugins.setLang( 'colorbutton', 'en', {
6
+ auto: 'Automatic',
7
+ bgColorTitle: 'Background Color',
8
+ colors: {
9
+ '000': 'Black',
10
+ '800000': 'Maroon',
11
+ '8B4513': 'Saddle Brown',
12
+ '2F4F4F': 'Dark Slate Gray',
13
+ '008080': 'Teal',
14
+ '000080': 'Navy',
15
+ '4B0082': 'Indigo',
16
+ '696969': 'Dark Gray',
17
+ B22222: 'Fire Brick',
18
+ A52A2A: 'Brown',
19
+ DAA520: 'Golden Rod',
20
+ '006400': 'Dark Green',
21
+ '40E0D0': 'Turquoise',
22
+ '0000CD': 'Medium Blue',
23
+ '800080': 'Purple',
24
+ '808080': 'Gray',
25
+ F00: 'Red',
26
+ FF8C00: 'Dark Orange',
27
+ FFD700: 'Gold',
28
+ '008000': 'Green',
29
+ '0FF': 'Cyan',
30
+ '00F': 'Blue',
31
+ EE82EE: 'Violet',
32
+ A9A9A9: 'Dim Gray',
33
+ FFA07A: 'Light Salmon',
34
+ FFA500: 'Orange',
35
+ FFFF00: 'Yellow',
36
+ '00FF00': 'Lime',
37
+ AFEEEE: 'Pale Turquoise',
38
+ ADD8E6: 'Light Blue',
39
+ DDA0DD: 'Plum',
40
+ D3D3D3: 'Light Grey',
41
+ FFF0F5: 'Lavender Blush',
42
+ FAEBD7: 'Antique White',
43
+ FFFFE0: 'Light Yellow',
44
+ F0FFF0: 'Honeydew',
45
+ F0FFFF: 'Azure',
46
+ F0F8FF: 'Alice Blue',
47
+ E6E6FA: 'Lavender',
48
+ FFF: 'White'
49
+ },
50
+ more: 'More Colors...',
51
+ panelTitle: 'Colors',
52
+ textColorTitle: 'Text Color'
53
+ });
@@ -0,0 +1,53 @@
1
+ /*
2
+ Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
3
+ For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+ CKEDITOR.plugins.setLang( 'colorbutton', 'ru', {
6
+ auto: 'Автоматически',
7
+ bgColorTitle: 'Цвет фона',
8
+ colors: {
9
+ '000': 'Чёрный',
10
+ '800000': 'Бордовый',
11
+ '8B4513': 'Кожано-коричневый',
12
+ '2F4F4F': 'Темный синевато-серый',
13
+ '008080': 'Сине-зелёный',
14
+ '000080': 'Тёмно-синий',
15
+ '4B0082': 'Индиго',
16
+ '696969': 'Тёмно-серый',
17
+ B22222: 'Кирпичный',
18
+ A52A2A: 'Коричневый',
19
+ DAA520: 'Золотисто-берёзовый',
20
+ '006400': 'Темно-зелёный',
21
+ '40E0D0': 'Бирюзовый',
22
+ '0000CD': 'Умеренно синий',
23
+ '800080': 'Пурпурный',
24
+ '808080': 'Серый',
25
+ F00: 'Красный',
26
+ FF8C00: 'Темно-оранжевый',
27
+ FFD700: 'Золотистый',
28
+ '008000': 'Зелёный',
29
+ '0FF': 'Васильковый',
30
+ '00F': 'Синий',
31
+ EE82EE: 'Фиолетовый',
32
+ A9A9A9: 'Тускло-серый',
33
+ FFA07A: 'Светло-лососевый',
34
+ FFA500: 'Оранжевый',
35
+ FFFF00: 'Жёлтый',
36
+ '00FF00': 'Лайма',
37
+ AFEEEE: 'Бледно-синий',
38
+ ADD8E6: 'Свелто-голубой',
39
+ DDA0DD: 'Сливовый',
40
+ D3D3D3: 'Светло-серый',
41
+ FFF0F5: 'Розово-лавандовый',
42
+ FAEBD7: 'Античный белый',
43
+ FFFFE0: 'Светло-жёлтый',
44
+ F0FFF0: 'Медвяной росы',
45
+ F0FFFF: 'Лазурный',
46
+ F0F8FF: 'Бледно-голубой',
47
+ E6E6FA: 'Лавандовый',
48
+ FFF: 'Белый'
49
+ },
50
+ more: 'Ещё цвета...',
51
+ panelTitle: 'Цвета',
52
+ textColorTitle: 'Цвет текста'
53
+ });
@@ -0,0 +1,273 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
4
+ */
5
+
6
+ /**
7
+ * @fileOverview The "colorbutton" plugin that makes it possible to assign
8
+ * text and background colors to editor contents.
9
+ *
10
+ */
11
+ CKEDITOR.plugins.add( 'colorbutton', {
12
+ requires: 'panelbutton,floatpanel',
13
+ lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh', // %REMOVE_LINE_CORE%
14
+ icons: 'bgcolor,textcolor', // %REMOVE_LINE_CORE%
15
+ init: function( editor ) {
16
+ var config = editor.config,
17
+ lang = editor.lang.colorbutton;
18
+
19
+ var clickFn;
20
+
21
+ if ( !CKEDITOR.env.hc ) {
22
+ addButton( 'TextColor', 'fore', lang.textColorTitle, 10 );
23
+ addButton( 'BGColor', 'back', lang.bgColorTitle, 20 );
24
+ }
25
+
26
+ function addButton( name, type, title, order ) {
27
+ var colorBoxId = CKEDITOR.tools.getNextId() + '_colorBox';
28
+ editor.ui.add( name, CKEDITOR.UI_PANELBUTTON, {
29
+ label: title,
30
+ title: title,
31
+ modes: { wysiwyg:1 },
32
+ editorFocus: 1,
33
+ toolbar: 'colors,' + order,
34
+
35
+ panel: {
36
+ css: CKEDITOR.skin.getPath( 'editor' ),
37
+ attributes: { role: 'listbox', 'aria-label': lang.panelTitle }
38
+ },
39
+
40
+ onBlock: function( panel, block ) {
41
+ block.autoSize = true;
42
+ block.element.addClass( 'cke_colorblock' );
43
+ block.element.setHtml( renderColors( panel, type, colorBoxId ) );
44
+ // The block should not have scrollbars (#5933, #6056)
45
+ block.element.getDocument().getBody().setStyle( 'overflow', 'hidden' );
46
+
47
+ CKEDITOR.ui.fire( 'ready', this );
48
+
49
+ var keys = block.keys;
50
+ var rtl = editor.lang.dir == 'rtl';
51
+ keys[ rtl ? 37 : 39 ] = 'next'; // ARROW-RIGHT
52
+ keys[ 40 ] = 'next'; // ARROW-DOWN
53
+ keys[ 9 ] = 'next'; // TAB
54
+ keys[ rtl ? 39 : 37 ] = 'prev'; // ARROW-LEFT
55
+ keys[ 38 ] = 'prev'; // ARROW-UP
56
+ keys[ CKEDITOR.SHIFT + 9 ] = 'prev'; // SHIFT + TAB
57
+ keys[ 32 ] = 'click'; // SPACE
58
+ },
59
+
60
+ // The automatic colorbox should represent the real color (#6010)
61
+ onOpen: function() {
62
+
63
+ var selection = editor.getSelection(),
64
+ block = selection && selection.getStartElement(),
65
+ path = editor.elementPath( block ),
66
+ color;
67
+
68
+ // Find the closest block element.
69
+ block = path.block || path.blockLimit || editor.document.getBody();
70
+
71
+ // The background color might be transparent. In that case, look up the color in the DOM tree.
72
+ do {
73
+ color = block && block.getComputedStyle( type == 'back' ? 'background-color' : 'color' ) || 'transparent';
74
+ }
75
+ while ( type == 'back' && color == 'transparent' && block && ( block = block.getParent() ) );
76
+
77
+ // The box should never be transparent.
78
+ if ( !color || color == 'transparent' )
79
+ color = '#ffffff';
80
+
81
+ this._.panel._.iframe.getFrameDocument().getById( colorBoxId ).setStyle( 'background-color', color );
82
+
83
+ return color;
84
+ }
85
+ });
86
+ }
87
+
88
+
89
+ function renderColors( panel, type, colorBoxId ) {
90
+ var output = [],
91
+ colors = config.colorButton_colors.split( ',' );
92
+
93
+ var clickFn = CKEDITOR.tools.addFunction( function( color, type ) {
94
+ if ( color == '?' ) {
95
+ var applyColorStyle = arguments.callee;
96
+
97
+ function onColorDialogClose( evt ) {
98
+ this.removeListener( 'ok', onColorDialogClose );
99
+ this.removeListener( 'cancel', onColorDialogClose );
100
+
101
+ evt.name == 'ok' && applyColorStyle( this.getContentElement( 'picker', 'selectedColor' ).getValue(), type );
102
+ }
103
+
104
+ editor.openDialog( 'colordialog', function() {
105
+ this.on( 'ok', onColorDialogClose );
106
+ this.on( 'cancel', onColorDialogClose );
107
+ });
108
+
109
+ return;
110
+ }
111
+
112
+ editor.focus();
113
+
114
+ panel.hide();
115
+
116
+ editor.fire( 'saveSnapshot' );
117
+
118
+ // Clean up any conflicting style within the range.
119
+ editor.removeStyle( new CKEDITOR.style( config[ 'colorButton_' + type + 'Style' ], { color: 'inherit' } ) );
120
+
121
+ if ( color ) {
122
+ var colorStyle = config[ 'colorButton_' + type + 'Style' ];
123
+
124
+ colorStyle.childRule = type == 'back' ?
125
+ function( element ) {
126
+ // It's better to apply background color as the innermost style. (#3599)
127
+ // Except for "unstylable elements". (#6103)
128
+ return isUnstylable( element );
129
+ } : function( element ) {
130
+ // Fore color style must be applied inside links instead of around it. (#4772,#6908)
131
+ return !( element.is( 'a' ) || element.getElementsByTag( 'a' ).count() ) || isUnstylable( element );
132
+ };
133
+
134
+ editor.applyStyle( new CKEDITOR.style( colorStyle, { color: color } ) );
135
+ }
136
+
137
+ editor.fire( 'saveSnapshot' );
138
+ });
139
+
140
+ // Render the "Automatic" button.
141
+ output.push( '<a class="cke_colorauto" _cke_focus=1 hidefocus=true' +
142
+ ' title="', lang.auto, '"' +
143
+ ' onclick="CKEDITOR.tools.callFunction(', clickFn, ',null,\'', type, '\');return false;"' +
144
+ ' href="javascript:void(\'', lang.auto, '\')"' +
145
+ ' role="option">' +
146
+ '<table role="presentation" cellspacing=0 cellpadding=0 width="100%">' +
147
+ '<tr>' +
148
+ '<td>' +
149
+ '<span class="cke_colorbox" id="', colorBoxId, '"></span>' +
150
+ '</td>' +
151
+ '<td colspan=7 align=center>', lang.auto, '</td>' +
152
+ '</tr>' +
153
+ '</table>' +
154
+ '</a>' +
155
+ '<table role="presentation" cellspacing=0 cellpadding=0 width="100%">' );
156
+
157
+ // Render the color boxes.
158
+ for ( var i = 0; i < colors.length; i++ ) {
159
+ if ( ( i % 8 ) === 0 )
160
+ output.push( '</tr><tr>' );
161
+
162
+ var parts = colors[ i ].split( '/' ),
163
+ colorName = parts[ 0 ],
164
+ colorCode = parts[ 1 ] || colorName;
165
+
166
+ // The data can be only a color code (without #) or colorName + color code
167
+ // If only a color code is provided, then the colorName is the color with the hash
168
+ // Convert the color from RGB to RRGGBB for better compatibility with IE and <font>. See #5676
169
+ if ( !parts[ 1 ] )
170
+ colorName = '#' + colorName.replace( /^(.)(.)(.)$/, '$1$1$2$2$3$3' );
171
+
172
+ var colorLabel = editor.lang.colorbutton.colors[ colorCode ] || colorCode;
173
+ output.push( '<td>' +
174
+ '<a class="cke_colorbox" _cke_focus=1 hidefocus=true' +
175
+ ' title="', colorLabel, '"' +
176
+ ' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'', colorName, '\',\'', type, '\'); return false;"' +
177
+ ' href="javascript:void(\'', colorLabel, '\')"' +
178
+ ' role="option">' +
179
+ '<span class="cke_colorbox" style="background-color:#', colorCode, '"></span>' +
180
+ '</a>' +
181
+ '</td>' );
182
+ }
183
+
184
+ // Render the "More Colors" button.
185
+ if ( editor.plugins.colordialog && config.colorButton_enableMore === undefined || config.colorButton_enableMore ) {
186
+ output.push( '</tr>' +
187
+ '<tr>' +
188
+ '<td colspan=8 align=center>' +
189
+ '<a class="cke_colormore" _cke_focus=1 hidefocus=true' +
190
+ ' title="', lang.more, '"' +
191
+ ' onclick="CKEDITOR.tools.callFunction(', clickFn, ',\'?\',\'', type, '\');return false;"' +
192
+ ' href="javascript:void(\'', lang.more, '\')"', ' role="option">', lang.more, '</a>' +
193
+ '</td>' ); // tr is later in the code.
194
+ }
195
+
196
+ output.push( '</tr></table>' );
197
+
198
+ return output.join( '' );
199
+ }
200
+
201
+ function isUnstylable( ele ) {
202
+ return ( ele.getAttribute( 'contentEditable' ) == 'false' ) || ele.getAttribute( 'data-nostyle' );
203
+ }
204
+ }
205
+ });
206
+
207
+ /**
208
+ * Whether to enable the **More Colors*** button in the color selectors.
209
+ *
210
+ * config.colorButton_enableMore = false;
211
+ *
212
+ * @cfg {Boolean} [colorButton_enableMore=true]
213
+ * @member CKEDITOR.config
214
+ */
215
+
216
+ /**
217
+ * Defines the colors to be displayed in the color selectors. This is a string
218
+ * containing hexadecimal notation for HTML colors, without the `'#'` prefix.
219
+ *
220
+ * **Since 3.3:** A color name may optionally be defined by prefixing the entries with
221
+ * a name and the slash character. For example, `'FontColor1/FF9900'` will be
222
+ * displayed as the color `#FF9900` in the selector, but will be output as `'FontColor1'`.
223
+ *
224
+ * // Brazil colors only.
225
+ * config.colorButton_colors = '00923E,F8C100,28166F';
226
+ *
227
+ * config.colorButton_colors = 'FontColor1/FF9900,FontColor2/0066CC,FontColor3/F00';
228
+ *
229
+ * @cfg {String} [colorButton_colors=see source]
230
+ * @member CKEDITOR.config
231
+ */
232
+ CKEDITOR.config.colorButton_colors = '000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,' +
233
+ 'B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,' +
234
+ 'F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,' +
235
+ 'FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,' +
236
+ 'FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';
237
+
238
+ /**
239
+ * Stores the style definition that applies the text foreground color.
240
+ *
241
+ * // This is actually the default value.
242
+ * config.colorButton_foreStyle = {
243
+ * element: 'span',
244
+ * styles: { color: '#(color)' }
245
+ * };
246
+ *
247
+ * @cfg [colorButton_foreStyle=see source]
248
+ * @member CKEDITOR.config
249
+ */
250
+ CKEDITOR.config.colorButton_foreStyle = {
251
+ element: 'span',
252
+ styles: { 'color': '#(color)' },
253
+ overrides: [ {
254
+ element: 'font', attributes: { 'color': null }
255
+ }]
256
+ };
257
+
258
+ /**
259
+ * Stores the style definition that applies the text background color.
260
+ *
261
+ * // This is actually the default value.
262
+ * config.colorButton_backStyle = {
263
+ * element: 'span',
264
+ * styles: { 'background-color': '#(color)' }
265
+ * };
266
+ *
267
+ * @cfg [colorButton_backStyle=see source]
268
+ * @member CKEDITOR.config
269
+ */
270
+ CKEDITOR.config.colorButton_backStyle = {
271
+ element: 'span',
272
+ styles: { 'background-color': '#(color)' }
273
+ };
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glebtv-ckeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2.4
4
+ version: 4.0.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -131,6 +131,11 @@ files:
131
131
  - vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js
132
132
  - vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/en.js
133
133
  - vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/ru.js
134
+ - vendor/assets/javascripts/ckeditor/plugins/colorbutton/icons/bgcolor.png
135
+ - vendor/assets/javascripts/ckeditor/plugins/colorbutton/icons/textcolor.png
136
+ - vendor/assets/javascripts/ckeditor/plugins/colorbutton/plugin.js
137
+ - vendor/assets/javascripts/ckeditor/plugins/colorbutton/lang/en.js
138
+ - vendor/assets/javascripts/ckeditor/plugins/colorbutton/lang/ru.js
134
139
  - vendor/assets/javascripts/ckeditor/plugins/fakeobjects/images/spacer.gif
135
140
  - vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js
136
141
  - vendor/assets/javascripts/ckeditor/plugins/image/images/noimage.png