Merges assets returned from registerAssets() to our list.

@throws \InvalidArgumentException
778622
private function loadAssets()
    {
        if ($this->loadedAssets) {
            return;
        }

        foreach ((array) $this->registerAssets() as $asset) {
            if (!$asset instanceof AssetInterface) {
                throw new \InvalidArgumentException(sprintf(
                    '%s::registerAssets() should return a list of Bolt\Asset\AssetInterface objects. Got: %s',
                    static::class,
                    is_object($asset) ? get_class($asset) : gettype($asset)
                ));
            }

            $this->addAsset($asset);
        }

        $this->loadedAssets = true;
    }
198544
public function registerAssetsCollection()
    {
        $this->app->singleton('assets.collection', function ($app) {
            return new AssetsCollection;
        });

        $this->app->alias('assets.collection', AssetsCollection::class);
    }
412697
public function registerAssetBundle()
    {
        if (isset($this->clientOptions['plugins']) && in_array('drag_drop', $this->clientOptions['plugins'])) {
            JuiAsset::register($this->getView());
        }
        MicroPluginAsset::register($this->getView());
        SifterAsset::register($this->getView());
        SelectizeAsset::register($this->getView());
    }
313217
public function registerAssets()
    {
        $view = $this->getView();
        JsTreeAsset::register($view);

        $config = [
            'core' => array_merge(['data' => $this->data], $this->core),
            'checkbox' => $this->checkbox,
            'contextmenu' => $this->contextmenu,
            'dnd' => $this->dnd,
            'search' => $this->search,
            'sort' => $this->sort,
            'state' => $this->state,
            'plugins' => $this->plugins,
            'types' => $this->types
        ];
        $defaults = Json::encode($config);

        $inputId = (!$this->hasModel()) ? $this->options['id'] : Html::getInputId($this->model, $this->attribute);

        $js = <<<SCRIPT
;(function($, window, document, undefined) {
    $('#jsTree_{$this->options['id']}')
        .bind("loaded.jstree", function (event, data) {
                $("#{$inputId}").val(JSON.stringify(data.selected));
            })
        .bind("changed.jstree", function(e, data, x){
                $("#{$inputId}").val(JSON.stringify(data.selected));
        })
        .jstree({$defaults});
})(window.jQuery, window, document);
SCRIPT;
        $view->registerJs($js);
    }
693056
public function addMerged($file_path, $media = 'screen')
    {
        $_fp = $this->__template->findAsset($file_path);
        if ($_fp || \AssetsManager\Loader::isUrl($file_path)) {
            $this->registry->addEntry(array(
                'file'=>$_fp, 'media'=>$media
            ), 'css_merged_files');
        } else {
            throw new \InvalidArgumentException(
                sprintf('CSS merged file "%s" not found!', $file_path)
            );
        }
        return $this;
    }
