Can't Get TextArea to display

35 views
Skip to first unread message

Michael Satterwhite

unread,
Jul 12, 2010, 9:27:58 PM7/12/10
to tinymce_hammer
I have no doubt I'm missing something - but I haven't been able to
find it.

I've followed the directions on installing / using the tinymce hammer
plugin - I *THINK*. I've checked what I've done and can't find a
deviation. Regardless, when I try to display a page with the plugin,
the text area is not visible - it's as if it's not there. Here is the
code in my view:

<%- form_for :category do |form| -%>
<%= form.label 'Text Area: ' %>
<%= form.tinymce :body %>
<% end %>

If it looks familiar, it's because I copied it from the sample (I
changed the label). This is the code that's generated - taken by
displaying the source from the browser:

<form action="/admin/catalog" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="authenticity_token" type="hidden"
value="fETpMaXlwVhBN4JddV1SINdthygaE8p7nKf4aiMUc5Q=" />
</div>
<label for="category_Text Area: ">Text area: </label>
<textarea class="tinymce" cols="40" id="category_body"
name="category[body]" rows="20">
</textarea>
</form>

My platform is PCLinuxOS. I've tried this with Firefox, Opera, and
Chrome. The only thing I see is that I don't know where css class
"tinymce" is defined, but I don't see where anything in the
instructions regarding that, so I'm guessing it's OK. Could someone
please help me here?

Thanks in advance
---Michael

Trevor Rowe

unread,
Jul 12, 2010, 11:51:11 PM7/12/10
to tinymce...@googlegroups.com
Did you call the init_tinymce_hammer_if_required function in the view
layout? That function should output some javascript that initializes
text areas with the css class name tinymce.

> --
> You received this message because you are subscribed to the Google Groups "tinymce_hammer" group.
> To post to this group, send email to tinymce...@googlegroups.com.
> To unsubscribe from this group, send email to tinymce_hamme...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/tinymce_hammer?hl=en.
>

Michael Satterwhite

unread,
Jul 13, 2010, 10:14:26 AM7/13/10
to tinymce_hammer
On Jul 12, 10:51 pm, Trevor Rowe <trevorr...@gmail.com> wrote:
> Did you call the init_tinymce_hammer_if_required function in the view
> layout?  That function should output some javascript that initializes
> text areas with the css class name tinymce.
>
Yes. These are the helper calls made in my header section:

<%= stylesheet_link_tag "admin" %>

<%= init_tinymce_hammer_if_required %>

This is the code produced by that call:

<script type='text/javascript'>
TinymceHammer = {
init : function() {
var init = { paste_convert_headers_to_strong : true,
paste_convert_middot_lists : true, paste_remove_spans : true,
paste_remove_styles : true, paste_strip_class_attributes : true,
theme : "advanced", theme_advanced_toolbar_align : "left",
theme_advanced_toolbar_location : "top", theme_advanced_buttons1 :
"undo,redo,cut,copy,paste,pastetext,|,bold,italic,strikethrough,blockquote,charmap,bullist,numlist,removeformat,|,link,unlink,image,|,cleanup,code",
theme_advanced_buttons2 : "", theme_advanced_buttons3 : "",
valid_elements : "a[href|
title],blockquote[cite],br,caption,cite,code,dl,dt,dd,em,i,img[src|alt|
title|width|height|align],li,ol,p,pre,q[cite],small,strike,strong/
b,sub,sup,u,ul" };
init.mode = 'specific_textareas';
init.editor_selector = 'tinymce';
init.plugins = 'paste';
init.language = 'en';

tinyMCE.init(init);
},
addEditor : function(dom_id) {
tinyMCE.execCommand('mceAddControl', true, dom_id);
}
}
DomReady.ready(TinymceHammer.init);
</script>

Trevor Rowe

unread,
Jul 13, 2010, 5:50:08 PM7/13/10
to tinymce...@googlegroups.com
It appears that both the required html markup and the required javascript is being generated. Are there any javascript errors happening on the page? TinyMCE will hide the text area and then proceed to add its custom markup to the page using javascript.

Michael Satterwhite

unread,
Jul 13, 2010, 7:18:01 PM7/13/10
to tinymce...@googlegroups.com
On Tuesday, July 13, 2010 04:50:08 pm Trevor Rowe wrote:
> It appears that both the required html markup and the required javascript
> is being generated. Are there any javascript errors happening on the
> page? TinyMCE will hide the text area and then proceed to add its custom
> markup to the page using javascript.
>
I'm a bit ashamed that I didn't think to look at the error console. I do have
several errors occurring in the javascript. Here are the first few. My guess is
that the same underlying problem is behind all of them:


Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File:
http://photon:3000/javascripts/tiny_mce/themes/advanced/skins/default/ui.css
Line: 40

Warning: Error in parsing value for 'filter'. Declaration dropped.
Source File:
http://photon:3000/javascripts/tiny_mce/themes/advanced/skins/default/ui.css
Line: 71

Warning: Unknown property 'scrollbar-3dlight-color'. Declaration dropped.
Source File:
http://photon:3000/javascripts/tiny_mce/themes/advanced/skins/default/content.css
Line: 25

Warning: Unknown property 'scrollbar-arrow-color'. Declaration dropped.
Source File:
http://photon:3000/javascripts/tiny_mce/themes/advanced/skins/default/content.css
Line: 26


Reply all
Reply to author
Forward
0 new messages