Get the script text

@return string
540981
protected function getScriptText()
    {
        $togglingControlId = Builder::escapeText($this->togglingControl->getId());
        $toggledControlId  = Builder::escapeText($this->toggledControl->getId());
        $visibility        = "!ToggleControl.Visible";
        if ($this->onlyShow) {
            $visibility = "True";
        } else if ($this->onlyHide) {
            $visibility = "False";
        }
        return "
if (Event.Control.ControlId == {$togglingControlId}) {
	declare ToggleControl = Page.GetFirstChild({$toggledControlId});
	ToggleControl.Visible = {$visibility};
}";
    }
369469
protected function getInlineJavaScript()
    {
        $javascript = sprintf(
            "var %1\$s_obj = new %2\$s('%1\$s', %3\$s);",
            $this->id,
            $this->getJavascriptClassName(),
            $this->animate ? 'true' : 'false'
        );

        $javascript .= sprintf(
            "\n%s_obj.animate = %s;",
            $this->id,
            $this->animate ? 'true' : 'false'
        );

        $javascript .= sprintf(
            "\n%s_obj.always_open = %s;",
            $this->id,
            $this->always_open ? 'true' : 'false'
        );

        return $javascript;
    }
402081
protected function getScriptText()
    {
        $actionName = Builder::escapeText($this->actionName);
        $key        = null;
        $value      = null;
        if ($this->keyName !== null) {
            $key   = "KeyName";
            $value = $this->keyName;
        } else if ($this->keyCode !== null) {
            $key   = "KeyCode";
            $value = $this->keyCode;
        } else if ($this->charPressed !== null) {
            $key   = "CharPressed";
            $value = $this->charPressed;
        }
        $value = Builder::escapeText($value);
        return "
if (Event.{$key} == {$value}) {
	TriggerPageAction({$actionName});
}";
    }
917010
protected function getInlineJavaScript()
    {
        $base_href = 'editor_base_' . $this->id;
        ob_start();

        if ($this->base_href === null) {
            echo "var {$base_href} = " .
                "document.getElementsByTagName('base');\n";

            echo "if ({$base_href}.length) {\n";
            echo "\t{$base_href} = {$base_href}[0];\n";
            echo "\t{$base_href} = {$base_href}.href;\n";
            echo "} else {\n";
            echo "\t{$base_href} = location.href.split('#', 2)[0];\n";
            echo "\t{$base_href} = {$base_href}.split('?', 2)[0];\n";
            echo "\t{$base_href} = {$base_href}.substring(\n";
            echo "\t\t0, {$base_href}.lastIndexOf('/') + 1);\n";
            echo "}\n";
        } else {
            echo "var {$base_href} = " .
                SwatString::quoteJavaScriptString($this->base_href) .
                ";\n";
        }

        echo "tinyMCE.init({\n";

        $lines = array();
        foreach ($this->getConfig() as $name => $value) {
            if (is_string($value)) {
                $value = SwatString::quoteJavaScriptString($value);
            } elseif (is_bool($value)) {
                $value = $value ? 'true' : 'false';
            }
            $lines[] = "\t" . $name . ": " . $value;
        }

        $lines[] = "\tdocument_base_url: {$base_href}";

        echo implode(",\n", $lines);

        // Make removeformat button also clear inline alignments, styles,
        // colors and classes.
        echo ",\n" .
            "\tformats: {\n" .
            "\t\tremoveformat : [\n" .
            "\t\t\t{\n" .
            "\t\t\t\tselector     : 'b,strong,em,i,font,u,strike',\n" .
            "\t\t\t\tremove       : 'all',\n" .
            "\t\t\t\tsplit        : true,\n" .
            "\t\t\t\texpand       : false,\n" .
            "\t\t\t\tblock_expand : true,\n" .
            "\t\t\t\tdeep         : true\n" .
            "\t\t\t},\n" .
            "\t\t\t{\n" .
            "\t\t\t\tselector     : 'span',\n" .
            "\t\t\t\tattributes   : [\n" .
            "\t\t\t\t\t'style',\n" .
            "\t\t\t\t\t'class',\n" .
            "\t\t\t\t\t'align',\n" .
            "\t\t\t\t\t'color',\n" .
            "\t\t\t\t\t'background'\n" .
            "\t\t\t\t],\n" .
            "\t\t\t\tremove       : 'empty',\n" .
            "\t\t\t\tsplit        : true,\n" .
            "\t\t\t\texpand       : false,\n" .
            "\t\t\t\tdeep         : true\n" .
            "\t\t\t},\n" .
            "\t\t\t{\n" .
            "\t\t\t\tselector     : '*',\n" .
            "\t\t\t\tattributes   : [\n" .
            "\t\t\t\t\t'style',\n" .
            "\t\t\t\t\t'class',\n" .
            "\t\t\t\t\t'align',\n" .
            "\t\t\t\t\t'color',\n" .
            "\t\t\t\t\t'background'\n" .
            "\t\t\t\t],\n" .
            "\t\t\t\tsplit        : false,\n" .
            "\t\t\t\texpand       : false,\n" .
            "\t\t\t\tdeep         : true\n" .
            "\t\t\t}\n" .
            "\t\t]\n" .
            "\t}";

        echo "\n});";

        return ob_get_clean();
    }
