Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
local-tinymce
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
athos
local-tinymce
Commits
662421f6
Commit
662421f6
authored
Mar 06, 2017
by
Георгий Попов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add instruction for adding custom styles to README file
parent
30bbaaf4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
README.md
README.md
+59
-0
No files found.
README.md
View file @
662421f6
...
...
@@ -13,3 +13,62 @@
## Использование
`$ firefox index.html`
## Настройка
### Добавление собственных стилей в CKEditor
Для добавления собственного стиля необходимо редактировать файл js/ckeditor.editor.js.
Файл содержит конфигурацию редактора. Стили задаются в массиве 'stylesSet':
```
javascript
stylesSet
:
[
/* Inline Styles */
{
name
:
'Marker'
,
element
:
'span'
,
attributes
:
{
'class'
:
'marker'
}
},
...
/* Object Styles */
{
name
:
'Compact table'
,
element
:
'table'
,
attributes
:
{
cellpadding
:
'5'
,
cellspacing
:
'0'
,
border
:
'1'
,
bordercolor
:
'#ccc'
},
styles
:
{
'border-collapse'
:
'collapse'
}
}
```
Для добавления стиля необходимо добавить объект к массиву:
```
javascript
{
name
:
'StyleName'
,
element
:
'HTMLelement'
,
attributes
:
{
HTMLattribute
:
'value'
;
...
},
styles
:
{
'CSSattribute'
:
'value'
}
}
```
Где
**StyleName**
- имя стиля, будет отображено в списке
**HTMLelement**
- имя html тэга, который будет использоваться для элементов стиля
**CSSattribute**
- имя аттрибута css, например, background-color
**HTMLattribute**
- имя аттрибута html, например, width
**value**
- значение аттрибутов, должно быть в одинарных кавычках
Пример добавления собственного стиля, который будет делать текст красным:
```
javascript
{
name
:
'Красный текст'
,
element
:
'span'
,
styles
:
{
color
:
red
;
}
}
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment