1
我使用此guide將tinyMCE集成到Active Admin textarea元素中。tinyMCE無法在Chrome中的Active Admin中使用
我所做的:的最新版本(tinymce_3.5.6.zip)
下載TinyMCE的,並把tiny_mce文件夾到我的puplic/JavaScript的文件夾中。
添加的應用/資產/ Java腳本/ active_admin.js:
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_buttons1 : "bold, italic, underline, strikethrough, |, bullist, numlist, blockquote, |, undo, redo, |, link, unlink, code",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "center",
theme_advanced_resizing : false
});
編輯過的配置/初始化/ active_admin.rb:
#...
config.register_javascript '/javascripts/tiny_mce/tiny_mce.js'
config.register_javascript 'active_admin.js'
end
這導致沒有tinyMCE的集成在鉻主動管理。從Chrome控制檯 輸出:
Uncaught ReferenceError: tinyMCE is not defined active_admin.js:1
(anonymous function) active_admin.js:1
Load jQuery first! tiny_mce.js:1
Uncaught TypeError: Object #<Object> has no method 'extend' tiny_mce.js:1
c.create tiny_mce.js:1
(anonymous function) tiny_mce.js:1
Uncaught TypeError: Object #<Object> has no method 'init' active_admin.js:1
(anonymous function) active_admin.js:1
雖然TinyMCE用於Safari和SRWare鐵做工不錯。但SRWare鐵控制檯仍然在控制檯輸出中有一些錯誤:
active_admin.js:1Uncaught ReferenceError: tinyMCE is not defined
(anonymous function)active_admin.js:1
如何解決?