104660
public function getOmmuScript() 
	{
		$module = strtolower(Yii::app()->controller->module->id);
		$controller = strtolower(Yii::app()->controller->id);
		$action = strtolower(Yii::app()->controller->action->id);
		if(isset($_GET))
			$attr = array_merge($_GET, array('protocol'=>'script'));
		else
			$attr = array('protocol'=>'script');
		
		if($module == 'null')
			$url = Yii::app()->createUrl($controller.'/'.$action, $attr);
		else
			$url = Yii::app()->createUrl($module.'/'.$controller.'/'.$action, $attr);
		
		$return = array();
		$return['cssFiles'] = $this->getCssFiles();
		$return['scriptFiles'] = $this->getScriptFiles();
		$return['scriptFiles'][] = $url;
		//$return['scripts'] = $this->getScripts();
		$return['powered'] = 'Ommu Platform by putra@sudaryanto.id';
		
		return $return;
	}
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;
    }
1216042
private function get_Text()
    {
        $text_formatting = array('b','strong','em','i','small','strong','sub','sup','ins','del','mark','br','hr');

        foreach ($this->dom_element->childNodes as $node)
        {
            if($node->nodeType == 3)
            {
                $this->set_text(trim($node->textContent));
                $this->textFormatting.=$node->textContent;
            }
            else if($node->nodeType == 1 && !!in_array($node->tagName, $text_formatting))
            {
                if(!!in_array($node->tagName, ['br','hr']))
                {
                    $this->textFormatting.= sprintf('<%s>',$node->tagName);
                }
                else
                {
                    $tag = $node->tagName;
                    $attrs = $this->attrs_to_string($node->attributes);
                    $text = $node->textContent;

                    $this->textFormatting.= sprintf('<%1$s%2$s>%3$s</%1$s>',$tag,$attrs,$text);
                }
            }
        }

        return $this;
    }
59130
public function getScript()
    {
        $_script = $this->script;
        $script = [
            $_script['form-create']
        ];
        if ($this->loadCityAreaData == true)
            $script[] = $_script['city-area-data'];
        if ($this->loadCityData == true)
            $script[] = $_script['city-data'];
        if ($this->linkJq)
            $script[] = $_script['jq'];
        if ($this->linkIview) {
            $script[] = $_script['iview'];
            $script[] = $_script['iview-css'];
        }
        if ($this->linkVue)
            $script[] = $_script['vue'];
        return array_reverse($script);
    }
659736
public function getScript()
    {
        $di = jaxon()->di();
        $code = '';
        foreach(array_keys($this->aFunctions) as $sName)
        {
            $xFunction = $di->get($sName);
            $code .= $xFunction->getScript();
        }
        return $code;
    }
