Forum: Ruby on Rails cool components in the form

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
8d79a081e726563e89e73faaf59997d5?d=identicon&s=25 Rodrigo Dominguez (Guest)
on 2006-01-29 00:34
(Received via mailing list)
Is there a easy way to add components like:
http://www.dynarch.com/projects/calendar/
http://tinymce.moxiecode.com/example_full.php?example=true
in ruby forms, by plugins or whatever?

Thank you


Rodrigo Domínguez
Iplan Networs
www.iplan.com.ar <http://www.iplan.com.ar/>  Â? rdominguez@iplan.com.ar
www.rorra.com.ar <http://www.rorra.com.ar/>  Â? rorra@rorra.com.ar
0a71494cd59bac334f10667f8407f1ef?d=identicon&s=25 Jorge Bernal (Guest)
on 2006-01-29 01:34
(Received via mailing list)
Maybe you should take a look at the recently announced "bundled
resource" plugin:
http://blog.inquirylabs.com/2006/01/26/bundled-res...
dynarch-calendar-support/

El 29/01/2006, a las 0:33, Rodrigo Dominguez
escribió:
> Is there a easy way to add components like:
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-01-29 11:16
(Received via mailing list)
Rodrigo
     > Is there a easy way to add components like:
     > http://tinymce.moxiecode.com/example_full.php?example=true
     > in ruby forms, by plugins or whatever?


"Integrating" tinyMce is a no-brainer:

Just

step 1/ add this once in your base layout:

	<script type="text/javascript" >
	tinyMCE.init({
		mode:"textareas", editor_selector : "my_tiny_mce",
		safari_warning:"true",
	});
	</script>

step 2/ tag each textarea with the previously chosen class:

       <%= text_area 'post', 'text'  , :cols => "60", :rows => "20",
:class => 'my_tiny_mce'	%>



Note: tinyMce doesn't work with Safari


Alain
8d79a081e726563e89e73faaf59997d5?d=identicon&s=25 Rodrigo Dominguez (Guest)
on 2006-01-29 16:45
(Received via mailing list)
One more question, do you know some kind of javascript textarea control
like tinymce that works for IE, mozilla and safari?

Thank you

Rodrigo Domínguez
Iplan Networs
www.iplan.com.ar ? rdominguez@iplan.com.ar
www.rorra.com.ar ? rorra@rorra.com.ar


-----Mensaje original-----
De: rails-bounces@lists.rubyonrails.org
[mailto:rails-bounces@lists.rubyonrails.org] En nombre de Alain Ravet
Enviado el: domingo, 29 de enero de 2006 7:15
Para: rails@lists.rubyonrails.org
Asunto: [Rails] Re: cool components in the form

Rodrigo
     > Is there a easy way to add components like:
     > http://tinymce.moxiecode.com/example_full.php?example=true
     > in ruby forms, by plugins or whatever?


"Integrating" tinyMce is a no-brainer:

Just

step 1/ add this once in your base layout:

	<script type="text/javascript" >
	tinyMCE.init({
		mode:"textareas", editor_selector : "my_tiny_mce",
		safari_warning:"true",
	});
	</script>

step 2/ tag each textarea with the previously chosen class:

       <%= text_area 'post', 'text'  , :cols => "60", :rows => "20",
:class => 'my_tiny_mce'	%>



Note: tinyMce doesn't work with Safari


Alain

_______________________________________________
Rails mailing list
Rails@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails
00973881979aa0a660ffbbb2f7a907fb?d=identicon&s=25 Peter De Berdt (Guest)
on 2006-01-29 19:22
(Received via mailing list)
> Note: TinyMCE doesn't work with Safari

Not exactly the whole story, TinyMCE has experimental and partial
support for Safari as you can read on http://tinymce.moxiecode.com/,
I've used it in a Joomla! site with success.


Best regards

Peter De Berdt
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-01-29 20:14
(Received via mailing list)
Peter

    > Not exactly the whole story, TinyMCE has experimental and partial
    > support for Safari as you can read on
http://tinymce.moxiecode.com/,
    > I've used it in a Joomla! site with success.

Lucky you. I see only the html contents and tags in a plain textarea
(instead of rich text and a toolbar).
How do you init it (aka: the js code in the page head section)?

Alain
00973881979aa0a660ffbbb2f7a907fb?d=identicon&s=25 Peter De Berdt (Guest)
on 2006-01-29 23:03
(Received via mailing list)
On 29 Jan 2006, at 20:12, Alain Ravet wrote:

