Generate DataTable javascript.

@param  null $script
@param  array $attributes
@return \Illuminate\Support\HtmlString
@throws \Exception
322937
public function scripts($script = null, array $attributes = ['type' => 'text/javascript'])
    {
        $script = $script ?: $this->generateScripts();
        $attributes = $this->html->attributes($attributes);

        return new HtmlString("<script{$attributes}>{$script}</script>\n");
    }
160654
private function setScript($src, $attributes)
    {
        $this->assets[$this->tag[$this->where]][strtolower(__FUNCTION__)][] = (string)
            static::$script.'
                    src="'.Url::getBase().$src.'"'.$this->addAttributes($attributes).'></script>'.PHP_EOL;
    }
1143998
private function buildScriptTag($attributes){
        $amdScript = '<script id="' . self::LOADER_ID . '" ';
        foreach($attributes as $attr => $value) {
            $amdScript .= $attr . '="' . \tao_helpers_Display::htmlize($value) . '" ';
        }
        return trim($amdScript) . '></script>';
    }
502374
public function script($src, $attr = array())
    {
        $src = $this->Assets->getScript($src);
        $attr['src'] = $src;
        return $this->tag('script', $attr, '', true);
    }
528701
public function build($name = null, array $attributes = [], $callback = null)
    {
        if (!$this->validator->isValid($attributes)) {
            throw new Exception\InvalidAttributesException('Invalid validator class');
        }
        unset($attributes['form']);

        $field = new Fluent([
            'name'       => $name,
            'value'      => isset($attributes['value']) ? $attributes['value'] : '',
            'attributes' => $attributes,
        ]);

        if ($callback instanceof Closure) {
            call_user_func($callback, $field);
        }

        $params  = $this->attributes($field);
        $this->extractor->generateScripts($params);
        $this->memorize($field);
        $hiddens = [
            app('form')->hidden('validator', $attributes['validator'])
        ];

        return view($this->config['view'], ['hiddens' => $hiddens, 'element' => app('form')->button($attributes['title'], $params)])->render();
    }
938164
public function renderScripts($withInternal = false, array $internalAttrs = [])
    {
        $html = [];

        $this->triggerEvent('onAssetRenderScripts', [
            'asset' => $this,
            'withInternal' => &$withInternal,
            'html' => &$html,
        ]);

        foreach ($this->scripts as $url => $script) {
            $defaultAttribs = [
                'src' => $script['url'],
            ];

            $attribs = array_merge($defaultAttribs, $script['attribs']);

            if ($script['options']['version'] !== false) {
                $attribs['src'] = $this->appendVersion($attribs['src']);
            }

            if (isset($script['options']['sri'])) {
                $attribs['integrity']   = $script['options']['sri'];
                $attribs['crossorigin'] = 'anonymous';
            }

            if (isset($script['options']['conditional'])) {
                $html[] = '<!--[if ' . $script['options']['conditional'] . ']>';
            }

            if (isset($script['options']['import'])) {
                $attribs['href'] = $attribs['src'];
                $attribs['rel']  = 'import';
                unset($attribs['src']);
                $html[] = (string) h('link', $attribs, null);
            } else {
                $html[] = (string) h('script', $attribs, null);
            }

            if (isset($script['options']['conditional'])) {
                $html[] = '<![endif]-->';
            }
        }

        if ($withInternal && $this->internalScripts) {
            $html[] = (string) h(
                'script',
                $internalAttrs,
                "\n" . $this->renderInternalScripts() . "\n" . $this->indents
            );
        }

        return implode("\n" . $this->indents, $html);
    }
937207
public static function attributes(array $attributes = null) {
        $attributes = (array)$attributes;
        $output = '';
        foreach ($attributes as $name => $value) {
            $output .= self::attribute($name, $value);
        }
        return $output;
    }
400668
public static function get_attribute_html( $attributes = array() ) {
		$html = '';

		if ( ! $attributes ) {
			return $html;
		}

		foreach ( $attributes as $key => $attribute ) {
			$html .= ' ' . esc_attr( $key ) . '="' . esc_attr( $attribute ) . '"';
		}

		return $html;
	}
