Remove unnecessary CKEditor samples

pull/324/head
Jordan Wright 2016-07-11 22:21:01 -05:00
parent 8cfdd07663
commit 737acbdb4e
36 changed files with 0 additions and 4410 deletions

View File

@ -1,82 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Ajax &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link rel="stylesheet" href="sample.css">
<script>
var editor, html = '';
function createEditor() {
if ( editor )
return;
// Create a new editor inside the <div id="editor">, setting its value to html
var config = {};
editor = CKEDITOR.appendTo( 'editor', config, html );
}
function removeEditor() {
if ( !editor )
return;
// Retrieve the editor contents. In an Ajax application, this data would be
// sent to the server or used in any other way.
document.getElementById( 'editorcontents' ).innerHTML = html = editor.getData();
document.getElementById( 'contents' ).style.display = '';
// Destroy the editor.
editor.destroy();
editor = null;
}
</script>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Create and Destroy Editor Instances for Ajax Applications
</h1>
<div class="description">
<p>
This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
area will be displayed in a <code>&lt;div&gt;</code> element.
</p>
<p>
For details of how to create this setup check the source code of this sample page
for JavaScript code responsible for the creation and destruction of a CKEditor instance.
</p>
</div>
<p>Click the buttons to create and remove a CKEditor instance.</p>
<p>
<input onclick="createEditor();" type="button" value="Create Editor">
<input onclick="removeEditor();" type="button" value="Remove Editor">
</p>
<!-- This div will hold the editor. -->
<div id="editor">
</div>
<div id="contents" style="display: none">
<p>
Edited Contents:
</p>
<!-- This div will be used to display the editor contents. -->
<div id="editorcontents">
</div>
</div>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,207 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>API Usage &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link href="sample.css" rel="stylesheet">
<script>
// The instanceReady event is fired, when an instance of CKEditor has finished
// its initialization.
CKEDITOR.on( 'instanceReady', function( ev ) {
// Show the editor name and description in the browser status bar.
document.getElementById( 'eMessage' ).innerHTML = 'Instance <code>' + ev.editor.name + '<\/code> loaded.';
// Show this sample buttons.
document.getElementById( 'eButtons' ).style.display = 'block';
});
function InsertHTML() {
// Get the editor instance that we want to interact with.
var editor = CKEDITOR.instances.editor1;
var value = document.getElementById( 'htmlArea' ).value;
// Check the active editing mode.
if ( editor.mode == 'wysiwyg' )
{
// Insert HTML code.
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertHtml
editor.insertHtml( value );
}
else
alert( 'You must be in WYSIWYG mode!' );
}
function InsertText() {
// Get the editor instance that we want to interact with.
var editor = CKEDITOR.instances.editor1;
var value = document.getElementById( 'txtArea' ).value;
// Check the active editing mode.
if ( editor.mode == 'wysiwyg' )
{
// Insert as plain text.
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertText
editor.insertText( value );
}
else
alert( 'You must be in WYSIWYG mode!' );
}
function SetContents() {
// Get the editor instance that we want to interact with.
var editor = CKEDITOR.instances.editor1;
var value = document.getElementById( 'htmlArea' ).value;
// Set editor contents (replace current contents).
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setData
editor.setData( value );
}
function GetContents() {
// Get the editor instance that you want to interact with.
var editor = CKEDITOR.instances.editor1;
// Get editor contents
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData
alert( editor.getData() );
}
function ExecuteCommand( commandName ) {
// Get the editor instance that we want to interact with.
var editor = CKEDITOR.instances.editor1;
// Check the active editing mode.
if ( editor.mode == 'wysiwyg' )
{
// Execute the command.
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-execCommand
editor.execCommand( commandName );
}
else
alert( 'You must be in WYSIWYG mode!' );
}
function CheckDirty() {
// Get the editor instance that we want to interact with.
var editor = CKEDITOR.instances.editor1;
// Checks whether the current editor contents present changes when compared
// to the contents loaded into the editor at startup
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-checkDirty
alert( editor.checkDirty() );
}
function ResetDirty() {
// Get the editor instance that we want to interact with.
var editor = CKEDITOR.instances.editor1;
// Resets the "dirty state" of the editor (see CheckDirty())
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-resetDirty
editor.resetDirty();
alert( 'The "IsDirty" status has been reset' );
}
function Focus() {
CKEDITOR.instances.editor1.focus();
}
function onFocus() {
document.getElementById( 'eMessage' ).innerHTML = '<b>' + this.name + ' is focused </b>';
}
function onBlur() {
document.getElementById( 'eMessage' ).innerHTML = this.name + ' lost focus';
}
</script>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Using CKEditor JavaScript API
</h1>
<div class="description">
<p>
This sample shows how to use the
<a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor">CKEditor JavaScript API</a>
to interact with the editor at runtime.
</p>
<p>
For details on how to create this setup check the source code of this sample page.
</p>
</div>
<!-- This <div> holds alert messages to be display in the sample page. -->
<div id="alerts">
<noscript>
<p>
<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
support, like yours, you should still see the contents (HTML data) and you should
be able to edit it normally, without a rich editor interface.
</p>
</noscript>
</div>
<form action="../../../samples/sample_posteddata.php" method="post">
<textarea cols="100" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<script>
// Replace the <textarea id="editor1"> with an CKEditor instance.
CKEDITOR.replace( 'editor1', {
on: {
focus: onFocus,
blur: onBlur,
// Check for availability of corresponding plugins.
pluginsLoaded: function( evt ) {
var doc = CKEDITOR.document, ed = evt.editor;
if ( !ed.getCommand( 'bold' ) )
doc.getById( 'exec-bold' ).hide();
if ( !ed.getCommand( 'link' ) )
doc.getById( 'exec-link' ).hide();
}
}
});
</script>
<p id="eMessage">
</p>
<div id="eButtons" style="display: none">
<input id="exec-bold" onclick="ExecuteCommand('bold');" type="button" value="Execute &quot;bold&quot; Command">
<input id="exec-link" onclick="ExecuteCommand('link');" type="button" value="Execute &quot;link&quot; Command">
<input onclick="Focus();" type="button" value="Focus">
<br><br>
<input onclick="InsertHTML();" type="button" value="Insert HTML">
<input onclick="SetContents();" type="button" value="Set Editor Contents">
<input onclick="GetContents();" type="button" value="Get Editor Contents (HTML)">
<br>
<textarea cols="100" id="htmlArea" rows="3">&lt;h2&gt;Test&lt;/h2&gt;&lt;p&gt;This is some &lt;a href="/Test1.html"&gt;sample&lt;/a&gt; HTML code.&lt;/p&gt;</textarea>
<br>
<br>
<input onclick="InsertText();" type="button" value="Insert Text">
<br>
<textarea cols="100" id="txtArea" rows="3"> First line with some leading whitespaces.
Second line of text preceded by two line breaks.</textarea>
<br>
<br>
<input onclick="CheckDirty();" type="button" value="checkDirty()">
<input onclick="ResetDirty();" type="button" value="resetDirty()">
</div>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,56 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Append To Page Element Using JavaScript Code &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Append To Page Element Using JavaScript Code
</h1>
<div id="section1">
<div class="description">
<p>
The <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-appendTo">CKEDITOR.appendTo()</a></code> method serves to to place editors inside existing DOM elements. Unlike <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR-method-replace">CKEDITOR.replace()</a></code>,
a target container to be replaced is no longer necessary. A new editor
instance is inserted directly wherever it is desired.
</p>
<pre class="samples">CKEDITOR.appendTo( '<em>container_id</em>',
{ /* Configuration options to be used. */ }
'Editor content to be used.'
);</pre>
</div>
<script>
// This call can be placed at any point after the
// DOM element to append CKEditor to or inside the <head><script>
// in a window.onload event handler.
// Append a CKEditor instance using the default configuration and the
// provided content to the <div> element of ID "section1".
CKEDITOR.appendTo( 'section1',
null,
'<p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>'
);
</script>
</div>
<br>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -1,204 +0,0 @@
/*
* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*
* Styles used by the XHTML 1.1 sample page (xhtml.html).
*/
/**
* Basic definitions for the editing area.
*/
body
{
font-family: Arial, Verdana, sans-serif;
font-size: 80%;
color: #000000;
background-color: #ffffff;
padding: 5px;
margin: 0px;
}
/**
* Core styles.
*/
.Bold
{
font-weight: bold;
}
.Italic
{
font-style: italic;
}
.Underline
{
text-decoration: underline;
}
.StrikeThrough
{
text-decoration: line-through;
}
.Subscript
{
vertical-align: sub;
font-size: smaller;
}
.Superscript
{
vertical-align: super;
font-size: smaller;
}
/**
* Font faces.
*/
.FontComic
{
font-family: 'Comic Sans MS';
}
.FontCourier
{
font-family: 'Courier New';
}
.FontTimes
{
font-family: 'Times New Roman';
}
/**
* Font sizes.
*/
.FontSmaller
{
font-size: smaller;
}
.FontLarger
{
font-size: larger;
}
.FontSmall
{
font-size: 8pt;
}
.FontBig
{
font-size: 14pt;
}
.FontDouble
{
font-size: 200%;
}
/**
* Font colors.
*/
.FontColor1
{
color: #ff9900;
}
.FontColor2
{
color: #0066cc;
}
.FontColor3
{
color: #ff0000;
}
.FontColor1BG
{
background-color: #ff9900;
}
.FontColor2BG
{
background-color: #0066cc;
}
.FontColor3BG
{
background-color: #ff0000;
}
/**
* Indentation.
*/
.Indent1
{
margin-left: 40px;
}
.Indent2
{
margin-left: 80px;
}
.Indent3
{
margin-left: 120px;
}
/**
* Alignment.
*/
.JustifyLeft
{
text-align: left;
}
.JustifyRight
{
text-align: right;
}
.JustifyCenter
{
text-align: center;
}
.JustifyFull
{
text-align: justify;
}
/**
* Other.
*/
code
{
font-family: courier, monospace;
background-color: #eeeeee;
padding-left: 1px;
padding-right: 1px;
border: #c0c0c0 1px solid;
}
kbd
{
padding: 0px 1px 0px 1px;
border-width: 1px 2px 2px 1px;
border-style: solid;
}
blockquote
{
color: #808080;
}

View File

@ -1,59 +0,0 @@
<!DOCTYPE html>
<?php
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
?>
<html>
<head>
<meta charset="utf-8">
<title>Sample &mdash; CKEditor</title>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
CKEditor &mdash; Posted Data
</h1>
<table border="1" cellspacing="0" id="outputSample">
<colgroup><col width="120"></colgroup>
<thead>
<tr>
<th>Field&nbsp;Name</th>
<th>Value</th>
</tr>
</thead>
<?php
if (!empty($_POST))
{
foreach ( $_POST as $key => $value )
{
if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) )
continue;
if ( get_magic_quotes_gpc() )
$value = htmlspecialchars( stripslashes((string)$value) );
else
$value = htmlspecialchars( (string)$value );
?>
<tr>
<th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th>
<td><pre class="samples"><?php echo $value; ?></pre></td>
</tr>
<?php
}
}
?>
</table>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
</p>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,7 +0,0 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
var CKEDITOR_LANGS=function(){var c={af:"Afrikaans",ar:"Arabic",bg:"Bulgarian",bn:"Bengali/Bangla",bs:"Bosnian",ca:"Catalan",cs:"Czech",cy:"Welsh",da:"Danish",de:"German",el:"Greek",en:"English","en-au":"English (Australia)","en-ca":"English (Canadian)","en-gb":"English (United Kingdom)",eo:"Esperanto",es:"Spanish",et:"Estonian",eu:"Basque",fa:"Persian",fi:"Finnish",fo:"Faroese",fr:"French","fr-ca":"French (Canada)",gl:"Galician",gu:"Gujarati",he:"Hebrew",hi:"Hindi",hr:"Croatian",hu:"Hungarian",id:"Indonesian",
is:"Icelandic",it:"Italian",ja:"Japanese",ka:"Georgian",km:"Khmer",ko:"Korean",ku:"Kurdish",lt:"Lithuanian",lv:"Latvian",mk:"Macedonian",mn:"Mongolian",ms:"Malay",nb:"Norwegian Bokmal",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese (Portugal)","pt-br":"Portuguese (Brazil)",ro:"Romanian",ru:"Russian",si:"Sinhala",sk:"Slovak",sq:"Albanian",sl:"Slovenian",sr:"Serbian (Cyrillic)","sr-latn":"Serbian (Latin)",sv:"Swedish",th:"Thai",tr:"Turkish",tt:"Tatar",ug:"Uighur",uk:"Ukrainian",vi:"Vietnamese",
zh:"Chinese Traditional","zh-cn":"Chinese Simplified"},b=[],a;for(a in CKEDITOR.lang.languages)b.push({code:a,name:c[a]||a});b.sort(function(a,b){return a.name<b.name?-1:1});return b}();

File diff suppressed because one or more lines are too long

View File

