function isWysiwygareaAvailable() {
// If in development mode, then the wysiwygarea must be available.
// Split REV into two strings so builder does not replace it :D.
if ( CKEDITOR.revision == ( '%RE' + 'V%' ) ) {
return true;
}
return !!CKEDITOR.plugins.get( 'wysiwygarea' );
}
我在 CKeditor 4.9.0 自定义构建中找到了这段代码。为什么 REV 被分成两个字符串?使用了什么 javascript 技术?
最佳答案
CKEditor 是使用 build.sh 构建的, 进而调用
java -jar ckbuilder/$CKBUILDER_VERSION/ckbuilder.jar
来源也在GitHub上.
文件tools.js 中的函数processDirectives()
用传递给 ckbuilder 的命令行参数替换出现的 %Version%
和 %Revision%
。
由于此替换仅适用于分发构建,因此开发源代码仍包含未处理的 %REV%
。此事实用于区分开发源和生产源。
拆分字符串 %REV%
只是避免了它的替换,因为它在这里用作引用值。
关于javascript - 在 CKEDITOR.revision == ( '%RE' + 'V%' ) 中使用了什么 Javascript 技术?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50207728/