Add ckeditor library's to lazyload
@return null
556187
public function display()
	{
        App::$Alias->setCustomLibrary('js', $this->baseUrl . '/ckeditor.js');
        App::$Alias->setCustomLibrary('js', $this->baseUrl . '/adapters/jquery.js');
        $jsInitializeCode = "$('.{$this->targetClass}').ckeditor({";
        $jsInitializeCode .= "language: '{$this->language}', customConfig: '{$this->config}.js', ";
        if ($this->jsConfig !== null && Any::isArray($this->jsConfig)) {
            foreach ($this->jsConfig as $obj => $value) {
                $jsInitializeCode .= $obj . ": '" . $value . "', ";
            }
        }
	    $jsInitializeCode .= "});";

        App::$Alias->addPlainCode('js', $jsInitializeCode);
		return null;
	}
457948
private function registerBladeDirectives()
    {
        /** @var  \Illuminate\View\Compilers\BladeCompiler  $blade */
        $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler();

        $blade->directive('parsedown', function ($markdown) {
            return "<?php echo markdown()->parse($markdown); ?>";
        });

        $blade->directive('markdown', function () {
            return '<?php markdown()->begin(); ?>';
        });

        $blade->directive('endmarkdown', function () {
            return '<?php echo markdown()->end(); ?>';
        });
    }
433309
protected function bootRichEditorEvents()
    {
        Event::listen('backend.richeditor.listTypes', function () {
            return [
                'cms-page' => 'cms::lang.page.cms_page'
            ];
        });

        Event::listen('backend.richeditor.getTypeInfo', function ($type) {
            if ($type === 'cms-page') {
                return CmsPage::getRichEditorTypeInfo($type);
            }
        });
    }
228746
protected function registerPlugin()
    {
        $view = $this->getView();

        $this->ckeditor = new \skeeks\cms\widgets\formInputs\ckeditor\Ckeditor(ArrayHelper::merge([
            'model' => $this->model,
            'attribute' => $this->attribute,
            'relatedModel' => $this->model,
        ], $this->ckeditorOptions));

        $this->codemirror = new CodemirrorWidget(ArrayHelper::merge([
            'model' => $this->model,
            'attribute' => $this->attribute,

            'preset' => 'htmlmixed',
            'assets' =>
                [
                    \skeeks\widget\codemirror\CodemirrorAsset::THEME_NIGHT
                ],
            'clientOptions' =>
                [
                    'theme' => 'night'
                ],

        ], $this->codemirrorOptions));

        $this->ckeditor->registerAssets();
        $this->codemirror->registerAssets();

        $this->clientOptions['ckeditor'] = $this->ckeditor->clientOptions;
        $this->clientOptions['codemirror'] = $this->codemirror->clientOptions;

        ComboTextInputWidgetAsset::register($this->view);

    }
177892
function () {
            var t = this,
                prefix = t.o.prefix;

            if (t.o.autogrowOnEnter) {
                t.autogrowOnEnterDontClose = !t.$box.hasClass(prefix + 'editor-hidden');
            }

            t.semanticCode(false, true);

            setTimeout(function () {
                t.doc.activeElement.blur();
                t.$box.toggleClass(prefix + 'editor-hidden ' + prefix + 'editor-visible');
                t.$btnPane.toggleClass(prefix + 'disable');
                $('.' + prefix + 'viewHTML-button', t.$btnPane).toggleClass(prefix + 'active');
                if (t.$box.hasClass(prefix + 'editor-visible')) {
                    t.$ta.attr('tabindex', -1);
                } else {
                    t.$ta.removeAttr('tabindex');
                }

                if (t.o.autogrowOnEnter && !t.autogrowOnEnterDontClose) {
                    t.autogrowEditorOnEnter();
                }
            }, 0);
        }
