-
Notifications
You must be signed in to change notification settings - Fork 12
/
quailInclude.js
52 lines (44 loc) · 1.6 KB
/
quailInclude.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
/**
* @license Copyright (c) 2014-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/license
*/
//jscs:disable
/* jshint ignore:start */
/**
* @fileOverview This file contains a code that will be inlined to plugin.js in partucilar place when
* building AC distro.
*
* The reason for such approach is that AMDClean was automatically hoisting all the AMD types to the
* beginning of the file, and executing them. Therefore Quail would... require jQuery! No matter if
* it's overriden by any custom plugin or not.
*
* So with this file Quail is simply inlined inside the plugin.js file (still I'd say that we might
* actually load it async at runtime, it would keep the file smaller).
*/
var acNamespace = CKEDITOR.plugins.a11ychecker,
Engine = acNamespace.Engine,
IssueList = acNamespace.IssueList,
Issue = acNamespace.Issue,
IssueDetails = acNamespace.IssueDetails,
Quail,
EngineQuailConfig,
$ = window.jQuery || window.$;
// EngineQuailConfig class can still be loaded with RequireJS as it does not have any deps.
require( [ 'EngineQuailConfig' ], function( _EngineQuailConfig ) {
EngineQuailConfig = _EngineQuailConfig;
} );
(function() {
if ( !$ || !$.fn ) {
throw new Error( 'Missing jQuery. Accessibility Checker\'s default engine, Quail.js requires jQuery ' +
'to work correctly.' );
}
// We'll load custom Quail only if it's not already registered.
if ( $.fn.quail ) {
return;
}
/*@include libs/quail/quail.jquery.min.js */
}());
Quail = $.fn.quail;
/*@include ../../EngineQuail.js */
callback( EngineQuail );
/* jshint ignore:end */