• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem getting TinyMCE to work together with CI

#1
[eluser]kingmaoam[/eluser]
Hi,

I want to use TinyMCE together with CI.

Earlier this morning my site was working and I don't know what is wrong at the moment, but the textareas are no longer displayed via TinyMCE.
My Chrome Javascript Erro extension shows the error "TypeError: Object [object Object] has no method 'tinymce'

I have a controller with following code:
Code:
$this->load->view('templates/admin/header', $header);
$this->load->view('templates/admin/styles');
$this->load->view('templates/admin/menue', $menue);
$this->load->view('templates/admin/submenue', $menue);
$this->load->view('einsatz/createEinsatz_admin', $einsatz);
$this->load->view('einsatz/tiny_mce_inc');
$this->load->view('templates/admin/footer');

In the view header I have following head section
Code:
<link rel="stylesheet" href="<?=base_url('css/admin/layout.css')?>" type="text/css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.22/themes/base/jquery-ui.css" type="text/css" media="all" />
  <\script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></\script>
  <\script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></\script>

<\script language="javascript" type="text/javascript" src="&lt;?=base_url('js/tiny_mce/tiny_mce.js')?&gt;"></\script>
<\script language="javascript" type="text/javascript" src="&lt;?=base_url('js/tiny_mce/jquery.tinymce.js')?&gt;"></\script>

<\script type="text/javascript">
   $(function() {$("#datum").datepicker();});
</\script>

The view tiny_mce_inc consists of following
Code:
<\script type="text/javascript">
        $(function() {
                $('textarea.tinymce').tinymce({
                        // Location of TinyMCE script
                        script_url : '/js/tiny_mce/tiny_mce.js',

                        // General options
                        theme : "advanced",
                        plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

                        // Theme options
                        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,insertdate,inserttime",
                        theme_advanced_buttons2 : "hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                        theme_advanced_buttons3 : "cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
                        theme_advanced_toolbar_location : "top",
                        theme_advanced_toolbar_align : "left",
                        theme_advanced_statusbar_location : "bottom",
                        theme_advanced_resizing : true,

                        // Example content CSS (should be your site CSS)
                        content_css : "/css/layout.css",

                        // Drop lists for link/image/media/template dialogs
                        template_external_list_url : "lists/template_list.js",
                        external_link_list_url : "lists/link_list.js",
                        external_image_list_url : "lists/image_list.js",
                        media_external_list_url : "lists/media_list.js",

                        // Replace values for the template plugin
                        template_replace_values : {
                                username : "Some User",
                                staffid : "991234"
                        }
                });
        });
</\script>

And finally the view createEinsatz_admin
Code:
$einsatzGeschehen = array(
'name'  => 'einsatzgeschehen',
'id' => 'einsatzgeschehen',
'class' => 'tinymce',
'value' => set_value('einsatzgeschehen')
);
...
<tr>
   <td>&lt;?=form_label('Einsatzgeschehen:', $einsatzGeschehen['id']); ?&gt;</td>
   <td>&lt;?=form_textarea($einsatzGeschehen); ?&gt;</td>
</tr>

The datepicker is working, but tinymce does not load...
Please ignore the \ in the script tags... otherwise the forum has displayed [removed]

Can anyone give me a quick hint?

KR
Habib

#2
[eluser]kingmaoam[/eluser]
No one got any idea?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.