From 648d5a6ad7120f8b81b81cce27cccb6397a369d2 Mon Sep 17 00:00:00 2001 From: Emanuel Schuetze Date: Thu, 19 Jun 2014 12:02:29 +0200 Subject: [PATCH] Fixed CKEditor stuff: - Added missing insertpre plugin and allow
 tag with class
  attribute. Added font style to base.css.
- Removed unused link to old ckeditor.css (now managed by
  django-ckeditor).
---
 CHANGELOG                                     |   3 +
 .../ckeditor/plugins/insertpre/README.md      |  27 ++++
 .../insertpre/icons/insertpre-color.png       | Bin 0 -> 603 bytes
 .../plugins/insertpre/icons/insertpre.png     | Bin 0 -> 693 bytes
 .../ckeditor/plugins/insertpre/lang/en.js     |   6 +
 .../ckeditor/plugins/insertpre/lang/pl.js     |   6 +
 .../ckeditor/plugins/insertpre/plugin.js      | 131 ++++++++++++++++++
 openslides/core/static/css/base.css           |   6 +
 openslides/core/static/js/ckeditor-config.js  |  43 ------
 openslides/global_settings.py                 |   5 +-
 .../motion/templates/motion/motion_form.html  |   1 -
 openslides/utils/forms.py                     |   3 +-
 12 files changed, 184 insertions(+), 47 deletions(-)
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre-color.png
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre.png
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/lang/en.js
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/lang/pl.js
 create mode 100644 openslides/core/static/ckeditor/ckeditor/plugins/insertpre/plugin.js
 delete mode 100644 openslides/core/static/js/ckeditor-config.js

diff --git a/CHANGELOG b/CHANGELOG
index fc619bbd0..188b00ed3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,9 @@ Version 1.6.1 (unreleased)
 ==========================
 [https://github.com/OpenSlides/OpenSlides/issues?milestone=16]
 
+Other:
+- Fixed CKEditor stuff (added insertpre plugin and removed unused code)
+
 
 Version 1.6 (2014-06-02)
 ========================
diff --git a/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md
new file mode 100644
index 000000000..5bf8edb2f
--- /dev/null
+++ b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/README.md
@@ -0,0 +1,27 @@
+CKEditor Insert <pre> Plugin
+===============================
+
+This plugin makes it easier to insert a <pre> tag in CKEditor.
+
+Installation
+------------
+
+1. Clone/copy this repository contents in a new "plugins/insertpre" folder in your CKEditor installation.
+2. Enable the "insertpre" plugin in the CKEditor configuration file (config.js):
+
+        config.extraPlugins = 'insertpre';
+
+That's all. "InsertPre" button will appear on the editor toolbar and will be ready to use.
+
+3. Optionally, you may specify which class should be added to the <pre> element:
+
+        CKEDITOR.config.insertpre_class = 'prettyprint';
+
+   As well as specify how the <pre> tag should be rendered inside CKEditor:
+   
+		CKEDITOR.config.insertpre_style = 'background-color:#F8F8F8;border:1px solid #DDD;padding:10px;';
+
+License
+-------
+
+Licensed under the terms of any of the following licenses at your choice: [GPL](http://www.gnu.org/licenses/gpl.html), [LGPL](http://www.gnu.org/licenses/lgpl.html) and [MPL](http://www.mozilla.org/MPL/MPL-1.1.html).
diff --git a/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre-color.png b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre-color.png
new file mode 100644
index 0000000000000000000000000000000000000000..0c76bd1297751b66230f74719504b2adb02b1615
GIT binary patch
literal 603
zcmV-h0;K(kP)^~*-1fljz_B$LUvK}k?BNXe#Y!m=zM!!V#}8bncK5m;8VP
zw86G*RI63?Cd%b9bX|ueNlZ|wR6rj|r_)VIP@r2imh3?SN+^{|kY%~8B{maJ@F*OK
z&VH9LwOeGt#DRjj0~v~8`>iO7!Ybi;zE$va`A^T#yW`y44;k^#O~K5*jD=qcUhPSc
zvyy~q;5H_1WT1l~cqje9yfa+l!hu6xjdOJ8s;8E^+=QQ$tw
p?%p!Hy#YapB=@+^9(46X{{RQg%9y;OKjr`c002ovPDHLkV1g7l326WT

literal 0
HcmV?d00001

diff --git a/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre.png b/openslides/core/static/ckeditor/ckeditor/plugins/insertpre/icons/insertpre.png
new file mode 100644
index 0000000000000000000000000000000000000000..756a4906f94bd832bfd77e8018c82339245c2be7
GIT binary patch
literal 693
zcmV;m0!safP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyx8
z3=Aw}o`rh=00K2hL_t(I%Z-yePa9DXg}?h)9E;d8iExDC$nXOqiU?@jxuHO`q@hlm
zh8|H<1PPEVrKh5&Kr%{4iG)N=8ibLI-@D7+y^{jl!Q^?QsqUFGb7#&d5dlCcRRZ1s
zhQFf$d>0W9fQT>@`4B}>D@l^nIVZo1D2il%e}4~{2egPx2rMT_lJG%8NXt&#P
ze}6Bxx3}V)lbf3xIXE~Ni;R*Luw=1nyOB#)aIOk+A7)YFWT*PTB%gX=koyMaycrM3f*p(TrS7O#l>SqV|Y3zeSLlX>F(|>
znx39E^?IF7rvpHz)8XvwjBGYbv)N>EaS>w-#u&8LV*w>1Y;A45E))v&g@uLp4-XG)
zZf%d4Yh<(8@n(h_z*@Va0d{wHn}>&opS|}aNdiEUBzW&xUtb?518A*(
z?O@~s=iK>o
-    
     
 {% endblock %}
 
diff --git a/openslides/utils/forms.py b/openslides/utils/forms.py
index 1dfe2404c..ca4db1a7c 100644
--- a/openslides/utils/forms.py
+++ b/openslides/utils/forms.py
@@ -29,7 +29,8 @@ HTML_TAG_WHITELIST = ('a',
 HTML_ATTRIBUTES_WHITELIST = {
     'a': ['href'],
     '*': ['style'],
-    'img': ['src'],
+    'pre': ['class'],
+    'img': ['src', 'width', 'height'],
 }
 
 HTML_STYLES_WHITELIST = ('color', 'background-color', 'list-style', 'width', 'height')