[Building Sakai] Adding wyswig editor to JSP form

Matthew Jones jonespm at umich.edu
Tue Sep 20 12:22:34 PDT 2011


Right, the "Editor Registry" was added as part of CKEditor and is only
available in 2.8+ (SAK-17880). In versions prior to 2.8, you'll only
*really* be supporting FCKEditor even though the property
wysiwyg.editor was available since at least 2.2.

Using this function will also get you any registry overridden via a site
property "wysiwyg.editor", saving some code. And you'll need to detect one
or another. (http://goo.gl/50jKt)

Since 2.7 is basically near EOL I'm guessing that this won't be backported,
but if you still need to support 2.7, you'll have to do something else,
probably hardcoded as you have, as Charles mentioned.

Thanks!

On Tue, Sep 20, 2011 at 2:47 PM, Charles Hedrick <hedrick at rutgers.edu>wrote:

> I don't see this function in the 2.7.1 version of PortalService. If your
> code needs to work on 2.7 you need a different approach.
>
> On Sep 20, 2011, at 1:42 PM, Matthew Jones wrote:
>
> The only thing you might need to worry about with this is that the user
> change change their editor from fck to the now default for 2.9 (ckeditor).
> This would always launch the fckeditor.
>
> There's a function in the portalService api to get the active Editor.
>
>
> http://source.sakaiproject.org/release/2.8.0/apidocs/org/sakaiproject/portal/api/PortalService.html#getActiveEditor()
>
> You can then build up the appropriate scripts from editor to deal with
> this:
>
> http://source.sakaiproject.org/release/2.8.0/apidocs/org/sakaiproject/portal/api/Editor.html
>
> This *possibly* should be somewhere other than portal, but everyone has to
> have portal, right? ;)
>
> It *looks* like the commit against osp uses this to build up the javascript
> needed to dump this into a jsp: http://goo.gl/8vVhc
>
> Hope this is somewhat accurate!
>
> On Tue, Sep 20, 2011 at 3:32 AM, Paul Mungai <paulwando at gmail.com> wrote:
>
>> Its worked.
>>
>> One also needs to add these scripts on the header section;
>>
>> <script type="text/javascript" language="JavaScript"
>> src="/library/editor/FCKeditor/fckeditor.js"></script>
>> <script type="text/javascript" language="JavaScript"
>> src="/library/editor/fckeditor.launch.js"></script>
>>
>> Unfortunately, there is no documentation that the search engine could lead
>> to, that explains this.
>>
>>
>> On Tue, Sep 20, 2011 at 9:28 AM, Paul Mungai <paulwando at gmail.com> wrote:
>>
>>> Kindly advise on what scripts I need to add to load the editor on a text
>>> area.
>>>
>>> I have added this script on the body section after the textarea whose
>>> name & id is cdesc
>>>
>>> <script type="text/javascript" defer="1">sakai.editor.launch('cdesc', {
>>> height: 650, width: 400 });</script>
>>>
>>> --
>>> Regards,
>>> Paul Mungai
>>>
>>> "Ability is what youre capable of doing. Motivation determines what you
>>> do. Attitude determines how well you do it" By Lou Holtz, Notre Dame
>>> Football Coach
>>>
>>
>>
>>
>> --
>> Regards,
>> Paul Mungai
>>
>> "Ability is what youre capable of doing. Motivation determines what you
>> do. Attitude determines how well you do it" By Lou Holtz, Notre Dame
>> Football Coach
>>
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>
>> TO UNSUBSCRIBE: send email to
>> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>> "unsubscribe"
>>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110920/c11b5404/attachment.html 


More information about the sakai-dev mailing list