Get generated raw scripts.

@return string
347944
public function generateScripts()
    {
        app('antares.asset')->container('antares/foundation::application')->add('gridstack', '/_dist/js/view_datatables.js', ['webpack_gridstack', 'app_cache']);
        //app('antares.asset')->container('antares/foundation::application')->add('gridstack', '//10.10.10.35:71/js/view_datatables.js', ['webpack_gridstack', 'app_cache']);

        if ($this->orderable) {
            array_set($this->attributes, 'rowReorder', true);
        }

        $columns = $this->hasColumnFilter() ? $this->getColumnFilterAdapter()->getColumns()->toArray() : $this->collection->toArray();
        array_set($this->attributes, 'sEmptyTable', $this->zeroData());
        array_set($this->attributes, 'iDisplayLength', $this->datatable->getPerPage());

        $args         = array_merge(
                $this->attributes, ['ajax' => $this->ajax, 'columns' => $this->cols()]
        );
        $searching    = (($value        = $this->getGlobalSearchValue()) !== false) ? "data.search.value=instance.find('.mdl-textfield__input').val();" : '';
        $groupsFilter = app(\Antares\Datatables\Adapter\GroupsFilterAdapter::class);
        $sessionValue = $groupsFilter->getSessionValue();
        $cols         = '';
        if (($sessionValue && !ajax()) or ! empty($this->selectedGroups)) {
            $columns = [];
            foreach ($this->collection as $columnIndex => $column) {


                $value       = '';
                $regex       = false;
                $fromSession = array_get($sessionValue, $columnIndex, $sessionValue);

                if ($column->data == array_get($fromSession, 'data') && $column->name == array_get($fromSession, 'name')) {

                    $value = array_get($fromSession, 'search.value');
                    $regex = true;
                } elseif (isset($this->selectedGroups[$columnIndex])) {
                    $value = $this->selectedGroups[$columnIndex];
                    $regex = true;
                }


                $columns[] = [
                    'data'       => $column->data,
                    'name'       => $column->name,
                    'searchable' => $column->searchable,
                    'orderable'  => $column->orderable,
                    'search'     => [
                        'value' => $value,
                        'regex' => $regex
                    ],
                ];
            }
            $cols = 'data.columns = ' . JavaScriptDecorator::decorate($columns) . ';';
        }
        $orderable = ($this->orderable) ? 'data.orderable=1;' : '';

        $eventAfterSearch = (request()->has('search') && !request()->ajax()) ? '$(document).trigger( "datatables.searchLoaded", [ dtInstance,data,' . count(config('search.datatables')) . ' ] );' : '';
        $ajax             = <<<EOD
            function (data, callback, settings) {                        
                    if(data.draw===1){
                        $cols
                    }
                    
                    var dtInstance=$(settings.oInstance);
                    var instance = dtInstance.closest('.grid-stack-item-content').length>0?dtInstance.closest('.grid-stack-item-content'):dtInstance.closest('.tbl-c');                    
                    $searching
                    $orderable
                    settings.jqXHR = $.ajax({
                        "dataType": 'json',
                        "timeout": 20000,
                        "type": "%s",
                        "url": "%s",
                        "data": data,
                        "success": callback
                    }).always(function (data) {
                        $eventAfterSearch
                        window.antaresEvents.emit('dt_data_loaded', dtInstance);    
                        $(document).trigger( "datatablesLoaded", [ dtInstance ] );
                    });                    
            }
EOD;


        $url          = $this->getTargetUrl();
        $args['ajax'] = new JavaScriptExpression(sprintf($ajax, $this->method, $url));
        //$args['columnDefs'][] = new JavaScriptExpression('{ responsivePriority:0, targets: -1 }');
        //$javascript   = file_get_contents(sandbox_path('packages/core/js/datatables.js'));
        $javascript   = file_get_contents(sandbox_path('packages/core/js/datatables.js'));
        $parameters   = JavaScriptDecorator::decorate(['options' => $args]);
        return str_replace(['$params = null,', '$instanceName = null;'], ['$params = ' . $parameters . ',', '$instanceName = "' . $this->tableAttributes['id'] . '";'], $javascript);
    }