294094
public function getScript()
    {
        $name = $this->chart->getName();
        $dataArrayJs = '[';

        $counter = 0;
        foreach ( $this->chart->getSeries() as $title => $series ) {

            $dataArrayJs .= $counter++ > 0 ? ', ' : '';

            $dataArrayJs .= '{';

            // associate Xs with Ys in cases where we need it
            $data = $series->getData();

            $formattedData = array();
            foreach ( $data as $datum ) { 
                if (! $datum instanceof ChartDatum\ChartDatumAbstract ) {
                    throw new \UnexpectedValueException('Chart data should be an object inheriting from ChartDatumAbstract');
                }
                foreach ( $this->dateAxes as $axis => $flag ) {
                    if ( $flag ) {
                        $date = \DateTime::createFromFormat( 'm/d/Y', $datum[$axis] );
                        $datum[$axis] = $date->getTimestamp() * 1000;
                    }
                }
                        
                if ( $this->useLabels ) {
                    $dataPoints = "{$datum['x']},{$datum['y']}";
                    $this->pointLabels[$dataPoints] = $datum->getLabel();
                }
                
                $formattedData[] = $datum->getRenderData();
            }
            
            $dataArrayJs .= 'data: '.$this->makeJSArray($formattedData);
            
            if ( isset( $this->types['default'] ) && 
               ( $this->types['default'] instanceOf \Altamira\Type\Flot\Bubble
                || $this->types['default'] instanceOf \Altamira\Type\Flot\Donut ) ) {
                $dataArrayJs .= ', label: "' . str_replace('"', '\\"', $series->getTitle() ) . '"';
            }

            $this->prepOpts( $this->options['seriesStorage'][$title] );

            $opts = substr( json_encode( $this->options['seriesStorage'][$title] ), 1, -1 );

            if (strlen($opts) > 2) {
                $dataArrayJs .= ',' . $opts;
            }

            $dataArrayJs .= '}';
        }

        $dataArrayJs .= ']';

        $optionsJs = ($js = $this->getOptionsJs()) ? ", {$js}" : ', {}';

        $extraFunctionCallString = implode("\n", $this->getExtraFunctionCalls($dataArrayJs, $optionsJs));

        return sprintf( self::SCRIPT_OUTPUT, $name, $dataArrayJs, $optionsJs, $extraFunctionCallString );
    }
964208
protected function getClientScript()
    {
        if (isset($this->_clientScript)) {
            return $this->_clientScript;
        } else {
            if (!Yii::app()->hasComponent('clientScript')) {
                return false;
            }
            return $this->_clientScript = Yii::app()->getComponent('clientScript');
        }
    }
46367
public function getScript()
    {
        $sPrefix = $this->getOption('core.prefix.function');
        $sJsFunction = $this->getName();

        return $this->render('jaxon::support/function.js', array(
            'sPrefix' => $sPrefix,
            'sAlias' => $sJsFunction,
            'sFunction' => $sJsFunction, // sAlias is the same as sFunction
            'aConfig' => $this->aConfiguration,
        ));
    }
917267
public function getJsCode()
    {
        $html = '';
        foreach ($this->js as $js) {
            $html .= sprintf('<script src="%s"></script>', $js);
        }
        foreach ($this->entry as $entry) {
            $html .= sprintf('<script>System.import(\'%s\')</script>', $entry);
        }
        return $html;
    }
1031149
public function getAsString(): string
    {
        return implode(
            '_',
            array_filter([
                (string) $this->getLanguage(),
                (string) $this->getRegion(),
                (string) $this->getScript(),
            ])
        );
    }
857902
protected function getInlineJavaScript()
    {
        $show_processing_throbber = $this->show_processing_throbber
            ? 'true'
            : 'false';

        $javascript = sprintf(
            "var %s_obj = new %s('%s', %s);",
            $this->id,
            $this->getJavaScriptClass(),
            $this->id,
            $show_processing_throbber
        );

        if ($this->show_processing_throbber) {
            $javascript .= sprintf(
                "\n%s_obj.setProcessingMessage(%s);",
                $this->id,
                SwatString::quoteJavaScriptString(
                    $this->processing_throbber_message
                )
            );
        }

        if ($this->confirmation_message !== null) {
            $javascript .= sprintf(
                "\n%s_obj.setConfirmationMessage(%s);",
                $this->id,
                SwatString::quoteJavaScriptString($this->confirmation_message)
            );
        }

        return $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;
    }
1335199
protected function getScript()
    {
        if (null === $this->getScriptName()) {
            $request = $this->frontController->getRequest();
            $this->setScriptName($request->getControllerName() . DIRECTORY_SEPARATOR . $request->getActionName());
        }

        return $this->getScriptName() . '.' . $this->getViewSuffix();
    }