7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » SimpleTinyMCE field not working--javascript problem
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 742 Views |
-
SimpleTinyMCE field not working--javascript problem

7 March 2011 at 4:03am
My SimpleTinyMCEField has no buttons. I'm getting a JS error in firebug that points to '$(function(){' in this script:
<script type="text/javascript">//<![CDATA[
$(function() {
$('#DataObjectManager_Popup_AddForm_Biography').tinymce({
plugins : 'safari,paste',
theme : 'advanced',
theme_advanced_buttons1 : 'bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,styleselect,formatselect',theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,bullist,numlist,|,link,unlink,anchor,image,|,code',theme_advanced_buttons3 : '',theme_advanced_buttons4 : '',
theme_advanced_toolbar_location : 'top',
theme_advanced_toolbar_align : 'left',
theme_advanced_statusbar_location : 'bottom',
theme_advanced_resizing : false,
paste_auto_cleanup_on_paste : true,
paste_remove_spans: true,
paste_remove_styles: true,
content_css : ''});
});//]]></script>
I'm not sure how to fix this--I have no custom JS in the CMS here, it's all SS (2.4.5) and DOM (using r540)
Nothing jumps out at me immediately here except that it mentions 'safari' and I'm using firefox. It is on a mac though.
Any ideas? Thanks! -
Re: SimpleTinyMCE field not working--javascript problem

12 March 2011 at 1:13am Last edited: 12 March 2011 1:14am
Hi theoldlr,
I've come across the same problem this morning, so I decided to share my simple solution:
The problem is, that sometimes not only jQuery but also prototype is included in the CMS, but both libraries are using the '$'-sign for different things, so the simple solution is to replace
$(function() {
withjQuery(function($) {
in line 186 in SimpleTinyMCEField.php
and you should have your SimpleTinyMCEField working...
@UncleCheese: I've attached a patch for this, maybe it would be useful to include this in dom's trunk...
link: http://pastie.org/1659285
| 742 Views | ||
|
Page:
1
|
Go to Top |