885247
public function getJs()
    {
        $html = '<script type="text/javascript">';
        $js = file_get_contents(__DIR__.'/Js/formidable.js');
        $html .= str_replace("\n", '', str_replace('{remove}', $this->factory->getLanguage()->translate('remove'), $js));
        $html .= '</script>';

        return $html;
    }
27428
public function getScript()
    {
        $data = array();
        if (!is_null($this->language))
            $data = array('hl' => $this->language);

        return '<script src="https://www.google.com/recaptcha/api.js?'.http_build_query($data).'"></script>';
    }
254146
public function render()
    {
        $htmlContent = '';
        foreach (self::$scriptList->toArray() as $script) {
            if ($script[0] == 'script') {
                $htmlContent .= '<script type="text/javascript">' . $script[1] . '</script>' . PHP_EOL;
            } else {
                if (Configuration::read('html.script.test_file_existance') === true) {
                    $scriptPath = APP_ROOT . '/public' . $script[1];
                    if (!file_exists($scriptPath)) {
                        trigger_error('Script file "' . $scriptPath . '" doesn\'t exist.', E_USER_WARNING);
                    }
                }
                $htmlContent .= '<script src="' . $script[1] . '" type="text/javascript"></script>' . PHP_EOL;
            }
        }
        return $htmlContent;
    }
628218
public function getScriptFiles()
	{
		$return = array();
		//$return = $this->coreScripts;
		//print_r($this->coreScripts);
		if(!empty($this->coreScripts)) {
			foreach($this->coreScripts as $key=>$val) {
				if((is_string($key) && $key != 'jquery') && is_array($val)) {
				//if((is_string($key)) && is_array($val))
					if($val['baseUrl'] != null)
						$return[] = /*$this->getProtocol()."://".Yii::app()->request->serverName.*/$val['baseUrl'].'/'.$val['js'][0];
					else 
						$return[] = /*$this->getProtocol()."://".Yii::app()->request->serverName.*/$this->getCoreScriptUrl().'/'.$val['js'][0];
				}
			}
		}
		//echo '===========================================';
		
		//$return = $this->scriptFiles;
		//print_r($this->scriptFiles);
		if(!empty($this->scriptFiles)) {
			foreach($this->scriptFiles as $key=>$val) {
				if((is_string($key)) || is_array($val)) {
					if(!empty($val)) {
						foreach($val as $key=>$row)
							if($key == $row || $row==null)
								$return[] = /*$this->getProtocol()."://".Yii::app()->request->serverName.*/$key;
					}
				}
			}
		}
		return $return;
	}
870945
public function scriptsAction()
    {
        $scriptsBuilder = $this->get('phlexible_gui.asset.scripts_builder');
        $asset = $scriptsBuilder->build();

        $response = new BinaryFileResponse($asset, 200, array('Content-Type' => 'text/javascript;charset=UTF-8'));
        if ($asset->getMapAsset()) {
            $response->headers->set('X-SourceMap', $this->generateUrl('asset_scripts_map'));
        }

        return $response;
    }
176738
protected function get_js_commands()
    {
        $out = '';

        foreach ($this->commands as $i => $args) {
            $method = array_shift($args);
            foreach ($args as $i => $arg) {
                $args[$i] = self::json_serialize($arg, $this->devel_mode, false);
            }

            $out .= sprintf(
                "this.%s(%s);\n",
                preg_replace('/^parent\./', '', $method),
                implode(',', $args)
            );
        }

        return $out;
    }
1090148
protected function _renderScripts()
    {
        $document = $this->getService('anahita:document');

        $string = '';
        $string .= $this->_template->getHelper('javascript')->language('lib_anahita');

        $scripts = array_reverse($document->getScripts());

        foreach ($scripts as $src => $script) {

            $type = $script['type'];

            $attribs = '';
            if (!empty($script['attribs'])) {
                $attribs = implode($script['attribs'], ' ');
            }

            $string .= '<script type="'.$type.'" src="'.$src.'" '.$attribs.'></script>';
        }

        $script = $document->getScript();

        foreach ($script as $type => $content) {
            $string .= '<script type="'.$type.'">'.$content.'</script>';
        }

        return $string;
    }
