Topic Closed
se
35 Posts

Hello does anyone know how you uninstall CKeditor plugins?

I can see how to install them on Admin/CKEditor but no other options.

Thanks

3 years ago#9748

juergen
1.4K Posts
51.6K Downloads
16 Plugins
design, web development & visual effects

There is no built-in User Interface to uninstall preinstalled CKEditor plugins in Typesetter.
It could be done programmatically via the CKEditorConfig and CKEditorPlugins filter hooks but this should be done with caution since lots of them depend on each other and doing so can break CKEditor.

But: If you only want to remove certain icons/toolbars, this can be done by copying the JSON string found in Settings -> CKEditor -> Configuration from the "Current Configuration" field and pasting it to the editor textarea above, removing the unwanted elements, then [ Save ]

 

3 years ago#9749

se
35 Posts

I want to uninstall the Stylesheetparser, as I want to test to see if that is what puts *all* of the css into the stylescombo dropdown. I only want to see the few styles I create for clients.

I cannot see an easy way to do this, it's just ridiculous to have everything in there. In Joomla / JCE its very easy to do this.
(I have asked about this before http://www.typesettercms.com/Forum?show=t1692 but no help was given.)

Thanks

3 years ago#9750

a2exfr
242 Posts
24.7K Downloads
2 Themes
10 Plugins

Hi.

I think removing Stylesheetparser can not help you, cause in such case styles dropdown will be taken only styles, that specified in js file in  special ckeditor format, not from your css file.

like this

 { name: 'Blue Title', element: 'h2', styles: { 'color': 'Blue' } },

 { name: 'Marker: Yellow', element: 'span', styles: { 'background-color': 'Yellow' } }

You can try exclude uneeded classes definning in Settings -> CKEditor -> Configuration

"stylesheetParser_skipSelectors":"regular_expression_here"

// Ignore rules for <body> and <caption> elements, classes starting with "high",

// and any class defined for no specific element.

"stylesheetParser_skipSelectors":"/(^body\.|^caption\.|\.high|^\.)/i"

I have no test it :)

And by the way:

The stylesheet parser plugin reads the contents of stylesheet in order to create the entries that will be shown in the Styles dropdown. But due to the way the Style system works in CKEditor, it requires BOTH an element name AND a class IN THE SAME RULE.

So ".my_class" will be ignored because it doesn't specify the element that must be used, you have to specify a rule like "div.myclass" so the system understands which element you want to handle and then apply/remove that class on it.

Usefull reading

 

3 years ago#9751

se
35 Posts
Thanks a2exfr - the problem is that all of the following are in the Styles dropdown. (I presume because I am using Bootstrap.) To go through and remove them all after they have been added seems ridiculous, I just need to stop them being added in the first place, so that just the few I add in the js file show. Thanks :)

se
35 Posts

Sorry the code did not post, here is a link to it http://wvy.testcms.co.uk/_tmp.php

Also here is a link to my styles.js http://wvy.testcms.co.uk/include/thirdparty/ckeditor_34/styles.js

Edited: 3 years ago#9756

juergen
1.4K Posts
51.6K Downloads
16 Plugins
design, web development & visual effects

I'v tried a bit with CKEditor Configuration but it seems that regular expressions passed via the JSON format will not be interpreted.
If the regex would work, we could do sth like …

