spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
816 stars 258 forks source link

Uncaught Syntax/Type-Error #113

Closed Znow closed 10 years ago

Znow commented 11 years ago

With the latest version, this seems to occur, and the editor is not loading.

See below

Uncaught SyntaxError: Unexpected token < : theme.js:1

Uncaught TypeError: undefined is not a function : application.js:44730

if (settings.theme) { if (typeof settings.theme != "function") { settings.theme = settings.theme.replace(/-/, ''); o = ThemeManager.get(settings.theme); self.theme = new o(self, ThemeManager.urls[settings.theme]); Uncaught TypeError: undefined is not a function

spohlenz commented 11 years ago

Could you post your config/tinymce.yml file, or alternatively the options that you are initializing TinyMCE with?

Znow commented 11 years ago
tinyMCE.init({
      mode : "textareas",
      editor_deselector : "no_editor",
      theme: "advanced",
      plugins: "media",

      theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,fontselect,fontsizeselect,formatselect",
      theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,media,|,code,preview,|,forecolor,backcolor",
      theme_advanced_buttons3 : "insertdate,inserttime,|,removeformat,|,sub,sup",
      theme_advanced_toolbar_location : "top",
      theme_advanced_toolbar_align : "left",
      theme_advanced_statusbar_location : "bottom",
      theme_advanced_resizing : true,

      skin : "o2k7",
      skin_variant : "silver"
    });
spohlenz commented 11 years ago

Looks like you may be using a 3.5.x configuration format with the 4.x version of the gem. You may want to pin your tinymce-rails gem version to ~> 3.5.8.3.

Znow commented 11 years ago

Already done that, since it wouldnt work otherwise.....

But what is necessary then to use the 4.x version? Cant see that described anywhere in your docs...

spohlenz commented 11 years ago

See the tinymce-4 branch (https://github.com/spohlenz/tinymce-rails/tree/tinymce-4) and use the configuration options described here: http://www.tinymce.com/wiki.php/Configuration

The way I currently have the repository structured I admit is a little confusing. I will rectify that when I get a chance.