js匿名函数传参_java 匿名函数
全栈程序员站长
发布
于
2022-11-09 16:09:00
发布
于
2022-11-09 16:09:00
<pre class="html" name="code">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%' ) ) {