exec: function (editor) {
var pagename = window.location.pathname.replace(/\/$/, '/index');
var body = editor.getData();
+ // empty line is equivalent to a paragraph break
body = body.replace(/<br \/>\s*<br \/>/g, '<p>');
+ // wrap long line after each sentence
body = body.replace(/^(\t*).{73,}/mg, function (line, indent) {
- // wrap long line after each sentence
var dots = '(?:.{24,72}|.{73,}?)'; // chars before punctuation
var wrap = new RegExp('('+dots+'[.;:!?]) (?=[A-Z(<])', 'g'); // separate lines
return line.replace(wrap, '$1\n'+indent+'\t');
});
+ // treat standalone placeholders as block elements
+ body = body.replace(/<p>(\[\[.*\]\])<\/p>/g, '$1');
+
var data = 'body='+encodeURIComponent(body);
ajaxpost = new XMLHttpRequest();
ajaxpost.open('POST', '/edit'+pagename, true);
config.uploadUrl = '/edit?output=ckjson';
config.image2_alignClasses = ['left', 'center', 'right'];
config.image2_disableResizer = true;
+ config.stylesSet = [
+ { name: 'Kolom', element: 'div', attributes: { 'class': 'col' } },
+ { name: 'Rechts', element: 'div', attributes: { 'class': 'right' } },
+ ];
config.pasteFilter = pastefilter;
config.contentsCss = document.styleSheets[0].href;
config.toolbar = [
['Inlinesave', '-', 'Undo', 'Redo'],
- ['Format', 'BulletedList', 'NumberedList', 'Blockquote'],
+ ['Format', 'BulletedList', 'NumberedList', 'CreateDiv', 'Table', 'Blockquote'],
+ ['HorizontalRule', 'CreatePlaceholder', 'Image'],
['Bold', 'Italic', 'Link'],
- ['HorizontalRule', 'Table', 'Image'],
- ['CreatePlaceholder', 'Sourcedialog'],
+ ['Sourcedialog'],
];
config.toolbarCanCollapse = true;
config.floatSpacePreferRight = true;