forked from ckeditor/ckeditor4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathckeditor.js
136 lines (131 loc) · 3.9 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
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
/*
Copyright (c) 2003-2011, 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*/
if ( !window.CKEDITOR ) {
window.CKEDITOR = (function() {
var b = {
timestamp: "", version: "%VERSION%", revision: "%REV%", _: { pending: [] },
status: "unloaded", basePath: (function() {
var g = window.CKEDITOR_BASEPATH || "";
if ( !g ) {
var d = document.getElementsByTagName( "script" );
for ( var f = 0; f < d.length; f++ ) {
var e = d[ f ].src.match( /(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i );
if ( e ) {
g = e[ 1 ];
break
}
}
}
if ( g.indexOf( ":/" ) == -1 ) {
if ( g.indexOf( "/" ) === 0 ) {
g = location.href.match( /^.*?:\/\/[^\/]*/ )[ 0 ] + g
} else {
g = location.href.match( /^[^\?]*\/(?:)/ )[ 0 ] + g
}
}
if ( !g ) {
throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.'
}
return g
})(), getUrl: function( d ) {
if ( d.indexOf( ":/" ) == -1 && d.indexOf( "/" ) !== 0 ) {
d = this.basePath + d
}
if ( this.timestamp && d.charAt( d.length - 1 ) != "/" && !( /[&?]t=/ ).test( d ) ) {
d += ( d.indexOf( "?" ) >= 0 ? "&" : "?" ) + "t=" + this.timestamp
}
return d
},
domReady: (function() {
var d = [];
function e() {
try {
if ( document.addEventListener ) {
document.removeEventListener( "DOMContentLoaded", e, false )
} else {
if ( document.attachEvent ) {
document.detachEvent( "onreadystatechange", e )
}
}
} catch ( g ) {}
var f;
while ( f = d.shift() ) {
f()
}
}
return function( g ) {
d.push( g );
if ( document.readyState === "complete" ) {
setTimeout( e, 1 )
}
if ( d.length != 1 ) {
return
}
if ( document.addEventListener ) {
document.addEventListener( "DOMContentLoaded", e, false );
window.addEventListener( "load", e, false )
} else {
if ( document.attachEvent ) {
document.attachEvent( "onreadystatechange", e );
window.attachEvent( "onload", e );
var f = false;
try {
f = window.frameElement == null
} catch ( h ) {}
if ( document.documentElement.doScroll && f ) {
(function i() {
try {
document.documentElement.doScroll( "left" )
} catch ( j ) {
setTimeout( i, 1 );
return
}
e()
})()
}
}
}
}
})() }; var a = window.CKEDITOR_GETURL; if ( a ) {
var c = b.url;
b.url = function( d ) {
return a.call( b, d ) || c.call( b, d )
}
}
return b
})()
};
/*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';