Added divarea plugin
authorMarcel Werk <burntime@woltlab.com>
Fri, 14 Jun 2013 13:12:58 +0000 (15:12 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 14 Jun 2013 13:12:58 +0000 (15:12 +0200)
com.woltlab.wcf/templates/wysiwyg.tpl
wcfsetup/install/files/js/3rdParty/ckeditor/plugins/divarea/plugin.js [new file with mode: 0644]
wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js
wcfsetup/install/files/style/message.less

index ce745024f5cbd909b8ae8e88ee9429d125d8bc12..5013051f987c07b5f2fdbe3c23c0a5b5dec951d9 100644 (file)
@@ -36,7 +36,7 @@ $(function() {
        
        var $config = {
                smiley_path: '{@$__wcf->getPath()|encodeJS}',
-               extraPlugins: 'wbbcode,wbutton',
+               extraPlugins: 'wbbcode,wbutton,divarea',
                removePlugins: 'contextmenu,tabletools,liststyle,elementspath,menubutton,forms,scayt',
                language: '{@$__wcf->language->getFixedLanguageCode()}',
                fontSize_sizes: '8/8pt;10/10pt;12/12pt;14/14pt;18/18pt;24/24pt;36/36pt;',
diff --git a/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/divarea/plugin.js b/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/divarea/plugin.js
new file mode 100644 (file)
index 0000000..cce6c0a
--- /dev/null
@@ -0,0 +1,36 @@
+/**
+ * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.html or http://ckeditor.com/license
+ */
+
+/**
+ * @fileOverview The "divarea" plugin. It registers the "wysiwyg" editing
+ *             mode using a DIV element.
+ */
+
+CKEDITOR.plugins.add( 'divarea', {
+       afterInit: function( editor ) {
+               // Add the "wysiwyg" mode.
+               // Do that in the afterInit function, so it'll eventually overwrite
+               // the mode defined by the wysiwygarea plugin.
+               editor.addMode( 'wysiwyg', function( callback ) {
+                       var editingBlock = CKEDITOR.dom.element.createFromHtml( '<div class="cke_wysiwyg_div cke_reset" hidefocus="true"></div>' );
+
+                       var contentSpace = editor.ui.space( 'contents' );
+                       contentSpace.append( editingBlock );
+
+                       editingBlock = editor.editable( editingBlock );
+
+                       editingBlock.detach = CKEDITOR.tools.override( editingBlock.detach,
+                               function( org ) {
+                                       return function() {
+                                               org.apply( this, arguments );
+                                               this.remove();
+                                       };
+                               });
+
+                       editor.setData( editor.getData( 1 ), callback );
+                       editor.fire( 'contentDom' );
+               });
+       }
+});
index edc7c7f32334e13f7a4605db8a5259d5def0594a..987fc6a2a8e659c4fe4d19bddd5da7bd46b8077d 100644 (file)
@@ -53,6 +53,9 @@
                });
                
                insertFakeSubmitButton(event);
+               
+               // remove stupid title tag
+               $(event.editor.container.$).find(".cke_wysiwyg_div").removeAttr('title');
        });
        
        /**
index d1040713e28abcc17b05ff53df1b26f2d0fc128e..2bed2d9ed39c9db33d57f95542c3066c6d20358b 100644 (file)
@@ -870,7 +870,8 @@ li:nth-child(2n+1) .message {
        padding: 0 !important;
 }
 
-.cke_source {
+.cke_source,
+.cke_wysiwyg_div {
        padding: 8px !important;
 }
 
@@ -882,6 +883,11 @@ li:nth-child(2n+1) .message {
        background-color: #000 !important;
 }
 
+.cke_wysiwyg_div,
+.cke_inner {
+       background-color: transparent !important;
+}
+
 @media only screen and (max-width: 800px) {
        .message.messageSidebarOrientationLeft,
        .message.messageSidebarOrientationRight {