Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Feature: Introduced the editor with a balloon toolbar build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Sep 2, 2017
0 parents commit 82fe8d5
Show file tree
Hide file tree
Showing 25 changed files with 707 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Configurations to normalize the IDE behavior.
# http://editorconfig.org/

root = true

[*]
indent_style = tab
tab_width = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
18 changes: 18 additions & 0 deletions .gitattributes
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
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Suggested merge commit message ([convention](https://github.com/ckeditor/ckeditor5-design/wiki/Git-commit-message-convention))

Type: Message. Closes #000.

---

### Additional information

*For example – encountered issues, assumptions you had to make, other affected tickets, etc.*
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These files will be ignored by Git and by our linting tools:
# gulp lint
# gulp lint-staged

node_modules/
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/**
sample/**
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
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>.
23 changes: 23 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Software License Agreement
==========================

**CKEditor 5 editor with a balloon toolbar build**https://github.com/ckeditor/ckeditor5-build-balloon-toolbar <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.
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
CKEditor 5 editor with a balloon toolbar build
==============================================

[![Join the chat at https://gitter.im/ckeditor/ckeditor5](https://badges.gitter.im/ckeditor/ckeditor5.svg)](https://gitter.im/ckeditor/ckeditor5?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-build-balloon-toolbar.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-balloon-toolbar)
[![Dependency Status](https://david-dm.org/ckeditor/ckeditor5-build-balloon-toolbar/status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-balloon-toolbar)
[![devDependency Status](https://david-dm.org/ckeditor/ckeditor5-build-balloon-toolbar/dev-status.svg)](https://david-dm.org/ckeditor/ckeditor5-build-balloon-toolbar?type=dev)

The editor with a balloon toolbar build. Read more in the [classic editor](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/overview.html#Classic-editor) and see the [demo](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/examples/builds/classic-editor.html).

## Documentation

See:

* [Installation](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/installation.html) for how to install this package and what it contains.
* [Basic API](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/basic-api.html) for how to create an editor and interact with it.
* [Configuration](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/configuration.html) for how to configure the editor.
* [Creating custom builds](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/development/custom-builds.html) for how to customize the build (configure and rebuild the editor bundle).

## Quick start

First, install the build from npm:

```
npm install --save @ckeditor/ckeditor5-build-balloon-toolbar
```

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-balloon-toolbar/build/ckeditor.js"></script>
<script>
BalloonToolbarEditor
.create( document.querySelector( '#editor' ) )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
</script>
```

Or in your JavaScript application:

```js
import { BalloonToolbarEditor } from '@ckeditor/ckeditor5-build-balloon-toolbar/build/ckeditor';

// Or using CommonJS verion:
// const BalloonToolbarEditor = require( '@ckeditor/ckeditor5-build-balloon-toolbar/build/ckeditor' ).BalloonToolbarEditor;

BalloonToolbarEditor
.create( document.querySelector( '#editor' ) )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
```

**Note:** If you are planning to integrate CKEditor 5 deep into your application it is actually more convenient and recommended to install and import the source modules directly (like it happens in `ckeditor.js`). Read more in the [Bundling guide](https://ckeditor5.github.io/docs/nightly/ckeditor5/latest/builds/guides/integration/bundling.html).

## License

Licensed under the GPL, LGPL and MPL licenses, at your choice. For full details about the license, please check the `LICENSE.md` file.
9 changes: 9 additions & 0 deletions bin/build-ckeditor.sh
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."
17 changes: 17 additions & 0 deletions bin/create-entry-file.js
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( '../build-config' );

console.log( 'Creating the entry file...' );

bundler.createEntryFile( 'ckeditor.js', buildConfig );

console.log( 'Done.' );
54 changes: 54 additions & 0 deletions build-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

'use strict';

module.exports = {
// The editor creator to use.
editor: '@ckeditor/ckeditor5-editor-balloon-toolbar/src/balloontoolbareditor',

// The name under which the editor will be exported.
moduleName: 'BalloonToolbarEditor',

// Plugins to include in the build.
plugins: [
'@ckeditor/ckeditor5-presets/src/essentials',

'@ckeditor/ckeditor5-autoformat/src/autoformat',
'@ckeditor/ckeditor5-basic-styles/src/bold',
'@ckeditor/ckeditor5-basic-styles/src/italic',
'@ckeditor/ckeditor5-block-quote/src/blockquote',
'@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',
],

// UI language. Language codes follow the https://en.wikipedia.org/wiki/ISO_639-1 format.
language: 'en',

// Editor config.
config: {
toolbar: [
'headings',
'bold',
'italic',
'link',
'bulletedList',
'numberedList',
'blockQuote',
'undo',
'redo'
],

image: {
toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
}
}
};
6 changes: 6 additions & 0 deletions build/ckeditor.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/ckeditor.js.map

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions ckeditor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

import BalloonToolbarEditorBase from '@ckeditor/ckeditor5-editor-balloon-toolbar/src/balloontoolbareditor';
import EssentialsPlugin from '@ckeditor/ckeditor5-presets/src/essentials';
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 BlockquotePlugin from '@ckeditor/ckeditor5-block-quote/src/blockquote';
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';

export class BalloonToolbarEditor extends BalloonToolbarEditorBase {}

BalloonToolbarEditor.build = {
plugins: [
EssentialsPlugin,
AutoformatPlugin,
BoldPlugin,
ItalicPlugin,
BlockquotePlugin,
HeadingPlugin,
ImagePlugin,
ImagecaptionPlugin,
ImagestylePlugin,
ImagetoolbarPlugin,
LinkPlugin,
ListPlugin,
ParagraphPlugin
],
config: {
toolbar: [
'headings',
'bold',
'italic',
'link',
'bulletedList',
'numberedList',
'blockQuote',
'undo',
'redo'
],
image: {
toolbar: [
'imageStyleFull',
'imageStyleSide',
'|',
'imageTextAlternative'
]
}
}
};
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@ckeditor/ckeditor5-build-balloon-toolbar",
"version": "0.0.1",
"description": "CKEditor 5 editor with a balloon toolbar build.",
"keywords": [
"ckeditor5-build",
"text editor",
"WYSIWYG",
"rich-text editor"
],
"main": "./build/ckeditor.js",
"dependencies": {
"@ckeditor/ckeditor5-editor-balloon-toolbar": "*",
"@ckeditor/ckeditor5-presets": "^0.2.2",
"@ckeditor/ckeditor5-autoformat": "^0.5.1",
"@ckeditor/ckeditor5-basic-styles": "^0.8.1",
"@ckeditor/ckeditor5-block-quote": "^0.1.1",
"@ckeditor/ckeditor5-heading": "^0.9.1",
"@ckeditor/ckeditor5-image": "^0.6.0",
"@ckeditor/ckeditor5-link": "^0.7.0",
"@ckeditor/ckeditor5-list": "^0.6.1",
"@ckeditor/ckeditor5-paragraph": "^0.8.0"
},
"devDependencies": {
"@ckeditor/ckeditor5-dev-utils": "^3.0.0",
"@ckeditor/ckeditor5-dev-webpack-plugin": "^2.0.11",
"babel-minify-webpack-plugin": "^0.2.0",
"css-loader": "^0.28.5",
"node-sass": "^4.5.3",
"raw-loader": "^0.5.1",
"sass-loader": "^6.0.6",
"style-loader": "^0.18.2",
"webpack": "^3.5.5"
},
"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-balloon-toolbar/issues",
"repository": {
"type": "git",
"url": "https://github.com/ckeditor/ckeditor5-build-balloon-toolbar.git"
},
"scripts": {
"build": "npm run create-entry-file && npm run build-ckeditor",
"create-entry-file": "./bin/create-entry-file.js",
"build-ckeditor": "./bin/build-ckeditor.sh"
}
}
Loading

0 comments on commit 82fe8d5

Please sign in to comment.