Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CKEditor 4.0.2 Update
#12
Hallo an alle Update-willigen, die nicht auf GetSimple v3.3 warten wollen !!!

EDIT: Mittlerweile gibt es die vollständigen Informationen hier:
http://www.get-simple.de/editor-update/e...ersion-41/

Hier ist die Zusammenfassung der erforderlichen Änderungen.
EDIT: Wie ich gerade erfahren habe, ist CKE 4.1 bereits im dev-branch von GS v3.3 vorgesehen. Ich kann das aber nicht nachvollziehen bzw. finden, und daher meine Lösung hier für GS v3.2. /EDIT
EDIT2: Ich habe noch weitere Vereinfachungen vorgenommen. /EDIT2

Die Voraussetzungen und die Aufgabenstellung waren folgende:
Ausgangsstatus:
GetSimple v3.2.0 mit CKEditor v3.6.2
Ziel:
Update auf CKEditor v4.x

Es waren folgende Punkte zu behandeln:
  1. Editor-Fenster mit Toolbar sichtbar und verwendbar
  2. Skin auswählbar u.a. Konfigurationen
  3. Änderungen erkennen

Schritt 1) Download von CKEditor v4.1 (Stand 1.4.2013) von Basic, Standard, Full Download
Die persönlich angepaßte Version unter Angepaßte Version funktioniert wegen des "Loaders" nicht !!! Keine Ahnung warum und ich habe es auch nicht nachverfolgt.


Schritt 2) Den gesamten Ast
Code:
...\getsimple\admin\template\js\ckeditor
ersetzen (unzip & upload to Server). Ggf. den Skin "kama" von hier http://ckeditor.com/addon/kama downloaden und ins Skin-Verzeichnis zusätzlich uploaden!


Schritt 3) Der CKEditor wird von GetSimple in edit.php aufgerufen. Daher ist diese Datei anzupassen.

Da der Skin "getsimple" nicht kompatibel mit CKEditor V4.x ist, kann nur der Skin "moono" (monochrom) oder "kama" (farbig) verwendet werden. Daher ist die fixe Zuordnung skin: 'getsimple', in edit.php zu entfernen, auszukommentieren oder zu ändern und uiColor einen anderen Wert zuzuweisen. (Beides ist in GS 3.2.1 bereits gemacht.)

Ebenso sind die Zeilen toolbar: ... und die Zeile mit $EDOPTIONS inkompatibel und daher auszukommentieren.
(Hier ist man nicht gewillt, den Fehler zu korrigieren - siehe daher obigen Link.)

Weiters ist die Erkennung von Änderungen in der für v3.6.2 nicht funktionsfähig, da Aktionen von der Toolbar nicht erkannt werden.
(Auch dieser Fehler wird noch nicht akzeptiert - siehe folgende Postings.)
Das Problem, Änderungen des (Editor)Inhaltes zu erkennen ist schon mehrmals beschrieben worden:
... links können nachgefragt werden ...
Ich habe auch das Sample "api.html" analysiert und bin zu folgendem Ergebnis gekommen:
Da es im CKEditor v4.1 (noch) keinen Event "change" gibt, aber die Funktion "checkDirty" ein brauchbares Ergebnis liefert, scheint es für mich am Einfachsten zu sein, diese Funktion periodisch (alle 200ms) aufzurufen.

Zusammengenommen sind daher folgende Änderungen durchzuführen:
edit.php - original für v3.6.2:
Code:
    var editor = CKEDITOR.replace( 'post-content', {
                skin : 'getsimple',
          ... ... ...
                uiColor : '#FFFFFF',
          ... ... ...
                toolbar :
                [
                <?php echo $toolbar; ?>
                ] */
                <?php echo $EDOPTIONS; ?>,    
          ... ... ...
    });
    CKEDITOR.instances["post-content"].on("instanceReady", InstanceReadyEvent);
    function InstanceReadyEvent() {
        this.document.on("keyup", function () {
            $('#editform #post-content').trigger('change');
        });
    }
geändert für v4.1:
Code:
    var editor = CKEDITOR.replace( 'post-content', {
                skin : 'kama',
          ... ... ...
                uiColor : '#8080E0',
          ... ... ...
                /*
                toolbar :
                [
                <?php echo $toolbar; ?>
                ] */
                <?php echo $EDOPTIONS; ?>,
                */
          ... ... ...
    });
    // The instanceReady event is fired,
    // when an instance of CKEditor has finished its initialization.
    CKEDITOR.on( 'instanceReady', function( ev ) { editor = ev.editor; });

    var timer = setInterval(function(){checkChanged()},200);

    function checkChanged() {
        if ( CKEDITOR.instances["post-content"].checkDirty() ) {
            $('#editform #post-content').trigger('change');
        }
    };

Möglicherweise sind dadurch andere Üerprüfungen auf Änderungen hinfällig geworden !?!?

