-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
plugin.js
697 lines (580 loc) · 21 KB
/
plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
/**
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
( function() {
'use strict';
var stylesLoaded = false,
WIDGET_NAME = 'easyimage',
BUTTON_PREFIX = 'EasyImage',
SUPPORTED_IMAGE_TYPES = [ 'jpeg', 'png', 'gif', 'bmp' ];
function capitalize( str ) {
return CKEDITOR.tools.capitalize( str, true );
}
function getStylesForEditor( editor ) {
var defaultStyles = {
full: {
attributes: {
'class': 'easyimage-full'
},
label: editor.lang.easyimage.commands.fullImage
},
side: {
attributes: {
'class': 'easyimage-side'
},
label: editor.lang.easyimage.commands.sideImage
},
alignLeft: {
attributes: {
'class': 'easyimage-align-left'
},
label: editor.lang.common.alignLeft
},
alignCenter: {
attributes: {
'class': 'easyimage-align-center'
},
label: editor.lang.common.alignCenter
},
alignRight: {
attributes: {
'class': 'easyimage-align-right'
},
label: editor.lang.common.alignRight
}
};
return CKEDITOR.tools.object.merge( defaultStyles, editor.config.easyimage_styles );
}
function addCommands( editor, styles ) {
function createCommandRefresh( enableCheck ) {
return function( editor, path ) {
var widget = editor.widgets.focused,
newState = CKEDITOR.TRISTATE_DISABLED;
if ( widget && widget.name === WIDGET_NAME ) {
var callbackResolution = enableCheck && enableCheck.call( this, widget, editor, path );
newState = callbackResolution ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
}
this.setState( newState );
};
}
function createStyleCommand( editor, name, styleDefinition, commandName ) {
styleDefinition.type = 'widget';
styleDefinition.widget = 'easyimage';
styleDefinition.group = styleDefinition.group || 'easyimage';
styleDefinition.element = 'figure';
var style = new CKEDITOR.style( styleDefinition );
editor.filter.allow( style );
// At this point cmd should be treated more as a definition due to #1582.
var cmd = new CKEDITOR.styleCommand( style );
cmd.contextSensitive = true;
cmd.refresh = createCommandRefresh( function( widget, editor, path ) {
return this.style.checkActive( path, editor );
} );
editor.addCommand( commandName, cmd );
// Command needs to be refetched. Calling addCommand will… create a new command.
cmd = editor.getCommand( commandName );
// Enable is called at multiple occasions, especially in editor#mode event listeners.
// Unfortunately it's even called with a timeout there.
cmd.enable = function() {};
// Without this the command is inited with a wrong state.
cmd.refresh( editor, editor.elementPath() );
return cmd;
}
function addDefaultCommands() {
editor.addCommand( 'easyimageAlt', new CKEDITOR.dialogCommand( 'easyimageAlt', {
startDisabled: true,
contextSensitive: true,
refresh: createCommandRefresh()
} ) );
}
function addStylesCommands( styles ) {
// Returns key of style associated with a given command or null if none.
function getStyleNameFromCommand( commandName, styles ) {
var match = commandName.match( /^easyimage(.+)$/ );
if ( match ) {
var lowered = ( match[ 1 ][ 0 ] || '' ).toLowerCase() + match[ 1 ].substr( 1 );
if ( match[ 1 ] in styles ) {
return match[ 1 ];
} else if ( lowered in styles ) {
return lowered;
}
}
return null;
}
// These commands must trigger refresh.
editor.on( 'afterCommandExec', function( evt ) {
if ( getStyleNameFromCommand( evt.data.name, styles ) ) {
editor.forceNextSelectionCheck();
editor.selectionChange( true );
}
} );
editor.on( 'beforeCommandExec', function( evt ) {
// Style commands should not be toggled.
if ( getStyleNameFromCommand( evt.data.name, styles ) && evt.data.command.style.checkActive( evt.editor.elementPath(), editor ) ) {
evt.cancel();
// Editor needs to be focused, otherwise balloon toolbar will hide.
editor.focus();
}
} );
for ( var style in styles ) {
createStyleCommand( editor, style, styles[ style ], 'easyimage' + capitalize( style ) );
}
}
addDefaultCommands();
addStylesCommands( styles );
}
function addButtons( editor, styles ) {
function addDefaultButtons() {
editor.ui.addButton( BUTTON_PREFIX + 'Alt', {
label: editor.lang.easyimage.commands.altText,
command: 'easyimageAlt',
toolbar: 'easyimage,3'
} );
}
function addStylesButtons( styles ) {
var style;
for ( style in styles ) {
editor.ui.addButton( BUTTON_PREFIX + capitalize( style ), {
label: styles[ style ].label,
command: 'easyimage' + capitalize( style ),
toolbar: 'easyimage,99',
icon: styles[ style ].icon,
iconHiDpi: styles[ style ].iconHiDpi
} );
}
}
addDefaultButtons();
addStylesButtons( styles );
}
function addToolbar( editor ) {
var buttons = editor.config.easyimage_toolbar;
editor._.easyImageToolbarContext = editor.balloonToolbars.create( {
buttons: buttons.join ? buttons.join( ',' ) : buttons,
widgets: [ WIDGET_NAME ]
} );
}
function addContextMenuItems( editor ) {
var buttons = editor.config.easyimage_toolbar;
if ( !editor.plugins.contextmenu ) {
return;
}
if ( buttons.split ) {
buttons = buttons.split( ',' );
}
editor.addMenuGroup( 'easyimage' );
CKEDITOR.tools.array.forEach( buttons, function( button ) {
button = editor.ui.items[ button ];
editor.addMenuItem( button.name, {
label: button.label,
command: button.command,
group: 'easyimage'
} );
} );
}
function updateMenuItemsStates( evt ) {
var editor = evt.sender.editor,
buttons = editor.config.easyimage_toolbar;
if ( buttons.split ) {
buttons = buttons.split( ',' );
}
CKEDITOR.tools.array.forEach( buttons, function( button ) {
button = editor.ui.items[ button ];
evt.data[ button.name ] = editor.getCommand( button.command ).state;
} );
}
function registerWidget( editor, styles ) {
var config = editor.config,
figureClass = config.easyimage_class,
widgetDefinition = {
name: WIDGET_NAME,
allowedContent: {
figure: {
classes: config.easyimage_sideClass
},
img: {
attributes: '!src,srcset,alt,width,sizes'
}
},
requiredContent: 'figure; img[!src]',
styleableElements: 'figure',
supportedTypes: new RegExp( 'image/(' + SUPPORTED_IMAGE_TYPES.join( '|' ) + ')', 'i' ),
loaderType: CKEDITOR.plugins.cloudservices.cloudServicesLoader,
progressReporterType: CKEDITOR.plugins.imagebase.progressBar,
upcasts: {
figure: function( element ) {
if ( ( !figureClass || element.hasClass( figureClass ) ) &&
element.find( 'img', true ).length === 1 ) {
return element;
}
}
},
init: function() {
// Natural width of the image can be fetched only after image is loaded.
// However cached images won't fire `load` event, but just mark themselves
// as complete.
function getNaturalWidth( image, callback ) {
var $image = image.$;
if ( $image.complete && $image.naturalWidth ) {
return callback( $image.naturalWidth );
}
image.once( 'load', function() {
// Sometimes Safari can't calculate correctly dimensions of the image.
// In such a case, force reload (#4183).
if ( !$image.naturalWidth ) {
$image.src = $image.src;
return getNaturalWidth( image, callback );
}
callback( $image.naturalWidth );
} );
}
function setImageWidth( widget, height ) {
if ( !widget.parts.image.hasAttribute( 'width' ) ) {
widget.editor.fire( 'lockSnapshot' );
widget.parts.image.setAttribute( 'width', height );
widget.editor.fire( 'unlockSnapshot' );
}
}
var imagePart = this.parts.image,
isIncomplete = imagePart && !imagePart.$.complete,
isIncorrectlyCalculated = imagePart && imagePart.$.complete && !imagePart.$.naturalWidth;
if ( isIncomplete || isIncorrectlyCalculated ) {
if ( isIncorrectlyCalculated ) {
// Sometimes Safari can't calculate correctly dimensions of the image.
// In such a case, force reload (#4183).
imagePart.$.src = imagePart.$.src;
}
// If widget begins with incomplete image, make sure to refresh balloon toolbar (if present)
// once the image size is available.
getNaturalWidth( imagePart, function() {
editor._.easyImageToolbarContext.toolbar.reposition();
} );
}
// There is a special handling in paste listener, where the element (figure) would gain upload id temporarily.
// This value should be removed afterwards.
var loaderId = this.element.data( 'cke-upload-id' );
if ( typeof loaderId !== 'undefined' ) {
this.setData( 'uploadId', loaderId );
this.element.data( 'cke-upload-id', false );
}
this.on( 'contextMenu', updateMenuItemsStates );
if ( editor.config.easyimage_class ) {
this.addClass( editor.config.easyimage_class );
}
this.on( 'uploadStarted', function() {
var widget = this;
getNaturalWidth( widget.parts.image, function( width ) {
setImageWidth( widget, width );
} );
} );
this.on( 'uploadDone', function( evt ) {
var loader = evt.data.loader,
resp = loader.responseData.response,
srcset = CKEDITOR.plugins.easyimage._parseSrcSet( resp );
this.parts.image.setAttributes( {
'data-cke-saved-src': resp[ 'default' ],
src: resp[ 'default' ],
srcset: srcset,
sizes: '100vw'
} );
} );
this.on( 'uploadFailed', function() {
alert( this.editor.lang.easyimage.uploadFailed ); // jshint ignore:line
} );
this._loadDefaultStyle();
},
_loadDefaultStyle: function() {
// Ensures that Easy Image widget uses a default Easy Image style if none other is applied.
var styleMatched = false,
defaultStyleName = editor.config.easyimage_defaultStyle;
for ( var styleName in styles ) {
var cmd = editor.getCommand( 'easyimage' + capitalize( styleName ) );
if ( !styleMatched && cmd && cmd.style && CKEDITOR.tools.array.indexOf( cmd.style.group, 'easyimage' ) !== -1 && this.checkStyleActive( cmd.style ) ) {
styleMatched = true;
}
}
if ( !styleMatched && defaultStyleName && editor.getCommand( 'easyimage' + capitalize( defaultStyleName ) ) ) {
this.applyStyle( editor.getCommand( 'easyimage' + capitalize( defaultStyleName ) ).style );
}
}
};
if ( figureClass ) {
widgetDefinition.requiredContent += '(!' + figureClass + ')';
widgetDefinition.allowedContent.figure.classes = '!' + figureClass + ',' + widgetDefinition.allowedContent.figure.classes;
}
if ( editor.plugins.link ) {
widgetDefinition = CKEDITOR.plugins.imagebase.addFeature( editor, 'link', widgetDefinition );
}
widgetDefinition = CKEDITOR.plugins.imagebase.addFeature( editor, 'upload', widgetDefinition );
widgetDefinition = CKEDITOR.plugins.imagebase.addFeature( editor, 'caption', widgetDefinition );
CKEDITOR.plugins.imagebase.addImageWidget( editor, WIDGET_NAME, widgetDefinition );
}
function addPasteListener( editor ) {
var imgWithDataUri = new RegExp( '<img[^>]*\\ssrc=[\\\'\\"]?data:image/(' + SUPPORTED_IMAGE_TYPES.join( '|' ) + ');base64,' , 'i' );
// Easy Image requires an img-specific paste listener for inlined images. This case happens in:
// * IE11 when pasting images from the clipboard.
// * FF when pasting a single image **file** from the clipboard.
// In both cases image gets inlined as img[src="data:"] element.
editor.on( 'paste', function( evt ) {
if ( editor.isReadOnly ) {
return;
}
// For performance reason do not parse data if it does not contain img tag and data attribute.
if ( !imgWithDataUri.test( evt.data.dataValue ) ) {
return;
}
var data = evt.data,
// Prevent XSS attacks.
tempDoc = document.implementation.createHTMLDocument( '' ),
temp = new CKEDITOR.dom.element( tempDoc.body ),
easyImageDef = editor.widgets.registered.easyimage,
widgetsFound = 0,
widgetElement,
imgFormat,
imgs,
img,
i;
// Without this isReadOnly will not works properly.
temp.data( 'cke-editable', 1 );
temp.appendHtml( data.dataValue );
imgs = temp.find( 'img' );
for ( i = 0; i < imgs.count(); i++ ) {
img = imgs.getItem( i );
// Assign src once, as it might be a big string, so there's no point in duplicating it all over the place.
var imgSrc = img.getAttribute( 'src' ),
// Image have to contain src=data:...
isDataInSrc = imgSrc && imgSrc.substring( 0, 5 ) == 'data:',
isRealObject = img.data( 'cke-realelement' ) === null;
// We are not uploading images in non-editable blocks and fake objects (https://dev.ckeditor.com/ticket/13003).
if ( isDataInSrc && isRealObject && !img.isReadOnly( 1 ) ) {
widgetsFound++;
if ( widgetsFound > 1 ) {
// Change the selection to avoid overwriting last widget (as it will be focused).
var sel = editor.getSelection(),
ranges = sel.getRanges();
ranges[ 0 ].enlarge( CKEDITOR.ENLARGE_ELEMENT );
ranges[ 0 ].collapse( false );
}
imgFormat = imgSrc.match( /image\/([a-z]+?);/i );
imgFormat = ( imgFormat && imgFormat[ 1 ] ) || 'jpg';
var loader = easyImageDef._spawnLoader( editor, imgSrc, easyImageDef );
widgetElement = easyImageDef._insertWidget( editor, easyImageDef, imgSrc, false, {
uploadId: loader.id
} );
// This id will be converted into widget data by widget#init method. Once that's done the core widget
// upload feature will take care of keeping track of the loader.
widgetElement.data( 'cke-upload-id', loader.id );
widgetElement.replace( img );
}
}
data.dataValue = temp.getHtml();
} );
}
function loadStyles( editor, plugin ) {
if ( !stylesLoaded ) {
CKEDITOR.document.appendStyleSheet( plugin.path + 'styles/easyimage.css' );
stylesLoaded = true;
}
if ( editor.addContentsCss ) {
editor.addContentsCss( plugin.path + 'styles/easyimage.css' );
}
}
/**
* Namespace providing a set of helper functions for the Easy Image plugin.
*
* @since 4.9.0
* @singleton
* @class CKEDITOR.plugins.easyimage
*/
CKEDITOR.plugins.easyimage = {
/**
* Converts the response from the server into a proper `[srcset]` attribute.
*
* @since 4.9.0
* @private
* @param {Object} srcs Sources list to be parsed.
* @returns {String} The `img[srcset]` attribute.
*/
_parseSrcSet: function( srcs ) {
var srcset = [],
src;
for ( src in srcs ) {
if ( src === 'default' ) {
continue;
}
srcset.push( srcs[ src ] + ' ' + src + 'w' );
}
return srcset.join( ', ' );
}
};
function addUploadButtonToToolbar( editor ) {
editor.ui.addButton( BUTTON_PREFIX + 'Upload', {
label: editor.lang.easyimage.commands.upload,
command: 'easyimageUpload',
toolbar: 'insert,1'
} );
editor.addCommand( 'easyimageUpload', {
exec: function() {
// hiddenUploadElement is not attached to DOM, but it is still possible to `virtually` click into it.
var hiddenUploadElement = CKEDITOR.dom.element.createFromHtml( '<input type="file" accept="image/*" multiple="multiple">' );
hiddenUploadElement.once( 'change', function( evt ) {
var targetElement = evt.data.getTarget();
if ( targetElement.$.files.length ) {
// Simulate paste event, to support all nice stuff from imagebase (e.g. loaders) (#1730).
editor.fire( 'paste', {
method: 'paste',
dataValue: '',
dataTransfer: new CKEDITOR.plugins.clipboard.dataTransfer( { files: targetElement.$.files } )
} );
}
} );
hiddenUploadElement.$.click();
}
} );
}
CKEDITOR.plugins.add( 'easyimage', {
requires: 'imagebase,balloontoolbar,button,dialog,cloudservices',
lang: 'ar,az,bg,cs,da,de,de-ch,el,en,en-au,et,fa,fr,gl,hr,hu,it,ku,lv,nb,nl,no,pl,pt,pt-br,ro,ru,sk,sq,sr,sr-latn,sv,tr,tt,uk,zh,zh-cn',
icons: 'easyimagefull,easyimageside,easyimagealt,easyimagealignleft,easyimagealigncenter,easyimagealignright,easyimageupload', // %REMOVE_LINE_CORE%
hidpi: true, // %REMOVE_LINE_CORE%
onLoad: function() {
CKEDITOR.dialog.add( 'easyimageAlt', this.path + 'dialogs/easyimagealt.js' );
},
isSupportedEnvironment: function() {
return !CKEDITOR.env.ie || CKEDITOR.env.version >= 11;
},
init: function( editor ) {
if ( !this.isSupportedEnvironment() ) {
return;
}
loadStyles( editor, this );
},
// Widget must be registered after init in case that link plugin is dynamically loaded e.g. via
// `config.extraPlugins`.
afterInit: function( editor ) {
if ( !this.isSupportedEnvironment() ) {
return;
}
var styles = getStylesForEditor( editor );
registerWidget( editor, styles );
addPasteListener( editor );
addCommands( editor, styles );
addButtons( editor, styles );
addContextMenuItems( editor );
addToolbar( editor );
addUploadButtonToToolbar( editor );
}
} );
/**
* A CSS class applied to all Easy Image widgets. If set to `null`, all `<figure>` elements are converted into widgets.
*
* ```js
* // Changes the class to "my-image".
* config.easyimage_class = 'my-image';
*
* // This will cause the plugin to convert any figure into a widget.
* config.easyimage_class = null;
* ```
*
* @since 4.9.0
* @cfg {String/null} [easyimage_class='easyimage']
* @member CKEDITOR.config
*/
CKEDITOR.config.easyimage_class = 'easyimage';
/**
* Custom styles that could be applied to the Easy Image widget.
* All styles must be {@glink guide/dev_howtos_styles#how-do-i-customize-the-styles-drop-down-list valid style definitions}.
* There are three additional properties for each style definition:
*
* * `label` – A string used as a button label in the balloon toolbar for the widget.
* * `icon` – The path to the icon used in the balloon toolbar.
* * `iconHiDpi` – The path to the high DPI version of the icon.
*
* A few styles are available by default:
*
* * `full` – Adding an `easyimage-full` class to the `figure` element.
* * `side` – Adding an `easyimage-side` class to the `figure` element.
* * `alignLeft` – Adding an `easyimage-align-left` class to the `figure` element.
* * `alignCenter` – Adding an `easyimage-align-center` class to the `figure` element.
* * `alignRight` – Adding an `easyimage-align-right` class to the `figure` element.
*
* Every style added by this configuration variable will result in adding the `EasyImage<name>` button
* and the `easyimage<name>` command, where `<name>` is the name of the style in Pascal case. For example, the
* `left` style would produce an `EasyImageLeft` button and an `easyimageLeft` command.
*
* // Adds a custom alignment style.
* config.easyimage_styles = {
* left: {
* attributes: {
* 'class': 'left'
* },
* label: 'Align left',
* icon: '/my/example/icons/left.png',
* iconHiDpi: '/my/example/icons/hidpi/left.png'
* }
* };
*
* The following example changes the class added by the `full` style and adds more border styles:
*
* config.easyimage_styles = {
* full: {
* // Changes just the class name, icon label remains unchanged.
* attributes: {
* 'class': 'my-custom-full-class'
* }
* },
* skipBorder: {
* attributes: {
* 'class': 'skip-border'
* },
* group: 'borders',
* label: 'Skip border'
* },
* thickBorder: {
* attributes: {
* 'class': 'thick-border'
* },
* group: 'borders',
* label: 'Thick border'
* }
* };
*
* @since 4.9.0
* @cfg {Object.<String, Object>} easyimage_styles
* @member CKEDITOR.config
*/
CKEDITOR.config.easyimage_styles = {};
/**
* The default style to be applied to Easy Image widgets, based on keys in {@link #easyimage_styles}.
*
* If set to `null`, no default style is applied.
*
* ```js
* // Make side image a default style.
* config.easyimage_defaultStyle = 'side';
* ```
*
* @since 4.9.0
* @cfg {String/null} easyimage_defaultStyle
* @member CKEDITOR.config
*/
CKEDITOR.config.easyimage_defaultStyle = 'full';
/**
* A list of buttons to be displayed in the balloon toolbar for the Easy Image widget.
*
* If the [Context Menu](https://ckeditor.com/cke4/addon/contextmenu) plugin is enabled, this
* configuration option will also be used to add items to the context menu for the Easy Image widget.
*
* You can find the list of available styles in {@link #easyimage_styles}.
*
* ```js
* // Change toolbar to alignment commands.
* config.easyimage_toolbar = [ 'EasyImageAlignLeft', 'EasyImageAlignCenter', 'EasyImageAlignRight' ];
* ```
*
* @since 4.9.0
* @cfg {String[]/String} [easyimage_toolbar=[ 'EasyImageFull', 'EasyImageSide', 'EasyImageAlt' ]]
* @member CKEDITOR.config
*/
CKEDITOR.config.easyimage_toolbar = [ BUTTON_PREFIX + 'Full', BUTTON_PREFIX + 'Side', BUTTON_PREFIX + 'Alt' ];
}() );