Adds necessary files (Js/CSS) to the widget's medias.

        Returns:
            django.forms.Media: Media object with all assets from registered
            config.
358845
def media(self):
        
        if not hasattr(self, "editor_manifest"):
            self.editor_manifest = self.init_manifest(self.config_name)

        return forms.Media(
            css={"all": self.editor_manifest.css()},
            js=self.editor_manifest.js()
        )
1169146
def _get_media(self):
        
        lang = get_language()
        select2_js = (settings.SELECT2_JS,) if settings.SELECT2_JS else ()
        select2_css = (settings.SELECT2_CSS,) if settings.SELECT2_CSS else ()

        i18n_name = SELECT2_TRANSLATIONS.get(lang)
        if i18n_name not in settings.SELECT2_I18N_AVAILABLE_LANGUAGES:
            i18n_name = None

        i18n_file = ('%s/%s.js' % (settings.SELECT2_I18N_PATH, i18n_name),) if i18n_name else ()

        return forms.Media(
            js=select2_js + i18n_file + ('django_select2/django_select2.js',),
            css={'screen': select2_css}
        )
1105077
def attach_files(self, files: Sequence[AttachedFile]):
        '''
        
        '''
        assert not self._content, 'content must be empty to attach files.'
        self.content_type = 'multipart/form-data'
        self._attached_files = files
175769
protected function _loadAssets()
    {
        if (Configure::read('CrudView.useAssetCompress')) {
            $this->AssetCompress->css('CrudView.crudview', ['block' => true]);
            $this->AssetCompress->script('CrudView.crudview_head', ['block' => 'headjs']);
            $this->AssetCompress->script('CrudView.crudview', ['block' => true]);

            return;
        }

        $config = Configure::read('CrudView');
        if (!$config) {
            return;
        }

        if (!empty($config['css'])) {
            $this->Html->css($config['css'], ['block' => true]);
        }

        if (!empty($config['js'])) {
            foreach ($config['js'] as $block => $scripts) {
                $this->Html->script($scripts, ['block' => $block]);
            }
        }
    }
1161397
def get_form(self, request, obj=None, **kwargs):
        
        kwargs.update(widgets={
            'plugin_type': widgets.Select(choices=self.plugins_for_site),
            'css_classes': JSONMultiWidget(self.classname_fields),
            'inline_styles': JSONMultiWidget(self.style_fields)
        })
        form = super(PluginExtraFieldsAdmin, self).get_form(request, obj, **kwargs)
        rectify_partial_form_field(form.base_fields['css_classes'], self.classname_fields)
        form.classname_fields = self.classname_fields
        rectify_partial_form_field(form.base_fields['inline_styles'], self.style_fields)
        form.style_fields = self.style_fields
        return form
1297272
protected function addStyleSheets()
	{
		// Initialize string for .css path
		$path = '';

		// Get .css path if defined in config file
		if ($this->getConfig('assets.paths.css'))
		{
			$path = $this->getConfig('assets.paths.css') . '/';
		}

		foreach ($this->stylesheets as $file => $options)
		{
			// Set default value for median attribute
			$media = 'all';

			// Set default value for conditional comments
			$cond = '';

			// Check in config file if stylesheet is an external resource
			$cdn = $this->getConfig('assets.cdn.'.$file);

			// Initialize string for file's url
			$href = '';

			// No conditional comment
			if (is_string($options) && $options)
			{
				$media = $options;
			}

			// Conditional comments are defined
			elseif(is_array($options))
			{
				// Check if value is not empty
				if (array_key_exists(1, $options) && $options[1])
				{
					// Get value for conditional comments
					$cond = $options[1];
				}

				// Check if value is not empty
				if (array_key_exists(0, $options) && $options[0])
				{
					// Get value for media attribute
					$media = $options[0];
				}
			}

			// Stylesheet is an external resource
			if ($cdn)
			{
				// Get file's url
				$href = $cdn;
			}

			// Stylesheet is a local resources + check if file exists
			elseif (File::exists(public_path($path.$file.'.css')))
			{
				// Get file's url
				$href = asset($path.$file.'.css');
			}

			// Check if url is not empty
			if ($href)
			{
				// Register link tag for this stylesheet
				$this->addOneLink('stylesheet', $href, '', array('media' => $media), $cond);
			}
		}
	}
147481
def _media(self):
        
        media = super(EntryAdminTinyMCEMixin, self).media

        media += TinyMCE().media + Media(
            js=[reverse('tinymce-js', args=['admin/zinnia/entry']),
                reverse('tinymce-filebrowser-callback')]
        )

        return media
1112849
public function requireEditorAssets()
    {
        $this->assets->requireAsset('core/file-manager');
        $this->assets->requireAsset('editor/ckeditor4');

        $plugins = $this->pluginManager->getSelectedPluginObjects();

        foreach ($plugins as $plugin) {
            /** @var Plugin $plugin */
            $group = $plugin->getRequiredAssets();
            $this->assets->requireAsset($group);
        }
    }
662299
protected function registerAssets()
    {
        $view = $this->getView();
        BxSliderAsset::register($view);
        $js = '$("#' . $this->containerOptions['id'] . '").bxSlider(' . $this->getPluginOptions() . ');';
        $view->registerJs($js, $view::POS_END);

    }
