You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by tubin gen <fa...@gmail.com> on 2009/12/02 17:34:02 UTC
making tinyMce TextArea readonly
I ma trying to make TextArea with TinyMce behaviour readonly , I added
the following custom settings but it did not work
tinyMCESettings.addCustomSetting("readonly : true");
tinyMCESettings.addCustomSetting("mode : textareas");
please suggest me how to make it readonly ?
Re: making tinyMce TextArea readonly
Posted by fachhoch <fa...@gmail.com>.
thank you for the post, but none of those settings will help me I have to
add some custom settings to add spell checker ,
to add spell checker tinymce tells
tinyMCE.init({
theme : "advanced",
mode : "textareas",
plugins : "spellchecker",
theme_advanced_buttons3_add : "spellchecker",
spellchecker_languages : "+English=en,Swedish=sv"
});
I added this through addCustomSettings , but it did not helped me , please
tell me what am I missing , wicket tinymce comes with jazzy spell check
plugin , please tell me how to use that ?
Steve Swinsburg-3 wrote:
>
> Here's a class I created which extends the default TinyMCESettings class.
> I use this as my configuration and can customise it to my hearts content,
> adding and removing buttons:
>
> /**
> * A configuration class for the TinyMCE Wicket component, used by
> textareas.
> * If more are required for different purposes, create a new class.
> */
> public class TextareaTinyMceSettings extends TinyMCESettings {
>
> private static final long serialVersionUID = 1L;
>
> public TextareaTinyMceSettings () {
> super(TinyMCESettings.Theme.advanced);
>
> /*
> add(Button.bullist, TinyMCESettings.Toolbar.first,
> TinyMCESettings.Position.after);
> add(Button.numlist, TinyMCESettings.Toolbar.first,
> TinyMCESettings.Position.after);
>
> disableButton(Button.styleselect);
> disableButton(Button.sub);
> disableButton(Button.sup);
> disableButton(Button.charmap);
> disableButton(Button.image);
> disableButton(Button.anchor);
> disableButton(Button.help);
> disableButton(Button.code);
> disableButton(Button.link);
> disableButton(Button.unlink);
> disableButton(Button.formatselect);
> disableButton(Button.indent);
> disableButton(Button.outdent);
> disableButton(Button.undo);
> disableButton(Button.redo);
> disableButton(Button.cleanup);
> disableButton(Button.hr);
> disableButton(Button.visualaid);
> disableButton(Button.separator);
> disableButton(Button.formatselect);
> disableButton(Button.removeformat);
> */
>
> List<Button> firstRowButtons = new ArrayList<Button>();
> firstRowButtons.add(Button.bold);
> firstRowButtons.add(Button.italic);
> firstRowButtons.add(Button.underline);
> firstRowButtons.add(Button.strikethrough);
> firstRowButtons.add(Button.separator);
> firstRowButtons.add(Button.sub);
> firstRowButtons.add(Button.sup);
> firstRowButtons.add(Button.separator);
> firstRowButtons.add(Button.link);
> firstRowButtons.add(Button.unlink);
> firstRowButtons.add(Button.separator);
> firstRowButtons.add(Button.bullist);
> firstRowButtons.add(Button.numlist);
> firstRowButtons.add(Button.separator);
> firstRowButtons.add(Button.code);
>
> //set first toolbar
> setToolbarButtons(TinyMCESettings.Toolbar.first, firstRowButtons);
>
> //remove the second and third toolbars
> setToolbarButtons(TinyMCESettings.Toolbar.second, new
> ArrayList<Button>());
> setToolbarButtons(TinyMCESettings.Toolbar.third, new
> ArrayList<Button>());
> setToolbarButtons(TinyMCESettings.Toolbar.fourth, new
> ArrayList<Button>());
>
> setToolbarAlign(TinyMCESettings.Align.center);
> setToolbarLocation(TinyMCESettings.Location.top);
> setStatusbarLocation(null);
> setResizing(true);
> setHorizontalResizing(true);
>
> }
>
> }
>
>
> It's then used like so:
> TextArea otherInformation = new TextArea("otherInformation", new
> PropertyModel(userProfile, "otherInformation"));
>
> //add TinyMCE control
> otherInformation.add(new TinyMceBehavior(new TextareaTinyMceSettings()));
>
>
> You might be able to play with the settings above to find what you need.
> Check out the settings available in the base class.
>
> cheers,
> Steve
>
>
> On 13/01/2010, at 9:43 AM, fachhoch wrote:
>
>>
>> I did as you said , recreated , the jar using latest js files . Please
>> tell me what setting I should add to add spell checker and to make copy
>> from
>> word and paste to tinymce ?
>>
>> Linkan wrote:
>>>
>>> You have to download the source and repack it with new javascripts to
>>> make it work.
>>> http://old.nabble.com/making-tinymce-textarea-read-only-td23160313.html#a23170821
>>>
>>> //Swanthe
>>>
>>> tubin gen wrote:
>>>> I ma trying to make TextArea with TinyMce behaviour readonly , I added
>>>> the following custom settings but it did not work
>>>> tinyMCESettings.addCustomSetting("readonly : true");
>>>> tinyMCESettings.addCustomSetting("mode : textareas");
>>>>
>>>> please suggest me how to make it readonly ?
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/making-tinyMce-TextArea-readonly-tp26611935p27136175.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
--
View this message in context: http://old.nabble.com/making-tinyMce-TextArea-readonly-tp26611935p27138236.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making tinyMce TextArea readonly
Posted by Steve Swinsburg <st...@gmail.com>.
Here's a class I created which extends the default TinyMCESettings class. I use this as my configuration and can customise it to my hearts content, adding and removing buttons:
/**
* A configuration class for the TinyMCE Wicket component, used by textareas.
* If more are required for different purposes, create a new class.
*/
public class TextareaTinyMceSettings extends TinyMCESettings {
private static final long serialVersionUID = 1L;
public TextareaTinyMceSettings () {
super(TinyMCESettings.Theme.advanced);
/*
add(Button.bullist, TinyMCESettings.Toolbar.first, TinyMCESettings.Position.after);
add(Button.numlist, TinyMCESettings.Toolbar.first, TinyMCESettings.Position.after);
disableButton(Button.styleselect);
disableButton(Button.sub);
disableButton(Button.sup);
disableButton(Button.charmap);
disableButton(Button.image);
disableButton(Button.anchor);
disableButton(Button.help);
disableButton(Button.code);
disableButton(Button.link);
disableButton(Button.unlink);
disableButton(Button.formatselect);
disableButton(Button.indent);
disableButton(Button.outdent);
disableButton(Button.undo);
disableButton(Button.redo);
disableButton(Button.cleanup);
disableButton(Button.hr);
disableButton(Button.visualaid);
disableButton(Button.separator);
disableButton(Button.formatselect);
disableButton(Button.removeformat);
*/
List<Button> firstRowButtons = new ArrayList<Button>();
firstRowButtons.add(Button.bold);
firstRowButtons.add(Button.italic);
firstRowButtons.add(Button.underline);
firstRowButtons.add(Button.strikethrough);
firstRowButtons.add(Button.separator);
firstRowButtons.add(Button.sub);
firstRowButtons.add(Button.sup);
firstRowButtons.add(Button.separator);
firstRowButtons.add(Button.link);
firstRowButtons.add(Button.unlink);
firstRowButtons.add(Button.separator);
firstRowButtons.add(Button.bullist);
firstRowButtons.add(Button.numlist);
firstRowButtons.add(Button.separator);
firstRowButtons.add(Button.code);
//set first toolbar
setToolbarButtons(TinyMCESettings.Toolbar.first, firstRowButtons);
//remove the second and third toolbars
setToolbarButtons(TinyMCESettings.Toolbar.second, new ArrayList<Button>());
setToolbarButtons(TinyMCESettings.Toolbar.third, new ArrayList<Button>());
setToolbarButtons(TinyMCESettings.Toolbar.fourth, new ArrayList<Button>());
setToolbarAlign(TinyMCESettings.Align.center);
setToolbarLocation(TinyMCESettings.Location.top);
setStatusbarLocation(null);
setResizing(true);
setHorizontalResizing(true);
}
}
It's then used like so:
TextArea otherInformation = new TextArea("otherInformation", new PropertyModel(userProfile, "otherInformation"));
//add TinyMCE control
otherInformation.add(new TinyMceBehavior(new TextareaTinyMceSettings()));
You might be able to play with the settings above to find what you need. Check out the settings available in the base class.
cheers,
Steve
On 13/01/2010, at 9:43 AM, fachhoch wrote:
>
> I did as you said , recreated , the jar using latest js files . Please
> tell me what setting I should add to add spell checker and to make copy from
> word and paste to tinymce ?
>
> Linkan wrote:
>>
>> You have to download the source and repack it with new javascripts to
>> make it work.
>> http://old.nabble.com/making-tinymce-textarea-read-only-td23160313.html#a23170821
>>
>> //Swanthe
>>
>> tubin gen wrote:
>>> I ma trying to make TextArea with TinyMce behaviour readonly , I added
>>> the following custom settings but it did not work
>>> tinyMCESettings.addCustomSetting("readonly : true");
>>> tinyMCESettings.addCustomSetting("mode : textareas");
>>>
>>> please suggest me how to make it readonly ?
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/making-tinyMce-TextArea-readonly-tp26611935p27136175.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
Re: making tinyMce TextArea readonly
Posted by fachhoch <fa...@gmail.com>.
I did as you said , recreated , the jar using latest js files . Please
tell me what setting I should add to add spell checker and to make copy from
word and paste to tinymce ?
Linkan wrote:
>
> You have to download the source and repack it with new javascripts to
> make it work.
> http://old.nabble.com/making-tinymce-textarea-read-only-td23160313.html#a23170821
>
> //Swanthe
>
> tubin gen wrote:
>> I ma trying to make TextArea with TinyMce behaviour readonly , I added
>> the following custom settings but it did not work
>> tinyMCESettings.addCustomSetting("readonly : true");
>> tinyMCESettings.addCustomSetting("mode : textareas");
>>
>> please suggest me how to make it readonly ?
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
--
View this message in context: http://old.nabble.com/making-tinyMce-TextArea-readonly-tp26611935p27136175.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: making tinyMce TextArea readonly
Posted by Swanthe Lindgren <sw...@megasol.se>.
You have to download the source and repack it with new javascripts to
make it work.
http://old.nabble.com/making-tinymce-textarea-read-only-td23160313.html#a23170821
//Swanthe
tubin gen wrote:
> I ma trying to make TextArea with TinyMce behaviour readonly , I added
> the following custom settings but it did not work
> tinyMCESettings.addCustomSetting("readonly : true");
> tinyMCESettings.addCustomSetting("mode : textareas");
>
> please suggest me how to make it readonly ?
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: making tinyMce TextArea readonly
Posted by Alex Rass <ar...@itbsllc.com>.
Yeah, would be good to update the whole tinyMCE thing.
It's SO popular!
It's rather outdated from what's on tinyMCE site.
It should really be repackaged with some helper stuff like
setReadOnly(true/false).
And provide with a convenient tabbed panel for HTML/RAW edit window.
Anyone who knows how to wants to help?
-----Original Message-----
From: tubin gen [mailto:fachhoch@gmail.com]
Sent: Wednesday, December 02, 2009 11:34 AM
To: users
Subject: making tinyMce TextArea readonly
I ma trying to make TextArea with TinyMce behaviour readonly , I added
the following custom settings but it did not work
tinyMCESettings.addCustomSetting("readonly : true");
tinyMCESettings.addCustomSetting("mode : textareas");
please suggest me how to make it readonly ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org