Custom ckEditor Toolbar in Liferay 6.2 - liferay

I want to add my own custom toolbar for my ckeditor and have therefore added this to my ckconfig.jsp via a hook.
config.toolbar_Mini = [
['Bold', 'Italic', 'Underline', 'Strike'],
['BulletedList']
];
Additionally I've found out that liferay uses the config.toolbar_liferaysettings. How (code) and where (file) can I change this default behaviour?
EDIT:
This is how the html-editor for my journal-articles looks now:
and I want to limit the functionality of the toolbar to this:
I do not want to change the default config.toolbar_liferay toolbar because I might need a different toolbar later on.
Is this the correct way to achieve this (via hook?) or can I just add a new completely new ckeditor that can be used in a structure?

Below configuration settings represents configuration for journal article ck-editor screen.
From ckconfig.jsp of source code.
config.toolbar_liferayArticle = [
['Styles', 'FontSize', '-', 'TextColor', 'BGColor'],
['Bold', 'Italic', 'Underline', 'Strike'],
['Subscript', 'Superscript'],
'/',
['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],
['Find', 'Replace', 'SpellChecker', 'Scayt'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
'/',
['Source'],
['Link', 'Unlink', 'Anchor'],
['Image', 'Flash', <c:if test="<%= XugglerUtil.isEnabled() %>">'Audio', 'Video',</c:if> 'Table', '-', 'Smiley', 'SpecialChar', 'LiferayPageBreak']
];
So, if you want to have different configuration setting for CKEditor of journal-article then you have to modify config.toolbar_liferayArticle in ckconfig.jsp using liferay plugin hook.
e.g
config.toolbar_liferayArticle=[
['Bold', 'Italic', 'Underline', 'Strike'],
['BulletedList']
];

Related

cds toolbox - Exception: Missing/incomplete configuration

cds toolbox - Exception: Missing/incomplete configuration
This is the code :
import cdsapi
c = cdsapi.Client()
c.retrieve(
'reanalysis-era5-single-levels',
{
'product_type': 'reanalysis',
'variable': [
'2m_temperature', 'cloud_base_height', 'total_precipitation',
],
'year': [
'1980', '1981', '1982',
'1983', '1984', '1985',
'1986', '1987', '1988',
'1989', '1990', '1991',
'1992', '1993', '1994',
'1995', '1996', '1997',
'1998', '1999',
],
'month': '10',
'day': '16',
'time': '21:00',
'format': 'netcdf',
},
'download.nc')
This is my output :
go to user directory C:Users\username
create a text file (like sample.txt) and change its name to .cdsapirc i.e you have to create a file with extension .CDSAPIRC (it should not be having any name, its just a file with extension like .conda)
open this file with any text editor like Notepad++
paste this in your .cdsapirc file
url: https://cds.climate.copernicus.eu/api/v2
key: xxxxx:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
you will get your own UID and API key from your user information via this URL or simply click on your username on the upper right corner, it will direct you to the page
https://cds.climate.copernicus.eu/user/
so in the line change credentials as
key: UID:API-Key
Your Python File should work Now

Easy Localization: Localization key [...] not found

I am using easy_localization: ^2.3.3 in a flutter project with CSV loader. When I build it is not able to find keys and it gives "Easy Localization: Localization key [...] not found". Any ideas why is this happening?
runApp(EasyLocalization(
supportedLocales: [
Locale('en', ''),
Locale('it', ''),
Locale('es', ''),
Locale('de', ''),
Locale('fr', ''),
Locale('pt', ''),
],
path: 'resources/langs/langs.csv',
fallbackLocale: Locale('en', ''),
saveLocale: false,
useOnlyLangCode: true,
assetLoader: CsvAssetLoader(),
child: MyApp(status),
));
}
Also this error can be happen for not setting the material app; I mean, I got same error for forgeting the add these lines to my material app;
MaterialApp(
locale: context.locale,
supportedLocales: context.supportedLocales,
localizationsDelegates: context.localizationDelegates,
),
and my problem solved !
You need to import import 'package:easy_localization/easy_localization.dart';
And add in your MaterialApp :
locale: context.locale,
supportedLocales: context.supportedLocales,
localizationsDelegates: context.localizationDelegates,
I found a solution looking at this bug: https://github.com/aissat/easy_localization/issues/190#
I added the following:
dependencies:
easy_localization_loader:
git:
url: git://github.com/aissat/easy_localization_loader.git
ref: overman-dev
then I did a
flutter pub upgrade
and also changed the code into this
runApp(EasyLocalization(
supportedLocales: [
Locale('en'),
Locale('it'),
Locale('es'),
Locale('de'),
Locale('fr'),
Locale('pt'),
],
path: 'resources/langs/langs.csv',
fallbackLocale: Locale('en'),
saveLocale: false,
useOnlyLangCode: true,
assetLoader: CsvAssetLoader(),
child: MyApp(status),
));
It worked.

Installing a CKEditor plugin in Liferay

I have followed these steps to add CKEditor YouTube plugin in Liferay 6.2 GA4 and I could able to add a plugin in Content section editor.
CKEditor YouTube plugin: http://ckeditor.com/addon/youtube
All plugins are located in ${LIFERAY_HOME}\tomcat-7.0.42\webapps\ROOT\html\js\editor\ckeditor\plugins folder.
1) Place the youtube plugin folder in plugins folder.
2) Add following change in the config.js file located in ${LIFERAY_HOME}\tomcat-7.0.42\webapps\ROOT\html\js\editor\ckeditor folder
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.extraPlugins = 'youtube';
};
3) Add following 'youtube' entries in the ckconfig.jsp file located in ${LIFERAY_HOME}\tomcat-7.0.42\webapps\ROOT\html\js\editor\ckeditor folder
config.extraPlugins = 'ajaxsave,media,restore,scayt,wsc,youtube';
config.toolbar_liferayArticle = [
['Styles', 'FontSize', '-', 'TextColor','BGColor'],
['Bold', 'Italic', 'Underline', 'Strike'],
['Subscript', 'Superscript'],['Youtube'],
'/',['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste',
'PasteText', 'PasteFromWord', '-', 'SelectAll','RemoveFormat'],
4) Restart the Liferay.
I know that this can be achieved by using Liferay Hook project.
However when I am using Liferay Structures and Templates this plugin is not appeared in the CKEditor. What are the other changes need to do in Liferay server?
When using Structures and Templates in Liferay, it is consisted with different types of CKEditor toolbars.Those different toolbars are defined in ckconfig.jsp and you need to change all the toolbar sections.
config.toolbar_email = [
['FontSize', 'TextColor', 'BGColor', '-', 'Bold', 'Italic', 'Underline', 'Strike'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['SpellChecker', 'Scayt'],
['Youtube'],
'/',
['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],
['Source'],
['Link', 'Unlink'],
['Image']
];
config.toolbar_liferay = [
['Bold', 'Italic', 'Underline', 'Strike'],
<c:if test="<%= inlineEdit %>">
['AjaxSave', '-', 'Restore'],
</c:if>
['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', ],
['Styles', 'FontSize', '-', 'TextColor', 'BGColor'],
['Youtube'],
'/',
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
['Image', 'Link', 'Unlink', 'Anchor'],
['Flash', <c:if test="<%= XugglerUtil.isEnabled() %>"> 'Audio', 'Video',</c:if> 'Table', '-', 'Smiley', 'SpecialChar'],
['Find', 'Replace', 'SpellChecker', 'Scayt'],
['SelectAll', 'RemoveFormat'],
['Subscript', 'Superscript']
<c:if test="<%= !inlineEdit %>">
,['Source']
</c:if>
];
config.toolbar_liferayArticle = [
['Styles', 'FontSize', '-', 'TextColor', 'BGColor'],
['Bold', 'Italic', 'Underline', 'Strike'],
['Subscript', 'Superscript'],
['Youtube'],
'/',
['Undo', 'Redo', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'SelectAll', 'RemoveFormat'],
['Find', 'Replace', 'SpellChecker', 'Scayt'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
'/',
['Source'],
['Link', 'Unlink', 'Anchor'],
['Image', 'Flash', <c:if test="<%= XugglerUtil.isEnabled() %>">'Audio', 'Video',</c:if> 'Table', '-', 'Smiley', 'SpecialChar', 'LiferayPageBreak']
];

CKEditor change default format

i try to change the default selected format in ckeditor
i added it in the styles.js
CKEDITOR.stylesSet.add('mystyles', [
{name: 'My styly style', element: 'p', styles: {'color': 'blue'}},
]);
and when my instance of ck loads i would lije to select by default the format when i click in the editor to change the texte .
Anyone has the answer
thanks
Try to add this line in your config.js:
config.format_p = { element: 'p', attributes: { 'class': 'color_blue' } };
** Do not forget to add (in your css)
.color_blue{
color:blue;
}

Enyo menu get overlapped z-index

The problem is that is I click the button of the menu I can't see the window popup because it's hiding behind "Main Content". I can see this with Firebugs inspect element tool.
I tried using the z-index style but it doesn't seem to help..
Are there any other options or creative solutions to fix this?
{kind:"FittableColumns", style:"z-index:1;", fit:true, components:[
{kind:"FittableRows", style:"z-index:1;", fit:true, components:[
{content:"Main Content",style:"z-index:1;", fit:true},
{kind: "onyx.Toolbar", style: "height:40px; padding:0px;", components: [
{kind: "onyx.MenuDecorator", onSelect: "itemSelected", components: [
{kind: "onyx.IconButton", src: "assets/menu-icon-bookmark.png"},
{kind: "onyx.Menu",style:"z-index:99999;",components: [
{components: [
{kind: "onyx.IconButton", src: "assets/menu-icon-bookmark.png"},
{content: "Bookmarks"}
]},
{content: "Favorites"},
{classes: "onyx-menu-divider"},
{content: "Recents"},
]}
]},
]}
and the code goes on but that isn't anywhere near the menu to overlap.
Tkx in advance for a solution.
solved added this, and did wonders {kind: "onyx.Menu", floating: true, components: [

Resources