Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#39 myckeditor patch ,Settings for each language

Legacy 2.2 modules
closed-rejected
HIKAWA Kilica
None
5
2011-02-27
2011-02-16
Anonymous
No

html/modules/myckeditor/preload/TextArea.class.php
use customConfig option
line 46
[code]
$jQuery->addScript('var ckconfig_'.$params['id'].' = {toolbar:[["Source", "-", "Bold", "Italic", "-", "NumberedList", "BulletedList", "-", "Link", "Unlink"],["UIColor"]]};');
[/code]

to

[code]
$mydirname = dirname(dirname(__FILE__));
$ckconfigdirname = $root->mContext->mXoopsConfig['language'];
if ( ! file_exists($mydirname.'/language/'.$ckconfigdirname.'/config.js') ) {
$ckconfigdirname = 'english';
}
$ckconfig ='var ckconfig_'.$params['id'].' = {';
$ckconfig .="customConfig:'../language/".$ckconfigdirname."/config.js',";
$ckconfig .="};";
$jQuery->addScript($ckconfig);
[/code]

and
sdd file
to
html/modules/myckeditor/language/english/config.js
example
[code]
/*
Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.docType = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
config.shiftEnterMode = CKEDITOR.ENTER_BR;
config.enterMode = CKEDITOR.ENTER_BR,
//config.plugins = 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,filebrowser,find,flash,font,format,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc';

config.toolbar_Full =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl' ],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];

// config.removePlugins = 'save,forms,newpage,print,smiley,specialchar,tab,pagebreak,stylescombo,preview,scayt,find,undo,templates';
config.removePlugins = 'save,forms,newpage,print,smiley,specialchar,tab,pagebreak,stylescombo,preview,scayt,find,templates,iframe';
config.width = '720px';
config.height = '500px';

config.fontSize_sizes='80%/80%;90%/90%;100%/100%;110%/110%;120%/120%;130%/130%;140%/140%;150%/150%;160%/160%;170%/170%;180%/180%;190%/190%;200%/200%';
// config.font_names='MSゴシック/MS Gothic, Osaka-Mono, monospace; MS Pゴシック/MS PGothic, Osaka, sans-serif; MS UI Gothic/MS UI Gothic, Meiryo, Meiryo UI, Osaka, sans-serif; MS P明朝/MS PMincho, Saimincho, serif; Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';
config.coreStyles_underline = { element : 'ins' };
config.coreStyles_strike = { element : 'del' };

};

CKEDITOR.dtd.del = CKEDITOR.dtd.strike;
CKEDITOR.dtd.ins = CKEDITOR.dtd.u;

[/code]

html/modules/myckeditor/language/ja_utf8/config.js
example
[code]
/*
Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.docType = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';
config.shiftEnterMode = CKEDITOR.ENTER_BR;
config.enterMode = CKEDITOR.ENTER_BR,
//config.plugins = 'about,basicstyles,blockquote,button,clipboard,colorbutton,contextmenu,elementspath,enterkey,entities,filebrowser,find,flash,font,format,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc';

config.toolbar_Full =
[
['Source','-','Save','NewPage','Preview','-','Templates'],
['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print'],
['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
'/',
['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','CreateDiv'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['BidiLtr', 'BidiRtl' ],
['Link','Unlink','Anchor'],
['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],
'/',
['Styles','Format','Font','FontSize'],
['TextColor','BGColor'],
['Maximize', 'ShowBlocks','-','About']
];

// config.removePlugins = 'save,forms,newpage,print,smiley,specialchar,tab,pagebreak,stylescombo,preview,scayt,find,undo,templates';
config.removePlugins = 'save,forms,newpage,print,smiley,specialchar,tab,pagebreak,stylescombo,preview,scayt,find,templates,iframe';
config.width = '720px';
config.height = '500px';

config.fontSize_sizes='80%/80%;90%/90%;100%/100%;110%/110%;120%/120%;130%/130%;140%/140%;150%/150%;160%/160%;170%/170%;180%/180%;190%/190%;200%/200%';
config.font_names='MSゴシック/MS Gothic, Osaka-Mono, monospace; MS Pゴシック/MS PGothic, Osaka, sans-serif; MS UI Gothic/MS UI Gothic, Meiryo, Meiryo UI, Osaka, sans-serif; MS P明朝/MS PMincho, Saimincho, serif; Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif';
config.coreStyles_underline = { element : 'ins' };
config.coreStyles_strike = { element : 'del' };

};

CKEDITOR.dtd.del = CKEDITOR.dtd.strike;
CKEDITOR.dtd.ins = CKEDITOR.dtd.u;

[/code]

Discussion

  • HIKAWA Kilica
    HIKAWA Kilica
    2011-02-27

    myckeditor module is just sample.
    Each site owner use their own editor based on the module or use preload file, if they want.

     
  • HIKAWA Kilica
    HIKAWA Kilica
    2011-02-27

    • milestone: --> Legacy 2.2 modules
    • assigned_to: nobody --> kilica
    • status: open --> closed-rejected