1188059
protected function addColumnAttributes(&$script)
    {

        $table = $this->getTable();

        foreach ($table->getColumns() as $col) {
            $this->addColumnAttributeComment($script, $col);
            $this->addColumnAttributeDeclaration($script, $col);
            if ($col->isLazyLoad()) {
                $this->addColumnAttributeLoaderComment($script, $col);
                $this->addColumnAttributeLoaderDeclaration($script, $col);
            }
            if ($col->getType() == PropelTypes::OBJECT || $col->getType() == PropelTypes::PHP_ARRAY) {
                $this->addColumnAttributeUnserializedComment($script, $col);
                $this->addColumnAttributeUnserializedDeclaration($script, $col);
            }
        }
    }
417412
public function generateScripts()
    {
        $parameters = $this->generateJson();

        return new HtmlString(
            sprintf($this->template(), $this->getTableAttribute('id'), $parameters)
        );
    }
551249
public function table(array $attributes = [], $drawFooter = false, $drawSearch = false)
    {
        $this->tableAttributes = array_merge($this->getTableAttributes(), $attributes);
        $htmlAttr = $this->html->attributes($this->tableAttributes);
        $tableHtml = '<table '.$htmlAttr.'></table>';

        return new HtmlString($tableHtml);
    }
39916
final protected function getScript($area, $data_only = false)
    {
        $files = $this->page->js->getFiles($area);

        if ($data_only) {
            return $files;
        }

        // Init output var
        $html = '';

        // Create files
        foreach ($files as $file) {

            // Create script html object
            $html .= PHP_EOL . '<script src="' . $file . '"></script>';
        }

        return $html;
    }
1373117
public function build($name = null, array $attributes = [], $callback = null)
    {
        if (!isset($attributes['response-container'])) {
            array_set($attributes, 'response-container', 'test-response');
        }
        if (!isset($attributes['form-container'])) {
            array_set($attributes, 'form-container', 'tester-form');
        }
        $script    = is_null($name) ? 'round' : $name;
        $container = app('antares.asset')->container('antares/foundation::scripts');
        $container->inlineScript($script, $this->generateScripts($attributes));
        if ($callback instanceof Closure) {
            call_user_func($callback, $container);
        }
    }
1139912
public function javascriptIncludeTag($sources = "application", $attributes = [])
    {
        // E.g. javascript_include_tag('app'); => app-9fcd9b50e5cb047af35d3c5a4b55f73f.js
        $args = func_get_args();
        if (is_array(last($args))) {
            $attributes = array_pop($args);
        } else {
            $attributes = [];
        }
        $sources = is_array($sources) ? $sources : $args;
        if (empty($sources)) {
            $sources = ["application"];
        }

        $assetsOptions = ['host' => array_pull($attributes, 'host', $this->assetsHost)];

        $defaults = ['type' => 'text/javascript'];
        $attributes = $attributes + $defaults;

        $javascript_tags = [];
        foreach ((array) $sources as $source) {
            $sourceName = "$source.js";
            $javascript_tags[] = app('html')->script($this->assetPath($sourceName, $assetsOptions), $attributes);
        }

        return implode($javascript_tags);
    }
350381
public static function buildHtmlElement($name, array $attributes = [], $content = null, $closeEmptyTag = true, array $cssClasses = []): string
    {
        $html = '<' . $name . self::buildAttrs($attributes, $cssClasses);
        if ($content !== null) {
            $html .= '>' . $content . '</' . $name . '>';
        } else {
            $html .= $closeEmptyTag ? ' />' : '>';
        }
        return $html;
    }
602774
public static function table(
        string $content = null, 
        array $attributes = []
    ) : string
    {
        return self::tag("table", $content, $attributes);
    }
631520
public function script($assets, array $attributes = [])
    {

        $manager = clone $this;

        $collection = (new JavascriptCollection)->setAttributes($attributes);

        $manager->clear()
                ->addCollection($collection)
                ->addArray((array) $assets);

        return $manager;
    }