Skip to content

Commit f26e474

Browse files
committed
update text styles in tiny mce
1 parent 8a0692a commit f26e474

File tree

181 files changed

+226531
-158293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+226531
-158293
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
Changelog
22
=========
33

4-
0.0.19 (development)
4+
0.0.20 (development)
55
--------------------
66

7+
0.0.19
8+
------
9+
* Update tinymce4 to 4.7.1
10+
* Add 'image_class_list'
711

812
0.0.18
913
------

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "django-tinymce-4",
3-
"version": "0.0.18",
3+
"version": "0.0.19",
44
"homepage": "https://github.com/ITCase-django/django-tinymce-4",
55
"authors": [
66
"ITCase <[email protected]>"
@@ -15,6 +15,6 @@
1515
"tests"
1616
],
1717
"dependencies": {
18-
"tinymce": "~4.4.3"
18+
"tinymce": "~4.7.1"
1919
}
2020
}

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
const gulp = require('gulp')
44
const plugins = require('gulp-load-plugins')({ pattern: ['gulp-*', 'gulp.*'] })
55

6-
const argv = require('yargs').argv;
6+
const argv = require('yargs').argv
77
const map = require('vinyl-map')
88

99
const TARGET_CSS = '__tinymce-4.css'
10-
const TARGET_CSS_PATH ='./tinymce_4/static/tinymce_4/css/'
10+
const TARGET_CSS_PATH = './tinymce_4/static/tinymce_4/css/'
1111
const CSS_FILES = [
1212
'./tinymce_4/static/tinymce_4/css/*.css',
1313
'./tinymce_4/static/tinymce_4/css/**/*.css',
@@ -95,7 +95,7 @@ gulp.task('css', () => {
9595
})
9696

9797
gulp.task('watch', () => {
98-
plugins.watch(paths.CSS_FILES, { verbose: true },
98+
plugins.watch(CSS_FILES, { verbose: true },
9999
plugins.batch((cb) => {
100100
gulp.series('css')()
101101
cb()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "django-tinymce-4",
33
"title": "Integrate TinyMCE4 in Django projects",
44
"description": "",
5-
"version": "0.0.18",
5+
"version": "0.0.19",
66
"homepage": "http://www.github.com/ITCase-django/django-tinymce-4/",
77
"author": "ITCase <[email protected]> (http://www.itcase.pro/)",
88
"repository": {

tinymce_4/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '0.0.18'
3+
__version__ = '0.0.19'

tinymce_4/static/tinymce_4/css/__tinymce-4.css

Lines changed: 1 addition & 173 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tinymce_4/static/tinymce_4/css/__tinymce-4.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tinymce_4/static/tinymce_4/css/list.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
ol {
44
counter-reset: list1;
5-
padding: 0 0 1em 1em;
5+
padding: 0 0 15px 15px;
66
& li {
77
position: relative;
88
display: block;
@@ -20,7 +20,7 @@ ol {
2020
top: 0;
2121
}
2222
& * ol {
23-
margin: 1.5em 0 0 0;
23+
margin: 20px 0 0 0;
2424
padding-bottom: 0;
2525
& li:last-child {
2626
padding-bottom: 0;
@@ -44,10 +44,10 @@ ul {
4444
}
4545
&::before {
4646
content: '\2014\a0';
47-
padding: 0 0.5em 0 0;
47+
padding: 0 8px 0 0;
4848
}
4949
& * ul {
50-
margin: 1.5em 0 0 0;
50+
margin: 24px 0 0 0;
5151
padding-bottom: 0;
5252
& li:last-child {
5353
padding-bottom: 0;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* global tinymce */
2+
3+
tinymce.PluginManager.add('insertzoomimage', function (editor, url) {
4+
function openDialog () {
5+
const selfData = tinymce.activeEditor.selection.getNode()
6+
editor.windowManager.open({
7+
title: 'Insert Zoomable Image',
8+
body: [
9+
{
10+
name: 'src',
11+
type: 'filepicker',
12+
filetype: 'image',
13+
label: 'Image',
14+
autofocus: true,
15+
value: selfData.getAttribute('data-mce-src') || null
16+
},
17+
{
18+
name: 'zoomableSrc',
19+
type: 'filepicker',
20+
filetype: 'image',
21+
label: 'Zoomable Image',
22+
value: selfData.getAttribute('data-image-path') || null
23+
}
24+
],
25+
onSubmit: (e) => {
26+
editor.insertContent(
27+
'<img src="' + e.data.src + '"' + 'data-image-path="' + e.data.zoomableSrc + '"' + 'class="image_action_open-popup" />'
28+
)
29+
}
30+
})
31+
}
32+
33+
editor.addMenuItem('insertzoomimage', {
34+
text: 'Insert zoomable image',
35+
context: 'insert',
36+
icon: 'browse',
37+
onClick: () => {
38+
openDialog()
39+
}
40+
})
41+
42+
editor.addButton('insertzoomimage', {
43+
icon: 'browse',
44+
tooltip: 'Insert zoomable image',
45+
stateSelector: 'img',
46+
onClick: () => {
47+
openDialog()
48+
}
49+
})
50+
})

tinymce_4/static/tinymce_4/settings/full.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ if (typeof tinySettings === 'object') {
1414
if (typeof externalPlugins === 'object') {
1515
tinySettings.external_plugins = externalPlugins;
1616
}
17+
if (typeof imageClassList === 'object') {
18+
tinySettings.image_class_list = imageClassList;
19+
}
20+
if (typeof languageUrl === 'string') {
21+
tinySettings.language_url = languageUrl
22+
}
1723
if (typeof styleFormats === 'object') {
1824
tinySettings.style_formats = styleFormats.concat(customStyleFormats);
1925
}
@@ -22,5 +28,5 @@ if (typeof tinySettings === 'object') {
2228
}
2329
tinymce.init(tinySettings);
2430
} else {
25-
console.warn('tinySettings is not exists');
31+
console.warn('tinyMCE 4 Settings is not exists');
2632
}

0 commit comments

Comments
 (0)