856796
public function generateRawData()
    {
        $rawData = ['id' => $this->getId()];
        if ($this->getCreatedAt()) {
            $rawData['created_at'] = $this->getCreatedAt();
        }
        if ($this->getStatusDescription() || $this->getStatusCode()) {
            $rawData['status'] = $this->getStatus();
        }

        return $rawData;
    }
697292
protected function getScriptText()
    {
        $scriptText = "";
        foreach ($this->imageUrls as $imageUrl) {
            $escapedImageUrl = Builder::escapeText($imageUrl);
            $scriptText      .= "
PreloadImage({$escapedImageUrl});";
        }
        return $scriptText;
    }
693104
public function getJavascript()
    {
        if (!empty($this->columns)) {
            $this->setJsInitParam('columns', $this->getColumnsForJs());
        }

        $js = 'var '.$this->tableName.' = $("#'.$this->tableName.'").dataTable('."\n"
                .(!empty($this->jsInitParameters) ? PHPToJS::render((object) $this->jsInitParameters) : '')."\n"
            .');'."\n";

        $js .= $this->getJavascriptSearchPart();

        return $js;
    }
473447
public function get_js_data() {
        global $CFG;

        $ret = new stdClass;

        // Sort the types by priority.
        uasort($this->types, array($this, 'type_compare'));

        $ret->types = array();
        if (!empty($CFG->dndallowtextandlinks)) {
            foreach ($this->types as $type) {
                if (empty($type->handlers)) {
                    continue; // Skip any types without registered handlers.
                }
                $ret->types[] = $type;
            }
        }

        $ret->filehandlers = $this->filehandlers;
        $uploadrepo = repository::get_instances(array('type' => 'upload', 'currentcontext' => $this->context));
        if (empty($uploadrepo)) {
            $ret->filehandlers = array(); // No upload repo => no file handlers.
        }

        return $ret;
    }
175422
public function getTemplateHtmlAndScript()
    {
        $html = '';
        $scripts = [];

        /* @var Field $field */
        foreach ($this->fields() as $field) {

            //when field render, will push $script to Merchant
            $html .= $field->render();

            /*
             * Get and remove the last script of Merchant::$script stack.
             */
            if ($field->getScript()) {
                $scripts[] = array_pop(Merchant::$script);
            }
        }

        return [$html, implode("\r\n", $scripts)];
    }
618581
final public static function get_formatted_properties() {
        $properties = static::properties_definition();

        $formatted = array();
        foreach ($properties as $property => $definition) {
            $propertyformat = $property . 'format';
            if (($definition['type'] == PARAM_RAW || $definition['type'] == PARAM_CLEANHTML)
                    && array_key_exists($propertyformat, $properties)
                    && $properties[$propertyformat]['type'] == PARAM_INT) {
                $formatted[$property] = $propertyformat;
            }
        }

        return $formatted;
    }
1084781
public function getScript() {
		$this->jquery_code_for_compile=array ();
		foreach ( $this->jsCodes as $jsCode ) {
			$this->jquery_code_for_compile []=$jsCode->compile(array (
					"identifier" => $this->attachTo
			));
		}
		$this->compileEvents();
		return $this->compileJQueryCode();
	}
582891
public function scripts()
    {
        $scripts = array_map(function ($scriptData) {
            /* @var $scriptData array<string, mixed> */
            return new Script(
                $scriptData['full_path'],
                $this->bytesToMb($scriptData['memory_consumption']),
                $scriptData['hits'],
                new \DateTimeImmutable('@' . $scriptData['last_used_timestamp'])
            );
        }, $this->data['scripts']);
        return new ScriptCollection($scripts, $this->calculateCacheSlots());
    }
700290
public function getAfterBodyScripts()
    {
        $output = '';
        foreach ($this->afterBodyScripts as $script) {
            $output .= $script . "\n";
        }
        $output = rtrim($output, "\n");
        return $output;
    }