ckeditor 4.0.7 → 4.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +16 -2
- data/app/assets/javascripts/ckeditor/application.js +1 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/application.js.erb +10 -0
- data/app/assets/javascripts/ckeditor/filebrowser/javascripts/jquery.endless-scroll.js +300 -0
- data/app/assets/javascripts/ckeditor/filebrowser/stylesheets/uploader.css.erb +4 -0
- data/app/controllers/ckeditor/attachment_files_controller.rb +3 -1
- data/app/controllers/ckeditor/pictures_controller.rb +3 -1
- data/app/views/ckeditor/attachment_files/index.html.erb +11 -5
- data/app/views/ckeditor/pictures/index.html.erb +12 -6
- data/app/views/ckeditor/shared/_asset.html.erb +1 -1
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +1 -1
- data/config/locales/cs.ckeditor.yml +1 -0
- data/config/locales/de.ckeditor.yml +1 -0
- data/config/locales/el-GR.cdkeditor.yml +2 -1
- data/config/locales/en.ckeditor.yml +1 -0
- data/config/locales/es.ckeditor.yml +1 -0
- data/config/locales/fr.ckeditor.yml +1 -0
- data/config/locales/hu.ckeditor.yml +1 -0
- data/config/locales/it.ckeditor.yml +1 -0
- data/config/locales/nl.ckeditor.yml +2 -1
- data/config/locales/pl.ckeditor.yml +1 -0
- data/config/locales/pt-BR.ckeditor.yml +2 -1
- data/config/locales/pt-PT.ckeditor.yml +1 -0
- data/config/locales/ru.ckeditor.yml +1 -0
- data/config/locales/sv-SE.ckeditor.yml +1 -0
- data/config/locales/uk.ckeditor.yml +1 -0
- data/config/locales/zh-CN.ckeditor.yml +1 -0
- data/lib/ckeditor.rb +11 -0
- data/lib/ckeditor/helpers/controllers.rb +1 -1
- data/lib/ckeditor/paginatable.rb +56 -0
- data/lib/ckeditor/utils.rb +41 -18
- data/lib/ckeditor/version.rb +2 -2
- data/lib/generators/ckeditor/templates/ckeditor.rb +3 -0
- data/test/dummy/public/uploads/tmp/20140108-1222-52217-3986/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1222-52217-6261/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1222-52217-6421/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-3058/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-3058/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-3058/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-3990/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-3990/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-3990/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-8126/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-8126/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1223-52217-8126/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-0400/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-0400/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-0400/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-1537/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-1537/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-1537/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-4718/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-4820/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-8057/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-8057/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-8057/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52513-9147/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-3606/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-4369/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-4369/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-4369/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-4698/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-7541/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-9146/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-9146/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-9146/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-9782/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-9782/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1228-52590-9782/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-3256/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-3256/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-3256/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-3565/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-3565/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-3565/thumb_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-4292/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-4514/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-7430/rails.tar.gz +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-9145/content_rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-9145/rails.png +0 -0
- data/test/dummy/public/uploads/tmp/20140108-1230-52768-9145/thumb_rails.png +0 -0
- data/vendor/assets/javascripts/ckeditor/CHANGES.md +36 -0
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +465 -463
- data/vendor/assets/javascripts/ckeditor/config.js +1 -1
- data/vendor/assets/javascripts/ckeditor/contents.css +17 -0
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/de.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/el.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/es.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/it.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/km.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/no.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +1 -1
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/cy.js +3 -3
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/fi.js +2 -2
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js +7 -0
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +16 -16
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/lang/zh.js +12 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +1 -1
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +31 -31
- data/vendor/assets/javascripts/ckeditor/samples/ajax.html +82 -0
- data/vendor/assets/javascripts/ckeditor/samples/api.html +207 -0
- data/vendor/assets/javascripts/ckeditor/samples/appendto.html +57 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/inlineall/logo.png +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/outputxhtml/outputxhtml.css +204 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/posteddata.php +59 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/sample.css +3 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/sample.jpg +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/assets/uilanguages/languages.js +7 -0
- data/vendor/assets/javascripts/ckeditor/samples/datafiltering.html +401 -0
- data/vendor/assets/javascripts/ckeditor/samples/divreplace.html +141 -0
- data/vendor/assets/javascripts/ckeditor/samples/index.html +128 -0
- data/vendor/assets/javascripts/ckeditor/samples/inlineall.html +311 -0
- data/vendor/assets/javascripts/ckeditor/samples/inlinebycode.html +121 -0
- data/vendor/assets/javascripts/ckeditor/samples/inlinetextarea.html +110 -0
- data/vendor/assets/javascripts/ckeditor/samples/jquery.html +97 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/dialog/assets/my_dialog.js +48 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/dialog/dialog.html +187 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/enterkey/enterkey.html +103 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.fla +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/outputforflash.swf +0 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/assets/outputforflash/swfobject.js +18 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputforflash.html +280 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/htmlwriter/outputhtml.html +221 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/magicline/magicline.html +206 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/toolbar/toolbar.html +232 -0
- data/vendor/assets/javascripts/ckeditor/samples/plugins/wysiwygarea/fullpage.html +77 -0
- data/vendor/assets/javascripts/ckeditor/samples/readonly.html +73 -0
- data/vendor/assets/javascripts/ckeditor/samples/replacebyclass.html +57 -0
- data/vendor/assets/javascripts/ckeditor/samples/replacebycode.html +56 -0
- data/vendor/assets/javascripts/ckeditor/samples/sample.css +356 -0
- data/vendor/assets/javascripts/ckeditor/samples/sample.js +50 -0
- data/vendor/assets/javascripts/ckeditor/samples/sample_posteddata.php +16 -0
- data/vendor/assets/javascripts/ckeditor/samples/tabindex.html +75 -0
- data/vendor/assets/javascripts/ckeditor/samples/uicolor.html +69 -0
- data/vendor/assets/javascripts/ckeditor/samples/uilanguages.html +119 -0
- data/vendor/assets/javascripts/ckeditor/samples/xhtmlstyle.html +231 -0
- metadata +139 -16
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +0 -1425
- data/test/tmp/app/models/ckeditor/asset.rb +0 -5
- data/test/tmp/app/models/ckeditor/attachment_file.rb +0 -12
- data/test/tmp/app/models/ckeditor/picture.rb +0 -13
- data/test/tmp/config/initializers/ckeditor.rb +0 -19
- data/test/tmp/config/routes.rb +0 -6
@@ -0,0 +1,50 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or http://ckeditor.com/license
|
4
|
+
*/
|
5
|
+
|
6
|
+
// Tool scripts for the sample pages.
|
7
|
+
// This file can be ignored and is not required to make use of CKEditor.
|
8
|
+
|
9
|
+
(function() {
|
10
|
+
CKEDITOR.on( 'instanceReady', function( ev ) {
|
11
|
+
// Check for sample compliance.
|
12
|
+
var editor = ev.editor,
|
13
|
+
meta = CKEDITOR.document.$.getElementsByName( 'ckeditor-sample-required-plugins' ),
|
14
|
+
requires = meta.length ? CKEDITOR.dom.element.get( meta[ 0 ] ).getAttribute( 'content' ).split( ',' ) : [],
|
15
|
+
missing = [],
|
16
|
+
i;
|
17
|
+
|
18
|
+
if ( requires.length ) {
|
19
|
+
for ( i = 0; i < requires.length; i++ ) {
|
20
|
+
if ( !editor.plugins[ requires[ i ] ] )
|
21
|
+
missing.push( '<code>' + requires[ i ] + '</code>' );
|
22
|
+
}
|
23
|
+
|
24
|
+
if ( missing.length ) {
|
25
|
+
var warn = CKEDITOR.dom.element.createFromHtml(
|
26
|
+
'<div class="warning">' +
|
27
|
+
'<span>To fully experience this demo, the ' + missing.join( ', ' ) + ' plugin' + ( missing.length > 1 ? 's are' : ' is' ) + ' required.</span>' +
|
28
|
+
'</div>'
|
29
|
+
);
|
30
|
+
warn.insertBefore( editor.container );
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
// Set icons.
|
35
|
+
var doc = new CKEDITOR.dom.document( document ),
|
36
|
+
icons = doc.find( '.button_icon' );
|
37
|
+
|
38
|
+
for ( i = 0; i < icons.count(); i++ ) {
|
39
|
+
var icon = icons.getItem( i ),
|
40
|
+
name = icon.getAttribute( 'data-icon' ),
|
41
|
+
style = CKEDITOR.skin.getIconStyle( name, ( CKEDITOR.lang.dir == 'rtl' ) );
|
42
|
+
|
43
|
+
icon.addClass( 'cke_button_icon' );
|
44
|
+
icon.addClass( 'cke_button__' + name + '_icon' );
|
45
|
+
icon.setAttribute( 'style', style );
|
46
|
+
icon.setStyle( 'float', 'none' );
|
47
|
+
|
48
|
+
}
|
49
|
+
} );
|
50
|
+
})();
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?php /* <body><pre>
|
2
|
+
|
3
|
+
-------------------------------------------------------------------------------------------
|
4
|
+
CKEditor - Posted Data
|
5
|
+
|
6
|
+
We are sorry, but your Web server does not support the PHP language used in this script.
|
7
|
+
|
8
|
+
Please note that CKEditor can be used with any other server-side language than just PHP.
|
9
|
+
To save the content created with CKEditor you need to read the POST data on the server
|
10
|
+
side and write it to a file or the database.
|
11
|
+
|
12
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
13
|
+
For licensing, see LICENSE.md or <a href="http://ckeditor.com/license">http://ckeditor.com/license</a>
|
14
|
+
-------------------------------------------------------------------------------------------
|
15
|
+
|
16
|
+
</pre><div style="display:none"></body> */ include "assets/posteddata.php"; ?>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
4
|
+
For licensing, see LICENSE.md or http://ckeditor.com/license
|
5
|
+
-->
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>TAB Key-Based Navigation — CKEditor Sample</title>
|
9
|
+
<meta charset="utf-8">
|
10
|
+
<script src="../ckeditor.js"></script>
|
11
|
+
<link href="sample.css" rel="stylesheet">
|
12
|
+
<style>
|
13
|
+
|
14
|
+
.cke_focused,
|
15
|
+
.cke_editable.cke_focused
|
16
|
+
{
|
17
|
+
outline: 3px dotted blue !important;
|
18
|
+
*border: 3px dotted blue !important; /* For IE7 */
|
19
|
+
}
|
20
|
+
|
21
|
+
</style>
|
22
|
+
<script>
|
23
|
+
|
24
|
+
CKEDITOR.on( 'instanceReady', function( evt ) {
|
25
|
+
var editor = evt.editor;
|
26
|
+
editor.setData( 'This editor has it\'s tabIndex set to <strong>' + editor.tabIndex + '</strong>' );
|
27
|
+
|
28
|
+
// Apply focus class name.
|
29
|
+
editor.on( 'focus', function() {
|
30
|
+
editor.container.addClass( 'cke_focused' );
|
31
|
+
});
|
32
|
+
editor.on( 'blur', function() {
|
33
|
+
editor.container.removeClass( 'cke_focused' );
|
34
|
+
});
|
35
|
+
|
36
|
+
// Put startup focus on the first editor in tab order.
|
37
|
+
if ( editor.tabIndex == 1 )
|
38
|
+
editor.focus();
|
39
|
+
});
|
40
|
+
|
41
|
+
</script>
|
42
|
+
</head>
|
43
|
+
<body>
|
44
|
+
<h1 class="samples">
|
45
|
+
<a href="index.html">CKEditor Samples</a> » TAB Key-Based Navigation
|
46
|
+
</h1>
|
47
|
+
<div class="description">
|
48
|
+
<p>
|
49
|
+
This sample shows how tab key navigation among editor instances is
|
50
|
+
affected by the <code>tabIndex</code> attribute from
|
51
|
+
the original page element. Use TAB key to move between the editors.
|
52
|
+
</p>
|
53
|
+
</div>
|
54
|
+
<p>
|
55
|
+
<textarea class="ckeditor" cols="80" id="editor4" rows="10" tabindex="1"></textarea>
|
56
|
+
</p>
|
57
|
+
<div class="ckeditor" contenteditable="true" id="editor1" tabindex="4"></div>
|
58
|
+
<p>
|
59
|
+
<textarea class="ckeditor" cols="80" id="editor2" rows="10" tabindex="2"></textarea>
|
60
|
+
</p>
|
61
|
+
<p>
|
62
|
+
<textarea class="ckeditor" cols="80" id="editor3" rows="10" tabindex="3"></textarea>
|
63
|
+
</p>
|
64
|
+
<div id="footer">
|
65
|
+
<hr>
|
66
|
+
<p>
|
67
|
+
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
68
|
+
</p>
|
69
|
+
<p id="copy">
|
70
|
+
Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
71
|
+
Knabben. All rights reserved.
|
72
|
+
</p>
|
73
|
+
</div>
|
74
|
+
</body>
|
75
|
+
</html>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
4
|
+
For licensing, see LICENSE.md or http://ckeditor.com/license
|
5
|
+
-->
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>UI Color Picker — CKEditor Sample</title>
|
9
|
+
<meta charset="utf-8">
|
10
|
+
<script src="../ckeditor.js"></script>
|
11
|
+
<link rel="stylesheet" href="sample.css">
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<h1 class="samples">
|
15
|
+
<a href="index.html">CKEditor Samples</a> » UI Color
|
16
|
+
</h1>
|
17
|
+
<div class="description">
|
18
|
+
<p>
|
19
|
+
This sample shows how to automatically replace <code><textarea></code> elements
|
20
|
+
with a CKEditor instance with an option to change the color of its user interface.<br>
|
21
|
+
<strong>Note:</strong>The UI skin color feature depends on the CKEditor skin
|
22
|
+
compatibility. The Moono and Kama skins are examples of skins that work with it.
|
23
|
+
</p>
|
24
|
+
</div>
|
25
|
+
<form action="sample_posteddata.php" method="post">
|
26
|
+
<p>
|
27
|
+
This editor instance has a UI color value defined in configuration to change the skin color,
|
28
|
+
To specify the color of the user interface, set the <code>uiColor</code> property:
|
29
|
+
</p>
|
30
|
+
<pre class="samples">
|
31
|
+
CKEDITOR.replace( '<em>textarea_id</em>', {
|
32
|
+
<strong>uiColor: '#14B8C4'</strong>
|
33
|
+
});</pre>
|
34
|
+
<p>
|
35
|
+
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
|
36
|
+
the <code><textarea></code> element to be replaced.
|
37
|
+
</p>
|
38
|
+
<p>
|
39
|
+
<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
|
40
|
+
<script>
|
41
|
+
|
42
|
+
// Replace the <textarea id="editor"> with an CKEditor
|
43
|
+
// instance, using default configurations.
|
44
|
+
CKEDITOR.replace( 'editor1', {
|
45
|
+
uiColor: '#14B8C4',
|
46
|
+
toolbar: [
|
47
|
+
[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
|
48
|
+
[ 'FontSize', 'TextColor', 'BGColor' ]
|
49
|
+
]
|
50
|
+
});
|
51
|
+
|
52
|
+
</script>
|
53
|
+
</p>
|
54
|
+
<p>
|
55
|
+
<input type="submit" value="Submit">
|
56
|
+
</p>
|
57
|
+
</form>
|
58
|
+
<div id="footer">
|
59
|
+
<hr>
|
60
|
+
<p>
|
61
|
+
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
62
|
+
</p>
|
63
|
+
<p id="copy">
|
64
|
+
Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
65
|
+
Knabben. All rights reserved.
|
66
|
+
</p>
|
67
|
+
</div>
|
68
|
+
</body>
|
69
|
+
</html>
|
@@ -0,0 +1,119 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
4
|
+
For licensing, see LICENSE.md or http://ckeditor.com/license
|
5
|
+
-->
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>User Interface Globalization — CKEditor Sample</title>
|
9
|
+
<meta charset="utf-8">
|
10
|
+
<script src="../ckeditor.js"></script>
|
11
|
+
<script src="assets/uilanguages/languages.js"></script>
|
12
|
+
<link rel="stylesheet" href="sample.css">
|
13
|
+
</head>
|
14
|
+
<body>
|
15
|
+
<h1 class="samples">
|
16
|
+
<a href="index.html">CKEditor Samples</a> » User Interface Languages
|
17
|
+
</h1>
|
18
|
+
<div class="description">
|
19
|
+
<p>
|
20
|
+
This sample shows how to automatically replace <code><textarea></code> elements
|
21
|
+
with a CKEditor instance with an option to change the language of its user interface.
|
22
|
+
</p>
|
23
|
+
<p>
|
24
|
+
It pulls the language list from CKEditor <code>_languages.js</code> file that contains the list of supported languages and creates
|
25
|
+
a drop-down list that lets the user change the UI language.
|
26
|
+
</p>
|
27
|
+
<p>
|
28
|
+
By default, CKEditor automatically localizes the editor to the language of the user.
|
29
|
+
The UI language can be controlled with two configuration options:
|
30
|
+
<code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-language">language</a></code> and
|
31
|
+
<code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-defaultLanguage">
|
32
|
+
defaultLanguage</a></code>. The <code>defaultLanguage</code> setting specifies the
|
33
|
+
default CKEditor language to be used when a localization suitable for user's settings is not available.
|
34
|
+
</p>
|
35
|
+
<p>
|
36
|
+
To specify the user interface language that will be used no matter what language is
|
37
|
+
specified in user's browser or operating system, set the <code>language</code> property:
|
38
|
+
</p>
|
39
|
+
<pre class="samples">
|
40
|
+
CKEDITOR.replace( '<em>textarea_id</em>', {
|
41
|
+
// Load the German interface.
|
42
|
+
<strong>language: 'de'</strong>
|
43
|
+
});</pre>
|
44
|
+
<p>
|
45
|
+
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
|
46
|
+
the <code><textarea></code> element to be replaced.
|
47
|
+
</p>
|
48
|
+
</div>
|
49
|
+
<form action="sample_posteddata.php" method="post">
|
50
|
+
<p>
|
51
|
+
Available languages (<span id="count"> </span> languages!):<br>
|
52
|
+
<script>
|
53
|
+
|
54
|
+
document.write( '<select disabled="disabled" id="languages" onchange="createEditor( this.value );">' );
|
55
|
+
|
56
|
+
// Get the language list from the _languages.js file.
|
57
|
+
for ( var i = 0 ; i < window.CKEDITOR_LANGS.length ; i++ ) {
|
58
|
+
document.write(
|
59
|
+
'<option value="' + window.CKEDITOR_LANGS[i].code + '">' +
|
60
|
+
window.CKEDITOR_LANGS[i].name +
|
61
|
+
'</option>' );
|
62
|
+
}
|
63
|
+
|
64
|
+
document.write( '</select>' );
|
65
|
+
|
66
|
+
</script>
|
67
|
+
<br>
|
68
|
+
<span style="color: #888888">
|
69
|
+
(You may see strange characters if your system does not support the selected language)
|
70
|
+
</span>
|
71
|
+
</p>
|
72
|
+
<p>
|
73
|
+
<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
|
74
|
+
<script>
|
75
|
+
|
76
|
+
// Set the number of languages.
|
77
|
+
document.getElementById( 'count' ).innerHTML = window.CKEDITOR_LANGS.length;
|
78
|
+
|
79
|
+
var editor;
|
80
|
+
|
81
|
+
function createEditor( languageCode ) {
|
82
|
+
if ( editor )
|
83
|
+
editor.destroy();
|
84
|
+
|
85
|
+
// Replace the <textarea id="editor"> with an CKEditor
|
86
|
+
// instance, using default configurations.
|
87
|
+
editor = CKEDITOR.replace( 'editor1', {
|
88
|
+
language: languageCode,
|
89
|
+
|
90
|
+
on: {
|
91
|
+
instanceReady: function() {
|
92
|
+
// Wait for the editor to be ready to set
|
93
|
+
// the language combo.
|
94
|
+
var languages = document.getElementById( 'languages' );
|
95
|
+
languages.value = this.langCode;
|
96
|
+
languages.disabled = false;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
});
|
100
|
+
}
|
101
|
+
|
102
|
+
// At page startup, load the default language:
|
103
|
+
createEditor( '' );
|
104
|
+
|
105
|
+
</script>
|
106
|
+
</p>
|
107
|
+
</form>
|
108
|
+
<div id="footer">
|
109
|
+
<hr>
|
110
|
+
<p>
|
111
|
+
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
112
|
+
</p>
|
113
|
+
<p id="copy">
|
114
|
+
Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
115
|
+
Knabben. All rights reserved.
|
116
|
+
</p>
|
117
|
+
</div>
|
118
|
+
</body>
|
119
|
+
</html>
|
@@ -0,0 +1,231 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<!--
|
3
|
+
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
|
4
|
+
For licensing, see LICENSE.md or http://ckeditor.com/license
|
5
|
+
-->
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>XHTML Compliant Output — CKEditor Sample</title>
|
9
|
+
<meta charset="utf-8">
|
10
|
+
<meta name="ckeditor-sample-required-plugins" content="sourcearea">
|
11
|
+
<script src="../ckeditor.js"></script>
|
12
|
+
<script src="../samples/sample.js"></script>
|
13
|
+
<link href="sample.css" rel="stylesheet">
|
14
|
+
</head>
|
15
|
+
<body>
|
16
|
+
<h1 class="samples">
|
17
|
+
<a href="index.html">CKEditor Samples</a> » Producing XHTML Compliant Output
|
18
|
+
</h1>
|
19
|
+
<div class="description">
|
20
|
+
<p>
|
21
|
+
This sample shows how to configure CKEditor to output valid
|
22
|
+
<a class="samples" href="http://www.w3.org/TR/xhtml11/">XHTML 1.1</a> code.
|
23
|
+
Deprecated elements (<code><font></code>, <code><u></code>) or attributes
|
24
|
+
(<code>size</code>, <code>face</code>) will be replaced with XHTML compliant code.
|
25
|
+
</p>
|
26
|
+
<p>
|
27
|
+
To add a CKEditor instance outputting valid XHTML code, load the editor using a standard
|
28
|
+
JavaScript call and define CKEditor features to use the XHTML compliant elements and styles.
|
29
|
+
</p>
|
30
|
+
<p>
|
31
|
+
A snippet of the configuration code can be seen below; check the source of this page for
|
32
|
+
full definition:
|
33
|
+
</p>
|
34
|
+
<pre class="samples">
|
35
|
+
CKEDITOR.replace( '<em>textarea_id</em>', {
|
36
|
+
contentsCss: 'assets/outputxhtml.css',
|
37
|
+
|
38
|
+
coreStyles_bold: {
|
39
|
+
element: 'span',
|
40
|
+
attributes: { 'class': 'Bold' }
|
41
|
+
},
|
42
|
+
coreStyles_italic: {
|
43
|
+
element: 'span',
|
44
|
+
attributes: { 'class': 'Italic' }
|
45
|
+
},
|
46
|
+
|
47
|
+
...
|
48
|
+
});</pre>
|
49
|
+
</div>
|
50
|
+
<form action="sample_posteddata.php" method="post">
|
51
|
+
<p>
|
52
|
+
<label for="editor1">
|
53
|
+
Editor 1:
|
54
|
+
</label>
|
55
|
+
<textarea cols="80" id="editor1" name="editor1" rows="10"><p>This is some <span class="Bold">sample text</span>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p></textarea>
|
56
|
+
<script>
|
57
|
+
|
58
|
+
CKEDITOR.replace( 'editor1', {
|
59
|
+
/*
|
60
|
+
* Style sheet for the contents
|
61
|
+
*/
|
62
|
+
contentsCss: 'assets/outputxhtml/outputxhtml.css',
|
63
|
+
|
64
|
+
/*
|
65
|
+
* Special allowed content rules for spans used by
|
66
|
+
* font face, size, and color buttons.
|
67
|
+
*
|
68
|
+
* Note: all rules have been written separately so
|
69
|
+
* it was possible to specify required classes.
|
70
|
+
*/
|
71
|
+
extraAllowedContent: 'span(!FontColor1);span(!FontColor2);span(!FontColor3);' +
|
72
|
+
'span(!FontColor1BG);span(!FontColor2BG);span(!FontColor3BG);' +
|
73
|
+
'span(!FontComic);span(!FontCourier);span(!FontTimes);' +
|
74
|
+
'span(!FontSmaller);span(!FontLarger);span(!FontSmall);span(!FontBig);span(!FontDouble)',
|
75
|
+
|
76
|
+
/*
|
77
|
+
* Core styles.
|
78
|
+
*/
|
79
|
+
coreStyles_bold: {
|
80
|
+
element: 'span',
|
81
|
+
attributes: { 'class': 'Bold' }
|
82
|
+
},
|
83
|
+
coreStyles_italic: {
|
84
|
+
element: 'span',
|
85
|
+
attributes: { 'class': 'Italic' }
|
86
|
+
},
|
87
|
+
coreStyles_underline: {
|
88
|
+
element: 'span',
|
89
|
+
attributes: { 'class': 'Underline' }
|
90
|
+
},
|
91
|
+
coreStyles_strike: {
|
92
|
+
element: 'span',
|
93
|
+
attributes: { 'class': 'StrikeThrough' },
|
94
|
+
overrides: 'strike'
|
95
|
+
},
|
96
|
+
coreStyles_subscript: {
|
97
|
+
element: 'span',
|
98
|
+
attributes: { 'class': 'Subscript' },
|
99
|
+
overrides: 'sub'
|
100
|
+
},
|
101
|
+
coreStyles_superscript: {
|
102
|
+
element: 'span',
|
103
|
+
attributes: { 'class': 'Superscript' },
|
104
|
+
overrides: 'sup'
|
105
|
+
},
|
106
|
+
|
107
|
+
/*
|
108
|
+
* Font face.
|
109
|
+
*/
|
110
|
+
|
111
|
+
// List of fonts available in the toolbar combo. Each font definition is
|
112
|
+
// separated by a semi-colon (;). We are using class names here, so each font
|
113
|
+
// is defined by {Combo Label}/{Class Name}.
|
114
|
+
font_names: 'Comic Sans MS/FontComic;Courier New/FontCourier;Times New Roman/FontTimes',
|
115
|
+
|
116
|
+
// Define the way font elements will be applied to the document. The "span"
|
117
|
+
// element will be used. When a font is selected, the font name defined in the
|
118
|
+
// above list is passed to this definition with the name "Font", being it
|
119
|
+
// injected in the "class" attribute.
|
120
|
+
// We must also instruct the editor to replace span elements that are used to
|
121
|
+
// set the font (Overrides).
|
122
|
+
font_style: {
|
123
|
+
element: 'span',
|
124
|
+
attributes: { 'class': '#(family)' },
|
125
|
+
overrides: [
|
126
|
+
{
|
127
|
+
element: 'span',
|
128
|
+
attributes: {
|
129
|
+
'class': /^Font(?:Comic|Courier|Times)$/
|
130
|
+
}
|
131
|
+
}
|
132
|
+
]
|
133
|
+
},
|
134
|
+
|
135
|
+
/*
|
136
|
+
* Font sizes.
|
137
|
+
*/
|
138
|
+
fontSize_sizes: 'Smaller/FontSmaller;Larger/FontLarger;8pt/FontSmall;14pt/FontBig;Double Size/FontDouble',
|
139
|
+
fontSize_style: {
|
140
|
+
element: 'span',
|
141
|
+
attributes: { 'class': '#(size)' },
|
142
|
+
overrides: [
|
143
|
+
{
|
144
|
+
element: 'span',
|
145
|
+
attributes: {
|
146
|
+
'class': /^Font(?:Smaller|Larger|Small|Big|Double)$/
|
147
|
+
}
|
148
|
+
}
|
149
|
+
]
|
150
|
+
} ,
|
151
|
+
|
152
|
+
/*
|
153
|
+
* Font colors.
|
154
|
+
*/
|
155
|
+
colorButton_enableMore: false,
|
156
|
+
|
157
|
+
colorButton_colors: 'FontColor1/FF9900,FontColor2/0066CC,FontColor3/F00',
|
158
|
+
colorButton_foreStyle: {
|
159
|
+
element: 'span',
|
160
|
+
attributes: { 'class': '#(color)' },
|
161
|
+
overrides: [
|
162
|
+
{
|
163
|
+
element: 'span',
|
164
|
+
attributes: {
|
165
|
+
'class': /^FontColor(?:1|2|3)$/
|
166
|
+
}
|
167
|
+
}
|
168
|
+
]
|
169
|
+
},
|
170
|
+
|
171
|
+
colorButton_backStyle: {
|
172
|
+
element: 'span',
|
173
|
+
attributes: { 'class': '#(color)BG' },
|
174
|
+
overrides: [
|
175
|
+
{
|
176
|
+
element: 'span',
|
177
|
+
attributes: {
|
178
|
+
'class': /^FontColor(?:1|2|3)BG$/
|
179
|
+
}
|
180
|
+
}
|
181
|
+
]
|
182
|
+
},
|
183
|
+
|
184
|
+
/*
|
185
|
+
* Indentation.
|
186
|
+
*/
|
187
|
+
indentClasses: [ 'Indent1', 'Indent2', 'Indent3' ],
|
188
|
+
|
189
|
+
/*
|
190
|
+
* Paragraph justification.
|
191
|
+
*/
|
192
|
+
justifyClasses: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull' ],
|
193
|
+
|
194
|
+
/*
|
195
|
+
* Styles combo.
|
196
|
+
*/
|
197
|
+
stylesSet: [
|
198
|
+
{ name: 'Strong Emphasis', element: 'strong' },
|
199
|
+
{ name: 'Emphasis', element: 'em' },
|
200
|
+
|
201
|
+
{ name: 'Computer Code', element: 'code' },
|
202
|
+
{ name: 'Keyboard Phrase', element: 'kbd' },
|
203
|
+
{ name: 'Sample Text', element: 'samp' },
|
204
|
+
{ name: 'Variable', element: 'var' },
|
205
|
+
|
206
|
+
{ name: 'Deleted Text', element: 'del' },
|
207
|
+
{ name: 'Inserted Text', element: 'ins' },
|
208
|
+
|
209
|
+
{ name: 'Cited Work', element: 'cite' },
|
210
|
+
{ name: 'Inline Quotation', element: 'q' }
|
211
|
+
]
|
212
|
+
});
|
213
|
+
|
214
|
+
</script>
|
215
|
+
</p>
|
216
|
+
<p>
|
217
|
+
<input type="submit" value="Submit">
|
218
|
+
</p>
|
219
|
+
</form>
|
220
|
+
<div id="footer">
|
221
|
+
<hr>
|
222
|
+
<p>
|
223
|
+
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
|
224
|
+
</p>
|
225
|
+
<p id="copy">
|
226
|
+
Copyright © 2003-2013, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
|
227
|
+
Knabben. All rights reserved.
|
228
|
+
</p>
|
229
|
+
</div>
|
230
|
+
</body>
|
231
|
+
</html>
|