@ -1,141 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Replace DIV &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link href="sample.css" rel="stylesheet">
<style>
div.editable
{
border: solid 2px transparent;
padding-left: 15px;
padding-right: 15px;
}
div.editable:hover
{
border-color: black;
}
</style>
<script>
// Uncomment the following code to test the "Timeout Loading Method".
// CKEDITOR.loadFullCoreTimeout = 5;
window.onload = function() {
// Listen to the double click event.
if ( window.addEventListener )
document.body.addEventListener( 'dblclick', onDoubleClick, false );
else if ( window.attachEvent )
document.body.attachEvent( 'ondblclick', onDoubleClick );
};
function onDoubleClick( ev ) {
// Get the element which fired the event. This is not necessarily the
// element to which the event has been attached.
var element = ev.target || ev.srcElement;
// Find out the div that holds this element.
var name;
do {
element = element.parentNode;
}
while ( element && ( name = element.nodeName.toLowerCase() ) &&
( name != 'div' || element.className.indexOf( 'editable' ) == -1 ) && name != 'body' );
if ( name == 'div' && element.className.indexOf( 'editable' ) != -1 )
replaceDiv( element );
}
var editor;
function replaceDiv( div ) {
if ( editor )
editor.destroy();
editor = CKEDITOR.replace( div );
}
</script>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Replace DIV with CKEditor on the Fly
</h1>
<div class="description">
<p>
This sample shows how to automatically replace <code>&lt;div&gt;</code> elements
with a CKEditor instance on the fly, following user's doubleclick. The content
that was previously placed inside the <code>&lt;div&gt;</code> element will now
be moved into CKEditor editing area.
</p>
<p>
For details on how to create this setup check the source code of this sample page.
</p>
</div>
<p>
Double-click any of the following <code>&lt;div&gt;</code> elements to transform them into
editor instances.
</p>
<div class="editable">
<h3>
Part 1
</h3>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
</p>
</div>
<div class="editable">
<h3>
Part 2
</h3>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
</p>
<p>
Donec velit. Mauris massa. Vestibulum non nulla. Nam suscipit arcu nec elit. Phasellus
sollicitudin iaculis ante. Ut non mauris et sapien tincidunt adipiscing. Vestibulum
vitae leo. Suspendisse nec mi tristique nulla laoreet vulputate.
</p>
</div>
<div class="editable">
<h3>
Part 3
</h3>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Cras et ipsum quis mi
semper accumsan. Integer pretium dui id massa. Suspendisse in nisl sit amet urna
rutrum imperdiet. Nulla eu tellus. Donec ante nisi, ullamcorper quis, fringilla
nec, sagittis eleifend, pede. Nulla commodo interdum massa. Donec id metus. Fusce
eu ipsum. Suspendisse auctor. Phasellus fermentum porttitor risus.
</p>
</div>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,128 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>CKEditor Samples</title>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
CKEditor Samples
</h1>
<div class="twoColumns">
<div class="twoColumnsLeft">
<h2 class="samples">
Basic Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="replacebyclass.html">Replace textarea elements by class name</a></dt>
<dd>Automatic replacement of all textarea elements of a given class with a CKEditor instance.</dd>
<dt><a class="samples" href="replacebycode.html">Replace textarea elements by code</a></dt>
<dd>Replacement of textarea elements with CKEditor instances by using a JavaScript call.</dd>
<dt><a class="samples" href="jquery.html">Create editors with jQuery</a></dt>
<dd>Creating standard and inline CKEditor instances with jQuery adapter.</dd>
</dl>
<h2 class="samples">
Basic Customization
</h2>
<dl class="samples">
<dt><a class="samples" href="uicolor.html">User Interface color</a></dt>
<dd>Changing CKEditor User Interface color and adding a toolbar button that lets the user set the UI color.</dd>
<dt><a class="samples" href="uilanguages.html">User Interface languages</a></dt>
<dd>Changing CKEditor User Interface language and adding a drop-down list that lets the user choose the UI language.</dd>
</dl>
<h2 class="samples">Plugins</h2>
<dl class="samples">
<dt><a class="samples" href="plugins/magicline/magicline.html">Magicline plugin</a></dt>
<dd>Using the Magicline plugin to access difficult focus spaces.</dd>
<dt><a class="samples" href="plugins/wysiwygarea/fullpage.html">Full page support</a></dt>
<dd>CKEditor inserted with a JavaScript call and used to edit the whole page from &lt;html&gt; to &lt;/html&gt;.</dd>
</dl>
</div>
<div class="twoColumnsRight">
<h2 class="samples">
Inline Editing
</h2>
<dl class="samples">
<dt><a class="samples" href="inlineall.html">Massive inline editor creation</a></dt>
<dd>Turn all elements with <code>contentEditable = true</code> attribute into inline editors.</dd>
<dt><a class="samples" href="inlinebycode.html">Convert element into an inline editor by code</a></dt>
<dd>Conversion of DOM elements into inline CKEditor instances by using a JavaScript call.</dd>
<dt><a class="samples" href="inlinetextarea.html">Replace textarea with inline editor</a> <span class="new">New!</span></dt>
<dd>A form with a textarea that is replaced by an inline editor at runtime.</dd>
</dl>
<h2 class="samples">
Advanced Samples
</h2>
<dl class="samples">
<dt><a class="samples" href="datafiltering.html">Data filtering and features activation</a> <span class="new">New!</span></dt>
<dd>Data filtering and automatic features activation basing on configuration.</dd>
<dt><a class="samples" href="divreplace.html">Replace DIV elements on the fly</a></dt>
<dd>Transforming a <code>div</code> element into an instance of CKEditor with a mouse click.</dd>
<dt><a class="samples" href="appendto.html">Append editor instances</a></dt>
<dd>Appending editor instances to existing DOM elements.</dd>
<dt><a class="samples" href="ajax.html">Create and destroy editor instances for Ajax applications</a></dt>
<dd>Creating and destroying CKEditor instances on the fly and saving the contents entered into the editor window.</dd>
<dt><a class="samples" href="api.html">Basic usage of the API</a></dt>
<dd>Using the CKEditor JavaScript API to interact with the editor at runtime.</dd>
<dt><a class="samples" href="xhtmlstyle.html">XHTML-compliant style</a></dt>
<dd>Configuring CKEditor to produce XHTML 1.1 compliant attributes and styles.</dd>
<dt><a class="samples" href="readonly.html">Read-only mode</a></dt>
<dd>Using the readOnly API to block introducing changes to the editor contents.</dd>
<dt><a class="samples" href="tabindex.html">"Tab" key-based navigation</a></dt>
<dd>Navigating among editor instances with tab key.</dd>
<dt><a class="samples" href="plugins/dialog/dialog.html">Using the JavaScript API to customize dialog windows</a></dt>
<dd>Using the dialog windows API to customize dialog windows without changing the original editor code.</dd>
<dt><a class="samples" href="plugins/enterkey/enterkey.html">Using the &quot;Enter&quot; key in CKEditor</a></dt>
<dd>Configuring the behavior of <em>Enter</em> and <em>Shift+Enter</em> keys.</dd>
<dt><a class="samples" href="plugins/htmlwriter/outputforflash.html">Output for Flash</a></dt>
<dd>Configuring CKEditor to produce HTML code that can be used with Adobe Flash.</dd>
<dt><a class="samples" href="plugins/htmlwriter/outputhtml.html">Output HTML</a></dt>
<dd>Configuring CKEditor to produce legacy HTML 4 code.</dd>
<dt><a class="samples" href="plugins/toolbar/toolbar.html">Toolbar Configurations</a></dt>
<dd>Configuring CKEditor to display full or custom toolbar layout.</dd>
</dl>
</div>
</div>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,311 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Massive inline editing &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<script>
// This code is generally not necessary, but it is here to demonstrate
// how to customize specific editor instances on the fly. This fits well
// this demo because we have editable elements (like headers) that
// require less features.
// The "instanceCreated" event is fired for every editor instance created.
CKEDITOR.on( 'instanceCreated', function( event ) {
var editor = event.editor,
element = editor.element;
// Customize editors for headers and tag list.
// These editors don't need features like smileys, templates, iframes etc.
if ( element.is( 'h1', 'h2', 'h3' ) || element.getAttribute( 'id' ) == 'taglist' ) {
// Customize the editor configurations on "configLoaded" event,
// which is fired after the configuration file loading and
// execution. This makes it possible to change the
// configurations before the editor initialization takes place.
editor.on( 'configLoaded', function() {
// Remove unnecessary plugins to make the editor simpler.
editor.config.removePlugins = 'colorbutton,find,flash,font,' +
'forms,iframe,image,newpage,removeformat,' +
'smiley,specialchar,stylescombo,templates';
// Rearrange the layout of the toolbar.
editor.config.toolbarGroups = [
{ name: 'editing', groups: [ 'basicstyles', 'links' ] },
{ name: 'undo' },
{ name: 'clipboard', groups: [ 'selection', 'clipboard' ] },
{ name: 'about' }
];
});
}
});
</script>
<link href="sample.css" rel="stylesheet">
<style>
/* The following styles are just to make the page look nice. */
/* Workaround to show Arial Black in Firefox. */
@font-face
{
font-family: 'arial-black';
src: local('Arial Black');
}
*[contenteditable="true"]
{
padding: 10px;
}
#container
{
width: 960px;
margin: 30px auto 0;
}
#header
{
overflow: hidden;
padding: 0 0 30px;
border-bottom: 5px solid #05B2D2;
position: relative;
}
#headerLeft,
#headerRight
{
width: 49%;
overflow: hidden;
}
#headerLeft
{
float: left;
padding: 10px 1px 1px;
}
#headerLeft h2,
#headerLeft h3
{
text-align: right;
margin: 0;
overflow: hidden;
font-weight: normal;
}
#headerLeft h2
{
font-family: "Arial Black",arial-black;
font-size: 4.6em;
line-height: 1.1;
text-transform: uppercase;
}
#headerLeft h3
{
font-size: 2.3em;
line-height: 1.1;
margin: .2em 0 0;
color: #666;
}
#headerRight
{
float: right;
padding: 1px;
}
#headerRight p
{
line-height: 1.8;
text-align: justify;
margin: 0;
}
#headerRight p + p
{
margin-top: 20px;
}
#headerRight > div
{
padding: 20px;
margin: 0 0 0 30px;
font-size: 1.4em;
color: #666;
}
#columns
{
color: #333;
overflow: hidden;
padding: 20px 0;
}
#columns > div
{
float: left;
width: 33.3%;
}
#columns #column1 > div
{
margin-left: 1px;
}
#columns #column3 > div
{
margin-right: 1px;
}
#columns > div > div
{
margin: 0px 10px;
padding: 10px 20px;
}
#columns blockquote
{
margin-left: 15px;
}
#tagLine
{
border-top: 5px solid #05B2D2;
padding-top: 20px;
}
#taglist {
display: inline-block;
margin-left: 20px;
font-weight: bold;
margin: 0 0 0 20px;
}
</style>
</head>
<body>
<div>
<h1 class="samples"><a href="index.html">CKEditor Samples</a> &raquo; Massive inline editing</h1>
<div class="description">
<p>This sample page demonstrates the inline editing feature - CKEditor instances will be created automatically from page elements with <strong>contentEditable</strong> attribute set to value <strong>true</strong>:</p>
<pre class="samples">&lt;div <strong>contenteditable="true</strong>" &gt; ... &lt;/div&gt;</pre>
<p>Click inside of any element below to start editing.</p>
</div>
</div>
<div id="container">
<div id="header">
<div id="headerLeft">
<h2 id="sampleTitle" contenteditable="true">
CKEditor<br> Goes Inline!
</h2>
<h3 contenteditable="true">
Lorem ipsum dolor sit amet dolor duis blandit vestibulum faucibus a, tortor.
</h3>
</div>
<div id="headerRight">
<div contenteditable="true">
<p>
Lorem ipsum dolor sit amet enim. Etiam ullamcorper. Suspendisse a pellentesque dui, non felis. Maecenas malesuada elit lectus felis, malesuada ultricies.
</p>
<p>
Curabitur et ligula. Ut molestie a, ultricies porta urna. Vestibulum commodo volutpat a, convallis ac, laoreet enim. Phasellus fermentum in, dolor. Pellentesque facilisis. Nulla imperdiet sit amet magna. Vestibulum dapibus, mauris nec malesuada fames ac.
</p>
</div>
</div>
</div>
<div id="columns">
<div id="column1">
<div contenteditable="true">
<h3>
Fusce vitae porttitor
</h3>
<p>
<strong>
Lorem ipsum dolor sit amet dolor. Duis blandit vestibulum faucibus a, tortor.
</strong>
</p>
<p>
Proin nunc justo felis mollis tincidunt, risus risus pede, posuere cubilia Curae, Nullam euismod, enim. Etiam nibh ultricies dolor ac dignissim erat volutpat. Vivamus fermentum <a href="http://ckeditor.com/">nisl nulla sem in</a> metus. Maecenas wisi. Donec nec erat volutpat.
</p>
<blockquote>
<p>
Fusce vitae porttitor a, euismod convallis nisl, blandit risus tortor, pretium.
Vehicula vitae, imperdiet vel, ornare enim vel sodales rutrum
</p>
</blockquote>
<blockquote>
<p>
Libero nunc, rhoncus ante ipsum non ipsum. Nunc eleifend pede turpis id sollicitudin fringilla. Phasellus ultrices, velit ac arcu.
</p>
</blockquote>
<p>Pellentesque nunc. Donec suscipit erat. Pellentesque habitant morbi tristique ullamcorper.</p>
<p><s>Mauris mattis feugiat lectus nec mauris. Nullam vitae ante.</s></p>
</div>
</div>
<div id="column2">
<div contenteditable="true">
<h3>
Integer condimentum sit amet
</h3>
<p>
<strong>Aenean nonummy a, mattis varius. Cras aliquet.</strong>
Praesent <a href="http://ckeditor.com/">magna non mattis ac, rhoncus nunc</a>, rhoncus eget, cursus pulvinar mollis.</p>
<p>Proin id nibh. Sed eu libero posuere sed, lectus. Phasellus dui gravida gravida feugiat mattis ac, felis.</p>
<p>Integer condimentum sit amet, tempor elit odio, a dolor non ante at sapien. Sed ac lectus. Nulla ligula quis eleifend mi, id leo velit pede cursus arcu id nulla ac lectus. Phasellus vestibulum. Nunc viverra enim quis diam.</p>
</div>
<div contenteditable="true">
<h3>
Praesent wisi accumsan sit amet nibh
</h3>
<p>Donec ullamcorper, risus tortor, pretium porttitor. Morbi quam quis lectus non leo.</p>
<p style="margin-left: 40px; ">Integer faucibus scelerisque. Proin faucibus at, aliquet vulputate, odio at eros. Fusce <a href="http://ckeditor.com/">gravida, erat vitae augue</a>. Fusce urna fringilla gravida.</p>
<p>In hac habitasse platea dictumst. Praesent wisi accumsan sit amet nibh. Maecenas orci luctus a, lacinia quam sem, posuere commodo, odio condimentum tempor, pede semper risus. Suspendisse pede. In hac habitasse platea dictumst. Nam sed laoreet sit amet erat. Integer.</p>
</div>
</div>
<div id="column3">
<div contenteditable="true">
<p>
<img src="assets/inlineall/logo.png" alt="CKEditor logo" style="float:left">
</p>
<p>Quisque justo neque, mattis sed, fermentum ultrices <strong>posuere cubilia Curae</strong>, Vestibulum elit metus, quis placerat ut, lectus. Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis. Fusce porttitor, nulla quis turpis. Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi. Donec odio nec velit ac nunc sit amet, accumsan cursus aliquet. Vestibulum ante sit amet sagittis mi.</p>
<h3>
Nullam laoreet vel consectetuer tellus suscipit
</h3>
<ul>
<li>Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis.</li>
<li>Fusce porttitor, nulla quis turpis. Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi.</li>
<li>Mauris eget tellus. Donec non felis. Nam eget dolor. Vestibulum enim. Donec.</li>
</ul>
<p>Quisque justo neque, mattis sed, <a href="http://ckeditor.com/">fermentum ultrices posuere cubilia</a> Curae, Vestibulum elit metus, quis placerat ut, lectus.</p>
<p>Nullam laoreet vel, consectetuer tellus suscipit ultricies, hendrerit wisi. Ut sagittis, nunc libero, egestas consequat lobortis velit rutrum ut, faucibus turpis. Fusce porttitor, nulla quis turpis.</p>
<p>Donec odio nec velit ac nunc sit amet, accumsan cursus aliquet. Vestibulum ante sit amet sagittis mi. Sed in nonummy faucibus turpis. Mauris eget tellus. Donec non felis. Nam eget dolor. Vestibulum enim. Donec.</p>
</div>
</div>
</div>
<div id="tagLine">
Tags of this article:
<p id="taglist" contenteditable="true">
inline, editing, floating, CKEditor
</p>
</div>
</div>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">
http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a>
- Frederico Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,121 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Inline Editing by Code &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link href="sample.css" rel="stylesheet">
<style>
#editable
{
padding: 10px;
float: left;
}
</style>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Inline Editing by Code
</h1>
<div class="description">
<p>
This sample shows how to create an inline editor instance of CKEditor. It is created
with a JavaScript call using the following code:
</p>
<pre class="samples">
// This property tells CKEditor to not activate every element with contenteditable=true element.
CKEDITOR.disableAutoInline = true;
var editor = CKEDITOR.inline( document.getElementById( 'editable' ) );
</pre>
<p>
Note that <code>editable</code> in the code above is the <code>id</code>
attribute of the <code>&lt;div&gt;</code> element to be converted into an inline instance.
</p>
</div>
<div id="editable" contenteditable="true">
<h1><img alt="Saturn V carrying Apollo 11" class="right" src="assets/sample.jpg" /> Apollo 11</h1>
<p><b>Apollo 11</b> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p>
<p>Armstrong spent about <s>three and a half</s> two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5&nbsp;kg) of lunar material for return to Earth. A third member of the mission, <a href="http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)" title="Michael Collins (astronaut)">Michael Collins</a>, piloted the <a href="http://en.wikipedia.org/wiki/Apollo_Command/Service_Module" title="Apollo Command/Service Module">command</a> spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.</p>
<h2>Broadcasting and <em>quotes</em> <a id="quotes" name="quotes"></a></h2>
<p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p>
<blockquote>
<p>One small step for [a] man, one giant leap for mankind.</p>
</blockquote>
<p>Apollo 11 effectively ended the <a href="http://en.wikipedia.org/wiki/Space_Race" title="Space Race">Space Race</a> and fulfilled a national goal proposed in 1961 by the late U.S. President <a href="http://en.wikipedia.org/wiki/John_F._Kennedy" title="John F. Kennedy">John F. Kennedy</a> in a speech before the United States Congress:</p>
<blockquote>
<p>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</p>
</blockquote>
<h2>Technical details <a id="tech-details" name="tech-details"></a></h2>
<table align="right" border="1" bordercolor="#ccc" cellpadding="5" cellspacing="0" style="border-collapse:collapse;margin:10px 0 10px 15px;">
<caption><strong>Mission crew</strong></caption>
<thead>
<tr>
<th scope="col">Position</th>
<th scope="col">Astronaut</th>
</tr>
</thead>
<tbody>
<tr>
<td>Commander</td>
<td>Neil A. Armstrong</td>
</tr>
<tr>
<td>Command Module Pilot</td>
<td>Michael Collins</td>
</tr>
<tr>
<td>Lunar Module Pilot</td>
<td>Edwin &quot;Buzz&quot; E. Aldrin, Jr.</td>
</tr>
</tbody>
</table>
<p>Launched by a <strong>Saturn V</strong> rocket from <a href="http://en.wikipedia.org/wiki/Kennedy_Space_Center" title="Kennedy Space Center">Kennedy Space Center</a> in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of <a href="http://en.wikipedia.org/wiki/NASA" title="NASA">NASA</a>&#39;s Apollo program. The Apollo spacecraft had three parts:</p>
<ol>
<li><strong>Command Module</strong> with a cabin for the three astronauts which was the only part which landed back on Earth</li>
<li><strong>Service Module</strong> which supported the Command Module with propulsion, electrical power, oxygen and water</li>
<li><strong>Lunar Module</strong> for landing on the Moon.</li>
</ol>
<p>After being sent to the Moon by the Saturn V&#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the <a href="http://en.wikipedia.org/wiki/Mare_Tranquillitatis" title="Mare Tranquillitatis">Sea of Tranquility</a>. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the <a href="http://en.wikipedia.org/wiki/Pacific_Ocean" title="Pacific Ocean">Pacific Ocean</a> on July 24.</p>
<hr />
<p style="text-align: right;"><small>Source: <a href="http://en.wikipedia.org/wiki/Apollo_11">Wikipedia.org</a></small></p>
</div>
<script>
// We need to turn off the automatic editor creation first.
CKEDITOR.disableAutoInline = true;
var editor = CKEDITOR.inline( 'editable' );
</script>
<div id="footer">
<hr>
<p contenteditable="true">
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">
http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a>
- Frederico Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,110 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Replace Textarea with Inline Editor &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link href="sample.css" rel="stylesheet">
<style>
/* Style the CKEditor element to look like a textfield */
.cke_textarea_inline
{
padding: 10px;
height: 200px;
overflow: auto;
border: 1px solid gray;
-webkit-appearance: textfield;
}
</style>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Replace Textarea with Inline Editor
</h1>
<div class="description">
<p>
You can also create an inline editor from a <code>textarea</code>
element. In this case the <code>textarea</code> will be replaced
by a <code>div</code> element with inline editing enabled.
</p>
<pre class="samples">
// "article-body" is the name of a textarea element.
var editor = CKEDITOR.inline( 'article-body' );
</pre>
</div>
<form action="sample_posteddata.php" method="post">
<h2>This is a sample form with some fields</h2>
<p>
Title:<br>
<input type="text" name="title" value="Sample Form"></p>
<p>
Article Body (Textarea converted to CKEditor):<br>
<textarea name="article-body" style="height: 200px">
&lt;h2&gt;Technical details &lt;a id="tech-details" name="tech-details"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;table align="right" border="1" bordercolor="#ccc" cellpadding="5" cellspacing="0" style="border-collapse:collapse;margin:10px 0 10px 15px;"&gt;
&lt;caption&gt;&lt;strong&gt;Mission crew&lt;/strong&gt;&lt;/caption&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope="col"&gt;Position&lt;/th&gt;
&lt;th scope="col"&gt;Astronaut&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Commander&lt;/td&gt;
&lt;td&gt;Neil A. Armstrong&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Command Module Pilot&lt;/td&gt;
&lt;td&gt;Michael Collins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lunar Module Pilot&lt;/td&gt;
&lt;td&gt;Edwin &quot;Buzz&quot; E. Aldrin, Jr.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Launched by a &lt;strong&gt;Saturn V&lt;/strong&gt; rocket from &lt;a href="http://en.wikipedia.org/wiki/Kennedy_Space_Center" title="Kennedy Space Center"&gt;Kennedy Space Center&lt;/a&gt; in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of &lt;a href="http://en.wikipedia.org/wiki/NASA" title="NASA"&gt;NASA&lt;/a&gt;&#39;s Apollo program. The Apollo spacecraft had three parts:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Command Module&lt;/strong&gt; with a cabin for the three astronauts which was the only part which landed back on Earth&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Service Module&lt;/strong&gt; which supported the Command Module with propulsion, electrical power, oxygen and water&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lunar Module&lt;/strong&gt; for landing on the Moon.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After being sent to the Moon by the Saturn V&#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the &lt;a href="http://en.wikipedia.org/wiki/Mare_Tranquillitatis" title="Mare Tranquillitatis"&gt;Sea of Tranquility&lt;/a&gt;. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the &lt;a href="http://en.wikipedia.org/wiki/Pacific_Ocean" title="Pacific Ocean"&gt;Pacific Ocean&lt;/a&gt; on July 24.&lt;/p&gt;
&lt;hr /&gt;
&lt;p style="text-align: right;"&gt;&lt;small&gt;Source: &lt;a href="http://en.wikipedia.org/wiki/Apollo_11"&gt;Wikipedia.org&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
</textarea>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
<script>
CKEDITOR.inline( 'article-body' );
</script>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">
http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a>
- Frederico Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,100 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>jQuery Adapter &mdash; CKEditor Sample</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="../ckeditor.js"></script>
<script src="../adapters/jquery.js"></script>
<link href="sample.css" rel="stylesheet">
<style>
#editable
{
padding: 10px;
float: left;
}
</style>
<script>
CKEDITOR.disableAutoInline = true;
$( document ).ready( function() {
$( '#editor1' ).ckeditor(); // Use CKEDITOR.replace() if element is <textarea>.
$( '#editable' ).ckeditor(); // Use CKEDITOR.inline().
} );
function setValue() {
$( '#editor1' ).val( $( 'input#val' ).val() );
}
</script>
</head>
<body>
<h1 class="samples">
<a href="index.html" id="a-test">CKEditor Samples</a> &raquo; Create Editors with jQuery
</h1>
<form action="sample_posteddata.php" method="post">
<div class="description">
<p>
This sample shows how to use the <a href="http://docs.ckeditor.com/#!/guide/dev_jquery">jQuery adapter</a>.
Note that you have to include both CKEditor and jQuery scripts before including the adapter.
</p>
<pre class="samples">
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="/ckeditor/ckeditor.js"&gt;&lt;/script&gt;
&lt;script src="/ckeditor/adapters/jquery.js"&gt;&lt;/script&gt;
</pre>
<p>Then you can replace HTML elements with a CKEditor instance using the <code>ckeditor()</code> method.</p>
<pre class="samples">
$( document ).ready( function() {
$( 'textarea#editor1' ).ckeditor();
} );
</pre>
</div>
<h2 class="samples">Inline Example</h2>
<div id="editable" contenteditable="true">
<p><img alt="Saturn V carrying Apollo 11" class="right" src="assets/sample.jpg"/><b>Apollo 11</b> was the spaceflight that landed the first humans, Americans <a href="http://en.wikipedia.org/wiki/Neil_Armstrong" title="Neil Armstrong">Neil Armstrong</a> and <a href="http://en.wikipedia.org/wiki/Buzz_Aldrin" title="Buzz Aldrin">Buzz Aldrin</a>, on the Moon on July 20, 1969, at 20:18 UTC. Armstrong became the first to step onto the lunar surface 6 hours later on July 21 at 02:56 UTC.</p>
<p>Armstrong spent about <s>three and a half</s> two and a half hours outside the spacecraft, Aldrin slightly less; and together they collected 47.5 pounds (21.5&nbsp;kg) of lunar material for return to Earth. A third member of the mission, <a href="http://en.wikipedia.org/wiki/Michael_Collins_(astronaut)" title="Michael Collins (astronaut)">Michael Collins</a>, piloted the <a href="http://en.wikipedia.org/wiki/Apollo_Command/Service_Module" title="Apollo Command/Service Module">command</a> spacecraft alone in lunar orbit until Armstrong and Aldrin returned to it for the trip back to Earth.
<p>Broadcast on live TV to a world-wide audience, Armstrong stepped onto the lunar surface and described the event as:</p>
<blockquote><p>One small step for [a] man, one giant leap for mankind.</p></blockquote> <p>Apollo 11 effectively ended the <a href="http://en.wikipedia.org/wiki/Space_Race" title="Space Race">Space Race</a> and fulfilled a national goal proposed in 1961 by the late U.S. President <a href="http://en.wikipedia.org/wiki/John_F._Kennedy" title="John F. Kennedy">John F. Kennedy</a> in a speech before the United States Congress:</p> <blockquote><p>[...] before this decade is out, of landing a man on the Moon and returning him safely to the Earth.</p></blockquote>
</div>
<br style="clear: both">
<h2 class="samples">Classic (iframe-based) Example</h2>
<textarea cols="80" id="editor1" name="editor1" rows="10">
&lt;h2&gt;Technical details &lt;a id=&quot;tech-details&quot; name=&quot;tech-details&quot;&gt;&lt;/a&gt;&lt;/h2&gt; &lt;table align=&quot;right&quot; border=&quot;1&quot; bordercolor=&quot;#ccc&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse:collapse;margin:10px 0 10px 15px;&quot;&gt; &lt;caption&gt;&lt;strong&gt;Mission crew&lt;/strong&gt;&lt;/caption&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope=&quot;col&quot;&gt;Position&lt;/th&gt; &lt;th scope=&quot;col&quot;&gt;Astronaut&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;Commander&lt;/td&gt; &lt;td&gt;Neil A. Armstrong&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Command Module Pilot&lt;/td&gt; &lt;td&gt;Michael Collins&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Lunar Module Pilot&lt;/td&gt; &lt;td&gt;Edwin &amp;quot;Buzz&amp;quot; E. Aldrin, Jr.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;Launched by a &lt;strong&gt;Saturn V&lt;/strong&gt; rocket from &lt;a href=&quot;http://en.wikipedia.org/wiki/Kennedy_Space_Center&quot; title=&quot;Kennedy Space Center&quot;&gt;Kennedy Space Center&lt;/a&gt; in Merritt Island, Florida on July 16, Apollo 11 was the fifth manned mission of &lt;a href=&quot;http://en.wikipedia.org/wiki/NASA&quot; title=&quot;NASA&quot;&gt;NASA&lt;/a&gt;&amp;#39;s Apollo program. The Apollo spacecraft had three parts:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Command Module&lt;/strong&gt; with a cabin for the three astronauts which was the only part which landed back on Earth&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Service Module&lt;/strong&gt; which supported the Command Module with propulsion, electrical power, oxygen and water&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Lunar Module&lt;/strong&gt; for landing on the Moon.&lt;/li&gt; &lt;/ol&gt; &lt;p&gt;After being sent to the Moon by the Saturn V&amp;#39;s upper stage, the astronauts separated the spacecraft from it and travelled for three days until they entered into lunar orbit. Armstrong and Aldrin then moved into the Lunar Module and landed in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Mare_Tranquillitatis&quot; title=&quot;Mare Tranquillitatis&quot;&gt;Sea of Tranquility&lt;/a&gt;. They stayed a total of about 21 and a half hours on the lunar surface. After lifting off in the upper part of the Lunar Module and rejoining Collins in the Command Module, they returned to Earth and landed in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Pacific_Ocean&quot; title=&quot;Pacific Ocean&quot;&gt;Pacific Ocean&lt;/a&gt; on July 24.&lt;/p&gt; &lt;hr/&gt; &lt;p style=&quot;text-align: right;&quot;&gt;&lt;small&gt;Source: &lt;a href=&quot;http://en.wikipedia.org/wiki/Apollo_11&quot;&gt;Wikipedia.org&lt;/a&gt;&lt;/small&gt;&lt;/p&gt;
</textarea>
<p style="overflow: hidden">
<input style="float: left" type="submit" value="Submit">
<span style="float: right">
<input type="text" id="val" value="I'm using jQuery val()!" size="30">
<input onclick="setValue();" type="button" value="Set value">
</span>
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,48 +0,0 @@
/**
* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.dialog.add( 'myDialog', function() {
return {
title: 'My Dialog',
minWidth: 400,
minHeight: 200,
contents: [
{
id: 'tab1',
label: 'First Tab',
title: 'First Tab',
elements: [
{
id: 'input1',
type: 'text',
label: 'Text Field'
},
{
id: 'select1',
type: 'select',
label: 'Select Field',
items: [
[ 'option1', 'value1' ],
[ 'option2', 'value2' ]
]
}
]
},
{
id: 'tab2',
label: 'Second Tab',
title: 'Second Tab',
elements: [
{
id: 'button1',
type: 'button',
label: 'Button Field'
}
]
}
]
};
} );

View File

@ -1,187 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Using API to Customize Dialog Windows &mdash; CKEditor Sample</title>
<script src="../../../ckeditor.js"></script>
<link rel="stylesheet" href="../../../samples/sample.css">
<meta name="ckeditor-sample-name" content="Using the JavaScript API to customize dialog windows">
<meta name="ckeditor-sample-group" content="Advanced Samples">
<meta name="ckeditor-sample-description" content="Using the dialog windows API to customize dialog windows without changing the original editor code.">
<style>
.cke_button__mybutton_icon
{
display: none !important;
}
.cke_button__mybutton_label
{
display: inline !important;
}
</style>
<script>
CKEDITOR.on( 'instanceCreated', function( ev ){
var editor = ev.editor;
// Listen for the "pluginsLoaded" event, so we are sure that the
// "dialog" plugin has been loaded and we are able to do our
// customizations.
editor.on( 'pluginsLoaded', function() {
// If our custom dialog has not been registered, do that now.
if ( !CKEDITOR.dialog.exists( 'myDialog' ) ) {
// We need to do the following trick to find out the dialog
// definition file URL path. In the real world, you would simply
// point to an absolute path directly, like "/mydir/mydialog.js".
var href = document.location.href.split( '/' );
href.pop();
href.push( 'assets/my_dialog.js' );
href = href.join( '/' );
// Finally, register the dialog.
CKEDITOR.dialog.add( 'myDialog', href );
}
// Register the command used to open the dialog.
editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
// Add the a custom toolbar buttons, which fires the above
// command..
editor.ui.add( 'MyButton', CKEDITOR.UI_BUTTON, {
label: 'My Dialog',
command: 'myDialogCmd'
});
});
});
// When opening a dialog, its "definition" is created for it, for
// each editor instance. The "dialogDefinition" event is then
// fired. We should use this event to make customizations to the
// definition of existing dialogs.
CKEDITOR.on( 'dialogDefinition', function( ev ) {
// Take the dialog name and its definition from the event data.
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
// Check if the definition is from the dialog we're
// interested on (the "Link" dialog).
if ( dialogName == 'myDialog' && ev.editor.name == 'editor2' ) {
// Get a reference to the "Link Info" tab.
var infoTab = dialogDefinition.getContents( 'tab1' );
// Add a new text field to the "tab1" tab page.
infoTab.add( {
type: 'text',
label: 'My Custom Field',
id: 'customField',
'default': 'Sample!',
validate: function() {
if ( ( /\d/ ).test( this.getValue() ) )
return 'My Custom Field must not contain digits';
}
});
// Remove the "select1" field from the "tab1" tab.
infoTab.remove( 'select1' );
// Set the default value for "input1" field.
var input1 = infoTab.get( 'input1' );
input1[ 'default' ] = 'www.example.com';
// Remove the "tab2" tab page.
dialogDefinition.removeContents( 'tab2' );
// Add a new tab to the "Link" dialog.
dialogDefinition.addContents( {
id: 'customTab',
label: 'My Tab',
accessKey: 'M',
elements: [
{
id: 'myField1',
type: 'text',
label: 'My Text Field'
},
{
id: 'myField2',
type: 'text',
label: 'Another Text Field'
}
]
});
// Provide the focus handler to start initial focus in "customField" field.
dialogDefinition.onFocus = function() {
var urlField = this.getContentElement( 'tab1', 'customField' );
urlField.select();
};
}
});
var config = {
extraPlugins: 'dialog',
toolbar: [ [ 'MyButton' ] ]
};
</script>
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Using CKEditor Dialog API
</h1>
<div class="description">
<p>
This sample shows how to use the
<a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.dialog">CKEditor Dialog API</a>
to customize CKEditor dialog windows without changing the original editor code.
The following customizations are being done in the example below:
</p>
<p>
For details on how to create this setup check the source code of this sample page.
</p>
</div>
<p>A custom dialog is added to the editors using the <code>pluginsLoaded</code> event, from an external <a target="_blank" href="assets/my_dialog.js">dialog definition file</a>:</p>
<ol>
<li><strong>Creating a custom dialog window</strong> &ndash; "My Dialog" dialog window opened with the "My Dialog" toolbar button.</li>
<li><strong>Creating a custom button</strong> &ndash; Add button to open the dialog with "My Dialog" toolbar button.</li>
</ol>
<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<script>
// Replace the <textarea id="editor1"> with an CKEditor instance.
CKEDITOR.replace( 'editor1', config );
</script>
<p>The below editor modify the dialog definition of the above added dialog using the <code>dialogDefinition</code> event:</p>
<ol>
<li><strong>Adding dialog tab</strong> &ndash; Add new tab "My Tab" to dialog window.</li>
<li><strong>Removing a dialog window tab</strong> &ndash; Remove "Second Tab" page from the dialog window.</li>
<li><strong>Adding dialog window fields</strong> &ndash; Add "My Custom Field" to the dialog window.</li>
<li><strong>Removing dialog window field</strong> &ndash; Remove "Select Field" selection field from the dialog window.</li>
<li><strong>Setting default values for dialog window fields</strong> &ndash; Set default value of "Text Field" text field. </li>
<li><strong>Setup initial focus for dialog window</strong> &ndash; Put initial focus on "My Custom Field" text field. </li>
</ol>
<textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<script>
// Replace the <textarea id="editor1"> with an CKEditor instance.
CKEDITOR.replace( 'editor2', config );
</script>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,103 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>ENTER Key Configuration &mdash; CKEditor Sample</title>
<script src="../../../ckeditor.js"></script>
<link href="../../../samples/sample.css" rel="stylesheet">
<meta name="ckeditor-sample-name" content="Using the &quot;Enter&quot; key in CKEditor">
<meta name="ckeditor-sample-group" content="Advanced Samples">
<meta name="ckeditor-sample-description" content="Configuring the behavior of &lt;em&gt;Enter&lt;/em&gt; and &lt;em&gt;Shift+Enter&lt;/em&gt; keys.">
<script>
var editor;
function changeEnter() {
// If we already have an editor, let's destroy it first.
if ( editor )
editor.destroy( true );
// Create the editor again, with the appropriate settings.
editor = CKEDITOR.replace( 'editor1', {
extraPlugins: 'enterkey',
enterMode: Number( document.getElementById( 'xEnter' ).value ),
shiftEnterMode: Number( document.getElementById( 'xShiftEnter' ).value )
});
}
window.onload = changeEnter;
</script>
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> &raquo; ENTER Key Configuration
</h1>
<div class="description">
<p>
This sample shows how to configure the <em>Enter</em> and <em>Shift+Enter</em> keys
to perform actions specified in the
<a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enterMode"><code>enterMode</code></a>
and <a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-shiftEnterMode"><code>shiftEnterMode</code></a>
parameters, respectively.
You can choose from the following options:
</p>
<ul class="samples">
<li><strong><code>ENTER_P</code></strong> &ndash; new <code>&lt;p&gt;</code> paragraphs are created;</li>
<li><strong><code>ENTER_BR</code></strong> &ndash; lines are broken with <code>&lt;br&gt;</code> elements;</li>
<li><strong><code>ENTER_DIV</code></strong> &ndash; new <code>&lt;div&gt;</code> blocks are created.</li>
</ul>
<p>
The sample code below shows how to configure CKEditor to create a <code>&lt;div&gt;</code> block when <em>Enter</em> key is pressed.
</p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
<strong>enterMode: CKEDITOR.ENTER_DIV</strong>
});</pre>
<p>
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
the <code>&lt;textarea&gt;</code> element to be replaced.
</p>
</div>
<div style="float: left; margin-right: 20px">
When <em>Enter</em> is pressed:<br>
<select id="xEnter" onchange="changeEnter();">
<option selected="selected" value="1">Create a new &lt;P&gt; (recommended)</option>
<option value="3">Create a new &lt;DIV&gt;</option>
<option value="2">Break the line with a &lt;BR&gt;</option>
</select>
</div>
<div style="float: left">
When <em>Shift+Enter</em> is pressed:<br>
<select id="xShiftEnter" onchange="changeEnter();">
<option value="1">Create a new &lt;P&gt;</option>
<option value="3">Create a new &lt;DIV&gt;</option>
<option selected="selected" value="2">Break the line with a &lt;BR&gt; (recommended)</option>
</select>
</div>
<br style="clear: both">
<form action="../../../samples/sample_posteddata.php" method="post">
<p>
<br>
<textarea cols="80" id="editor1" name="editor1" rows="10">This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.</textarea>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,18 +0,0 @@
var swfobject=function(){function u(){if(!s){try{var a=d.getElementsByTagName("body")[0].appendChild(d.createElement("span"));a.parentNode.removeChild(a)}catch(b){return}s=!0;for(var a=x.length,c=0;c<a;c++)x[c]()}}function L(a){s?a():x[x.length]=a}function M(a){if(typeof m.addEventListener!=i)m.addEventListener("load",a,!1);else if(typeof d.addEventListener!=i)d.addEventListener("load",a,!1);else if(typeof m.attachEvent!=i)U(m,"onload",a);else if("function"==typeof m.onload){var b=m.onload;m.onload=
function(){b();a()}}else m.onload=a}function V(){var a=d.getElementsByTagName("body")[0],b=d.createElement(r);b.setAttribute("type",y);var c=a.appendChild(b);if(c){var f=0;(function(){if(typeof c.GetVariable!=i){var g=c.GetVariable("$version");g&&(g=g.split(" ")[1].split(","),e.pv=[parseInt(g[0],10),parseInt(g[1],10),parseInt(g[2],10)])}else if(10>f){f++;setTimeout(arguments.callee,10);return}a.removeChild(b);c=null;D()})()}else D()}function D(){var a=p.length;if(0<a)for(var b=0;b<a;b++){var c=p[b].id,
f=p[b].callbackFn,g={success:!1,id:c};if(0<e.pv[0]){var d=n(c);if(d)if(z(p[b].swfVersion)&&!(e.wk&&312>e.wk))t(c,!0),f&&(g.success=!0,g.ref=E(c),f(g));else if(p[b].expressInstall&&F()){g={};g.data=p[b].expressInstall;g.width=d.getAttribute("width")||"0";g.height=d.getAttribute("height")||"0";d.getAttribute("class")&&(g.styleclass=d.getAttribute("class"));d.getAttribute("align")&&(g.align=d.getAttribute("align"));for(var h={},d=d.getElementsByTagName("param"),j=d.length,k=0;k<j;k++)"movie"!=d[k].getAttribute("name").toLowerCase()&&
(h[d[k].getAttribute("name")]=d[k].getAttribute("value"));G(g,h,c,f)}else W(d),f&&f(g)}else if(t(c,!0),f){if((c=E(c))&&typeof c.SetVariable!=i)g.success=!0,g.ref=c;f(g)}}}function E(a){var b=null;if((a=n(a))&&"OBJECT"==a.nodeName)typeof a.SetVariable!=i?b=a:(a=a.getElementsByTagName(r)[0])&&(b=a);return b}function F(){return!A&&z("6.0.65")&&(e.win||e.mac)&&!(e.wk&&312>e.wk)}function G(a,b,c,f){A=!0;H=f||null;N={success:!1,id:c};var g=n(c);if(g){"OBJECT"==g.nodeName?(w=I(g),B=null):(w=g,B=c);a.id=
O;if(typeof a.width==i||!/%$/.test(a.width)&&310>parseInt(a.width,10))a.width="310";if(typeof a.height==i||!/%$/.test(a.height)&&137>parseInt(a.height,10))a.height="137";d.title=d.title.slice(0,47)+" - Flash Player Installation";f=e.ie&&e.win?"ActiveX":"PlugIn";f="MMredirectURL="+m.location.toString().replace(/&/g,"%26")+"&MMplayerType="+f+"&MMdoctitle="+d.title;b.flashvars=typeof b.flashvars!=i?b.flashvars+("&"+f):f;e.ie&&(e.win&&4!=g.readyState)&&(f=d.createElement("div"),c+="SWFObjectNew",f.setAttribute("id",
c),g.parentNode.insertBefore(f,g),g.style.display="none",function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}());J(a,b,c)}}function W(a){if(e.ie&&e.win&&4!=a.readyState){var b=d.createElement("div");a.parentNode.insertBefore(b,a);b.parentNode.replaceChild(I(a),b);a.style.display="none";(function(){4==a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)})()}else a.parentNode.replaceChild(I(a),a)}function I(a){var b=d.createElement("div");if(e.win&&
e.ie)b.innerHTML=a.innerHTML;else if(a=a.getElementsByTagName(r)[0])if(a=a.childNodes)for(var c=a.length,f=0;f<c;f++)!(1==a[f].nodeType&&"PARAM"==a[f].nodeName)&&8!=a[f].nodeType&&b.appendChild(a[f].cloneNode(!0));return b}function J(a,b,c){var f,g=n(c);if(e.wk&&312>e.wk)return f;if(g)if(typeof a.id==i&&(a.id=c),e.ie&&e.win){var o="",h;for(h in a)a[h]!=Object.prototype[h]&&("data"==h.toLowerCase()?b.movie=a[h]:"styleclass"==h.toLowerCase()?o+=' class="'+a[h]+'"':"classid"!=h.toLowerCase()&&(o+=" "+
h+'="'+a[h]+'"'));h="";for(var j in b)b[j]!=Object.prototype[j]&&(h+='<param name="'+j+'" value="'+b[j]+'" />');g.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+o+">"+h+"</object>";C[C.length]=a.id;f=n(a.id)}else{j=d.createElement(r);j.setAttribute("type",y);for(var k in a)a[k]!=Object.prototype[k]&&("styleclass"==k.toLowerCase()?j.setAttribute("class",a[k]):"classid"!=k.toLowerCase()&&j.setAttribute(k,a[k]));for(o in b)b[o]!=Object.prototype[o]&&"movie"!=o.toLowerCase()&&
(a=j,h=o,k=b[o],c=d.createElement("param"),c.setAttribute("name",h),c.setAttribute("value",k),a.appendChild(c));g.parentNode.replaceChild(j,g);f=j}return f}function P(a){var b=n(a);b&&"OBJECT"==b.nodeName&&(e.ie&&e.win?(b.style.display="none",function(){if(4==b.readyState){var c=n(a);if(c){for(var f in c)"function"==typeof c[f]&&(c[f]=null);c.parentNode.removeChild(c)}}else setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function n(a){var b=null;try{b=d.getElementById(a)}catch(c){}return b}
function U(a,b,c){a.attachEvent(b,c);v[v.length]=[a,b,c]}function z(a){var b=e.pv,a=a.split(".");a[0]=parseInt(a[0],10);a[1]=parseInt(a[1],10)||0;a[2]=parseInt(a[2],10)||0;return b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?!0:!1}function Q(a,b,c,f){if(!e.ie||!e.mac){var g=d.getElementsByTagName("head")[0];if(g){c=c&&"string"==typeof c?c:"screen";f&&(K=l=null);if(!l||K!=c)f=d.createElement("style"),f.setAttribute("type","text/css"),f.setAttribute("media",c),l=g.appendChild(f),
e.ie&&(e.win&&typeof d.styleSheets!=i&&0<d.styleSheets.length)&&(l=d.styleSheets[d.styleSheets.length-1]),K=c;e.ie&&e.win?l&&typeof l.addRule==r&&l.addRule(a,b):l&&typeof d.createTextNode!=i&&l.appendChild(d.createTextNode(a+" {"+b+"}"))}}}function t(a,b){if(R){var c=b?"visible":"hidden";s&&n(a)?n(a).style.visibility=c:Q("#"+a,"visibility:"+c)}}function S(a){return null!=/[\\\"<>\.;]/.exec(a)&&typeof encodeURIComponent!=i?encodeURIComponent(a):a}var i="undefined",r="object",y="application/x-shockwave-flash",
O="SWFObjectExprInst",m=window,d=document,q=navigator,T=!1,x=[function(){T?V():D()}],p=[],C=[],v=[],w,B,H,N,s=!1,A=!1,l,K,R=!0,e=function(){var a=typeof d.getElementById!=i&&typeof d.getElementsByTagName!=i&&typeof d.createElement!=i,b=q.userAgent.toLowerCase(),c=q.platform.toLowerCase(),f=c?/win/.test(c):/win/.test(b),c=c?/mac/.test(c):/mac/.test(b),b=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!+"\v1",e=[0,0,0],h=null;if(typeof q.plugins!=i&&typeof q.plugins["Shockwave Flash"]==
r){if((h=q.plugins["Shockwave Flash"].description)&&!(typeof q.mimeTypes!=i&&q.mimeTypes[y]&&!q.mimeTypes[y].enabledPlugin))T=!0,g=!1,h=h.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),e[0]=parseInt(h.replace(/^(.*)\..*$/,"$1"),10),e[1]=parseInt(h.replace(/^.*\.(.*)\s.*$/,"$1"),10),e[2]=/[a-zA-Z]/.test(h)?parseInt(h.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}else if(typeof m.ActiveXObject!=i)try{var j=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(j&&(h=j.GetVariable("$version")))g=!0,h=h.split(" ")[1].split(","),
e=[parseInt(h[0],10),parseInt(h[1],10),parseInt(h[2],10)]}catch(k){}return{w3:a,pv:e,wk:b,ie:g,win:f,mac:c}}();(function(){e.w3&&((typeof d.readyState!=i&&"complete"==d.readyState||typeof d.readyState==i&&(d.getElementsByTagName("body")[0]||d.body))&&u(),s||(typeof d.addEventListener!=i&&d.addEventListener("DOMContentLoaded",u,!1),e.ie&&e.win&&(d.attachEvent("onreadystatechange",function(){"complete"==d.readyState&&(d.detachEvent("onreadystatechange",arguments.callee),u())}),m==top&&function(){if(!s){try{d.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,
0);return}u()}}()),e.wk&&function(){s||(/loaded|complete/.test(d.readyState)?u():setTimeout(arguments.callee,0))}(),M(u)))})();(function(){e.ie&&e.win&&window.attachEvent("onunload",function(){for(var a=v.length,b=0;b<a;b++)v[b][0].detachEvent(v[b][1],v[b][2]);a=C.length;for(b=0;b<a;b++)P(C[b]);for(var c in e)e[c]=null;e=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})})();return{registerObject:function(a,b,c,f){if(e.w3&&a&&b){var d={};d.id=a;d.swfVersion=b;d.expressInstall=c;d.callbackFn=
f;p[p.length]=d;t(a,!1)}else f&&f({success:!1,id:a})},getObjectById:function(a){if(e.w3)return E(a)},embedSWF:function(a,b,c,d,g,o,h,j,k,m){var n={success:!1,id:b};e.w3&&!(e.wk&&312>e.wk)&&a&&b&&c&&d&&g?(t(b,!1),L(function(){c+="";d+="";var e={};if(k&&typeof k===r)for(var l in k)e[l]=k[l];e.data=a;e.width=c;e.height=d;l={};if(j&&typeof j===r)for(var p in j)l[p]=j[p];if(h&&typeof h===r)for(var q in h)l.flashvars=typeof l.flashvars!=i?l.flashvars+("&"+q+"="+h[q]):q+"="+h[q];if(z(g))p=J(e,l,b),e.id==
b&&t(b,!0),n.success=!0,n.ref=p;else{if(o&&F()){e.data=o;G(e,l,b,m);return}t(b,!0)}m&&m(n)})):m&&m(n)},switchOffAutoHideShow:function(){R=!1},ua:e,getFlashPlayerVersion:function(){return{major:e.pv[0],minor:e.pv[1],release:e.pv[2]}},hasFlashPlayerVersion:z,createSWF:function(a,b,c){if(e.w3)return J(a,b,c)},showExpressInstall:function(a,b,c,d){e.w3&&F()&&G(a,b,c,d)},removeSWF:function(a){e.w3&&P(a)},createCSS:function(a,b,c,d){e.w3&&Q(a,b,c,d)},addDomLoadEvent:L,addLoadEvent:M,getQueryParamValue:function(a){var b=
d.location.search||d.location.hash;if(b){/\?/.test(b)&&(b=b.split("?")[1]);if(null==a)return S(b);for(var b=b.split("&"),c=0;c<b.length;c++)if(b[c].substring(0,b[c].indexOf("="))==a)return S(b[c].substring(b[c].indexOf("=")+1))}return""},expressInstallCallback:function(){if(A){var a=n(O);a&&w&&(a.parentNode.replaceChild(w,a),B&&(t(B,!0),e.ie&&e.win&&(w.style.display="block")),H&&H(N));A=!1}}}}();

View File

@ -1,280 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Output for Flash &mdash; CKEditor Sample</title>
<script src="../../../ckeditor.js"></script>
<script src="../../../samples/sample.js"></script>
<script src="assets/outputforflash/swfobject.js"></script>
<link href="../../../samples/sample.css" rel="stylesheet">
<meta name="ckeditor-sample-required-plugins" content="sourcearea">
<meta name="ckeditor-sample-name" content="Output for Flash">
<meta name="ckeditor-sample-group" content="Advanced Samples">
<meta name="ckeditor-sample-description" content="Configuring CKEditor to produce HTML code that can be used with Adobe Flash.">
<style>
.alert
{
background: #ffa84c;
padding: 10px 15px;
font-weight: bold;
display: block;
margin-bottom: 20px;
}
</style>
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Producing Flash Compliant HTML Output
</h1>
<div class="description">
<p>
This sample shows how to configure CKEditor to output
HTML code that can be used with
<a class="samples" href="http://www.adobe.com/livedocs/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&amp;file=00000922.html">
Adobe Flash</a>.
The code will contain a subset of standard HTML elements like <code>&lt;b&gt;</code>,
<code>&lt;i&gt;</code>, and <code>&lt;p&gt;</code> as well as HTML attributes.
</p>
<p>
To add a CKEditor instance outputting Flash compliant HTML code, load the editor using a standard
JavaScript call, and define CKEditor features to use HTML elements and attributes.
</p>
<p>
For details on how to create this setup check the source code of this sample page.
</p>
</div>
<p>
To see how it works, create some content in the editing area of CKEditor on the left
and send it to the Flash object on the right side of the page by using the
<strong>Send to Flash</strong> button.
</p>
<table style="width: 100%; border-spacing: 0; border-collapse:collapse;">
<tr>
<td style="width: 100%">
<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;&lt;b&gt;&lt;font size=&quot;18&quot; style=&quot;font-size:18px;&quot;&gt;Flash and HTML&lt;/font&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It is possible to have &lt;a href=&quot;http://ckeditor.com&quot;&gt;CKEditor&lt;/a&gt; creating content that will be later loaded inside &lt;b&gt;Flash&lt;/b&gt; objects and animations.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Flash has a few limitations when dealing with HTML:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It has limited support on tags.&lt;/li&gt;&lt;li&gt;There is no margin between block elements, like paragraphs.&lt;/li&gt;&lt;/ul&gt;</textarea>
<script>
if ( document.location.protocol == 'file:' )
alert( 'Warning: This samples does not work when loaded from local filesystem' +
'due to security restrictions implemented in Flash.' +
'\n\nPlease load the sample from a web server instead.' );
var editor = CKEDITOR.replace( 'editor1', {
/*
* Ensure that htmlwriter plugin, which is required for this sample, is loaded.
*/
extraPlugins: 'htmlwriter',
height: 290,
width: '100%',
toolbar: [
[ 'Source', '-', 'Bold', 'Italic', 'Underline', '-', 'BulletedList', '-', 'Link', 'Unlink' ],
[ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock' ],
'/',
[ 'Font', 'FontSize' ],
[ 'TextColor', '-', 'About' ]
],
/*
* Style sheet for the contents
*/
contentsCss: 'body {color:#000; background-color#FFF; font-family: Arial; font-size:80%;} p, ol, ul {margin-top: 0px; margin-bottom: 0px;}',
/*
* Quirks doctype
*/
docType: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
/*
* Core styles.
*/
coreStyles_bold: { element: 'b' },
coreStyles_italic: { element: 'i' },
coreStyles_underline: { element: 'u' },
/*
* Font face.
*/
// Define the way font elements will be applied to the document. The "font"
// element will be used.
font_style: {
element: 'font',
attributes: { 'face': '#(family)' }
},
/*
* Font sizes.
*/
// The CSS part of the font sizes isn't used by Flash, it is there to get the
// font rendered correctly in CKEditor.
fontSize_sizes: '8px/8;9px/9;10px/10;11px/11;12px/12;14px/14;16px/16;18px/18;20px/20;22px/22;24px/24;26px/26;28px/28;36px/36;48px/48;72px/72',
fontSize_style: {
element: 'font',
attributes: { 'size': '#(size)' },
styles: { 'font-size': '#(size)px' }
} ,
/*
* Font colors.
*/
colorButton_enableMore: true,
colorButton_foreStyle: {
element: 'font',
attributes: { 'color': '#(color)' }
},
colorButton_backStyle: {
element: 'font',
styles: { 'background-color': '#(color)' }
},
on: { 'instanceReady': configureFlashOutput }
});
/*
* Adjust the behavior of the dataProcessor to match the
* requirements of Flash
*/
function configureFlashOutput( ev ) {
var editor = ev.editor,
dataProcessor = editor.dataProcessor,
htmlFilter = dataProcessor && dataProcessor.htmlFilter;
// Out self closing tags the HTML4 way, like <br>.
dataProcessor.writer.selfClosingEnd = '>';
// Make output formatting match Flash expectations
var dtd = CKEDITOR.dtd;
for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) {
dataProcessor.writer.setRules( e, {
indent: false,
breakBeforeOpen: false,
breakAfterOpen: false,
breakBeforeClose: false,
breakAfterClose: false
});
}
dataProcessor.writer.setRules( 'br', {
indent: false,
breakBeforeOpen: false,
breakAfterOpen: false,
breakBeforeClose: false,
breakAfterClose: false
});
// Output properties as attributes, not styles.
htmlFilter.addRules( {
elements: {
$: function( element ) {
var style, match, width, height, align;
// Output dimensions of images as width and height
if ( element.name == 'img' ) {
style = element.attributes.style;
if ( style ) {
// Get the width from the style.
match = ( /(?:^|\s)width\s*:\s*(\d+)px/i ).exec( style );
width = match && match[1];
// Get the height from the style.
match = ( /(?:^|\s)height\s*:\s*(\d+)px/i ).exec( style );
height = match && match[1];
if ( width ) {
element.attributes.style = element.attributes.style.replace( /(?:^|\s)width\s*:\s*(\d+)px;?/i , '' );
element.attributes.width = width;
}
if ( height ) {
element.attributes.style = element.attributes.style.replace( /(?:^|\s)height\s*:\s*(\d+)px;?/i , '' );
element.attributes.height = height;
}
}
}
// Output alignment of paragraphs using align
if ( element.name == 'p' ) {
style = element.attributes.style;
if ( style ) {
// Get the align from the style.
match = ( /(?:^|\s)text-align\s*:\s*(\w*);?/i ).exec( style );
align = match && match[1];
if ( align ) {
element.attributes.style = element.attributes.style.replace( /(?:^|\s)text-align\s*:\s*(\w*);?/i , '' );
element.attributes.align = align;
}
}
}
if ( element.attributes.style === '' )
delete element.attributes.style;
return element;
}
}
});
}
function sendToFlash() {
var html = CKEDITOR.instances.editor1.getData() ;
// Quick fix for link color.
html = html.replace( /<a /g, '<font color="#0000FF"><u><a ' )
html = html.replace( /<\/a>/g, '</a></u></font>' )
var flash = document.getElementById( 'ckFlashContainer' ) ;
flash.setData( html ) ;
}
CKEDITOR.domReady( function() {
if ( !swfobject.hasFlashPlayerVersion( '8' ) ) {
CKEDITOR.dom.element.createFromHtml( '<span class="alert">' +
'At least Adobe Flash Player 8 is required to run this sample. ' +
'You can download it from <a href="http://get.adobe.com/flashplayer">Adobe\'s website</a>.' +
'</span>' ).insertBefore( editor.element );
}
swfobject.embedSWF(
'assets/outputforflash/outputforflash.swf',
'ckFlashContainer',
'550',
'400',
'8',
{ wmode: 'transparent' }
);
});
</script>
<p>
<input type="button" value="Send to Flash" onclick="sendToFlash();">
</p>
</td>
<td style="vertical-align: top; padding-left: 20px">
<div id="ckFlashContainer"></div>
</td>
</tr>
</table>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,221 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>HTML Compliant Output &mdash; CKEditor Sample</title>
<script src="../../../ckeditor.js"></script>
<script src="../../../samples/sample.js"></script>
<link href="../../../samples/sample.css" rel="stylesheet">
<meta name="ckeditor-sample-required-plugins" content="sourcearea">
<meta name="ckeditor-sample-name" content="Output HTML">
<meta name="ckeditor-sample-group" content="Advanced Samples">
<meta name="ckeditor-sample-description" content="Configuring CKEditor to produce legacy HTML 4 code.">
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Producing HTML Compliant Output
</h1>
<div class="description">
<p>
This sample shows how to configure CKEditor to output valid
<a class="samples" href="http://www.w3.org/TR/html401/">HTML 4.01</a> code.
Traditional HTML elements like <code>&lt;b&gt;</code>,
<code>&lt;i&gt;</code>, and <code>&lt;font&gt;</code> are used in place of
<code>&lt;strong&gt;</code>, <code>&lt;em&gt;</code>, and CSS styles.
</p>
<p>
To add a CKEditor instance outputting legacy HTML 4.01 code, load the editor using a standard
JavaScript call, and define CKEditor features to use the HTML compliant elements and attributes.
</p>
<p>
A snippet of the configuration code can be seen below; check the source of this page for
full definition:
</p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
coreStyles_bold: { element: 'b' },
coreStyles_italic: { element: 'i' },
fontSize_style: {
element: 'font',
attributes: { 'size': '#(size)' }
}
...
});</pre>
</div>
<form action="../../../samples/sample_posteddata.php" method="post">
<p>
<label for="editor1">
Editor 1:
</label>
<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;b&gt;sample text&lt;/b&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<script>
CKEDITOR.replace( 'editor1', {
/*
* Ensure that htmlwriter plugin, which is required for this sample, is loaded.
*/
extraPlugins: 'htmlwriter',
/*
* Style sheet for the contents
*/
contentsCss: 'body {color:#000; background-color#:FFF;}',
/*
* Simple HTML5 doctype
*/
docType: '<!DOCTYPE HTML>',
/*
* Allowed content rules which beside limiting allowed HTML
* will also take care of transforming styles to attributes
* (currently only for img - see transformation rules defined below).
*
* Read more: http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
*/
allowedContent:
'h1 h2 h3 p pre[align]; ' +
'blockquote code kbd samp var del ins cite q b i u strike ul ol li hr table tbody tr td th caption; ' +
'img[!src,alt,align,width,height]; font[!face]; font[!family]; font[!color]; font[!size]; font{!background-color}; a[!href]; a[!name]',
/*
* Core styles.
*/
coreStyles_bold: { element: 'b' },
coreStyles_italic: { element: 'i' },
coreStyles_underline: { element: 'u' },
coreStyles_strike: { element: 'strike' },
/*
* Font face.
*/
// Define the way font elements will be applied to the document.
// The "font" element will be used.
font_style: {
element: 'font',
attributes: { 'face': '#(family)' }
},
/*
* Font sizes.
*/
fontSize_sizes: 'xx-small/1;x-small/2;small/3;medium/4;large/5;x-large/6;xx-large/7',
fontSize_style: {
element: 'font',
attributes: { 'size': '#(size)' }
},
/*
* Font colors.
*/
colorButton_foreStyle: {
element: 'font',
attributes: { 'color': '#(color)' }
},
colorButton_backStyle: {
element: 'font',
styles: { 'background-color': '#(color)' }
},
/*
* Styles combo.
*/
stylesSet: [
{ name: 'Computer Code', element: 'code' },
{ name: 'Keyboard Phrase', element: 'kbd' },
{ name: 'Sample Text', element: 'samp' },
{ name: 'Variable', element: 'var' },
{ name: 'Deleted Text', element: 'del' },
{ name: 'Inserted Text', element: 'ins' },
{ name: 'Cited Work', element: 'cite' },
{ name: 'Inline Quotation', element: 'q' }
],
on: {
pluginsLoaded: configureTransformations,
loaded: configureHtmlWriter
}
});
/*
* Add missing content transformations.
*/
function configureTransformations( evt ) {
var editor = evt.editor;
editor.dataProcessor.htmlFilter.addRules( {
attributes: {
style: function( value, element ) {
// Return #RGB for background and border colors
return CKEDITOR.tools.convertRgbToHex( value );
}
}
} );
// Default automatic content transformations do not yet take care of
// align attributes on blocks, so we need to add our own transformation rules.
function alignToAttribute( element ) {
if ( element.styles[ 'text-align' ] ) {
element.attributes.align = element.styles[ 'text-align' ];
delete element.styles[ 'text-align' ];
}
}
editor.filter.addTransformations( [
[ { element: 'p', right: alignToAttribute } ],
[ { element: 'h1', right: alignToAttribute } ],
[ { element: 'h2', right: alignToAttribute } ],
[ { element: 'h3', right: alignToAttribute } ],
[ { element: 'pre', right: alignToAttribute } ]
] );
}
/*
* Adjust the behavior of htmlWriter to make it output HTML like FCKeditor.
*/
function configureHtmlWriter( evt ) {
var editor = evt.editor,
dataProcessor = editor.dataProcessor;
// Out self closing tags the HTML4 way, like <br>.
dataProcessor.writer.selfClosingEnd = '>';
// Make output formatting behave similar to FCKeditor.
var dtd = CKEDITOR.dtd;
for ( var e in CKEDITOR.tools.extend( {}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent ) ) {
dataProcessor.writer.setRules( e, {
indent: true,
breakBeforeOpen: true,
breakAfterOpen: false,
breakBeforeClose: !dtd[ e ][ '#' ],
breakAfterClose: true
});
}
}
</script>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,206 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Using Magicline plugin &mdash; CKEditor Sample</title>
<script src="../../../ckeditor.js"></script>
<link rel="stylesheet" href="../../../samples/sample.css">
<meta name="ckeditor-sample-name" content="Magicline plugin">
<meta name="ckeditor-sample-group" content="Plugins">
<meta name="ckeditor-sample-description" content="Using the Magicline plugin to access difficult focus spaces.">
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Using Magicline plugin
</h1>
<div class="description">
<p>
This sample shows the advantages of <strong>Magicline</strong> plugin
which is to enhance the editing process. Thanks to this plugin,
a number of difficult focus spaces which are inaccessible due to
browser issues can now be focused.
</p>
<p>
<strong>Magicline</strong> plugin shows a red line with a handler
which, when clicked, inserts a paragraph and allows typing. To see this,
focus an editor and move your mouse above the focus space you want
to access. The plugin is enabled by default so no additional
configuration is necessary.
</p>
</div>
<div>
<label for="editor1">
Editor 1:
</label>
<div class="description">
<p>
This editor uses a default <strong>Magicline</strong> setup.
</p>
</div>
<textarea cols="80" id="editor1" name="editor1" rows="10">
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;width: 100%; &quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;This table&lt;/td&gt;
&lt;td&gt;is the&lt;/td&gt;
&lt;td&gt;very first&lt;/td&gt;
&lt;td&gt;element of the document.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;We are still&lt;/td&gt;
&lt;td&gt;able to acces&lt;/td&gt;
&lt;td&gt;the space before it.&lt;/td&gt;
&lt;td&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;width: 100%; &quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;This table is inside of a cell of another table.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;We can type&amp;nbsp;either before or after it though.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Two succesive horizontal lines (&lt;tt&gt;HR&lt;/tt&gt; tags). We can access the space in between:&lt;/p&gt;
&lt;hr /&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li&gt;This numbered list...&lt;/li&gt;
&lt;li&gt;...is a neighbour of a horizontal line...&lt;/li&gt;
&lt;li&gt;...and another list.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;We can type between the lists...&lt;/li&gt;
&lt;li&gt;...thanks to &lt;strong&gt;Magicline&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Lorem ipsum dolor sit amet dui. Morbi vel turpis. Nullam et leo. Etiam rutrum, urna tellus dui vel tincidunt mattis egestas, justo fringilla vel, massa. Phasellus.&lt;/p&gt;
&lt;p&gt;Quisque iaculis, dui lectus varius vitae, tortor. Proin lacus. Pellentesque ac lacus. Aenean nonummy commodo nec, pede. Etiam blandit risus elit.&lt;/p&gt;
&lt;p&gt;Ut pretium. Vestibulum rutrum in, adipiscing elit. Sed in quam in purus sem vitae pede. Pellentesque bibendum, urna sem vel risus. Vivamus posuere metus. Aliquam gravida iaculis nisl. Nam enim. Aliquam erat ac lacus tellus ac felis.&lt;/p&gt;
&lt;div style=&quot;border: 2px dashed green; background: #ddd; text-align: center;&quot;&gt;
&lt;p&gt;This text is wrapped in a&amp;nbsp;&lt;tt&gt;DIV&lt;/tt&gt;&amp;nbsp;element. We can type after this element though.&lt;/p&gt;
&lt;/div&gt;
</textarea>
<script>
// This call can be placed at any point after the
// <textarea>, or inside a <head><script> in a
// window.onload event handler.
CKEDITOR.replace( 'editor1', {
extraPlugins: 'magicline', // Ensure that magicline plugin, which is required for this sample, is loaded.
allowedContent: true // Switch off the ACF, so very complex content created to
// show magicline's power isn't filtered.
} );
</script>
</div>
<br>
<div>
<label for="editor2">
Editor 2:
</label>
<div class="description">
<p>
This editor is using a blue line.
</p>
<pre class="samples">
CKEDITOR.replace( 'editor2', {
magicline_color: 'blue'
});</pre>
</div>
<textarea cols="80" id="editor2" name="editor2" rows="10">
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;width: 100%; &quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;This table&lt;/td&gt;
&lt;td&gt;is the&lt;/td&gt;
&lt;td&gt;very first&lt;/td&gt;
&lt;td&gt;element of the document.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;We are still&lt;/td&gt;
&lt;td&gt;able to acces&lt;/td&gt;
&lt;td&gt;the space before it.&lt;/td&gt;
&lt;td&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;width: 100%; &quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;This table is inside of a cell of another table.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;We can type&amp;nbsp;either before or after it though.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Two succesive horizontal lines (&lt;tt&gt;HR&lt;/tt&gt; tags). We can access the space in between:&lt;/p&gt;
&lt;hr /&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li&gt;This numbered list...&lt;/li&gt;
&lt;li&gt;...is a neighbour of a horizontal line...&lt;/li&gt;
&lt;li&gt;...and another list.&lt;/li&gt;
&lt;/ol&gt;
&lt;ul&gt;
&lt;li&gt;We can type between the lists...&lt;/li&gt;
&lt;li&gt;...thanks to &lt;strong&gt;Magicline&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Lorem ipsum dolor sit amet dui. Morbi vel turpis. Nullam et leo. Etiam rutrum, urna tellus dui vel tincidunt mattis egestas, justo fringilla vel, massa. Phasellus.&lt;/p&gt;
&lt;p&gt;Quisque iaculis, dui lectus varius vitae, tortor. Proin lacus. Pellentesque ac lacus. Aenean nonummy commodo nec, pede. Etiam blandit risus elit.&lt;/p&gt;
&lt;p&gt;Ut pretium. Vestibulum rutrum in, adipiscing elit. Sed in quam in purus sem vitae pede. Pellentesque bibendum, urna sem vel risus. Vivamus posuere metus. Aliquam gravida iaculis nisl. Nam enim. Aliquam erat ac lacus tellus ac felis.&lt;/p&gt;
&lt;div style=&quot;border: 2px dashed green; background: #ddd; text-align: center;&quot;&gt;
&lt;p&gt;This text is wrapped in a&amp;nbsp;&lt;tt&gt;DIV&lt;/tt&gt;&amp;nbsp;element. We can type after this element though.&lt;/p&gt;
&lt;/div&gt;
</textarea>
<script>
// This call can be placed at any point after the
// <textarea>, or inside a <head><script> in a
// window.onload event handler.
CKEDITOR.replace( 'editor2', {
extraPlugins: 'magicline', // Ensure that magicline plugin, which is required for this sample, is loaded.
magicline_color: 'blue', // Blue line
allowedContent: true // Switch off the ACF, so very complex content created to
// show magicline's power isn't filtered.
});
</script>
</div>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,232 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Toolbar Configuration &mdash; CKEditor Sample</title>
<meta name="ckeditor-sample-name" content="Toolbar Configurations">
<meta name="ckeditor-sample-group" content="Advanced Samples">
<meta name="ckeditor-sample-description" content="Configuring CKEditor to display full or custom toolbar layout.">
<script src="../../../ckeditor.js"></script>
<link href="../../../samples/sample.css" rel="stylesheet">
</head>
<body>
<h1 class="samples">
<a href="../../../samples/index.html">CKEditor Samples</a> &raquo; Toolbar Configuration
</h1>
<div class="description">
<p>
This sample page demonstrates editor with loaded <a href="#fullToolbar">full toolbar</a> (all registered buttons) and, if
current editor's configuration modifies default settings, also editor with <a href="#currentToolbar">modified toolbar</a>.
</p>
<p>Since CKEditor 4 there are two ways to configure toolbar buttons.</p>
<h2 class="samples">By <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-toolbar">config.toolbar</a></h2>
<p>
You can explicitly define which buttons are displayed in which groups and in which order.
This is the more precise setting, but less flexible. If newly added plugin adds its
own button you'll have to add it manually to your <code>config.toolbar</code> setting as well.
</p>
<p>To add a CKEditor instance with custom toolbar setting, insert the following JavaScript call to your code:</p>
<pre class="samples">
CKEDITOR.replace( <em>'textarea_id'</em>, {
<strong>toolbar:</strong> [
{ name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] }, // Defines toolbar group with name (used to create voice label) and items in 3 subgroups.
[ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ], // Defines toolbar group without name.
'/', // Line break - next group will be placed in new line.
{ name: 'basicstyles', items: [ 'Bold', 'Italic' ] }
]
});</pre>
<h2 class="samples">By <a href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-toolbarGroups">config.toolbarGroups</a></h2>
<p>
You can define which groups of buttons (like e.g. <code>basicstyles</code>, <code>clipboard</code>
and <code>forms</code>) are displayed and in which order. Registered buttons are associated
with toolbar groups by <code>toolbar</code> property in their definition.
This setting's advantage is that you don't have to modify toolbar configuration
when adding/removing plugins which register their own buttons.
</p>
<p>To add a CKEditor instance with custom toolbar groups setting, insert the following JavaScript call to your code:</p>
<pre class="samples">
CKEDITOR.replace( <em>'textarea_id'</em>, {
<strong>toolbarGroups:</strong> [
{ name: 'document', groups: [ 'mode', 'document' ] }, // Displays document group with its two subgroups.
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, // Group's name will be used to create voice label.
'/', // Line break - next group will be placed in new line.
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'links' }
]
// NOTE: Remember to leave 'toolbar' property with the default value (null).
});</pre>
</div>
<div id="currentToolbar" style="display: none">
<h2 class="samples">Current toolbar configuration</h2>
<p>Below you can see editor with current toolbar definition.</p>
<textarea cols="80" id="editorCurrent" name="editorCurrent" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<pre id="editorCurrentCfg" class="samples"></pre>
</div>
<div id="fullToolbar">
<h2 class="samples">Full toolbar configuration</h2>
<p>Below you can see editor with full toolbar, generated automatically by the editor.</p>
<p>
<strong>Note</strong>: To create editor instance with full toolbar you don't have to set anything.
Just leave <code>toolbar</code> and <code>toolbarGroups</code> with the default, <code>null</code> values.
</p>
<textarea cols="80" id="editorFull" name="editorFull" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<pre id="editorFullCfg" class="samples"></pre>
</div>
<script>
(function() {
'use strict';
var buttonsNames;
CKEDITOR.config.extraPlugins = 'toolbar';
CKEDITOR.on( 'instanceReady', function( evt ) {
var editor = evt.editor,
editorCurrent = editor.name == 'editorCurrent',
defaultToolbar = !( editor.config.toolbar || editor.config.toolbarGroups || editor.config.removeButtons ),
pre = CKEDITOR.document.getById( editor.name + 'Cfg' ),
output = '';
if ( editorCurrent ) {
// If default toolbar configuration has been modified, show "current toolbar" section.
if ( !defaultToolbar )
CKEDITOR.document.getById( 'currentToolbar' ).show();
else
return;
}
if ( !buttonsNames )
buttonsNames = createButtonsNamesHash( editor.ui.items );
// Toolbar isn't set explicitly, so it was created automatically from toolbarGroups.
if ( !editor.config.toolbar ) {
output +=
'// Toolbar configuration generated automatically by the editor based on config.toolbarGroups.\n' +
dumpToolbarConfiguration( editor ) +
'\n\n' +
'// Toolbar groups configuration.\n' +
dumpToolbarConfiguration( editor, true )
}
// Toolbar groups doesn't count in this case - print only toolbar.
else {
output += '// Toolbar configuration.\n' +
dumpToolbarConfiguration( editor );
}
// Recreate to avoid old IE from loosing whitespaces on filling <pre> content.
var preOutput = pre.getOuterHtml().replace( /(?=<\/)/, output );
CKEDITOR.dom.element.createFromHtml( preOutput ).replace( pre );
} );
CKEDITOR.replace( 'editorCurrent', { height: 100 } );
CKEDITOR.replace( 'editorFull', {
// Reset toolbar settings, so full toolbar will be generated automatically.
toolbar: null,
toolbarGroups: null,
removeButtons: null,
height: 100
} );
function dumpToolbarConfiguration( editor, printGroups ) {
var output = [],
toolbar = editor.toolbar;
for ( var i = 0; i < toolbar.length; ++i ) {
var group = dumpToolbarGroup( toolbar[ i ], printGroups );
if ( group )
output.push( group );
}
return 'config.toolbar' + ( printGroups ? 'Groups' : '' ) + ' = [\n\t' + output.join( ',\n\t' ) + '\n];';
}
function dumpToolbarGroup( group, printGroups ) {
var output = [];
if ( typeof group == 'string' )
return '\'' + group + '\'';
if ( CKEDITOR.tools.isArray( group ) )
return dumpToolbarItems( group );
// Skip group when printing entire toolbar configuration and there are no items in this group.
if ( !printGroups && !group.items )
return;
if ( group.name )
output.push( 'name: \'' + group.name + '\'' );
if ( group.groups )
output.push( 'groups: ' + dumpToolbarItems( group.groups ) );
if ( !printGroups )
output.push( 'items: ' + dumpToolbarItems( group.items ) );
return '{ ' + output.join( ', ' ) + ' }';
}
function dumpToolbarItems( items ) {
if ( typeof items == 'string' )
return '\'' + items + '\'';
var names = [],
i, item;
for ( var i = 0; i < items.length; ++i ) {
item = items[ i ];
if ( typeof item == 'string' )
names.push( item );
else {
if ( item.type == CKEDITOR.UI_SEPARATOR )
names.push( '-' );
else
names.push( buttonsNames[ item.name ] );
}
}
return '[ \'' + names.join( '\', \'' ) + '\' ]';
}
// Creates { 'lowercased': 'LowerCased' } buttons names hash.
function createButtonsNamesHash( items ) {
var hash = {},
name;
for ( name in items ) {
hash[ items[ name ].name ] = name;
}
return hash;
}
})();
</script>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,73 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>Using the CKEditor Read-Only API &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link rel="stylesheet" href="sample.css">
<script>
var editor;
// The instanceReady event is fired, when an instance of CKEditor has finished
// its initialization.
CKEDITOR.on( 'instanceReady', function( ev ) {
editor = ev.editor;
// Show this "on" button.
document.getElementById( 'readOnlyOn' ).style.display = '';
// Event fired when the readOnly property changes.
editor.on( 'readOnly', function() {
document.getElementById( 'readOnlyOn' ).style.display = this.readOnly ? 'none' : '';
document.getElementById( 'readOnlyOff' ).style.display = this.readOnly ? '' : 'none';
});
});
function toggleReadOnly( isReadOnly ) {
// Change the read-only state of the editor.
// http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly
editor.setReadOnly( isReadOnly );
}
</script>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Using the CKEditor Read-Only API
</h1>
<div class="description">
<p>
This sample shows how to use the
<code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setReadOnly">setReadOnly</a></code>
API to put editor into the read-only state that makes it impossible for users to change the editor contents.
</p>
<p>
For details on how to create this setup check the source code of this sample page.
</p>
</div>
<form action="sample_posteddata.php" method="post">
<p>
<textarea class="ckeditor" id="editor1" name="editor1" cols="100" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
</p>
<p>
<input id="readOnlyOn" onclick="toggleReadOnly();" type="button" value="Make it read-only" style="display:none">
<input id="readOnlyOff" onclick="toggleReadOnly( false );" type="button" value="Make it editable again" style="display:none">
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,365 +0,0 @@
/*
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
html, body, h1, h2, h3, h4, h5, h6, div, span, blockquote, p, address, form, fieldset, img, ul, ol, dl, dt, dd, li, hr, table, td, th, strong, em, sup, sub, dfn, ins, del, q, cite, var, samp, code, kbd, tt, pre
{
line-height: 1.5;
}
body
{
padding: 10px 30px;
}
input, textarea, select, option, optgroup, button, td, th
{
font-size: 100%;
}
pre
{
-moz-tab-size: 4;
-o-tab-size: 4;
-webkit-tab-size: 4;
tab-size: 4;
}
pre, code, kbd, samp, tt
{
font-family: monospace,monospace;
font-size: 1em;
}
body {
width: 960px;
margin: 0 auto;
}
code
{
background: #f3f3f3;
border: 1px solid #ddd;
padding: 1px 4px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
abbr
{
border-bottom: 1px dotted #555;
cursor: pointer;
}
.new, .beta
{
text-transform: uppercase;
font-size: 10px;
font-weight: bold;
padding: 1px 4px;
margin: 0 0 0 5px;
color: #fff;
float: right;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.new
{
background: #FF7E00;
border: 1px solid #DA8028;
text-shadow: 0 1px 0 #C97626;
-moz-box-shadow: 0 2px 3px 0 #FFA54E inset;
-webkit-box-shadow: 0 2px 3px 0 #FFA54E inset;
box-shadow: 0 2px 3px 0 #FFA54E inset;
}
.beta
{
background: #18C0DF;
border: 1px solid #19AAD8;
text-shadow: 0 1px 0 #048CAD;
font-style: italic;
-moz-box-shadow: 0 2px 3px 0 #50D4FD inset;
-webkit-box-shadow: 0 2px 3px 0 #50D4FD inset;
box-shadow: 0 2px 3px 0 #50D4FD inset;
}
h1.samples
{
color: #0782C1;
font-size: 200%;
font-weight: normal;
margin: 0;
padding: 0;
}
h1.samples a
{
color: #0782C1;
text-decoration: none;
border-bottom: 1px dotted #0782C1;
}
.samples a:hover
{
border-bottom: 1px dotted #0782C1;
}
h2.samples
{
color: #000000;
font-size: 130%;
margin: 15px 0 0 0;
padding: 0;
}
p, blockquote, address, form, pre, dl, h1.samples, h2.samples
{
margin-bottom: 15px;
}
ul.samples
{
margin-bottom: 15px;
}
.clear
{
clear: both;
}
fieldset
{
margin: 0;
padding: 10px;
}
body, input, textarea
{
color: #333333;
font-family: Arial, Helvetica, sans-serif;
}
body
{
font-size: 75%;
}
a.samples
{
color: #189DE1;
text-decoration: none;
}
form
{
margin: 0;
padding: 0;
}
pre.samples
{
background-color: #F7F7F7;
border: 1px solid #D7D7D7;
overflow: auto;
padding: 0.25em;
white-space: pre-wrap; /* CSS 2.1 */
word-wrap: break-word; /* IE7 */
}
#footer
{
clear: both;
padding-top: 10px;
}
#footer hr
{
margin: 10px 0 15px 0;
height: 1px;
border: solid 1px gray;
border-bottom: none;
}
#footer p
{
margin: 0 10px 10px 10px;
float: left;
}
#footer #copy
{
float: right;
}
#outputSample
{
width: 100%;
table-layout: fixed;
}
#outputSample thead th
{
color: #dddddd;
background-color: #999999;
padding: 4px;
white-space: nowrap;
}
#outputSample tbody th
{
vertical-align: top;
text-align: left;
}
#outputSample pre
{
margin: 0;
padding: 0;
}
.description
{
border: 1px dotted #B7B7B7;
margin-bottom: 10px;
padding: 10px 10px 0;
overflow: hidden;
}
label
{
display: block;
margin-bottom: 6px;
}
/**
* CKEditor editables are automatically set with the "cke_editable" class
* plus cke_editable_(inline|themed) depending on the editor type.
*/
/* Style a bit the inline editables. */
.cke_editable.cke_editable_inline
{
cursor: pointer;
}
/* Once an editable element gets focused, the "cke_focus" class is
added to it, so we can style it differently. */
.cke_editable.cke_editable_inline.cke_focus
{
box-shadow: inset 0px 0px 20px 3px #ddd, inset 0 0 1px #000;
outline: none;
background: #eee;
cursor: text;
}
/* Avoid pre-formatted overflows inline editable. */
.cke_editable_inline pre
{
white-space: pre-wrap;
word-wrap: break-word;
}
/**
* Samples index styles.
*/
.twoColumns,
.twoColumnsLeft,
.twoColumnsRight
{
overflow: hidden;
}
.twoColumnsLeft,
.twoColumnsRight
{
width: 45%;
}
.twoColumnsLeft
{
float: left;
}
.twoColumnsRight
{
float: right;
}
dl.samples
{
padding: 0 0 0 40px;
}
dl.samples > dt
{
display: list-item;
list-style-type: disc;
list-style-position: outside;
margin: 0 0 3px;
}
dl.samples > dd
{
margin: 0 0 3px;
}
.warning
{
color: #ff0000;
background-color: #FFCCBA;
border: 2px dotted #ff0000;
padding: 15px 10px;
margin: 10px 0;
}
/* Used on inline samples */
blockquote
{
font-style: italic;
font-family: Georgia, Times, "Times New Roman", serif;
padding: 2px 0;
border-style: solid;
border-color: #ccc;
border-width: 0;
}
.cke_contents_ltr blockquote
{
padding-left: 20px;
padding-right: 8px;
border-left-width: 5px;
}
.cke_contents_rtl blockquote
{
padding-left: 8px;
padding-right: 20px;
border-right-width: 5px;
}
img.right {
border: 1px solid #ccc;
float: right;
margin-left: 15px;
padding: 5px;
}
img.left {
border: 1px solid #ccc;
float: left;
margin-right: 15px;
padding: 5px;
}
.marker
{
background-color: Yellow;
}