379845
public void onModuleLoad() {
    VueGWT.init();

    // Inject JS Components
    HTMLScriptElement scriptElement =
        (HTMLScriptElement) DomGlobal.document.createElement("script");
    scriptElement.text = JsFilesResources.INSTANCE.jsComponents().getText();
    DomGlobal.document.body.appendChild(scriptElement);

    MelisandreComponentClientBundle.INSTANCE.melisandreComponentStyle().ensureInjected();
    Vue.customElement("animal-selector", AnimalSelectorComponentFactory.get());

    VueGwtExamplesService.initExamples();
  }
266781
public function library($sLibrary)
    {
        switch (strtoupper($sLibrary)) {

            case 'CKEDITOR':

                $this->load(
                    [
                        'ckeditor/ckeditor.js',
                        'ckeditor/adapters/jquery.js',
                    ],
                    'NAILS-BOWER'
                );
                break;

            case 'JQUERYUI':

                $this->load(
                    [
                        'jquery-ui/jquery-ui.min.js',
                        'jquery-ui/themes/smoothness/jquery-ui.min.css',
                        'jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.min.js',
                        'jqueryui-timepicker-addon/dist/jquery-ui-timepicker-addon.css',
                    ],
                    'NAILS-BOWER'
                );

                $this->load(
                    'jquery.ui.extra.css',
                    'NAILS'
                );
                break;

            case 'CMSWIDGETEDITOR':

                $this->library('JQUERYUI');
                $this->load(
                    [
                        'mustache.js/mustache.js',
                        'jquery-serialize-object/dist/jquery.serialize-object.min.js',
                    ],
                    'NAILS-BOWER'
                );
                break;

            case 'UPLOADIFY':

                $this->load(
                    [
                        'uploadify/uploadify.css',
                        'uploadify/jquery.uploadify.min.js',
                    ],
                    'NAILS-PACKAGE'
                );
                break;

            case 'CHOSEN':

                $this->load(
                    [
                        'chosen/chosen.min.css',
                        'chosen/chosen.jquery.min.js',
                    ],
                    'NAILS-BOWER'
                );
                break;

            case 'SELECT2':

                $this->load(
                    [
                        'select2/select2.css',
                        'select2/select2.min.js',
                    ],
                    'NAILS-BOWER'
                );
                break;

            case 'ZEROCLIPBOARD':

                $this->load(
                    [
                        'zeroclipboard/dist/ZeroClipboard.min.js',
                    ],
                    'NAILS-BOWER'
                );
                break;

            case 'KNOCKOUT':

                $this->load(
                    [
                        'knockout/dist/knockout.js',
                    ],
                    'NAILS-BOWER'
                );
                break;

            case 'MUSTACHE':

                $this->load(
                    [
                        'mustache.js/mustache.js',
                    ],
                    'NAILS-BOWER'
                );
                break;

            case 'MOMENT':

                $this->load(
                    [
                        'moment/moment.js',
                    ],
                    'NAILS-BOWER'
                );
                break;
        }

        return $this;
    }