Natürlich müssen die Verzeichnisse:
Code:
... \getsimple\admin\template\js\ckeditor\skins\kama
... \getsimple\admin\template\js\ckeditor\skins\moono
mit entsprechendem Inhalt vorhanden sein !!!


Schritt 3) Die Anpassungen des CKEditors in der gsconfig.php haben Priorität vor den Einstellungen in:
Code:
    ...\getsimple\admin\template\js\ckeditor\config.js
Ich empfehle aber, die Einstellungen in der config.js zu machen und nicht in der gsconfig.php !!!
Die möglichen Einstellungen sind in der CKE 4 Doku nachzulesen:
http://docs.ckeditor.com/# > Configuration Reference
Einige habe ich hier verwendet:
Code:
CKEDITOR.editorConfig = function( config ) {
    // Define changes to default configuration here.
    //config.resize_dir = 'vertical'; // vertical resize
    config.toolbarCanCollapse = true; // hide/show toolbar collapse button
    config.skin = 'kama';
    config.uiColor = '#8080E0'; // helles blau
    config.language = 'de';
    config.emailProtection = 'encode';
    // Default setting. rearranged
    config.toolbarGroups = [
    { name: 'document',    groups: [ 'mode', 'document', 'doctools' ] },
    { name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
    { name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
    { name: 'forms' }, { name: 'insert' },
    '/',
    { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
    { name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align' ] },
    { name: 'links' },
    // 'insert' war hier
    '/',
    { name: 'styles' }, { name: 'colors' }, { name: 'tools' }, { name: 'others' }, { name: 'about' }
];
};

LG Wolfgang

PS: Please ask me if somebody needs english explanation.
Reply


Messages In This Thread
CKEditor 4.0.2 Update - by karamo - 2013-03-21, 19:30:49
RE: CKEditor 4.0.2 Update - by Connie - 2013-03-21, 22:04:53
RE: CKEditor 4.0.2 Update - by karamo - 2013-03-22, 01:00:58
RE: CKEditor 4.0.2 Update - by shovenose - 2013-03-22, 03:19:20
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-03-22, 03:30:06
RE: CKEditor 4.0.2 Update - by karamo - 2013-03-22, 06:38:20
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-03-22, 07:54:40
RE: CKEditor 4.0.2 Update - by karamo - 2013-03-22, 19:03:48
RE: CKEditor 4.0.2 Update - by Connie - 2013-03-22, 21:27:06
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-03-22, 22:36:57
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-03-22, 23:27:15
RE: CKEditor 4.1 Update (gelöst) - by karamo - 2013-04-01, 11:09:50
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-02, 23:28:27
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-03, 06:53:28
RE: CKEditor 4.0.2 Update - by shovenose - 2013-04-05, 10:21:00
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-06, 17:58:40
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-06, 23:45:33
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-07, 10:27:27
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-07, 10:31:10
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-07, 11:42:00
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-07, 20:31:59
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-07, 23:32:43
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-07, 23:48:50
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-08, 03:43:21
RE: CKEditor 4.0.2 Update - by Connie - 2013-04-08, 18:19:08
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-08, 09:35:33
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-08, 22:50:42
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-08, 22:53:32
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-08, 22:54:32
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-08, 23:55:11
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-08, 23:59:53
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-09, 00:01:18
RE: CKEditor 4.0.2 Update - by Connie - 2013-04-09, 17:20:19
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-11, 07:04:50
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-11, 07:57:57
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-11, 17:39:14
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-11, 22:20:23
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-11, 23:24:55
RE: CKEditor 4.0.2 Update - by zintonio - 2013-04-30, 19:53:58
RE: CKEditor 4.0.2 Update - by karamo - 2013-04-30, 20:18:10
RE: CKEditor 4.0.2 Update - by zintonio - 2013-04-30, 21:04:29
RE: CKEditor 4.0.2 Update - by karamo - 2013-05-01, 02:17:36
RE: CKEditor 4.0.2 Update - by zintonio - 2013-05-01, 17:26:58
RE: CKEditor 4.0.2 Update - by karamo - 2013-05-01, 17:44:37
RE: CKEditor 4.0.2 Update - by zintonio - 2013-05-01, 18:40:27
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-30, 22:17:35
RE: CKEditor 4.0.2 Update - by zintonio - 2013-04-30, 22:55:46
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-04-30, 23:06:08
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-01, 23:23:18
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-01, 23:32:25
RE: CKEditor 4.0.2 Update - by zintonio - 2013-05-05, 00:26:54
RE: CKEditor 4.0.2 Update - by Carlos - 2013-05-02, 03:20:05
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-02, 04:58:23
RE: CKEditor 4.0.2 Update - by Carlos - 2013-05-02, 05:02:47
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-02, 05:24:45
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-04, 06:00:35
RE: CKEditor 4.0.2 Update - by karamo - 2013-05-04, 08:09:15
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-04, 08:41:34
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-05, 01:13:32
RE: CKEditor 4.0.2 Update - by shawn_a - 2013-05-05, 01:19:19



Users browsing this thread: 1 Guest(s)