467498
public function registerAssets()
    {
        $idPrefix = $this->idPrefix;
        echo "<div>";
        if($this->filter){
            echo "<label>Filter:</label><input name='".$idPrefix."search' id='".$idPrefix."search' placeholder='Filter...' autocomplete='off'><button id='".$idPrefix."btnResetSearch'>&times;</button><span id='".$idPrefix."matches'></span>";
        }
 		echo "</div>";

        echo "<div>";
        if($this->btnExpandAll)	echo "<button id='".$idPrefix."btnExpandAll' class='btn btn-xs btn-primary'>Expand All</button>";
        
        if($this->btnCollapseAll) echo "<button id='".$idPrefix."btnCollapseAll' class='btn btn-xs btn-warning'>Collapse All</button>";

        if($this->btnToggleExpand) echo "<button id='".$idPrefix."btnToggleExpand' class='btn btn-xs btn-info'>Toggle Expand</button>";

        if($this->btnSelectAll && $this->selectMode == self::SELECT_MULTI)
            echo "<button id='".$idPrefix."btnSetAll' class='btn btn-xs btn-primary'>Select All</button>";

        if($this->btnUnselectAll && $this->selectMode == self::SELECT_MULTI)
            echo "<button id='".$idPrefix."btnUnsetAll' class='btn btn-xs btn-warning'>Unselect All</button>";

        if($this->btnToggleSelect && $this->selectMode == self::SELECT_MULTI)
            echo "<button id='".$idPrefix."btnToggleSelect' class='btn btn-xs btn-info'>Toggle Select</button>";
		echo "</div>";

        $view = $this->getView();
        
        FancytreeAsset::register($view);
        $id = 'fancyree_' . $this->id;
        if (isset($this->options['id'])) {
            $id = $this->options['id'];
            unset($this->options['id']);
        } else {
            echo Html::tag('div', '', ['id' => $id]);
        }
        
        if($this->childcounter)
        {
            if(array_search('childcounter',$this->extensions)<1)
            {
                array_push($this->extensions,'childcounter');
            }
            $childcounter = array();
            $childcounter["deep"]=true;
            $childcounter["hideZeros"]=true;
            $childcounter["hideExpanded"]=true;
        }
        if($this->glyph)
        {
            if(array_search('glyph',$this->extensions)<1)
            {
                array_push($this->extensions,'glyph');
            }
            $map = array();
            $map['doc'] = "glyphicon glyphicon-file";
            $map['docOpen'] = "glyphicon glyphicon-file";
            $map['checkbox'] = "glyphicon glyphicon-unchecked";
            $map['checkboxSelected'] = "glyphicon glyphicon-check";
            $map['checkboxUnknown'] = "glyphicon glyphicon-share";
            $map['dragHelper'] = "glyphicon glyphicon-play";
            $map['dropMarker'] = "glyphicon glyphicon-arrow-right";
            $map['error'] = "glyphicon glyphicon-warning-sign";
            $map['expanderClosed'] = "glyphicon glyphicon-menu-right";
            $map['expanderLazy'] = "glyphicon glyphicon-menu-right";  // glyphicon-plus-sign
            $map['expanderOpen'] = "glyphicon glyphicon-menu-down";  // glyphicon-collapse-down
            $map['folder'] = "glyphicon glyphicon-folder-close";
            $map['folderOpen'] = "glyphicon glyphicon-folder-open";
            $map['loading'] = "glyphicon glyphicon-refresh glyphicon-spin";
          
            $glyph_opts = array();
            $glyph_opts['map']=$map;
        }
        if($this->filter)
        {
            if(array_search('filter',$this->extensions)<1)
            {
                array_push($this->extensions,'filter');
            }
            $this->quicksearch = true;

            $filter = array();
            $filter["autoExpand"]=true;
            $filter["leavesOnly"]=true;
            $filter["autoApply"]=true; // Re-apply last filter if lazy data is loaded
            $filter["counter"]=true; // Show a badge with number of matching child nodes near parent icons
            $filter["fuzzy"]=false; // Match single characters in order, e.g. 'fb' will match 'FooBar'
            $filter["hideExpandedCounter"]=true;// Hide counter badge, when parent is expanded
            $filter["highlight"]=true; // Highlight matches by wrapping inside <mark> tags
            $filter["mode"]="dimm"; // Grayout unmatched nodes (pass "hide" to remove unmatched node instead)
        }
        
        $options = Json::encode(ArrayHelper::merge([
            'activeVisible' => $this->activeVisible,
            'ajax' => $this->ajax,
            'aria' => $this->aria,
            'autoActivate' => $this->autoActivate,
            'autoCollapse' => $this->autoCollapse,
            'autoScroll' => $this->autoScroll,
            'checkbox' => $this->checkbox,
            'clickFolderMode' => $this->clickFolderMode,
            'debugLevel' => $this->debugLevel,
            'defaultKey' => $this->defaultKey,
            'enableAspx' => $this->enableAspx,
            'extensions' => $this->extensions,
            'toggleEffect' => $this->toggleEffect,
            'generateIds' => $this->generateIds,
            'icon' => $this->icon,
            'idPrefix' => $this->idPrefix,
            'imagePath' => $this->imagePath,
            'keyboard' => $this->keyboard,
            'keyPathSeparator' => $this->keyPathSeparator,
            'minExpandLevel' => $this->minExpandLevel,
            'scrollOfs' => $this->scrollOfs,
            'scrollParent' => $this->scrollParent,
            'selectMode' => $this->selectMode,
            'source' => $this->source,
            'quicksearch' => $this->quicksearch,
            'parent' => $this->parent,
            'strings' => $this->strings,
            'tabindex' => $this->tabindex,
            'titlesTabbable' => $this->titlesTabbable,
            'childcounter' => $childcounter,
            'glyph' => $glyph_opts,
            'filter' => $filter,
        ], $this->options));
        $view->registerJs('$("#' . $id . '").fancytree( ' . $options . ')');
        if ($this->hasModel() || $this->name !== null) {
            $name = $this->hasModel() ? Html::getInputName($this->model, $this->attribute) : $this->name;

			if($this->selectMode != self::SELECT_SINGLE)
				$name = $name.'[]';

            //$selected = $this->selectMode == self::SELECT_SINGLE ? 'undefined' : "\"{$name}\"";
            $selected = $this->selectMode == self::SELECT_SINGLE ? "\"{$name}\"" : "\"{$name}\"";
            //$active = $this->selectMode == self::SELECT_SINGLE ? "\"{$name}\"" : 'undefined';
            $active = 'undefined';
            //$active = $this->selectMode == self::SELECT_SINGLE ? $name : 'undefined';
            
            if($this->btnExpandAll)
                $view->registerJs('$("#'.$idPrefix.'btnExpandAll").click(function(event){event.preventDefault(); $("#'.$id.'").fancytree("getRootNode").visit(function(node){node.setExpanded(true);});});');
            
            if($this->btnCollapseAll)
                $view->registerJs('$("#'.$idPrefix.'btnCollapseAll").click(function(event){event.preventDefault(); $("#'.$id.'").fancytree("getRootNode").visit(function(node){node.setExpanded(false);});});');

			if($this->btnToggleExpand)
				$view->registerJs('$("#'.$idPrefix.'btnToggleExpand").click(function(event){event.preventDefault(); $("#'.$id.'").fancytree("getRootNode").visit(function(node){node.toggleExpanded();});});');
            
            if($this->btnSelectAll && $this->selectMode == self::SELECT_MULTI)
                $view->registerJs('$("#'.$idPrefix.'btnSetAll").click(function(event){event.preventDefault(); $("#'.$id.'").fancytree("getTree").visit(function(node){node.setSelected(true);});});');
        
            if($this->btnUnselectAll && $this->selectMode == self::SELECT_MULTI)
                $view->registerJs('$("#'.$idPrefix.'btnUnsetAll").click(function(event){event.preventDefault(); $("#'.$id.'").fancytree("getTree").visit(function(node){node.setSelected(false);});});');

            if($this->btnToggleSelect && $this->selectMode == self::SELECT_MULTI)
                $view->registerJs('$("#'.$idPrefix.'btnToggleSelect").click(function(event){event.preventDefault(); $("#'.$id.'").fancytree("getRootNode").visit(function(node){node.toggleSelected();});});');

			if($this->filter){
                $view->registerJs('$("#'.$idPrefix.'search").keyup(function(e){e.preventDefault(); var n,opts = {autoExpand:'.$filter["autoExpand"].',leavesOnly: '.$filter["leavesOnly"].'},match = $(this).val();if(e && e.which === $.ui.keyCode.ESCAPE || $.trim(match) === ""){$("#'.$idPrefix.'btnResetSearch").click();return;}n = $("#' . $id . '").fancytree("getTree").filterNodes(match, opts);$("#'.$idPrefix.'btnResetSearch").attr("disabled", false);$("#'.$idPrefix.'matches").text("(" + n + " matches)");}).focus();');
                
                $view->registerJs('$("#'.$idPrefix.'btnResetSearch").click(function(e){e.preventDefault();$("#'.$idPrefix.'search").val("");$("#'.$idPrefix.'matches").text("");$("#' . $id . '").fancytree("getTree").clearFilter();}).attr("disabled", true);');
            }
            
            $view->registerJs('$("#' . $id . '").parents("form").submit(function(){$("#' . $id . '").fancytree("getTree").generateFormElements(' . $selected . ', ' . $active . ')});');
            
            $idfield = $this->idfield; 
            
            if (!empty($this->parent) && ($this->model->$idfield)) {
                $view->registerJs('$("#' . $id . '").fancytree("getTree").activateKey("' . $this->model->$idfield . '");');
                $view->registerJs('$("#' . $id . '").fancytree("getTree").getNodeByKey("' . $this->parent . '").setSelected(true)');
            } elseif ($this->model->$idfield) {
                $attribute = $this->attribute;
                if($this->selectMode == self::SELECT_SINGLE)
                {
                    $view->registerJs('$("#' . $id . '").fancytree("getTree").activateKey("'.$this->model->$attribute.'");');
                    $view->registerJs('$("#' . $id . '").fancytree("getTree").getNodeByKey("'.$this->model->$attribute.'").setSelected(true)');
                }
                else
                {
                    foreach($this->model->$attribute as $node)
                    {
                        $view->registerJs('$("#' . $id . '").fancytree("getTree").activateKey("'.$node.'");');
                        $view->registerJs('$("#' . $id . '").fancytree("getTree").getNodeByKey("'.$node.'").setSelected(true)');
                    }
                }
            }
        }
    }
