I have created a plugin to adapt ckeditor (the html editor) to TW5. Before 
it can be released there are few issues with the core that need to be 
addressed. The changes that I have made to the core can be seen at
https://github.com/buggyj/TiddlyWiki5/tree/v506, this tree along with the 
plugin can be seen working at
http://ckeditdemo.tiddlyspot.com/

tiddler called 'undefined' problem
Symptom:
tw5 loads without the tiddlywiki stylesheets.
Cause:
a)During the build process, file plugins/BJ/TW5CKEditor/readme.md is added 
as a tiddler to the plugin with tile "undefined"
b)having a tiddler with title "undefined" in the store causes the unpacking 
of the theme plugins to fail so the stylesheets tiddlers are not added to 
the store.

Proposed solution:
for b):- in getTiddler() in boot.js add check for undefined title, if so 
return undefined
for a) in loadTiddlersFromFile() in boot.js if file type is unknown and 
there is not an accompanying metafile do not try to convert to a tiddler as 
there is no way to assign a tiddler name.


nbsp substitution error
Symptom:
When viewing the source html produced by ckeditor, the letters n,b,s,p are 
converted to html entities (ascii values);
binary comparing the contents of the tiddler containing the ckeditor.js 
(copied from an edit tiddler textarea) with the original ckeditor.js shows 
that the value 0xA0 is replaced with the string 'nbsp'
cause:
innerHTML returns "non-breaking space" character as the string "&nbsp" and 
so substitutions will occur in tiddlers that are unpacked from plugins.
Proposed solution:
add 
replace(/ /mg," ") 
to $tw.utils.htmlDecode() in boot.js


new edit widget integration
Requirement: A new edit widget need to be associated with the tiddlers of 
mime-type text/html

Proposed Implementation:- generally use the 'extension' of the mime-type as 
an appendage to 'edit-' as names for edit widgets that are added as 
extensions, (in this case edit-html) and use a different name for the 
default edit widgets (as is already the case for all types so far)
At present we have 'edit-text' as the built-in assigned editor for 
text/html (.html), so this extension defines an 'edit-html' widget and this 
gets selected by the edit widget for text/html tiddlers in preference to 
the build in default.

The advantage to this naming scheme is that if extensions add new tiddler 
types (along with an editor) to TW5 the edit widget does not need to be 
changed.

See the proposed code changes to edit.js



style sheet loading order
There is no proposed change for this issue, having temporal ordering to 
loading files for plugins would be complicated.

symptoms:
ckeditor 'appears' invisible when editing a text/html tiddler.
cause:
when ckeditor.js is initialised it first loads an internally created 'hide' 
style sheet, then it normally loads external 'display' stylesheets, which 
override the 'hide' style sheet (precedence is determined by the order of 
loading). In TW5 stylesheets from tiddlers are loaded before modules are 
initialised, and thus style sheets are in the wrong pecking order (for 
ckeditor).
Work around:
leave off the "$:/tags/stylesheet" tags on css tiddlers and load the 
stylesheets programmatically by the widget module when it is initialised.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to