A Cappuccino control providing rich text editing through use of the WysiHat editor.
This is mostly a hack for use until a proper rich-text-capable CPTextView
is introduced.
Link the WyzihatKit
folder into your Frameworks
folder.
Create and combine the wyzihat.js
file using the WyzihatKit modified version of WysiHat:
git submodule init
git submodule update
cd wysihat
git submodule init
git submodule update
rake
cat dist/prototype.js dist/wysihat.js >../Resources/WKTextView/wysihat.js
Optionally minify the combined wysihat.js
- it will shrink very well.
textView = [[WKTextView alloc] initWithFrame:effectiveFrame];
[textView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[textView setDelegate:self];
The view needs to load resources such as editor.html
and wysihat.js
. Wait for the textViewDidLoad:
delegate call before using.
A sample program is provided in the sample
folder. You can view it online or compile it yourself. To compile, install Frameworks
and wysihat.js
:
cd sample
capp gen -f -l --force # Installs Cappuccino frameworks.
cd Frameworks
ln -s ../../ WyzihatKit
Then open up index-debug.html
in a browser.
WysihatKit is released under the MIT license. The sample incorporates Creative Commons icons from FamFamFam.
- Alexander Ljungberg, WireLoad LLC
- xanados
- Paul Baumgart
- Evadne Wu
- Harry Vangberg