View File

@ -1,50 +0,0 @@
/**
* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
// Tool scripts for the sample pages.
// This file can be ignored and is not required to make use of CKEditor.
( function() {
CKEDITOR.on( 'instanceReady', function( ev ) {
// Check for sample compliance.
var editor = ev.editor,
meta = CKEDITOR.document.$.getElementsByName( 'ckeditor-sample-required-plugins' ),
requires = meta.length ? CKEDITOR.dom.element.get( meta[ 0 ] ).getAttribute( 'content' ).split( ',' ) : [],
missing = [],
i;
if ( requires.length ) {
for ( i = 0; i < requires.length; i++ ) {
if ( !editor.plugins[ requires[ i ] ] )
missing.push( '<code>' + requires[ i ] + '</code>' );
}
if ( missing.length ) {
var warn = CKEDITOR.dom.element.createFromHtml(
'<div class="warning">' +
'<span>To fully experience this demo, the ' + missing.join( ', ' ) + ' plugin' + ( missing.length > 1 ? 's are' : ' is' ) + ' required.</span>' +
'</div>'
);
warn.insertBefore( editor.container );
}
}
// Set icons.
var doc = new CKEDITOR.dom.document( document ),
icons = doc.find( '.button_icon' );
for ( i = 0; i < icons.count(); i++ ) {
var icon = icons.getItem( i ),
name = icon.getAttribute( 'data-icon' ),
style = CKEDITOR.skin.getIconStyle( name, ( CKEDITOR.lang.dir == 'rtl' ) );
icon.addClass( 'cke_button_icon' );
icon.addClass( 'cke_button__' + name + '_icon' );
icon.setAttribute( 'style', style );
icon.setStyle( 'float', 'none' );
}
} );
} )();

View File

@ -1,16 +0,0 @@
<?php /* <body><pre>
-------------------------------------------------------------------------------------------
CKEditor - Posted Data
We are sorry, but your Web server does not support the PHP language used in this script.
Please note that CKEditor can be used with any other server-side language than just PHP.
To save the content created with CKEditor you need to read the POST data on the server
side and write it to a file or the database.
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or <a href="http://ckeditor.com/license">http://ckeditor.com/license</a>
-------------------------------------------------------------------------------------------
</pre><div style="display:none"></body> */ include "assets/posteddata.php"; ?>