{
    "toolbar" :[
        [ "Sourcedialog", "Templates", "ShowBlocks", "Undo", "Redo", "RemoveFormat" ],
        [ "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "SelectAll", "Find", "Replace" ],
        [ "HorizontalRule", "Smiley", "SpecialChar", "PageBreak", "TextColor", "BGColor" ],
        [ "Link", "Unlink", "Anchor", "Image", "Flash", "Table" ], [ "Format", "Font", "FontSize" ],
        [ "Styles" ], [ "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock", "NumberedList", "BulletedList", "Outdent", "Indent" ],
        [ "Bold", "Italic", "Underline", "Strike", "Blockquote", "Subscript", "Superscript", "About" ]
    ],
    "stylesheetParser_validSelectors" : "\/c-k-e\/"
}

… where all and only those CSS rules containing 'c-k-e' would be included into the Styles dropdown, such as e.g.

h1.blue-heading-c-k-e { color:blue; }

Maybe there is a trick I don't know. Otherwise we could try if passing the regex via the CKEditorConfig filter hook works
A plugin with an Admin page featuring an input field for ths regex woud be easy to code.

 

Edited: 3 years ago#9759

a2exfr
242 Posts
24.7K Downloads
2 Themes
10 Plugins

regular expressions passed via the JSON format will not be interpreted.

Pity but it's true, no easy copy-paste to field :)

 Maybe there is a trick I don't know.

I didnt find any to make it work from pasted json options. Try it out of curiosity)

IMHO: Do not see much point in style selector. We have beatiful selectable classes and all major styles usually  defined with css. And of cause custom sections ^_^

You can define class .article, apply it to section, and then define . article h1  {}   .article p {}

May be I m wrong and sometimes it can be usefull. Anyway I even didnt know that it exists in CKE by default.

Better to have more possibilities then less.

 

3 years ago#9760

juergen
1.4K Posts
51.6K Downloads
16 Plugins
design, web development & visual effects

we could try if passing the regex via the CKEditorConfig filter hook works

Just tested. Unfortunately this won't work either. Probably because JSON is always used between PHP and JS. I fear it would need to eval() the expression. A no-go in my opinion.

But It might be possible to…

  • modify gp_editor.config with the InlineEdit_Scripts hook
  • inject it live into the editor using JS events

So, further investigation needed ;)

IMHO: Do not see much point in style selector. We have beatiful selectable classes and all major styles usually  defined with css. And of cause custom sections ^_^

I agree, basically. But it's also a matter of taste.
Contextual styling of standard elements and using container classes is where CSS truly shines, but the concept is not easily comprehensible for most webmasters.
So I find a working StylesCombo absolutely useful and legit in many situations. Especially in those cases where folks would start to use inline styles, which is much worse ;-)

3 years ago#9763

juergen
1.4K Posts
51.6K Downloads
16 Plugins
design, web development & visual effects

OK, this one was a bit tricky ;-)

get CKE StylesCombo 1.0b1   CKE StylesCombo 1.0b2

Installation:
Unpack the downloaded ZIP into your /addons directory and install it via
Admin Toolbox → Plugins → Manage → Available → Install

 

In order to see anything in the Styles Combo you need to …

  • add sth. like div.myClass1-c-k-e { background: red; } span.myClass2-c-k-e { color: blue; } to your theme stylesheet

    or
     
  • change the RegExp pattern on the plugin's Admin page to match some of your already existing classes

 

Hope it works. Quickly coded – barely tested ;o)

Any feedback is welcome!

 

edit:/ some more detaild instructions here

Edited: 3 years ago#9764

se
35 Posts

Thanks again juergen - it works like a charm, perfect.

Sarah :)

 

3 years ago#9765

juergen
1.4K Posts
51.6K Downloads
16 Plugins
design, web development & visual effects

it works like a charm

Great!

3 years ago#9766

juergen
1.4K Posts
51.6K Downloads
16 Plugins
design, web development & visual effects

BTW: Sarah, and of course any native or just better english speaker than me.

I'd appreciate wording proposals for my plugins.
Although I belive it's comprehensible, I also fear my english is sometimes clupsy or at least too 'flowery'. Don't hesitate to tell me if sth. sounds stange, funny, odd… or simply wrong ;)

Thx!

 

Edited: 3 years ago#9767

juergen
1.4K Posts
51.6K Downloads
16 Plugins
design, web development & visual effects

Here is CKE StylesCombo 1.0b2

A few small UI improvements including form validation of the RegExp pattern field.

edit: see my Addon page here

Edited: 3 years ago#9768

Topic Closed

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register