Support » Plugins and Hacks » FEE: Suggestion for improvement

FEE: Suggestion for improvement

  • Scribu,

    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 🙂




Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘FEE: Suggestion for improvement’ is closed to new replies.