View File

@ -1,75 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>TAB Key-Based Navigation &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link href="sample.css" rel="stylesheet">
<style>
.cke_focused,
.cke_editable.cke_focused
{
outline: 3px dotted blue !important;
*border: 3px dotted blue !important; /* For IE7 */
}
</style>
<script>
CKEDITOR.on( 'instanceReady', function( evt ) {
var editor = evt.editor;
editor.setData( 'This editor has it\'s tabIndex set to <strong>' + editor.tabIndex + '</strong>' );
// Apply focus class name.
editor.on( 'focus', function() {
editor.container.addClass( 'cke_focused' );
});
editor.on( 'blur', function() {
editor.container.removeClass( 'cke_focused' );
});
// Put startup focus on the first editor in tab order.
if ( editor.tabIndex == 1 )
editor.focus();
});
</script>
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; TAB Key-Based Navigation
</h1>
<div class="description">
<p>
This sample shows how tab key navigation among editor instances is
affected by the <code>tabIndex</code> attribute from
the original page element. Use TAB key to move between the editors.
</p>
</div>
<p>
<textarea class="ckeditor" cols="80" id="editor4" rows="10" tabindex="1"></textarea>
</p>
<div class="ckeditor" contenteditable="true" id="editor1" tabindex="4"></div>
<p>
<textarea class="ckeditor" cols="80" id="editor2" rows="10" tabindex="2"></textarea>
</p>
<p>
<textarea class="ckeditor" cols="80" id="editor3" rows="10" tabindex="3"></textarea>
</p>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,69 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>UI Color Picker &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; UI Color
</h1>
<div class="description">
<p>
This sample shows how to automatically replace <code>&lt;textarea&gt;</code> elements
with a CKEditor instance with an option to change the color of its user interface.<br>
<strong>Note:</strong>The UI skin color feature depends on the CKEditor skin
compatibility. The Moono and Kama skins are examples of skins that work with it.
</p>
</div>
<form action="sample_posteddata.php" method="post">
<p>
This editor instance has a UI color value defined in configuration to change the skin color,
To specify the color of the user interface, set the <code>uiColor</code> property:
</p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
<strong>uiColor: '#14B8C4'</strong>
});</pre>
<p>
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
the <code>&lt;textarea&gt;</code> element to be replaced.
</p>
<p>
<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<script>
// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.
CKEDITOR.replace( 'editor1', {
uiColor: '#14B8C4',
toolbar: [
[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
[ 'FontSize', 'TextColor', 'BGColor' ]
]
});
</script>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,119 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>User Interface Globalization &mdash; CKEditor Sample</title>
<script src="../ckeditor.js"></script>
<script src="assets/uilanguages/languages.js"></script>
<link rel="stylesheet" href="sample.css">
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; User Interface Languages
</h1>
<div class="description">
<p>
This sample shows how to automatically replace <code>&lt;textarea&gt;</code> elements
with a CKEditor instance with an option to change the language of its user interface.
</p>
<p>
It pulls the language list from CKEditor <code>_languages.js</code> file that contains the list of supported languages and creates
a drop-down list that lets the user change the UI language.
</p>
<p>
By default, CKEditor automatically localizes the editor to the language of the user.
The UI language can be controlled with two configuration options:
<code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-language">language</a></code> and
<code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-defaultLanguage">
defaultLanguage</a></code>. The <code>defaultLanguage</code> setting specifies the
default CKEditor language to be used when a localization suitable for user's settings is not available.
</p>
<p>
To specify the user interface language that will be used no matter what language is
specified in user's browser or operating system, set the <code>language</code> property:
</p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
// Load the German interface.
<strong>language: 'de'</strong>
});</pre>
<p>
Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
the <code>&lt;textarea&gt;</code> element to be replaced.
</p>
</div>
<form action="sample_posteddata.php" method="post">
<p>
Available languages (<span id="count"> </span> languages!):<br>
<script>
document.write( '<select disabled="disabled" id="languages" onchange="createEditor( this.value );">' );
// Get the language list from the _languages.js file.
for ( var i = 0 ; i < window.CKEDITOR_LANGS.length ; i++ ) {
document.write(
'<option value="' + window.CKEDITOR_LANGS[i].code + '">' +
window.CKEDITOR_LANGS[i].name +
'</option>' );
}
document.write( '</select>' );
</script>
<br>
<span style="color: #888888">
(You may see strange characters if your system does not support the selected language)
</span>
</p>
<p>
<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<script>
// Set the number of languages.
document.getElementById( 'count' ).innerHTML = window.CKEDITOR_LANGS.length;
var editor;
function createEditor( languageCode ) {
if ( editor )
editor.destroy();
// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.
editor = CKEDITOR.replace( 'editor1', {
language: languageCode,
on: {
instanceReady: function() {
// Wait for the editor to be ready to set
// the language combo.
var languages = document.getElementById( 'languages' );
languages.value = this.langCode;
languages.disabled = false;
}
}
});
}
// At page startup, load the default language:
createEditor( '' );
</script>
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>

