Author Topic: CK Editor question  (Read 1162 times)

Offline rumen

  • Posts: 399
CK Editor question
« on: February 27, 2019, 09:46:20 PM »
Hi there,

1. When I click in Ck Editor  the icon "blockquote" it apply code
Code: [Select]
<blockquote>
How can I put class (not to make it manually every time) so when I click the icon to get direct
Code: [Select]
<blockquote class="nice_quote">It is defined in the CSS of the template, but now have to be added manually .. the class.

2. Droplets icon missing and it is defined in the WB_CKConfig.js


Thanks a lot in advance!

Rumen

Offline dbs

  • Betatester
  • **
  • Posts: 8039
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: CK Editor question
« Reply #1 on: February 27, 2019, 10:59:44 PM »
Hi, @2: in the toolbar pic the last entry is About.
In the code pic last entry is FontSize. So it looks like this is not the used wb_ckconfig.js.
Maybe you have another one in /templates or /templates/your-template ?

Offline rumen

  • Posts: 399
Re: CK Editor question
« Reply #2 on: February 27, 2019, 11:04:22 PM »
No, but I keep a backup of the original. Can they mess? I changed the extension from .js to .js.original

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CK Editor question
« Reply #3 on: February 28, 2019, 12:11:11 AM »
#1 - not possible, to change the base definition from "blockquote" in ckeditor, because, its defined directly in the minified ckeditor.js and you'll lost everything in the next upgrade

but, maybe another solution for you

go to modules / ckeditor / wb_config / editor.styles.js - open this file with a editor like notepad++  etc

you see the the definition of the STYLE-Dropdownbar from the Editor  started with a code like this

