ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
2017-02-18 11:52
525 查看
因为除了ckeditor.js之外的引用文件是通过ckeditor.js自动添加<script>或<link>标签实现文件的引入,引入的根目录是展示页面的地址。有时需要手动修改通过ckeditor.js引入的文件。这是需要在引入ckeditor.js之前定义window.CKEDITOR_BASEPATH = '../../static'(目录自己修改),编辑器将强制修改引用地址。
ckeditor.js的这一部分源码是处理定义地址的:
basePath: function() {
var b = window.CKEDITOR_BASEPATH || "";
if (!b)
for (var c = document.getElementsByTagName("script"), d = 0; d < c.length; d++) {
var h = c[d].src.match(a);
if (h) {
b = h[1];
break
}
} - 1 == b.indexOf(":/") && "//" != b.slice(0, 2) && (b = 0 === b.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] +
b : location.href.match(/^[^\?]*\/(?:)/)[0] + b);
if (!b) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
return b
}(),
ckeditor.js的这一部分源码是处理定义地址的:
basePath: function() {
var b = window.CKEDITOR_BASEPATH || "";
if (!b)
for (var c = document.getElementsByTagName("script"), d = 0; d < c.length; d++) {
var h = c[d].src.match(a);
if (h) {
b = h[1];
break
}
} - 1 == b.indexOf(":/") && "//" != b.slice(0, 2) && (b = 0 === b.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] +
b : location.href.match(/^[^\?]*\/(?:)/)[0] + b);
if (!b) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
return b
}(),
相关文章推荐
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- ckeditor中 config.js等通过ckeditor.js引入文件手动修改方法
- 通过bootstrap-fileupload上传文件时js库修改为默认中文的方法
- ASP.NET通过配置Web.config文件提高手动绑定数据库效率的一个简单方法,不用每次手动连接数据库地址,或者数据库地址变更时只改一处即可。
- CodeIgniter通过修改.htaccess文件的办法解决加载css js 图片类型文件的方法
- IIS 之 通过 Web.config 修改文件上传大小限制设置方法
- MVC 通过BundleConfig 将JS和CSS文件引入到视图中
- 如何通过代码修改web.config文件
- jQuery中getScript方法引入外部js文件,乱码处理(自己遇到的问题)
- 通过修改ipa文件包修改文件名的方法
- 通过隐藏iframe实现文件下载的js方法
- javascript构造可以上传文件的form表单(通过js修改enctype)
- js文件中再引入js文件的方法
- ckeditor 配置文件Config.js的一些具体配置信息
- jquery的getScript方法引入的js文件怎么转化编码
- jsp引入js,css文件的方法
- 通过代码修改config文件中的配置
- js自定义方法通过隐藏iframe实现文件下载