forked from ckeditor/ckeditor4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathckeditor.js
103 lines (99 loc) · 3.58 KB
/
ckeditor.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
/**
* @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/
// Compressed version of core/ckeditor_base.js. See original for instructions.
/*jsl:ignore*/
window.CKEDITOR || ( window.CKEDITOR = function() {
var e = {
timestamp: "", version: "%VERSION%", revision: "%REV%", rnd: Math.floor( 900 * Math.random() ) + 100, _: { pending: [] },
status: "unloaded", basePath: function() {
var a = window.CKEDITOR_BASEPATH || ""; if ( !a )
for ( var c = document.getElementsByTagName( "script" ), b = 0; b < c.length; b++ ) {
var d = c[ b ].src.match( /(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i );
if ( d ) {
a = d[ 1 ];
break
}
} - 1 == a.indexOf( ":/" ) && ( a = 0 === a.indexOf( "/" ) ? location.href.match( /^.*?:\/\/[^\/]*/ )[ 0 ] + a : location.href.match( /^[^\?]*\/(?:)/ )[ 0 ] + a );
if ( !a )
throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
return a
}(), getUrl: function( a ) {
-1 == a.indexOf( ":/" ) && 0 !== a.indexOf( "/" ) && ( a = this.basePath + a );
this.timestamp && "/" != a.charAt( a.length - 1 ) && !/[&?]t=/.test( a ) && ( a += ( 0 <= a.indexOf( "?" ) ? "&" : "?" ) + "t=" + this.timestamp );
return a
},
domReady: function() {
function a() {
try {
document.addEventListener ? document.removeEventListener( "DOMContentLoaded", a, !1 ) : document.attachEvent && document.detachEvent( "onreadystatechange", a )
} catch ( b ) {}
for ( var d; d = c.shift(); )
d()
}
var c = [];
return function( b ) {
c.push( b );
"complete" === document.readyState && setTimeout( a, 1 );
if ( 1 == c.length )
if ( document.addEventListener )
document.addEventListener( "DOMContentLoaded", a, !1 ), window.addEventListener( "load", a, !1 );
else if ( document.attachEvent ) {
document.attachEvent( "onreadystatechange", a );
window.attachEvent( "onload", a );
b = !1;
try {
b = null == window.frameElement
} catch ( d ) {}
document.documentElement.doScroll && b &&
function g() {
try {
document.documentElement.doScroll( "left" )
} catch ( b ) {
setTimeout( g, 1 );
return
}
a()
}()
}
}
}() },
f = window.CKEDITOR_GETURL; if ( f ) {
var h = e.url;
e.url = function( a ) {
return f.call( e, a ) || h.call( e, a )
}
}
return e
}() );
/*jsl:end*/
if ( CKEDITOR.loader )
CKEDITOR.loader.load( 'ckeditor' );
else {
// Set the script name to be loaded by the loader.
CKEDITOR._autoLoad = 'ckeditor';
// Include the loader script.
if ( document.body && ( !document.readyState || document.readyState == 'complete' ) ) {
var script = document.createElement( 'script' );
script.type = 'text/javascript';
script.src = CKEDITOR.getUrl( 'core/loader.js' );
document.body.appendChild( script );
} else {
document.write( '<script type="text/javascript" src="' + CKEDITOR.getUrl( 'core/loader.js' ) + '"></script>' );
}
}
/**
* The skin to load for all created instances, it may be the name of the skin
* folder inside the editor installation path, or the name and the path separated
* by a comma.<br>
* <br>
* <strong>Note:</strong> This is a global configuration that applies to all instances.
* @name CKEDITOR.editorSkin
* @type String
* @example
* CKEDITOR.editorSkin = 'kama';
* @example
* CKEDITOR.editorSkin = 'myskin,/customstuff/myskin/';
*/
CKEDITOR.skinName = 'kama';