504207
function()
	{
		CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass(
		{
			base : CKEDITOR.menu,

			$ : function( editor )
			{
				this.base.call( this, editor,
				{
					panel:
					{
						className : editor.skinClass + ' cke_contextmenu',
						attributes :
						{
							'aria-label' : editor.lang.contextmenu.options
						}
					}
				});
			},

			proto :
			{
				addTarget : function( element, nativeContextMenuOnCtrl )
				{
					// Opera doesn't support 'contextmenu' event, we have duo approaches employed here:
					// 1. Inherit the 'button override' hack we introduced in v2 (#4530), while this require the Opera browser
					//  option 'Allow script to detect context menu/right click events' to be always turned on.
					// 2. Considering the fact that ctrl/meta key is not been occupied
					//  for multiple range selecting (like Gecko), we use this key
					//  combination as a fallback for triggering context-menu. (#4530)
					if ( CKEDITOR.env.opera && !( 'oncontextmenu' in document.body ))
					{
						var contextMenuOverrideButton;
						element.on( 'mousedown', function( evt )
						{
							evt = evt.data;
							if ( evt.$.button != 2 )
							{
								if ( evt.getKeystroke() == CKEDITOR.CTRL + 1 )
									element.fire( 'contextmenu', evt );
								return;
							}

							if ( nativeContextMenuOnCtrl
								 && ( CKEDITOR.env.mac ? evt.$.metaKey : evt.$.ctrlKey ) )
								return;

							var target = evt.getTarget();

							if ( !contextMenuOverrideButton )
							{
								var ownerDoc =  target.getDocument();
								contextMenuOverrideButton = ownerDoc.createElement( 'input' ) ;
								contextMenuOverrideButton.$.type = 'button' ;
								ownerDoc.getBody().append( contextMenuOverrideButton ) ;
							}

							contextMenuOverrideButton.setAttribute( 'style', 'position:absolute;top:' + ( evt.$.clientY - 2 ) +
								'px;left:' + ( evt.$.clientX - 2 ) +
								'px;width:5px;height:5px;opacity:0.01' );

						} );

						element.on( 'mouseup', function ( evt )
						{
							if ( contextMenuOverrideButton )
							{
								contextMenuOverrideButton.remove();
								contextMenuOverrideButton = undefined;
								// Simulate 'contextmenu' event.
								element.fire( 'contextmenu', evt.data );
							}
						} );
					}

					element.on( 'contextmenu', function( event )
						{
							var domEvent = event.data;

							if ( nativeContextMenuOnCtrl &&
								 // Safari on Windows always show 'ctrlKey' as true in 'contextmenu' event,
								// which make this property unreliable. (#4826)
								 ( CKEDITOR.env.webkit ? holdCtrlKey : ( CKEDITOR.env.mac ? domEvent.$.metaKey : domEvent.$.ctrlKey ) ) )
								return;


							// Cancel the browser context menu.
							domEvent.preventDefault();

							var offsetParent = domEvent.getTarget().getDocument().getDocumentElement(),
								offsetX = domEvent.$.clientX,
								offsetY = domEvent.$.clientY;

							CKEDITOR.tools.setTimeout( function()
								{
									this.open( offsetParent, null, offsetX, offsetY );

								// IE needs a short while to allow selection change before opening menu. (#7908)
								}, CKEDITOR.env.ie? 200 : 0, this );
						},
						this );

					if ( CKEDITOR.env.opera )
					{
						// 'contextmenu' event triggered by Windows menu key is unpreventable,
						// cancel the key event itself. (#6534)
						element.on( 'keypress' , function ( evt )
						{
							var domEvent = evt.data;

							if ( domEvent.$.keyCode === 0 )
								domEvent.preventDefault();
						});
					}

					if ( CKEDITOR.env.webkit )
					{
						var holdCtrlKey,
							onKeyDown = function( event )
							{
								holdCtrlKey = CKEDITOR.env.mac ? event.data.$.metaKey : event.data.$.ctrlKey ;
							},
							resetOnKeyUp = function()
							{
								holdCtrlKey = 0;
							};

						element.on( 'keydown', onKeyDown );
						element.on( 'keyup', resetOnKeyUp );
						element.on( 'contextmenu', resetOnKeyUp );
					}
				},

				open : function( offsetParent, corner, offsetX, offsetY )
				{
					this.editor.focus();
					offsetParent = offsetParent || CKEDITOR.document.getDocumentElement();
					this.show( offsetParent, corner, offsetX, offsetY );
				}
			}
		});
	}
967527
protected function checkLazyLoad()
    {
        if ($this->lazyLoadInitiated === true) {
            return;
        }

        $this->lazyLoad();
        $this->generateKeys();

        $this->lazyLoadInitiated = true;
    }
696598
public static function SetupCKEditor( &$editorObj, $basePath = CKFINDER_DEFAULT_BASEPATH, $imageType = null, $flashType = null )
	{
		if ( empty( $basePath ) )
			$basePath = CKFINDER_DEFAULT_BASEPATH ;

		$ckfinder = new CKFinder( $basePath ) ;
		$ckfinder->SetupCKEditorObject( $editorObj, $imageType, $flashType );
	}
