js匿名函数传参_java 匿名函数

js匿名函数传参_java 匿名函数var initSample function var wysiwygareaA isWysiwygare isBBCodeBuil CKEDITOR plugins get bbcode return function paramId var editorElemen CKEDITOR

var initSample = ( function() {
var wysiwygareaAvailable = isWysiwygareaAvailable(),
isBBCodeBuiltIn = !!CKEDITOR.plugins.get( 'bbcode' );

return function(paramId) {
var editorElement = CKEDITOR.document.getById(paramId);

// :(((
if ( isBBCodeBuiltIn ) {
editorElement.setHtml(
'Hello world!\n\n' +
'I\'m an instance of [url=http://ckeditor.com]CKEditor[/url].'
);
}

// Depending on the wysiwygare plugin availability initialize classic or inline editor.
if ( wysiwygareaAvailable ) {
CKEDITOR.replace(paramId);
} else {
editorElement.setAttribute( 'contenteditable', 'true' );
CKEDITOR.inline(paramId);

// TODO we can consider displaying some info box that
// without wysiwygarea the classic editor may not work.
}
};

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' );
}
} )();

调用:initSample(“content”);

编程小号
上一篇 2025-04-12 20:51
下一篇 2025-04-14 15:40

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/hz/133383.html