FEE: Suggestion for improvement (4 posts)

  1. blogologist
    Posted 4 years ago #


    Love the plugin. Really great!

    One thing...

    I have added a hack to make the editor content more closely resemble my own post/page content CSS.

    I've done three things to achieve this:

    a) added CLEditor's native "docCSSFile" attribute to the CLEditor invocation call, linking to my theme's style.css file.

    b) added a couple of classes to CLEditor's BODY tag by means of a hack to the "bodyStyle" attribute of the invocation call (the old trick where you add an escaped close double-quotes and then open a class attribute double-quotes which you don't close). I had to add these classes because my theme uses non-standard class names to the .entry-content tag for styling.

    c) added a CSS rule to your CLEditor "bodyStyle" attribute to left-align text because for some reason it was centered with my theme.

    I achieved all this simply by editing your init_cleditor function in editor.js, obviously.

    But it occurs to me that you could very easily achieve this with a mod that adds this stuff as options to your plugin's options page and am asking if you could do that?

    I would envision three options, then:

    1. A text field to add class names to the CLEditor's body tag.

    2. A text field to add CSS rules to the CLEditor's body tag (if it's someone that is easier done that way rather than via a class (as per #1).

    3. A text field to add a path to the theme's CSS file (or another file if the user would rather create a simplified CSS file for purposes of styling the editor).

    That would be deliciously wonderful if you could do that!!

    Here is the raw code from editor.js, as I hacked it... so you can see exactly what I did...

    init_cleditor:function(b){var a=this;b.cleditor({controls:FrontEndEditor.data.cleditor.controls,width:a.form.width(),height:FrontEndEditor.data.cleditor.height,docCSSFile:"/b1z-content/themes/bwps_v1/style.css",bodyStyle:"text-align:left; cursor:text; margin:4px; "+FrontEndEditor.data.cleditor.css.replace(/"/g,"'")+'" class="single column-content'})}

    Again Scribu, wonderful plugin and I hope you are positive about this very minor improvement :)




  2. scribu
    Posted 4 years ago #

    Thanks for the suggestions, but I plan to approach this in a more direct way, by leveraging a wysiwyg editor that doesn't place the content in an iframe.

    In the meantime, there already is a filter for this:


  3. blogologist
    Posted 4 years ago #

    Thanks Scribu.

    That will certainly fix it, but in the meantime your filter won't allow the include of the theme's CSS file.

    Any idea on how far away you are from an inline editor? Any hints on what lib you're looking at for it??



  4. scribu
    Posted 4 years ago #

    The main candidate is Aloha Editor and it will take a while.

    More background: http://github.com/scribu/wp-front-end-editor/wiki/WYSIWYG-Editors

Topic Closed

This topic has been closed to new replies.

About this Topic