213114
def html_assets(cls, core=True, extras=True, backends=None, script=False):
        
        if backends is None:
            backends = [cls.backend] if cls.backend else []

        # Get all the widgets and find the set of required js widget files
        widgets = [wdgt for r in [Renderer]+Renderer.__subclasses__()
                   for wdgt in r.widgets.values()]
        css = list({wdgt.css for wdgt in widgets})
        basejs = list({wdgt.basejs for wdgt in widgets})
        extensionjs = list({wdgt.extensionjs for wdgt in widgets})

        # Join all the js widget code into one string
        path = os.path.dirname(os.path.abspath(__file__))

        def open_and_read(path, f):
            with open(find_file(path, f), 'r') as f:
                txt = f.read()
            return txt

        widgetjs = '\n'.join(open_and_read(path, f)
                             for f in basejs + extensionjs if f is not None)
        widgetcss = '\n'.join(open_and_read(path, f)
                              for f in css if f is not None)

        dependencies = {}
        if core:
            dependencies.update(cls.core_dependencies)
        if extras:
            dependencies.update(cls.extra_dependencies)
        for backend in backends:
            dependencies[backend] = Store.renderers[backend].backend_dependencies

        js_html, css_html = '', ''
        for _, dep in sorted(dependencies.items(), key=lambda x: x[0]):
            js_data = dep.get('js', [])
            if isinstance(js_data, tuple):
                for js in js_data:
                    if script:
                        js_html += js
                    else:
                        js_html += '\n<script type="text/javascript">%s</script>' % js
            elif not script:
                for js in js_data:
                    js_html += '\n<script src="%s" type="text/javascript"></script>' % js
            css_data = dep.get('css', [])
            if isinstance(js_data, tuple):
                for css in css_data:
                    css_html += '\n<style>%s</style>' % css
            else:
                for css in css_data:
                    css_html += '\n<link rel="stylesheet" href="%s">' % css
        if script:
            js_html += widgetjs
        else:
            js_html += '\n<script type="text/javascript">%s</script>' % widgetjs
        css_html += '\n<style>%s</style>' % widgetcss

        comm_js = cls.comm_manager.js_manager
        if script:
            js_html += comm_js
        else:
            js_html += '\n<script type="text/javascript">%s</script>' % comm_js

        return unicode(js_html), unicode(css_html)
679875
def render_html(self, *args, **kwargs):
        
        static_url = '%s://%s%s' % (self.request.scheme, self.request.get_host(), settings.STATIC_URL)
        media_url = '%s://%s%s' % (self.request.scheme, self.request.get_host(), settings.MEDIA_URL)

        with override_settings(STATIC_URL=static_url, MEDIA_URL=media_url):
            template = loader.get_template(self.template_name)
            context = self.get_context_data(*args, **kwargs)
            html = template.render(context)
            return html
826388
def append_default_stylesheets(self):
        
        for style in utils.get_stylesheet_list(self.settings):
            self.css(style)
118207
public function registerClientAssets()
    {
        $view = $this->getView();
        Asset::register($view);
        $settings = [
            'url' => $this->uploadUrl,
            'name' => $this->uploadParameter,
            'maxSize' => $this->maxSize / 1024,
            'allowedExtensions' => explode(', ', $this->extensions),
            'size_error_text' => Yii::t('jcrop', 'File Size Error', ['size' => $this->maxSize / (1024 * 1024)]),
            'ext_error_text' => Yii::t('jcrop', 'File Extension Error', ['formats' => $this->extensions]),
            'accept' => 'image/*'
        ];
        if ($this->onCompleteJcrop)
            $settings['onCompleteJcrop'] = $this->onCompleteJcrop;
        $view->registerJs(
            'jQuery("#' . $this->options['id'] . '").parent().find(".new-photo-area").cropper(' . Json::encode($settings) . ', ' . $this->thumbnailWidth . ', ' . $this->thumbnailHeight . ');',
            $view::POS_READY
        );
    }
295102
def create_asset_browser(self, ):
        
        assetbrws = ListBrowser(4, headers=['Assettype', 'Asset', 'Task', 'Descriptor'])
        self.asset_browser_vbox.insertWidget(0, assetbrws)
        return assetbrws
1013235
function () {
  var mediaPath = path.join(__dirname, '..', 'media'),
      templateFile = path.join(mediaPath, 'templates', 'index.jade'),
      monolith = require('monolith').init({
        minify: true
      });

  monolith.addCSSFile(path.join(mediaPath, "css", "normalize.css"));
  monolith.addCSSFile(path.join(mediaPath, "css", "razdraz.css"));

  outputData.css = monolith.getCSS();
  outputData.scripts = monolith.getScript();
  outputData.pageTemplate = jade.compile(fs.readFileSync(templateFile, 'utf-8'));

}
298514
public function registerScripts()
    {
        $view = $this->getView();

        Asset::register($view);
        if ($this->crop === true) {
            CropAsset::register($view);
        }

        $view->registerJs(
            'jQuery(\'#' . $this->getSelector() . '\').fileapi(' . Json::encode($this->settings) .');'
        );

        $this->registerCallbacks();
    }
511049
async def download_media(self, *args, **kwargs):
        
        return await self._client.download_media(self, *args, **kwargs)