Author Topic: Can anyone upgrade CKeditor?  (Read 113843 times)

Offline Hans

  • Posts: 912
  • Gender: Male
Re: Can anyone upgrade CKeditor?
« Reply #200 on: September 09, 2015, 03:21:16 PM »
I agree with the critique and find it a pity that so much functionality has been offered only for making the code work in responsive websites.
I would like to use the WB standard too, but I see that when I have an image that is wider than its container the image is malformed with this code:
Code: [Select]
<p><img alt="" src="http://www.yyyy.nl/media/plaatjes/600-brandenburg-50492.jpg" style="width: 640px; height: 427px;" /></p>

which is the usual code (mind the "style" )  and will be proportional scaled with this code:
Code: [Select]
<p><img alt="" height="427" src="http://www.yyy.nl/media/plaatjes/600-brandenburg-50492.jpg" width="640" /></p>
which is the code that version 5.4.3 produces.
I would be glad if someone could point me in the right direction to make that happen. I couldń find a solution on StackOverflow.

@jacobi22 Maybe you pointed to a possible solution when you wrote that the old image plugin also works with html 5?
Or did I oversee something?

Auf (mein ;-) ) "Deutsch":

Ich stimme mit Ihrer Kritik, denn es ist in der Tat eine Menge verloren.
Ich möchte auch lieber das Standard WB CKEditor verwenden aber ich sehe, dass, wenn ich ein Bild, das breiter als sein Behälter ist platziere das Bild fehlerhaft (verzerrt) ist mit diesem Code (beachte den "inline style" Teil:
Code: [Select]
<p><img alt="" src="http://www.yyy.nl/media/plaatjes/600-brandenburg-50492.jpg" style="width: 640px; height: 427px;" /> </ p> Das ist die übliche Code.
Mit
Code: [Select]
<p><img alt = "" height = "427" src="http://www.yyyy.nl/media/plaatjes/600-brandenburg-50492.jpg" width="640" /> </ p> wird das Bild proportional skaliert: Dass ist die Code, der version 5.4.3 produziert hat.

Ich würde mich freuen, wenn jemand mich in die richtige Richtung weisen könnte Ich konnte eine Lösung auf Stackoverflow leider nicht finden

@jacobi22 Vielleicht haben Sie auf eine mögliche Lösung hingewiesen wenn Sie schrieb, dass das alte Image-Plugin auch mit HTML 5 funktioniert?? Muss dann etwas irgendwo in CKEditor geändert werden?
Ich weiss: Es ist kein WB Sache aber es wäre schön wenn Jemand eine Lösung hätte.
Hans - Nijmegen - The Netherlands

instantflorian

  • Guest
Re: Can anyone upgrade CKeditor?
« Reply #201 on: September 09, 2015, 05:29:32 PM »
I found at stackoverflow a solution which *seems* to work.

At the end of wb_ckconfig.js (either in /modules/ckedidor/wb_config/wb_ckconfig.js or in /templates/$yourtemplatename/wb_ckconfig.js add the following lines of code:

Code: [Select]
CKEDITOR.on('instanceReady', function (ev) {
// Ends self closing tags the HTML4 way, like <br>.
ev.editor.dataProcessor.htmlFilter.addRules(
    {
        elements:
        {
            $: function (element) {
                // Output dimensions of images as width and height
                if (element.name == 'img') {
                    var style = element.attributes.style;

                    if (style) {
                        // Get the width from the style.
                        var match = /(?:^|\s)width\s*:\s*(\d+)px/i.exec(style),
                            width = match && match[1];

                        // Get the height from the style.
                        match = /(?:^|\s)height\s*:\s*(\d+)px/i.exec(style);
                        var height = match && match[1];

                        if (width) {
                            element.attributes.style = element.attributes.style.replace(/(?:^|\s)width\s*:\s*(\d+)px;?/i, '');
                            element.attributes.width = width;
                        }

                        if (height) {
                            element.attributes.style = element.attributes.style.replace(/(?:^|\s)height\s*:\s*(\d+)px;?/i, '');
                            element.attributes.height = height;
                        }
                    }
                }



                if (!element.attributes.style)
                    delete element.attributes.style;

                return element;
            }
        }
    });
});


Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Can anyone upgrade CKeditor?
« Reply #202 on: September 09, 2015, 06:27:06 PM »
Quote
@jacobi22 Maybe you pointed to a possible solution when you wrote that the old image plugin also works with html 5?
Or did I oversee something?

no, not you - it was my fault - sorry for that, i did'nt read the complete docu and understand your problem wrong.

the code from the image2-plugin is html5-conform, but the plugin give not so much possibilitys like the "old" standard image-plugin.
the "old" image-plugin give a non-html5-compatible code, if its use border or hspace

a little history.... the new image2-plugin is a "new" plugin from the ckeditor.com-webpage (means: is a first step, maybe it come a better version in the future), a try to give some html5-compatible code in the editor. It give's another plugin that give a little more service for responsive pictures
here the plugin -> http://ckeditor.com/addon/imageresponsive
and here a picture from the interface in the backend


same problem.... no css-class, no style-informations  :roll:

from my point of view.... at the moment only two ways
1. using the image2-plugin without preview in the interface, without field for a class-name etc
2. using the "old" - standard-image-plugin combined with the solution from florian

i talk with Dietmar the last ours to found the best solution and we found, that the best way is it, to remove the image2-plugin from the package
for the fast solution, its possible to remove the image2-plugin, if you follow the instructions from post#197

after that, you have the "old" image-interface with the tabs and the solution from florian, works without problems for html5 and for me with the css in the bottom also in html4.x (no trouble with the validator because the missing px in with & height
 

on my own hp i use the fckeditor, this give me a html5-conform code like this
Code: [Select]
<img width="315" height="200" alt="" class="textbild aboutpic0" src="http://xyz.de/media/banner2.png" />but its also possible, to edit the code in the source-code-mode in the ckeditor and remove the px there or (better way) if you use the code from Florian


than i have two classes for every picure, called for me with "textbild" (a picture inside in the content) and the class "aboutpicX" (give some styling to every pic like a border, margin-left etc)

now my css
for all pics - is needed for responsive
Quote
img {
    height: auto;
    max-width: 100%;
}

the class textbild
Code: [Select]
.textbild {
    max-width: 50%;
    max-height:50%;
    padding: 0;
}

and the individual styling (its not needed for responsive)
Code: [Select]
.aboutpic0 {
border: 2px solid #003480;
float:right;
margin-left:15px;
margin-right:5px;
margin-bottom:5px;
margin-top:15px}

this works fine in my responsive html5-template

Thx also to Florian for the solution!
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Can anyone upgrade CKeditor?
« Reply #203 on: September 09, 2015, 07:15:28 PM »
so, latest version without the image2-plugin and with the solution from florian is now in the addon-area

http://addon.WebsiteBaker-next.de/pages/en/browse-add-ons.php?id=08A769F
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Hans

  • Posts: 912
  • Gender: Male
Re: Can anyone upgrade CKeditor?
« Reply #204 on: September 09, 2015, 07:20:49 PM »
Wow, thanks both of you.
Just a little note.
I have little time this evening but I'll try in the course of tomorrow.
Thank you again!
Hans - Nijmegen - The Netherlands

Offline Hans

  • Posts: 912
  • Gender: Male
Re: Can anyone upgrade CKeditor?
« Reply #205 on: September 09, 2015, 10:55:47 PM »
Had to try hahaha.
It works perfect! It even works after altering the dimensions afterwards
Hope it will make it to the official 4.5.3 (with the release history accordingly) in the repo
Thanks, Dietmar, Florian and Uwe.
Hans - Nijmegen - The Netherlands

Offline sky writer

  • Posts: 926
Re: Can anyone upgrade CKeditor?
« Reply #206 on: September 10, 2015, 04:42:16 AM »
I installed this update.  I'm not a fan of moonocolor, so I switched back to moono and the oembed icon does not display in the toolbar.

I see that the default oembed icon is included in the moonocolor skins/icons.png
It is not in the moono skins/icons.png
I always had it as an insert plugin.

So, I tried playing around with my config.toolbar_WB_D efault in                /wb_config/wb_ckconfig.js
Nothing I change seems to take effect.  Maybe I'm just tired, but I was sure this is how I always added, moved toolbar icons in the past.

Can anyone help me here?
Thanks!

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4379
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: Can anyone upgrade CKeditor?
« Reply #207 on: September 10, 2015, 04:53:55 AM »
Tkx for your report. I will have  a look and going to fix it.

Dietmar

Immer nur von der Zukunft reden, die Gegenwart vergessen und auf die Vergangenheit schimpfen
Neues Unwort: Schnappatmung

Offline sky writer

  • Posts: 926
Re: Can anyone upgrade CKeditor?
« Reply #208 on: September 10, 2015, 05:08:06 AM »
Just to clarify,
The default oembed icon is included in the moonocolor skins/icons.png
It is not in the moono skins/icons.png
It didn't used to be included in either.
I always had it added from it's plugin icon folder.
Hope this helps.

I then tried simply switching the 'image' and 'flash' order in the WB_Default, but that didn't happen either.

I checked the include.php file to see if something there is stopping the updated to wb_config/wb_ckconfig.js from showing.  I did empty my cash, close browser, but still nothing changed.

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4379
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: Can anyone upgrade CKeditor?
« Reply #209 on: September 10, 2015, 05:50:07 AM »
Pls check again, new package is online. I updated the skin mono

Directdownload

Dietmar
Immer nur von der Zukunft reden, die Gegenwart vergessen und auf die Vergangenheit schimpfen
Neues Unwort: Schnappatmung

Offline sky writer

  • Posts: 926
Re: Can anyone upgrade CKeditor?
« Reply #210 on: September 10, 2015, 06:12:29 AM »
I tried installing, but WB said Already Installed.  So I just uploaded the two moono png's and now a bunch of my toolbar icons are wrong.

What's the best way to revert back to an older version of a module?  I just want to go back, to see if that fixes this issue.

Offline hgs

  • Betatester
  • **
  • Posts: 1119
    • EFG MG
Re: Can anyone upgrade CKeditor?
« Reply #211 on: September 10, 2015, 07:47:28 AM »
 (Y) (Y)
Musste zwar den "alten Neue" deinstallieren, Fehlermeldung wie bei sky writer.
Aber jetzt ist alles wieder so komfortabel wie mit der Version 4.4.7

Danke an alle
 (Y) (Y)

Google Translate
Had to uninstall while the "old new" error message as in sky writer.
But now everything is as comfortable as with the version 4.4.7

Thanks to all
LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

Offline sky writer

  • Posts: 926
Re: Can anyone upgrade CKeditor?
« Reply #212 on: September 10, 2015, 03:43:47 PM »
I tried installing, but WB said Already Installed.  So I just uploaded the two moono png's and now a bunch of my toolbar icons are wrong.

What's the best way to revert back to an older version of a module?  I just want to go back, to see if that fixes this issue.

Please ignore.  I figured out how to go back to 4.4.3 and manually "upgrade" (downgrade).  I was really tired when I wrote this post.

When I have more time, I will upgrade again to 4.5.3 and see if I can't figure out what was happening with that icon.

Great work with the development of this crucial module.  Cheers!

Offline sky writer

  • Posts: 926
Re: Can anyone upgrade CKeditor?
« Reply #213 on: September 11, 2015, 04:26:11 AM »
Pls check again, new package is online. I updated the skin mono

Directdownload

Dietmar

Upgraded my 4.4.3 version to this new v4.5.3, and all icons are visible in moono skin.  Thank you very much.
Do you mind if I ask what the issue was?

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4379
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: Can anyone upgrade CKeditor?
« Reply #214 on: September 11, 2015, 04:41:38 AM »
Hi,

i too upgraded the skin mono.

Dietmar
Immer nur von der Zukunft reden, die Gegenwart vergessen und auf die Vergangenheit schimpfen
Neues Unwort: Schnappatmung

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
Re: Can anyone upgrade CKeditor?
« Reply #215 on: September 30, 2015, 08:39:12 AM »
Hi,

in the version 4.5.3 from the temporary addons repo at http://addon.WebsiteBaker-next.de/pages/en/browse-add-ons.php?id=08A769F there are two issues:

the most severe for wb 2.8.3 users: include.php makes use of methods in the database class not yet present in 2.8.3.
To make it work again change lines 251-252 as follows:
Code: [Select]
        if (($result = $database->query( $query )) && ($result->numRows() > 0) ) {
            $data = $result->fetchRow( MYSQLI_ASSOC );
(the change is doQuery -> query and fetchArray -> fetchRow )

and another hint: In wb_config, lines 306-307, currently commented out:
Code: [Select]
var urlField = linkTab.get( 'txtUrl' );
urlField['default'] = 'www.example.com';
here the name of the urlField has changed to txtUrl and therefore the subsequent line did not work anymore and someone has commented it out in the version currently provided in the addons repo.

cheers, Martin

Offline Luisehahne

  • WebsiteBaker Org e.V.
  • **
  • Posts: 4379
  • Gender: Male
    • Webdesign und Entwicklung WebsiteBaker
Re: Can anyone upgrade CKeditor?
« Reply #216 on: September 30, 2015, 02:22:40 PM »
the most severe for wb 2.8.3 users: include.php makes use of methods in the database class not yet present in 2.8.3.
To make it work again change lines 251-252 as follows:
Code: [Select]
        if (($result = $database->query( $query )) && ($result->numRows() > 0) ) {
            $data = $result->fetchRow( MYSQLI_ASSOC );
(the change is doQuery -> query and fetchArray -> fetchRow )

we solved it to use with WB 283 and WB 284. We will be going to inform if new version is ready for download.

Quote
and another hint: In wb_config, lines 306-307, currently commented out:
Code: [Select]
var urlField = linkTab.get( 'txtUrl' );
urlField['default'] = 'www.example.com';
here the name of the urlField has changed to txtUrl and therefore the subsequent line did not work anymore and someone has commented it out in the version currently provided in the addons repo.

cheers, Martin

i can't agree. This Lines are for the image Plugin and there is no existing urlField variable, only  a element id: txtUrl.

Like i remember it's a old code snippet for the image plugin in ckeditor 3.x

We remove this lines.

Dietmar



Immer nur von der Zukunft reden, die Gegenwart vergessen und auf die Vergangenheit schimpfen
Neues Unwort: Schnappatmung

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
Re: Can anyone upgrade CKeditor?
« Reply #217 on: October 01, 2015, 02:12:14 PM »
Hi Dietmar,

i can't agree. This Lines are for the image Plugin and there is no existing urlField variable, only  a element id: txtUrl.
Like i remember it's a old code snippet for the image plugin in ckeditor 3.x

yes, it might be old code and it's not worth discussing a lot. It is  just supposed to put 'www.example.com'  as a predefined value into the URL field.
old code:
Code: [Select]
        if ( dialogName == 'image' )
        {
            // Get a reference to the "Link Info" tab.
            var linkTab = dialogDefinition.getContents('Link');
  //alert(linkTab);
            // Set the default value for the URL field.
            var urlField = linkTab.get( 'Klasse' );
            //urlField['default'] = 'www.example.com';
              //alert(urlField);
        }

in my understanding urlField is a local variable here, which stores the handle to something on the Link tab. There is nothing named 'Klasse' and therefore the local variable urlField is null and the assignment to its default-component fails (and prevents the whole dialog from appearing). The point is that 'Klasse' should be replaced by 'txtUrl'. The name of the variable urlField is irrelevant and it could as well be dropped completely if you decide to write it on a single line:

Code: [Select]
        if ( dialogName == 'image' ) dialogDefinition.getContents('Link').get('txtUrl')['default'] = 'www.example.com';

but it's totally ok to remove the example url completely. Usually, you wouldn't want to have links to www.example.com inserted by default (even if you don't click on the Link-tab at all).

I only wanted to mention this because I still had an old wb_config.js with my local modifications and noticed that this piece of old code did not work anymore (and according to the debugging comments in the release you might just have given up at this place). But again, removing this section completely is probably the best solution.

Martin

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Can anyone upgrade CKeditor?
« Reply #218 on: December 08, 2015, 02:51:06 PM »
is it possible to style this 4 buttons, i need a little more width



i didnt found a class for this  :oops:

a styling for this buttons was possible in cke 3.x via css

i found some styles in the web for the dropdown-list, but it doesnt work in a css-file in template-folder (like earlyer versions), maybe they change the load-order for the css-files
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline dbs

  • Betatester
  • **
  • Posts: 8039
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Can anyone upgrade CKeditor?
« Reply #219 on: December 08, 2015, 03:14:05 PM »
Hm, in der wb_theme css eingetragen verändert es die Breite vom Feld Größe (letzter CK)
Code: [Select]
.cke_combo__fontsize .cke_combo_text {
    width: 40px!important;
}

Geht bei dir nicht?

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Can anyone upgrade CKeditor?
« Reply #220 on: December 08, 2015, 03:28:46 PM »
i try it in my editor.css in template folder, but this was overwritten from the css-files in ckeditor-folder

your solution with the theme.css works. thx  (Y)
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline sky writer

  • Posts: 926
Re: Can anyone upgrade CKeditor?
« Reply #221 on: December 08, 2015, 06:28:39 PM »
For those who can't read dbs' message:
you can style these 4 buttons by editing "theme.css" in your ADMIN theme folder (e.g., wb theme, argos theme)

Also, for those who are not aware, these buttons and their drop-down panels can be styled globally:

Drop-down buttons on toolbar:
.cke_combo .cke_combo_text

Drop-down panels:
.cke_panel


Or individually:

Drop-down buttons on toolbar:
.cke_combo__font .cke_combo_text
.cke_combo__fontsiz e .cke_combo_text
.cke_combo__format .cke_combo_text
.cke_combo__style .cke_combo_text

Drop-down panels:
.cke_combopanel__fo nt
.cke_combopanel__fo ntsize
.cke_combopanel__fo rmat
.cke_combopanel__st yles

e.g.,
to change the width of the drop-down panel for the "Format" button only:

.cke_combopanel__fo rmat {
width: 422px !important;
}

Hope this helps.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Can anyone upgrade CKeditor?
« Reply #222 on: December 09, 2015, 12:18:05 PM »
 (Y)
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline dbs

  • Betatester
  • **
  • Posts: 8039
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Can anyone upgrade CKeditor?
« Reply #223 on: December 10, 2015, 08:54:59 AM »
+1 from me too.
This is now in the CK as backend.css.

Q: change of width or height of the CK with include or wb_ckconfig has no effect. It is only changable in modify.php of module wysiwyg?


Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3026
  • Gender: Female
Re: Can anyone upgrade CKeditor?
« Reply #224 on: December 10, 2015, 09:55:38 AM »
Q: change of width or height of the CK with include or wb_ckconfig has no effect. It is only changable in modify.php of module wysiwyg?
This is correct..
The wysiwyg module defines the size how it shall be shown...
The editor itself is an extension, a child of the wysiwyg only and must fit the frame of it's parent.
The behavior and appearance of the editor then is part of it's own settings.

Manuela
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"You have to take the men as they are… but you can not leave them like that !" :-P
Das tägliche Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

 

postern-length