1247196
public function registerAssets()
    {
        $id = Inflector::variablize($this->getId());
        $view = $this->getView();
        
        SwitcheryAsset::register($view);
        
        $selector = $id . 'Element';
        $options = [$selector];
        
        if (!empty($this->clientOptions)) {
            $options[] = Json::encode($this->clientOptions);
        }

        $js = new JsExpression(implode(', ', $options));
        $script = <<<EOT
var {$selector} = document.querySelector('{$this->querySelector}');
var {$id} = new Switchery({$js});
EOT;

        if (!empty($this->clientChangeEvent)) {
            $script .= "{$selector}.addEventListener('change', {$this->clientChangeEvent});" . PHP_EOL;
        }

        $view->registerJs($script);
    }
1374065
public function getAssetFileList()
    {
        $propertyList = $this->_getEntityList('Files');
        $result = [];

        foreach ($propertyList as $properties) {
            $result[] = AssetFile::createFromOptions($properties);
        }

        return $result;
    }
680033
public function processBundles()
    {
        $loader = $this->getLoader();
        $view = $this->ensureView($this->owner);

        foreach (array_keys($view->assetBundles) as $name) {
            $loader->registerAssetBundle($name);
        }
    }
883818
public function registerAssetPipelineFilters()
    {
        foreach ($this->parser->config['filters'] as $filters)
        {
            foreach ($filters as $filter)
            {
                if (method_exists($filter, 'setAssetPipeline'))
                {
                    $filter->setAssetPipeline($this);
                }
            }
        }

        foreach ($this->generator->config['filters'] as $filters)
        {
            foreach ($filters as $filter)
            {
                if (method_exists($filter, 'setAssetPipeline'))
                {
                    $filter->setAssetPipeline($this);
                }
            }
        }

        return $this;
    }