984441
function addSafely( collection, element, database ) {
		// 1. IE doesn't support customData on text nodes;
		// 2. Text nodes never get chance to appear twice;
		if ( !element.is || !element.getCustomData( 'block_processed' ) ) {
			element.is && CKEDITOR.dom.element.setMarker( database, element, 'block_processed', true );
			collection.push( element );
		}
	}
308973
function( editor, output )
		{
			var env = CKEDITOR.env;

			var id = 'cke_' + this.id;
			var clickFn = CKEDITOR.tools.addFunction( function( $element )
				{
					var _ = this._;

					if ( _.state == CKEDITOR.TRISTATE_DISABLED )
						return;

					this.createPanel( editor );

					if ( _.on )
					{
						_.panel.hide();
						return;
					}

					this.commit();
					var value = this.getValue();
					if ( value )
						_.list.mark( value );
					else
						_.list.unmarkAll();

					_.panel.showBlock( this.id, new CKEDITOR.dom.element( $element ), 4 );
				},
				this );

			var instance = {
				id : id,
				combo : this,
				focus : function()
				{
					var element = CKEDITOR.document.getById( id ).getChild( 1 );
					element.focus();
				},
				clickFn : clickFn
			};

			function updateState()
			{
				var state = this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
				this.setState( editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state );
				this.setValue( '' );
			}

			editor.on( 'mode', updateState, this );
			// If this combo is sensitive to readOnly state, update it accordingly.
			!this.readOnly && editor.on( 'readOnly', updateState, this);

			var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element )
				{
					ev = new CKEDITOR.dom.event( ev );

					var keystroke = ev.getKeystroke();
					switch ( keystroke )
					{
						case 13 :	// ENTER
						case 32 :	// SPACE
						case 40 :	// ARROW-DOWN
							// Show panel
							CKEDITOR.tools.callFunction( clickFn, element );
							break;
						default :
							// Delegate the default behavior to toolbar button key handling.
							instance.onkey( instance,  keystroke );
					}

					// Avoid subsequent focus grab on editor document.
					ev.preventDefault();
				});

			var focusFn = CKEDITOR.tools.addFunction( function() { instance.onfocus && instance.onfocus(); } );

			// For clean up
			instance.keyDownFn = keyDownFn;

			output.push(
				'<span class="cke_rcombo" role="presentation">',
				'<span id=', id );

			if ( this.className )
				output.push( ' class="', this.className, ' cke_off"');

			output.push(
				' role="presentation">',
					'<span id="' + id+ '_label" class=cke_label>', this.label, '</span>',
					'<a hidefocus=true title="', this.title, '" tabindex="-1"',
						env.gecko && env.version >= 10900 && !env.hc ? '' : ' href="javascript:void(\'' + this.label + '\')"',
						' role="button" aria-labelledby="', id , '_label" aria-describedby="', id, '_text" aria-haspopup="true"' );

			// Some browsers don't cancel key events in the keydown but in the
			// keypress.
			// TODO: Check if really needed for Gecko+Mac.
			if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) )
			{
				output.push(
					' onkeypress="return false;"' );
			}

			// With Firefox, we need to force it to redraw, otherwise it
			// will remain in the focus state.
			if ( CKEDITOR.env.gecko )
			{
				output.push(
					' onblur="this.style.cssText = this.style.cssText;"' );
			}

			output.push(
					' onkeydown="CKEDITOR.tools.callFunction( ', keyDownFn, ', event, this );"' +
					' onfocus="return CKEDITOR.tools.callFunction(', focusFn, ', event);" ' +
					( CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : 'onclick' ) +		// #188
						'="CKEDITOR.tools.callFunction(', clickFn, ', this); return false;">' +
						'<span>' +
							'<span id="' + id + '_text" class="cke_text cke_inline_label">' + this.label + '</span>' +
						'</span>' +
						'<span class=cke_openbutton><span class=cke_icon>' + ( CKEDITOR.env.hc ? '&#9660;' : CKEDITOR.env.air ?  '&nbsp;' : '' ) + '</span></span>' +	// BLACK DOWN-POINTING TRIANGLE
					'</a>' +
				'</span>' +
				'</span>' );

			if ( this.onRender )
				this.onRender();

			return instance;
		}
