I was unable to obtain ckeditor using cvs as follows:
cvs co openacs-4/packages/xowiki/www/resources/ckeditor
I therefore downloaded the earlier version 3.6.5 from ckeditor.com, since I realise now that my earlier failed
attempt was with version 4 which has substantially changes dependencies, just as Gustaf mentioned.
I have checked all the paths and they seem to be fine now, and the integration code seems to be doing its thing since
the parameters in my form spec do appear in the page header. However ckeditor does not start (in fact the
textarea field to which it should be added does not appear at all).
The error I get is :
SCRIPT5007: Unable to get value of the property 'icons': object is null or undefined
ckeditor.js, line 180 character 249
I have tried to work out why this is happening, but am a little out of my depth.
The most obvious absent resource is the one referenced in the document ready function. I have no directory called /xowiki/ckeditor-images/
Where and how would I obtain this?
Here is the resulting header:
___________________________________________________________________________________
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>xowiki - Airfield Entry Form (1362)</title>
<meta name="language" content="en">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="OpenACS version 5.7.0">
<link rel="stylesheet" href="/resources/acs-templating/lists.css" type="text/css" media="all">
<link rel="stylesheet" href="/resources/acs-templating/forms.css" type="text/css" media="all">
<link rel="stylesheet" href="/resources/openacs-default-theme/styles/default-master.css" type="text/css" media="all">
<script type="text/javascript" src="/resources/acs-subsite/core.js"></script>
<link rel="stylesheet" type="text/css" href="/resources/xowiki/xowiki.css" media="all" >
<link type='text/css' rel='stylesheet' href='/resources/xowiki/jquery-ui-1.8.17.custom.css' media='all' >
<link type='text/css' rel='stylesheet' href='/resources/ajaxhelper/yui/fonts/fonts-min.css' media='all' >
<script src='/resources/xowiki/jquery/jquery.min.js' type='text/javascript'></script>
<script src='/resources/xowiki/ckeditor/ckeditor.js' type='text/javascript'></script>
<script src='/resources/xowiki/ckeditor/adapters/jquery.js' type='text/javascript'></script>
<script src='/resources/xowiki/jquery-ui-1.8.17.custom.min.js' type='text/javascript'></script>
<script src='/resources/xowiki/get-http-object.js' type='text/javascript'></script>
<script type='text/javascript' >
function xowiki_image_callback(editor) {
$(editor.element.$.form).submit(function(e) {
calc_image_tags_to_wiki_image_links(this);
});
editor.setData(calc_wiki_image_links_to_image_tags(editor.getData()));
}
function calc_image_tags_to_wiki_image_links (form) {
var calc = function() {
var wiki_link = $(this).attr('alt');
$(this).replaceWith('[['+wiki_link+']]');
}
$(form).find('iframe').each(function() {
$(this).contents().find('img[type="wikilink"]').each(calc);
});
$(form).find('textarea.ckeip').each(function() {
var contents = $('<div>'+this.value+'</div>');
contents.find('img[type="wikilink"]').each(calc);
this.value = contents.html();
});
return true;
}
function calc_wiki_image_links_to_image_tags (data) {
var pathname = window.location.pathname;
pathname = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length)
console.log('pathname' + pathname);
pathname = pathname.replace(/:/ig,"%3a");
var regex_wikilink = new RegExp('(\\[\\[./image:)(.*?)(\\]\\])', 'g');
data = data.replace(regex_wikilink,'<img src="'+pathname+'/$2" alt="./image:$2" type="wikilink" />');
console.log('data' + data);
return data
}
$(document).ready(function() {
$( '#F1362af_descent' ).ckeditor(function() { /* callback code */ }, {
toolbar : 'Page',
uiColor: '',
language: 'en',
skin: 'Office2003',
startupMode: 'wysiwyg',
parent_id: '1363',
package_url: '/wikirim/',
extraPlugins: 'xowikiimage,_description:omit,_page_order:omit',
contentsCss: '/resources/xowiki/ck_contents.css',
imageSelectorDialog: '/xowiki/ckeditor-images/',
ready_callback: 'xowiki_image_callback(e.editor);',
customConfig: '../ck_config.js'
});
CKEDITOR.instances['F1362af_descent'].on('instanceReady',function(e) {xowiki_image_callback(e.editor);});
});
</script>
<script type="text/javascript">
function get_popular_tags(popular_tags_link, prefix) {
var http = getHttpObject();
http.open('GET', popular_tags_link, true);
http.onreadystatechange = function() {
if (http.readyState == 4) {
if (http.status != 200) {
alert('Something wrong in HTTP request, status code = ' + http.status);
} else {
var e = document.getElementById(prefix + '-popular_tags');
e.innerHTML = http.responseText;
e.style.display = 'block';
}
}
};
http.send(null);
}
</script>