This repository has been archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from ckeditor/t/1
Feature: Initial implementation. Closes #1.
- Loading branch information
Showing
31 changed files
with
791 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
* text=auto | ||
|
||
*.htaccess eol=lf | ||
*.cgi eol=lf | ||
*.sh eol=lf | ||
|
||
*.css text | ||
*.htm text | ||
*.html text | ||
*.js text | ||
*.json text | ||
*.php text | ||
*.txt text | ||
*.md text | ||
|
||
*.png -text | ||
*.gif -text | ||
*.jpg -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tests/** | ||
sample/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Contributing | ||
======================================== | ||
|
||
Information about contributing can be found on the following page: <https://github.com/ckeditor/ckeditor5/blob/master/CONTRIBUTING.md>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Software License Agreement | ||
========================== | ||
|
||
**CKEditor 5 classic build** – https://github.com/ckeditor/ckeditor5-build-classic <br> | ||
Copyright (c) 2003-2017, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved. | ||
|
||
Licensed under the terms of any of the following licenses at your choice: | ||
|
||
* [GNU General Public License Version 2 or later (the "GPL")](http://www.gnu.org/licenses/gpl.html) | ||
* [GNU Lesser General Public License Version 2.1 or later (the "LGPL")](http://www.gnu.org/licenses/lgpl.html) | ||
* [Mozilla Public License Version 1.1 or later (the "MPL")](http://www.mozilla.org/MPL/MPL-1.1.html) | ||
|
||
You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. In any case, your choice will not restrict any recipient of your version of this software to use, reproduce, modify and distribute this software under any of the above licenses. | ||
|
||
Sources of Intellectual Property Included in CKEditor | ||
----------------------------------------------------- | ||
|
||
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission. | ||
|
||
Trademarks | ||
---------- | ||
|
||
**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
CKEditor 5 classic build | ||
======================================== | ||
|
||
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-build-classic.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-classic) | ||
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-build-classic/status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-classic) | ||
[![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-build-classic/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-classic?type=dev) | ||
|
||
Classic build of CKEditor 5. Features the [classic creator](https://github.com/ckeditor/ckeditor5-editor-classic) and the standard set of article features. | ||
|
||
## Bundles | ||
|
||
The package contain two bundles of the classic editor: | ||
|
||
* `build/ckeditor.js` – minified, ES6 version of the bundle, | ||
* `build/ckeditor.compat.js` – minified, backward-compatible version of the bundle (`babel-preset-env` is configured to support `[ 'last 2 versions', 'ie >= 11' ]`). | ||
|
||
## Usage | ||
|
||
First, install the build from npm: | ||
|
||
``` | ||
npm install --save @ckeditor/ckeditor5-build-classic | ||
``` | ||
|
||
And use it in your website: | ||
|
||
```html | ||
<div id="editor"> | ||
<p>This is the editor content.</p> | ||
</div> | ||
<script src="./node_modules/@ckeditor/ckeditor5-build-classic/build/ckeditor.js"></script> | ||
<script> | ||
ClassicEditor.create( document.querySelector( '#editor' ) ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); | ||
</script> | ||
``` | ||
|
||
Or in your JavaScript application: | ||
|
||
```js | ||
import { ClassicEditor } from '@ckeditor/ckeditor5-build-classic/build/ckeditor'; | ||
|
||
// or using CommonJS verion: | ||
// const ClassicEditor = require( '@ckeditor/ckeditor5-build-classic/build/ckeditor' ).ClassicEditor; | ||
|
||
ClassicEditor.create( document.querySelector( '#editor' ) ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); | ||
``` | ||
|
||
**Note:** If you're planning to integrate CKEditor 5 deep into your application it's actually more convenient and recommended to install and import the source modules directly (like it happens in `ckeditor.js`). | ||
|
||
## Rebuilding the bundle | ||
|
||
**Note:** This section assumes that you cloned this package repository and execute the commands inside it. | ||
|
||
You can modify `config-editor.js`, `config-build.js` or any of the Webpack configs and run: | ||
|
||
``` | ||
npm run build | ||
``` | ||
|
||
To rebuild the entry-point (`ckeditor.js`) and both builds (`build/*`). | ||
|
||
You can also modify `ckeditor.js` directly and run one of `npm run build-ckeditor` or `npm run build-ckeditor-compat`. | ||
|
||
## License | ||
|
||
Licensed under the GPL, LGPL and MPL licenses, at your choice. For full details about the license, please check the `LICENSE.md` file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Building 'build/ckeditor.compat.js'..." | ||
echo "" | ||
|
||
webpack --config webpack.compat.config.js | ||
|
||
echo "" | ||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Building 'build/ckeditor.js'..." | ||
echo "" | ||
|
||
webpack | ||
|
||
echo "" | ||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { bundler } = require( '@ckeditor/ckeditor5-dev-utils' ); | ||
const buildConfig = require( '../config-build' ); | ||
|
||
console.log( 'Creating the entry file...' ); | ||
|
||
bundler.createEntryFile( 'ckeditor.js', './config-editor', buildConfig ); | ||
|
||
console.log( 'Done.' ); |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classic'; | ||
import AutoformatPlugin from '@ckeditor/ckeditor5-autoformat/src/autoformat'; | ||
import BoldPlugin from '@ckeditor/ckeditor5-basic-styles/src/bold'; | ||
import ItalicPlugin from '@ckeditor/ckeditor5-basic-styles/src/italic'; | ||
import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard'; | ||
import EnterPlugin from '@ckeditor/ckeditor5-enter/src/enter'; | ||
import HeadingPlugin from '@ckeditor/ckeditor5-heading/src/heading'; | ||
import ImagePlugin from '@ckeditor/ckeditor5-image/src/image'; | ||
import ImagecaptionPlugin from '@ckeditor/ckeditor5-image/src/imagecaption'; | ||
import ImagestylePlugin from '@ckeditor/ckeditor5-image/src/imagestyle'; | ||
import ImagetoolbarPlugin from '@ckeditor/ckeditor5-image/src/imagetoolbar'; | ||
import LinkPlugin from '@ckeditor/ckeditor5-link/src/link'; | ||
import ListPlugin from '@ckeditor/ckeditor5-list/src/list'; | ||
import ParagraphPlugin from '@ckeditor/ckeditor5-paragraph/src/paragraph'; | ||
import TypingPlugin from '@ckeditor/ckeditor5-typing/src/typing'; | ||
import UndoPlugin from '@ckeditor/ckeditor5-undo/src/undo'; | ||
|
||
export class ClassicEditor extends ClassicEditorBase {} | ||
|
||
ClassicEditor.build = { | ||
plugins: [ | ||
AutoformatPlugin, | ||
BoldPlugin, | ||
ItalicPlugin, | ||
ClipboardPlugin, | ||
EnterPlugin, | ||
HeadingPlugin, | ||
ImagePlugin, | ||
ImagecaptionPlugin, | ||
ImagestylePlugin, | ||
ImagetoolbarPlugin, | ||
LinkPlugin, | ||
ListPlugin, | ||
ParagraphPlugin, | ||
TypingPlugin, | ||
UndoPlugin | ||
], | ||
config: require( './config-editor' ) | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
editor: '@ckeditor/ckeditor5-editor-classic/src/classic', | ||
moduleName: 'ClassicEditor', | ||
plugins: [ | ||
'@ckeditor/ckeditor5-autoformat/src/autoformat', | ||
'@ckeditor/ckeditor5-basic-styles/src/bold', | ||
'@ckeditor/ckeditor5-basic-styles/src/italic', | ||
'@ckeditor/ckeditor5-clipboard/src/clipboard', | ||
'@ckeditor/ckeditor5-enter/src/enter', | ||
'@ckeditor/ckeditor5-heading/src/heading', | ||
'@ckeditor/ckeditor5-image/src/image', | ||
'@ckeditor/ckeditor5-image/src/imagecaption', | ||
'@ckeditor/ckeditor5-image/src/imagestyle', | ||
'@ckeditor/ckeditor5-image/src/imagetoolbar', | ||
'@ckeditor/ckeditor5-link/src/link', | ||
'@ckeditor/ckeditor5-list/src/list', | ||
'@ckeditor/ckeditor5-paragraph/src/paragraph', | ||
'@ckeditor/ckeditor5-typing/src/typing', | ||
'@ckeditor/ckeditor5-undo/src/undo', | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
toolbar: [ | ||
'headings', | ||
'bold', | ||
'italic', | ||
'link', | ||
'unlink', | ||
'bulletedList', | ||
'numberedList', | ||
'undo', | ||
'redo' | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "@ckeditor/ckeditor5-build-classic", | ||
"version": "0.0.1", | ||
"description": "CKEditor 5 classic build.", | ||
"keywords": [], | ||
"main": "./build/ckeditor.js", | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-editor-classic": "*", | ||
"@ckeditor/ckeditor5-autoformat": "*", | ||
"@ckeditor/ckeditor5-basic-styles": "*", | ||
"@ckeditor/ckeditor5-clipboard": "*", | ||
"@ckeditor/ckeditor5-enter": "*", | ||
"@ckeditor/ckeditor5-heading": "*", | ||
"@ckeditor/ckeditor5-image": "*", | ||
"@ckeditor/ckeditor5-link": "*", | ||
"@ckeditor/ckeditor5-list": "*", | ||
"@ckeditor/ckeditor5-paragraph": "*", | ||
"@ckeditor/ckeditor5-typing": "*", | ||
"@ckeditor/ckeditor5-undo": "*" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-dev-utils": "^2.5.0", | ||
"babel-core": "^6.24.0", | ||
"babel-loader": "^6.4.0", | ||
"babel-preset-env": "^1.2.2", | ||
"babili-webpack-plugin": "^0.0.11", | ||
"regenerator-runtime": "^0.10.3", | ||
"webpack": "^2.3.2" | ||
}, | ||
"engines": { | ||
"node": ">=6.0.0", | ||
"npm": ">=3.0.0" | ||
}, | ||
"author": "CKSource (http://cksource.com/)", | ||
"license": "(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)", | ||
"homepage": "https://ckeditor5.github.io", | ||
"bugs": "https://github.com/ckeditor/ckeditor5-build-classic/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ckeditor/ckeditor5-build-classic.git" | ||
}, | ||
"scripts": { | ||
"build": "npm run create-entry-file && npm run build-ckeditor && npm run build-ckeditor-compat", | ||
"create-entry-file": "./bin/create-entry-file.js", | ||
"build-ckeditor": "./bin/build-ckeditor.sh", | ||
"build-ckeditor-compat": "./bin/build-ckeditor-compat.sh" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>CKEditor 5 – classic build sample</title> | ||
<style> | ||
body { | ||
max-width: 800px; | ||
margin: 20px auto; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
|
||
<h1>CKEditor 5 – classic build sample</h1> | ||
|
||
<div id="editor"> | ||
<h2>About CKEditor 5</h2> | ||
|
||
<p>This is <a href="https://ckeditor5.github.io">CKEditor 5</a>. | ||
</p> | ||
|
||
<figure class="image"> | ||
<img src="../tests/manual/sample.jpg" alt="Autumn fields" /> | ||
</figure> | ||
|
||
<p>After more than 2 years of building the next generation editor from | ||
scratch and closing over 980 tickets, we created a highly <strong>extensible | ||
and flexible architecture</strong> which consists of an <strong>amazing | ||
editing framework</strong> and <strong>editing | ||
solutions</strong> that will be built on top of it.</p> | ||
|
||
<h3>Notes</h3> | ||
|
||
<p><a href="https://ckeditor5.github.io">CKEditor 5</a> is <em>under | ||
heavy development</em> and this demo is not production-ready | ||
software. For example:</p> | ||
|
||
<ul> | ||
<li><strong>Only Chrome, Opera and Safari are supported</strong>. | ||
</li> | ||
<li>Firefox requires enabling the <a | ||
href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">“dom.select_events.enabled”</a> | ||
option. | ||
</li> | ||
<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support | ||
for pasting</a> is under development (content filtering is | ||
unstable). | ||
</li> | ||
</ul> | ||
|
||
<p>It has <em>bugs</em> that we are aware of — and that we | ||
will be working on in the next few iterations of the project. Stay | ||
tuned for some updates soon!</p> | ||
</div> | ||
|
||
<script src="../build/ckeditor.js"></script> | ||
<script> | ||
ClassicEditor.create( document.querySelector( '#editor' ) ) | ||
.then( editor => { | ||
window.editor = editor; | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); | ||
</script> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.