406716
public function compileAssets()
	{
		foreach ($this->site->getAssets() as $asset)
		{
			if(!file_exists(dirname($asset->getUrl()) ))
    		mkdir(dirname($asset->getUrl()), 0777, true);

			copy( $asset->getPath(), $asset->getUrl() );
		}
	}
942991
private function initialize()
    {
        foreach ($this->globs as $glob) {
            $glob = VarUtils::resolve($glob, $this->getVars(), $this->getValues());

            if (false !== $paths = glob($glob)) {
                foreach ($paths as $path) {
                    if (is_file($path)) {
                        $asset = new FileAsset($path, array(), $this->getSourceRoot(), null, $this->getVars());
                        $asset->setValues($this->getValues());
                        $this->add($asset);
                    }
                }
            }
        }

        $this->initialized = true;
    }
1323355
public function registerAssets()
    {
        $view = $this->getView();
        /** @var yii\web\AssetBundle $bandle */
        $bandle = Select2Asset::register($view);
        if ($this->language !== false) {
            $langs[0] = $this->language ? $this->language : Yii::$app->language;
            if (($pos = strpos($langs[0], '-')) > 0) {
                // If "en-us" is not found, try to use "en".
                $langs[1] = substr($langs[0], 0, $pos);
            }
            foreach ($langs as $lang) {
                $langFile = "/js/i18n/{$lang}.js";
                if (file_exists($bandle->sourcePath . $langFile)) {
                    $view->registerJsFile($bandle->baseUrl . $langFile, ['depends' => Select2Asset::className()]);
                    break;
                }
            }
        }
        if ($this->bootstrap) {
            Select2BootstrapAsset::register($view);
        }
        $settings = Json::encode($this->settings);
        $js = "jQuery('#{$this->options['id']}').select2($settings)";
        if ($this->maximize) {
            Select2MaximizeAsset::register($view);
            if (is_integer($this->maximize)) {
                $this->maximize = "{cushion: $this->maximize}";
            } elseif (is_array($this->maximize)) {
                $this->maximize = Json::encode($this->maximize);
            } else {
                $this->maximize = '{}';
            }
            $js .= ".maximizeSelect2Height($this->maximize)";
        }
        foreach ($this->events as $event => $handler) {
            $js .= '.on("' . $event . '", ' . new JsExpression($handler) . ')';
        }
        $view->registerJs("$js;");
    }
