if(typeof ckeStyles=='undefined') var ckeStyles=[];
if(typeof ckeDefaultStyle=='undefined') var ckeDefaultStyle='';
if(typeof ckeAllowedContent=='undefined') var ckeAllowedContent=true;
function ckeditor_replace(id,args) {
if(typeof args!='object') args={};
if(args.width===undefined) args.width=380;
if(args.height===undefined) args.height=80;
if(args.toolbar===undefined) args.toolbar=[['Bold','Italic','Underline','-','Format','Font','FontSize','TextColor','BGColor']];
return CKEDITOR.replace( id, {
fullPage : false,
height : args.height ,
width : args.width ,
resize_dir : 'vertical' ,
filebrowserImageBrowseUrl : '/CK_browser.htm',
filebrowserImageUploadUrl : '/CK_upload.htm' ,
filebrowserWindowWidth : '840',
filebrowserWindowHeight : '480',
toolbar :args.toolbar,
entities:false
});
}
function cke_getLangs() {
var langs='FR;Français;-1101\nEN;English;-1102\nIT;Italiano;-1103\nDE;Deutsch;-1104\nES;Español;-1105\nNL;Netherlands;-1106\nBR;Brezhoneg;-1112\n'.split('\n');
var ret=[];
for(i in langs) {
if(langs[i]!=='') {
var t=langs[i].split(';');
if(t[2]!=='0') ret.push({code:t[0],label:t[1],icon:'/kent-img/flags/'+t[0]+'.svg'});
}
}
return ret;
}
(function () {
if(typeof CKEDITOR==='undefined') return false;
var ckeStyleSheets=[];
ckeStyleSheets.push('/kent-css/RFX/24604923873000/global.css');
for(x in ckeStyles) {
if(ckeStyles[x].styleSheet!==undefined) ckeStyleSheets.push(ckeStyles[x].styleSheet);
if(ckeStyles[x].toolbar!==undefined) var toolbar=ckeStyles[x].toolbar;
}
if(toolbar==undefined) {
var toolbar=
[
['Source'],
['Undo','Redo','-','Paste','Find','Replace'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','-','ShowBlocks'],
'/',
['kimage','Table','HorizontalRule','Smiley'],
['Link','Unlink','Anchor','knotes'],
['TextColor','BGColor'],
['Bold','Italic','Underline','Strike'],
'/',
['Styles','Font','FontSize'],
['Subscript','Superscript']
]
}
if(ckeAllowedContent!==true) {
for(x in toolbar) {
if(typeof toolbar[x]=='object') {
for(y in toolbar[x])
if(toolbar[x][y]=='Source') toolbar[x][y]='';
}
}
}
CKEDITOR.replace( 'wordprocessor_id', {
fullPage : false,
height : '400px',
//width : '625' ,
resize_dir : 'vertical' ,
filebrowserImageBrowseUrl : '/CK_browser.htm' ,
filebrowserImageUploadUrl : '/CK_upload.htm' ,
filebrowserWindowWidth : '840',
filebrowserWindowHeight : '480',
contentsCss:ckeStyleSheets,//used to point to css used inside CKEditor
scayt_autoStartup:false,
disableNativeSpellChecker:0,
language:'en',
allowedContent : ckeAllowedContent,
removePlugins:'image',
bodyClass:'cke_container',
/*entities:false,*/
toolbar : toolbar
});
ckeStyles.push({
name:'styles',
styles:[
{name:'Titre de page', element:'h1', attributes:{'class':'cke hgroup'}},
{name:'Sous-Titre de page', element:'h2', attributes:{'class':'cke hgroup'}},
{name:'Titre 1',element: 'h1', attributes:{'class':'cke'}},
{name:'Titre 2',element: 'h2', attributes:{'class':'cke'}},
{name:'Titre 3',element: 'h3', attributes:{'class':'cke'}},
{name:'Insert',element:'div', attributes:{'class':'cke floatBox'}, styles:{style:'float:right'}},
{name:'Emphase',element: 'em', attributes:{'class':'cke'}},
{name:'Discret',element:'span',attributes:{'class':'cke faded'}},
{name:'Important',element:'span',attributes:{'class':'red'}},
{name:'Couleur Espace',element:'span',attributes:{'class':'context-color'}},
{name:'ABCGE',element:'span',attributes:{'class':'kent-ico'}},
{name:'aZ8Q3',element:'span',attributes:{'class':'kent-ico font2'}}
]
});
ckeStyles.push({
name:'email',
styles:[
{name:'Titre 1', element:'p',styles:{'font-size':'1.4em','font-weight':'bold','margin-top':'0px','margin-bottom':'10px'}},
{name:'Titre 2', element:'p',styles:{'font-size':'1.2em','font-weight':'bold','margin-top':'0px','margin-bottom':'10px'}},
{name:'Texte de base',element:'p',styles:{'color':'#494948','text-decoration':'none'}},
{name:'Lien rouge',element:'a',styles:{'color':'#C43739','text-decoration':'none'}}
]
});
for(x in ckeStyles) {
if(ckeStyles[x].styles!==undefined) {
CKEDITOR.stylesSet.add('Kentika_'+ckeStyles[x].name,ckeStyles[x].styles);
if(ckeStyles[x].default && ckeDefaultStyle==='') ckeDefaultStyle='Kentika_'+ckeStyles[x].name;
}
}
if(ckeDefaultStyle==='') ckeDefaultStyle='Kentika_styles';
CKEDITOR.config.stylesSet =ckeDefaultStyle;
CKEDITOR.instances['wordprocessor_id'].on('contentDom',function (e1) {
var editor=e1.editor;
this.document.$.addEventListener('paste',function (e) {
var paste=(e.clipboardData || window.clipboardData);
for(i=0;i');
};
}
}
}
});
editor.on('paste',function (e) {
if(e.data.type==='html' && e.data.dataValue.match(/^$/)) //if pasting base64 image, cancel automated paste, it has been taken care of by code above
return false;
});
cke_svgIcons(editor);
});
})();