81713
public function includeAceEditor()
    {
        if ($this->editorIncluded) {
            return;
        }

        if (!$this->environment->hasExtension(AssetExtension::class)) {
            throw new \LogicException('"asset" extension is mandatory if you don\'t include Ace editor by yourself.');
        }

        if (!$this->editorIncluded) {
            foreach (['ace', 'ext-language_tools'] as $file) {
                /** @var AssetExtension $extension */
                $extension = $this->environment->getExtension(AssetExtension::class);
                $jsPath = $extension->getAssetUrl($this->basePath.'/'.$this->mode.'/'.$file.'.js');

                printf('<script src="%s" charset="utf-8" type="text/javascript"></script>', $jsPath);
            }
            $this->editorIncluded = true;
        }
    }
1371679
protected function getEditor()
	{
		// Only create the editor if it is not already created.
		if (empty($this->editor))
		{
			// Initialize variables.
			$editor = null;

			// Get the editor type attribute. Can be in the form of: editor="desired|alternative".
			$type = trim((string) $this->element['editor']);

			if ($type)
			{
				// Get the list of editor types.
				$types = explode('|', $type);

				// Get the database object.
				$db = App::get('db');

				// Iterate over teh types looking for an existing editor.
				foreach ($types as $element)
				{
					// Build the query.
					$query = $db->getQuery()
						->select('element')
						->from('#__extensions')
						->whereEquals('element', $element)
						->whereEquals('folder', 'editors')
						->whereEquals('enabled', '1')
						->limit(1)
						->start(0);

					// Check of the editor exists.
					$db->setQuery($query->toString());
					$editor = $db->loadResult();

					// If an editor was found stop looking.
					if ($editor)
					{
						break;
					}
				}
			}

			// Create the Editor instance based on the given editor.
			$this->editor = $editor ? Wysiwyg::getInstance($editor) : App::get('editor');
		}

		return $this->editor;
	}
1173400
function (placeholder, dependencies, lazy) {
            var modules = this._pageModules, refpath, moduleDesc, typeUtils = ariaUtilsType;
            if (!typeUtils.isObject(placeholder)) {
                return;
            }
            var isLazy = (placeholder.lazy);
            if ((lazy && !isLazy) || (!lazy && isLazy)) {
                return;
            }
            if ("module" in placeholder) {
                refpath = placeholder.module;
                if (refpath.match(/^common:/)) {
                    this._utils.addIfMissing(refpath.replace(/^common:/, ""), dependencies.modules.common);
                } else {
                    moduleDesc = modules[refpath];
                    if (moduleDesc) {
                        this._utils.addIfMissing(moduleDesc.classpath, dependencies.classes);
                        this._utils.addIfMissing(refpath, dependencies.modules.page);
                    }
                }
            }
            if ("template" in placeholder) {
                this._utils.addIfMissing(placeholder.template, dependencies.templates);
            }
            if ("css" in placeholder) {
                this._utils.wiseConcat(dependencies.css, placeholder.css);
            }
        }
1712
function updateEditorElement() {
		var element = this.element;

		// Some editor creation mode will not have the
		// associated element.
		if ( element && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO ) {
			var data = this.getData();

			if ( this.config.htmlEncodeOutput )
				data = CKEDITOR.tools.htmlEncode( data );

			if ( element.is( 'textarea' ) )
				element.setValue( data );
			else
				element.setHtml( data );

			return true;
		}
		return false;
	}
72052
public function loadEditor($editorId)
    {
        if (! is_null($editor = $this->getEditor($editorId))) {
            if ($editor->isUsed()) {
                return true;
            }

            return $editor->load();
        }

        return false;
    }