662299
protected function registerAssets()
    {
        $view = $this->getView();
        BxSliderAsset::register($view);
        $js = '$("#' . $this->containerOptions['id'] . '").bxSlider(' . $this->getPluginOptions() . ');';
        $view->registerJs($js, $view::POS_END);

    }
989523
protected function publishAssets()
    {
        $assets = [];

        foreach ($this->assets as $location => $asset) {
            $assets[$this->basePath($location)] = base_path($asset);
        }

        $this->publishes($assets);
    }
60532
public function getAssets()
    {
        $assets = $this->assets;

        // Spin through each directory and recursively merge the current directories assets
        // on to the directories assets. This maintains the order of adding in the array
        // structure.
        $this->directories->each(function($directory) use (&$assets)
        {
            $assets = $directory->getAssets()->merge($assets);
        });

        // Spin through each of the filters and apply them to each of the assets. Every filter
        // is applied and then later during the build will be removed if it does not apply
        // to a given asset.
        $this->filters->each(function($filter) use (&$assets)
        {
            $assets->each(function($asset) use ($filter) { $asset->apply($filter); });
        });

        return $assets;
    }
1156262
private function registerAssets()
    {
        $al = AssetList::getInstance();
        $al->registerMultiple([
            'jquery/scroll-to' => [
                ['javascript', 'js/jquery.scrollTo.min.js', ['minify' => true, 'combine' => true, 'version' => '2.1.2'], $this],
            ],
            'community_translation/online_translation/bootstrap' => [
                ['javascript', 'js/bootstrap.min.js', ['minify' => false, 'combine' => true], $this],
            ],
            'community_translation/online_translation/markdown-it' => [
                ['javascript', 'js/markdown-it.min.js', ['minify' => false, 'combine' => true], $this],
            ],
            'community_translation/online_translation/core' => [
                ['css', 'css/online-translation.css', ['minify' => false, 'combine' => true], $this],
                ['javascript', 'js/online-translation.js', ['minify' => true, 'combine' => true], $this],
            ],
            'jquery/comtraSortable' => [
                ['css', 'css/jquery.comtraSortable.css', ['minify' => true, 'combine' => true], $this],
                ['javascript', 'js/jquery.comtraSortable.js', ['minify' => true, 'combine' => true], $this],
            ],
        ]);
        $al->registerGroupMultiple([
            'jquery/scroll-to' => [
                [
                    ['javascript', 'jquery'],
                    ['javascript', 'jquery/scroll-to'],
                ],
            ],
            'community_translation/online_translation' => [
                [
                    ['css', 'community_translation/online_translation/core'],
                    ['javascript', 'community_translation/online_translation/bootstrap'],
                    ['javascript', 'community_translation/online_translation/markdown-it'],
                    ['javascript', 'community_translation/online_translation/core'],
                ],
            ],
            'jquery/comtraSortable' => [
                [
                    ['css', 'font-awesome'],
                    ['css', 'jquery/comtraSortable'],
                    ['javascript', 'jquery/comtraSortable'],
                ],
            ],
        ]);
    }