ckeditor中 config.js等通過ckeditor.js引入文件手動修改方法


因為除了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
}(),


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM