TinyMCE 路径,如何指定加载 editor_plugin.js 等内容的位置
我安装了 TinyMCE,一切运行良好。然后我使用 Google Closure 将我网站的 JavaScript 与 TinyMCE_src 一起打包
我遇到的问题是 TinyMCE 现在正在调用:
plugins/paste/editor_plugin.js
themes/advanced/editor_template.js
langs/en.js
并且正在使用的路径无效,它们是 404'ing
我如何告诉 TinyMCE 去哪里去获取这些文件吗?
我尝试过:
relative_urls : false,
document_base_url : "http://www.site.com/path1/",
但是它们对上面的文件没有影响。
建议?谢谢
I installed TinyMCE, everything was working great. I then used Google Closure to package my site's JavaScript along with TinyMCE_src
The problem I'm having is that TinyMCE is now making calls to:
plugins/paste/editor_plugin.js
themes/advanced/editor_template.js
langs/en.js
And that paths that are being used are invalid, they are 404'ing
How can I tell TinyMCE where to go to get these files?
I tried:
relative_urls : false,
document_base_url : "http://www.site.com/path1/",
But they have no effect on the files above.
Advise? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我遇到了同样的问题,如果我们能够使用 document_base_url 指定基本 url,那么这个问题就可以轻松解决。
或者,我可以在初始化tinymce 之前指定基本url。
TinyMCE 现在工作正常。
I had the same issue, and it could have been solved easily if we were able to specify the base url using the document_base_url.
Alternatively, I was able to specify the base url before initializing tinymce.
TinyMCE is working fine now.
您可以通过在初始化tinyMCE之前放置以下代码来覆盖tinyMCE的基本url。
如果您已经从合并源加载了tinyMCE并且未正确找到基本路径,那么这非常有用。
You can override the base url for tinyMCE by placing the following code before initializing tinyMCE.
This is usefull if you already loaded tinyMCE from a merged source and the base path isn't correctly found.
根据此: http://www.tinymce.com/wiki.php/Configuration:theme_url< /a>
但是,需要小心路径。在
document.location.pathname
的帮助下,我得到了项目根目录。替换函数需要将双斜杠替换为单斜杠,因为不同的服务器可以返回“...//server/site”或“...//server/site/”,它可以是:“...//服务器/站点/js...”或“...//服务器/站点//js...”。
According this: http://www.tinymce.com/wiki.php/Configuration:theme_url
But, need to be carefull with paths. With help
document.location.pathname
I've got project root directory. Replace function need for replacing double slash with single slash, because different server can return "...//server/site" OR "...//server/site/" and it can be:"...//server/site/js..." OR "...//server/site//js...".
如果您使用 TinyMCE jQuery 插件,则可以从远程位置加载所有内容,只需将
script_url
参数添加到初始化代码中即可。它将从那里加载所有内容,包括任何脚本/图像/等。看看这个小提琴,它包括从 TinyMCE 网站远程访问的整个内容: http://jsfiddle.net/xgPzS/ 22/
If you're using the TinyMCE jQuery plugin, you can load everything from a remote location, just add the
script_url
parameter into your init code. It will load everything from there, including any scripts/images/etc.Check out this fiddle, it's including the whole thing remotely from the TinyMCE website: http://jsfiddle.net/xgPzS/22/
根据 TinyMCE 4.x 文档,您可以在 init 期间指定文档基 url。
如果您使用 CodeIgniter,只需使用
base_url()
请记住:
relative_url
必须为 true 才能完美工作,否则您将获得绝对 URL 。欲了解更多详情:
http://www.tinymce.com/wiki.php/Configuration:document_base_url
As per TinyMCE 4.x documentation you can specify the document base url during init.
if you are using CodeIgniter, simply use
base_url()
Remember:
relative_url
must be true in order to work it perfectly otherwise you will get absolute URLS.For more details:
http://www.tinymce.com/wiki.php/Configuration:document_base_url
使用 grunt 捆绑所有内容(github 上的说明),然后您只需配置从哪里开始使用选项
skin_url
加载所有 cssBundle everything using grunt (instructions on github) then you will just have to configure from where to load all the css using the option
skin_url