View File

@ -1,231 +0,0 @@
<!DOCTYPE html>
<!--
Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
-->
<html>
<head>
<meta charset="utf-8">
<title>XHTML Compliant Output &mdash; CKEditor Sample</title>
<meta name="ckeditor-sample-required-plugins" content="sourcearea">
<script src="../ckeditor.js"></script>
<script src="../samples/sample.js"></script>
<link href="sample.css" rel="stylesheet">
</head>
<body>
<h1 class="samples">
<a href="index.html">CKEditor Samples</a> &raquo; Producing XHTML Compliant Output
</h1>
<div class="description">
<p>
This sample shows how to configure CKEditor to output valid
<a class="samples" href="http://www.w3.org/TR/xhtml11/">XHTML 1.1</a> code.
Deprecated elements (<code>&lt;font&gt;</code>, <code>&lt;u&gt;</code>) or attributes
(<code>size</code>, <code>face</code>) will be replaced with XHTML compliant code.
</p>
<p>
To add a CKEditor instance outputting valid XHTML code, load the editor using a standard
JavaScript call and define CKEditor features to use the XHTML compliant elements and styles.
</p>
<p>
A snippet of the configuration code can be seen below; check the source of this page for
full definition:
</p>
<pre class="samples">
CKEDITOR.replace( '<em>textarea_id</em>', {
contentsCss: 'assets/outputxhtml.css',
coreStyles_bold: {
element: 'span',
attributes: { 'class': 'Bold' }
},
coreStyles_italic: {
element: 'span',
attributes: { 'class': 'Italic' }
},
...
});</pre>
</div>
<form action="sample_posteddata.php" method="post">
<p>
<label for="editor1">
Editor 1:
</label>
<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;span class="Bold"&gt;sample text&lt;/span&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
<script>
CKEDITOR.replace( 'editor1', {
/*
* Style sheet for the contents
*/
contentsCss: 'assets/outputxhtml/outputxhtml.css',
/*
* Special allowed content rules for spans used by
* font face, size, and color buttons.
*
* Note: all rules have been written separately so
* it was possible to specify required classes.
*/
extraAllowedContent: 'span(!FontColor1);span(!FontColor2);span(!FontColor3);' +
'span(!FontColor1BG);span(!FontColor2BG);span(!FontColor3BG);' +
'span(!FontComic);span(!FontCourier);span(!FontTimes);' +
'span(!FontSmaller);span(!FontLarger);span(!FontSmall);span(!FontBig);span(!FontDouble)',
/*
* Core styles.
*/
coreStyles_bold: {
element: 'span',
attributes: { 'class': 'Bold' }
},
coreStyles_italic: {
element: 'span',
attributes: { 'class': 'Italic' }
},
coreStyles_underline: {
element: 'span',
attributes: { 'class': 'Underline' }
},
coreStyles_strike: {
element: 'span',
attributes: { 'class': 'StrikeThrough' },
overrides: 'strike'
},
coreStyles_subscript: {
element: 'span',
attributes: { 'class': 'Subscript' },
overrides: 'sub'
},
coreStyles_superscript: {
element: 'span',
attributes: { 'class': 'Superscript' },
overrides: 'sup'
},
/*
* Font face.
*/
// List of fonts available in the toolbar combo. Each font definition is
// separated by a semi-colon (;). We are using class names here, so each font
// is defined by {Combo Label}/{Class Name}.
font_names: 'Comic Sans MS/FontComic;Courier New/FontCourier;Times New Roman/FontTimes',
// Define the way font elements will be applied to the document. The "span"
// element will be used. When a font is selected, the font name defined in the
// above list is passed to this definition with the name "Font", being it
// injected in the "class" attribute.
// We must also instruct the editor to replace span elements that are used to
// set the font (Overrides).
font_style: {
element: 'span',
attributes: { 'class': '#(family)' },
overrides: [
{
element: 'span',
attributes: {
'class': /^Font(?:Comic|Courier|Times)$/
}
}
]
},
/*
* Font sizes.
*/
fontSize_sizes: 'Smaller/FontSmaller;Larger/FontLarger;8pt/FontSmall;14pt/FontBig;Double Size/FontDouble',
fontSize_style: {
element: 'span',
attributes: { 'class': '#(size)' },
overrides: [
{
element: 'span',
attributes: {
'class': /^Font(?:Smaller|Larger|Small|Big|Double)$/
}
}
]
} ,
/*
* Font colors.
*/
colorButton_enableMore: false,
colorButton_colors: 'FontColor1/FF9900,FontColor2/0066CC,FontColor3/F00',
colorButton_foreStyle: {
element: 'span',
attributes: { 'class': '#(color)' },
overrides: [
{
element: 'span',
attributes: {
'class': /^FontColor(?:1|2|3)$/
}
}
]
},
colorButton_backStyle: {
element: 'span',
attributes: { 'class': '#(color)BG' },
overrides: [
{
element: 'span',
attributes: {
'class': /^FontColor(?:1|2|3)BG$/
}
}
]
},
/*
* Indentation.
*/
indentClasses: [ 'Indent1', 'Indent2', 'Indent3' ],
/*
* Paragraph justification.
*/
justifyClasses: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull' ],
/*
* Styles combo.
*/
stylesSet: [
{ name: 'Strong Emphasis', element: 'strong' },
{ name: 'Emphasis', element: 'em' },
{ name: 'Computer Code', element: 'code' },
{ name: 'Keyboard Phrase', element: 'kbd' },
{ name: 'Sample Text', element: 'samp' },
{ name: 'Variable', element: 'var' },
{ name: 'Deleted Text', element: 'del' },
{ name: 'Inserted Text', element: 'ins' },
{ name: 'Cited Work', element: 'cite' },
{ name: 'Inline Quotation', element: 'q' }
]
});
</script>
</p>
<p>
<input type="submit" value="Submit">
</p>
</form>
<div id="footer">
<hr>
<p>
CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
</p>
<p id="copy">
Copyright &copy; 2003-2015, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
Knabben. All rights reserved.
</p>
</div>
</body>
</html>