Code: [Select]
CKEDITOR.addStylesSet( 'wb',
[

you see active and inactive lines, search there for the right place, to add a new definition in the list. every definition start's with a bracket and ends with comma like

Quote
    { name : 'Blue Title'       , element : 'h3', attributes  : { 'class' : 'marker-blue' } },

blue is the name in the list
orange is the Tag-type, here <h3></h3>
green is a additional attribute, here class = marker-blue
you can also add style here like styles : {'color' : 'red' }


add now a new line, maybe directly in the top with this example code

Code: [Select]
    { name: 'BQ-Div-Nice1'  , element: 'div', attributes: { 'class': 'nice_quote1'} },
    { name: 'BQ-P-Nice2'  , element: 'p', attributes: { 'class': 'nice_quote2'} },

#1 builds a <div class="nice_quote1></div>"
#2 build a <p class="nice_quote2"></p>

save this file, go in the backend to a page without wysiwyg-editor, maybe to admintools, and then back to a wysiwyg section (with this action, you start a new browser-instance) - result in the Dropdownlist:



now, we need a little css

if you want to see the blockquote-style also direktly in the wysiwyg editor, you have to add this code in a file, named: editor.css

Code: [Select]
.nice_quote1 {
  background: transparent;
  border-left: 10px solid #ccc;
  margin: 1.5em 10px;
  padding: 0.5em 10px;
  quotes: "\201C""\201D""\2018""\2019";
}
.nice_quote1:before {
  color: #ccc;
  content: open-quote;
  font-size: 4em;
  line-height: 0.1em;
  margin-right: 0.25em;
  vertical-align: -0.4em;
}
.nice_quote1 p {
  display: inline;
}

you can save this file in your -frontend-template-directory and load it in the index.php, then you need only one css-defintion. otherwhise, you add the css also into the css-file from the frontend-template

results

in wysiwyg-area in backend


in frontend-output
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline rumen

  • Posts: 399
Re: CK Editor question
« Reply #4 on: February 28, 2019, 12:18:44 AM »
Thanks a lot mate! I will give it a try now! Perfect workaround solution!

You are great!

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CK Editor question
« Reply #5 on: February 28, 2019, 12:25:39 AM »
#2 - see answer from dbs - maybe another wb_ckconfig there??

to check it, make in the backend on the page with the editor and the missing Droplet-Icon outside from the editor-field a right-mouse-click and select: View Source

scroll down to this code here



there, you find the path's to the config-files , marked in pink
the skin - marked in yellow
the extra plugins - marked in blue
remove plugins - marked in red
the toolbar - marked in green

be sure, that you search in the correct toolbar and also, that you have wbDroplets in the extraPlugins, not in removePlugins


Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CK Editor question
« Reply #6 on: February 28, 2019, 12:33:40 AM »
one more

use browser tools (F12-key) to search for the Icon
in my browser
Network-analysis -> select Grafics only -> reload the page , push the keys STRG + F and write "droplet" in the search field

it will show the _wbDroplet.gif and the loading status - but only, it the script sends this order (needs a activated plugin and no error in Javascript)



do you have it only in this wb-installation or in every bulgarian wb? (maybe a language problem) - see also in console for more info's (if avaiable)
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CK Editor question
« Reply #7 on: February 28, 2019, 12:48:36 AM »
if you want.....  the ckeditor works with browser language detection, but maybe, it works not in every case or for every language

go to modules/ckeditor/ckeditor/pluging/wbDroplet
and open there the file plugins.js

you see in the top the language definition

Code: [Select]
    lang: [
            CKEDITOR.config.defaultLanguage,
            CKEDITOR.lang.detect(CKEDITOR.config.language )
        ],

and in the next line all avaiable language files for this plugin, but deactivated

switch the deactivation to the first code and activate the files like

Code: [Select]
//    lang: [
//            CKEDITOR.config.defaultLanguage,
//            CKEDITOR.lang.detect(CKEDITOR.config.language )
//        ],

    lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh', // %REMOVE_LINE_CORE%

now, you can translate the file modules/ckeditor/ckeditor/pluging/wbDroplet/lang/bg.js

reload the page and see, whats happend
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline rumen

  • Posts: 399
Re: CK Editor question
« Reply #8 on: February 28, 2019, 12:53:29 AM »
Very very elegant solution - For the first point!

Kudos to you!

Offline rumen

  • Posts: 399
Re: CK Editor question
« Reply #9 on: February 28, 2019, 01:22:23 AM »
Language changed as per instructions, but no changes. Also try to find the _wbdroplets.gif but it doesn't find it. I checked and the file is there in folder /orionstudio.rocks/modules/ckeditor/ckeditor/plugins/wbdroplets/icons/



if you want.....  the ckeditor works with browser language detection, but maybe, it works not in every case or for every language

go to modules/ckeditor/ckeditor/pluging/wbDroplet
and open there the file plugins.js

you see in the top the language definition

Code: [Select]
    lang: [
            CKEDITOR.config.defaultLanguage,
            CKEDITOR.lang.detect(CKEDITOR.config.language )
        ],

and in the next line all avaiable language files for this plugin, but deactivated

switch the deactivation to the first code and activate the files like

Code: [Select]
//    lang: [
//            CKEDITOR.config.defaultLanguage,
//            CKEDITOR.lang.detect(CKEDITOR.config.language )
//        ],

    lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en-au,en-ca,en-gb,en,eo,es,et,eu,fa,fi,fo,fr-ca,fr,gl,gu,he,hi,hr,hu,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt-br,pt,ro,ru,sk,sl,sr-latn,sr,sv,th,tr,ug,uk,vi,zh-cn,zh', // %REMOVE_LINE_CORE%

now, you can translate the file modules/ckeditor/ckeditor/pluging/wbDroplet/lang/bg.js

reload the page and see, whats happend

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CK Editor question
« Reply #10 on: February 28, 2019, 01:34:29 AM »
sorry, i mean wbdroplets.png  (not the GIF)

but i found it also in this folder on your webspace

do you found any help in this post -> https://forum.WebsiteBaker.org/index.php/topic,31345.msg218824.html#msg218824?
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline rumen

  • Posts: 399
Re: CK Editor question
« Reply #11 on: February 28, 2019, 01:45:07 AM »
The icon is there, but missing in the toolbar. Never mind. I will show them how to call the droplets from the AdinTools / Droplets

Offline rumen

  • Posts: 399
Re: CK Editor question
« Reply #12 on: February 28, 2019, 02:06:20 AM »
CKEditor - re uploaded via FTP and the problem was solved!

Offline jacobi22

  • Posts: 5879
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: CK Editor question
« Reply #13 on: February 28, 2019, 10:01:03 AM »
 (Y) (Y)
Wer nicht will, findet Gründe, wer will, findet Wege.

 

postern-length