> Peter
>
>    > Not exactly the whole story, TinyMCE has experimental and partial
>    > support for Safari as you can read on http://
> tinymce.moxiecode.com/,
>    > I've used it in a Joomla! site with success.
>
> Lucky you. I see only the html contents and tags in a plain
> textarea (instead of rich text and a toolbar).
> How do you init it (aka: the js code in the page head section)?

Well, Joomla is an open source PHP CMS (http://www.joomla.org), so
you could install it yourself (it's very easy to install) or just
look it up in the "mambots/editors/tinymce.php" script file. In case
you install it, TinyMCE editing is an option you can select in the
preferences of Joomla.

Best regards

Peter De Berdt
00973881979aa0a660ffbbb2f7a907fb?d=identicon&s=25 Peter De Berdt (Guest)
on 2006-01-29 23:36
(Received via mailing list)
On 29 Jan 2006, at 20:12, Alain Ravet wrote:

> Peter
>
>    > Not exactly the whole story, TinyMCE has experimental and partial
>    > support for Safari as you can read on http://
> tinymce.moxiecode.com/,
>    > I've used it in a Joomla! site with success.
>
> Lucky you. I see only the html contents and tags in a plain
> textarea (instead of rich text and a toolbar).
> How do you init it (aka: the js code in the page head section)?

This is what comes up in the content editing in the administrator
section of the demo of joomla on the site:

	<script type="text/javascript" src="http://demo.joomla.org/mambots/
editors/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
	<script type="text/javascript">
	tinyMCE.init({
		theme : "advanced",
		language : "en",
		mode : "specific_textareas",
		document_base_url : "http://demo.joomla.org/",
		relative_urls : false,
		remove_script_host : false,
		save_callback : "TinyMCE_Save",
		invalid_elements : "script,applet,iframe",
		theme_advanced_toolbar_location : "top",
		theme_advanced_source_editor_height : "550",
		theme_advanced_source_editor_width : "750",
		directionality: "ltr",
		force_br_newlines : "false",
		force_p_newlines : "true",
		content_css : "http://demo.joomla.org/templates/rhuk_solarflare_ii/
css/template_css.css",
		debug : false,
		cleanup : true,
		safari_warning : false,
		plugins : "advlink,
advimage, ,preview,searchreplace,insertdatetime,emotions,advhr,flash,tab
le,fullscreen",
		theme_advanced_buttons2_add :
",preview,search,replace,insertdate,inserttime,emotions",
		theme_advanced_buttons3_add : ",advhr,flash,tablecontrols,fullscreen",
		plugin_insertdate_dateFormat : "%Y-%m-%d",
		plugin_insertdate_timeFormat : "%H:%M:%S",
		plugin_preview_width : "750",
		plugin_preview_height : "550",
		extended_valid_elements : "a[name|href|target|title|onclick], img
[class|src|border=0|alt|title|hspace|vspace|width|height|align|
onmouseover|onmouseout|name], ,hr[class|width|size|noshade]",
		fullscreen_settings : {
			theme_advanced_path_location : "top"
		}
	});
	function TinyMCE_Save(editor_id, content, node)
	{
		base_url = tinyMCE.settings['document_base_url'];
		var vHTML = content;
		if (true == true){
			vHTML = tinyMCE.regexpReplace(vHTML, 'href\s*=\s*"?'+base_url+'',
'href="', 'gi');
			vHTML = tinyMCE.regexpReplace(vHTML, 'src\s*=\s*"?'+base_url+'',
'src="', 'gi');
			vHTML = tinyMCE.regexpReplace(vHTML, 'mce_real_src\s*=\s*"?', '',
'gi');
			vHTML = tinyMCE.regexpReplace(vHTML, 'mce_real_href\s*=\s*"?', '',
'gi');
		}
		return vHTML;
	}

</script>



.... and the textarea section:


<textarea id="introtext" name="introtext" cols="75" rows="20"
style="width:100%;px; height:350px;"
mce_editable="true">&lt;p&gt;Lorem ipsum dolor sit amet, consetetur
sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
dolore magna aliquyam erat,
sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
magna aliquyam erat, sed diam
voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
amet.&lt;/p&gt;</textarea>
<br /><img src="http://demo.joomla.org/mambots/editors-xtd/
mosimage.gif" onclick="tinyMCE.execCommand
('mceInsertContent',false,'{mosimage}')" alt="{mosimage}"/><img
src="http://demo.joomla.org/mambots/editors-xtd/mospage.gif"
onclick="tinyMCE.execCommand
('mceInsertContent',false,'{mospagebreak}')" alt="{mospagebreak}"/>

Hope this helps!


Best regards

Peter De Berdt
This topic is locked and can not be replied to.