Gets the inline JavaScript required for this check-all row

@return string the inline JavaScript required for this check-all row.

@see SwatTableViewRow::getInlineJavaScript()
549368
public function getInlineJavaScript()
    {
        if (count($this->view->model) < 2) {
            return '';
        }

        // set the controller of the check-all widget
        return sprintf(
            "%s_obj.setController(%s);",
            $this->check_all->id,
            $this->list_id
        );
    }
661954
public function getHtml()
    {
        $html = array();
        
        if (count($this->m_trendlines) > 0)
        {
            $this->m_options['trendlines'] = json_decode(json_encode($this->m_trendlines, JSON_FORCE_OBJECT)); 
        }
        
        # debug hacks
        $this->m_options['seriesType'] = 'lines';
        $chartType = "ScatterChart"; # LineChart
        
        $html[] = "var data = google.visualization.arrayToDataTable(" . json_encode($this->m_data, JSON_PRETTY_PRINT) . ");";
        $html[] = "var options = " . json_encode($this->m_options) . ";";
        $html[] = "var chart = new google.visualization." . $chartType . "(document.getElementById('" . $this->m_anchorId . "'));";
        
        if ($this->m_clickHandler != null)
        {
            $html[] = "google.visualization.events.addListener(chart, 'click', " . $this->m_clickHandler . ");";
        }
        
        if ($this->m_selectHandler != null)
        {
            $html[] = "google.visualization.events.addListener(chart, 'select', " . $this->m_selectHandler . ");";
        }
        
        $html[] = "chart.draw(data, options);";
        
        return implode(PHP_EOL, $html);
    }
947361
public function getJavascriptOptions() {
        $out = $this->_options['javascriptOptions'];
        $out['options'] = base64_encode(serialize(array(
            'pageSize' => $this->_options['pageSize'],
            'viewPath' => $this->_options['viewPath'],
            'filters'  => $this->getFilters()
        )));
        return $out;
    }
537028
public function getScript()
    {
        $sJsCode = '';
        switch($this->sType)
        {
        case Jaxon::FORM_VALUES:
            $sJsCode = $this->getJsCall('getFormValues', $this->xValue);
            break;
        case Jaxon::INPUT_VALUE:
            $sJsCode = $this->getJsCall('$', $this->xValue) . '.value';
            break;
        case Jaxon::CHECKED_VALUE:
            $sJsCode = $this->getJsCall('$', $this->xValue) . '.checked';
            break;
        case Jaxon::ELEMENT_INNERHTML:
            $sJsCode = $this->getJsCall('$', $this->xValue) . '.innerHTML';
            break;
        case Jaxon::QUOTED_VALUE:
            $sJsCode = $this->getQuotedValue(addslashes($this->xValue));
            break;
        case Jaxon::BOOL_VALUE:
            $sJsCode = ($this->xValue) ? 'true' : 'false';
            break;
        case Jaxon::PAGE_NUMBER:
            $sJsCode = (string)$this->xValue;
            break;
        case Jaxon::NUMERIC_VALUE:
            $sJsCode = (string)$this->xValue;
            break;
        case Jaxon::JS_VALUE:
            if(is_array($this->xValue) || is_object($this->xValue))
            {
                // Unable to use double quotes here because they cannot be handled on client side.
                // So we are using simple quotes even if the Json standard recommends double quotes.
                $sJsCode = str_replace(['"'], ["'"], json_encode($this->xValue, JSON_HEX_APOS | JSON_HEX_QUOT));
            }
            else
            {
                $sJsCode = (string)$this->xValue;
            }
            break;
        }
        return $sJsCode;
    }
52515
public function toJavaScript()
    {
        $lines = [];

        foreach (get_object_vars($this) as $key => $value) {
            if (!is_null($value)) {
                $line = $key . ": ";

                if ($key == 'version') {
                    $line .= 'new Version({ ' . $value->toJavaScript() . ' })';
                } elseif ($key == 'family') {
                    $line .= 'new Family({ ' . $value->toJavaScript() . ' })';
                } elseif ($key == 'using') {
                    $line .= 'new Using({ ' . $value->toJavaScript() . ' })';
                } else {
                    switch (gettype($value)) {
                        case 'boolean':
                            $line .= $value ? 'true' : 'false';
                            break;
                        case 'string':
                            $line .= '"' . addslashes($value) . '"';
                            break;
                        case 'integer':
                            $line .= $value;
                            break;
                    }
                }

                $lines[] = $line;
            }
        }

        return implode($lines, ", ");
    }
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();
	}
1030161
function getValidationScript()
    {
        if (empty($this->_rules) || empty($this->_attributes['onsubmit'])) {
            return '';
        }

        include_once('HTML/QuickForm/RuleRegistry.php');
        $registry =& HTML_QuickForm_RuleRegistry::singleton();
        $test = array();
        $js_escape = array(
            "\r"    => '\r',
            "\n"    => '\n',
            "\t"    => '\t',
            "'"     => "\\'",
            '"'     => '\"',
            '\\'    => '\\\\'
        );

        foreach ($this->_rules as $elementName => $rules) {
            foreach ($rules as $rule) {
                if ('client' == $rule['validation']) {
                    unset($element);

                    $dependent  = isset($rule['dependent']) && is_array($rule['dependent']);
                    $rule['message'] = strtr($rule['message'], $js_escape);

                    if (isset($rule['group'])) {
                        $group    =& $this->getElement($rule['group']);
                        // No JavaScript validation for frozen elements
                        if ($group->isFrozen()) {
                            continue 2;
                        }
                        $elements =& $group->getElements();
                        foreach (array_keys($elements) as $key) {
                            if ($elementName == $group->getElementName($key)) {
                                $element =& $elements[$key];
                                break;
                            }
                        }
                    } elseif ($dependent) {
                        $element   =  array();
                        $element[] =& $this->getElement($elementName);
                        foreach ($rule['dependent'] as $elName) {
                            $element[] =& $this->getElement($elName);
                        }
                    } else {
                        $element =& $this->getElement($elementName);
                    }
                    // No JavaScript validation for frozen elements
                    if (is_object($element) && $element->isFrozen()) {
                        continue 2;
                    } elseif (is_array($element)) {
                        foreach (array_keys($element) as $key) {
                            if ($element[$key]->isFrozen()) {
                                continue 3;
                            }
                        }
                    }

                    $test[] = $registry->getValidationScript($element, $elementName, $rule);
                }
            }
        }
        if (count($test) > 0) {
            return
                "\n<script type=\"text/javascript\">\n" .
                "//<![CDATA[\n" .
                "function validate_" . $this->_attributes['id'] . "(frm) {\n" .
                "  var value = '';\n" .
                "  var errFlag = new Array();\n" .
                "  var _qfGroups = {};\n" .
                "  _qfMsg = '';\n\n" .
                join("\n", $test) .
                "\n  if (_qfMsg != '') {\n" .
                "    _qfMsg = '" . strtr($this->_jsPrefix, $js_escape) . "' + _qfMsg;\n" .
                "    _qfMsg = _qfMsg + '\\n" . strtr($this->_jsPostfix, $js_escape) . "';\n" .
                "    alert(_qfMsg);\n" .
                "    return false;\n" .
                "  }\n" .
                "  return true;\n" .
                "}\n" .
                "//]]>\n" .
                "</script>";
        }
        return '';
    }
350813
public function getJavascriptValue()
    {
        $args = array();
        foreach ($this as $child) {
            if ($child instanceof HTML_QuickForm2_Container) {
                $args[] = $child->getJavascriptValue();
            } else {
                $args[] = "'" . $child->getId() . "'";
            }
        }
        return 'qf.form.getContainerValue(' . implode(', ', $args) . ')';
    }
998038
public function generateConditionalJavascript()
    {
        $rules = '';
        $form = $this->data();
        if (!$form) {
            return;
        }
        $formFields = $form->Fields();

        $watch = [];

        if ($formFields) {
            /** @var EditableFormField $field */
            foreach ($formFields as $field) {
                if ($result = $field->formatDisplayRules()) {
                    $watch[] = $result;
                }
            }
        }
        if ($watch) {
            $rules .= $this->buildWatchJS($watch);
        }

        // Only add customScript if $default or $rules is defined
        if ($rules) {
            Requirements::customScript(<<<JS
                (function($) {
                    $(document).ready(function() {
                        {$rules}
                    });
                })(jQuery);
JS
            , 'UserFormsConditional-' . $form->ID);
        }
    }
886656
public function getScript() {
		$jsCode="$('".$this->attachTo." a').click(function (event) { event.preventDefault();$(this).tab('show');});";
		$this->jquery_code_for_compile []=$jsCode;
		$this->compileEvents();
		return $this->compileJQueryCode();
	}
1162907
protected function getInlineJavaScript()
    {
        $javascript = parent::getInlineJavaScript();

        $colors = "'" . implode("', '", $this->colors) . "'";

        if ($this->none_option) {
            $none_option =
                $this->none_option_title === null
                    ? 'null'
                    : SwatString::quoteJavaScriptString(
                        $this->none_option_title
                    );
        } else {
            $none_option = 'null';
        }

        $js_class_name = $this->getJavaScriptClassName();

        $javascript .=
            "\nvar {$this->id}_obj = new {$js_class_name}(" .
            "'{$this->id}', [{$colors}], {$none_option});\n";

        return $javascript;
    }
1042663
public function generateAndIncludeJavaScript()
    {
        $filePath = $this->assetHandlerConnectorManager->getFormzGeneratedFilePath() . '.js';

        $this->assetHandlerConnectorManager->createFileInTemporaryDirectory(
            $filePath,
            function () {
                return
                    // Form initialization code.
                    $this->getFormInitializationJavaScriptAssetHandler()
                        ->getFormInitializationJavaScriptCode() .
                    LF .
                    // Fields validation code.
                    $this->getFieldsValidationJavaScriptAssetHandler()
                        ->getJavaScriptCode() .
                    LF .
                    // Fields activation conditions code.
                    $this->getFieldsActivationJavaScriptAssetHandler()
                        ->getFieldsActivationJavaScriptCode() .
                    LF .
                    // Fields validation activation conditions code.
                    $this->getFieldsValidationActivationJavaScriptAssetHandler()
                        ->getFieldsValidationActivationJavaScriptCode();
            }
        );

        $this->includeJsFile(StringService::get()->getResourceRelativePath($filePath));

        return $this;
    }
1074050
public function getScript() : ?string 
    {
        if ( ! $this->hasScript()) {
            $this->setScript($this->getDefaultScript());
        }
        return $this->script;
    }
1364990
protected function getInlineJavaScriptTranslations()
    {
        $close_text =
            $this->close_text === null ? Swat::_('Close') : $this->close_text;

        return sprintf(
            "SwatImagePreviewDisplay.close_text = '%s';\n",
            $close_text
        );
    }
793899
protected function getInlineJavaScript()
    {
        $use_current_date = $this->use_current_date ? 'true' : 'false';

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

        if ($this->display_parts & self::DAY) {
            $day_flydown = $this->getCompositeWidget('day_flydown');

            $lookup_days = array();
            foreach ($day_flydown->options as $key => $option) {
                $lookup_days[] = sprintf(
                    '%s: %s',
                    $option->value,
                    $day_flydown->show_blank ? $key + 1 : $key
                );
            }

            $javascript .= sprintf(
                "\n%s_obj.addLookupTable('day', {%s});",
                $this->id,
                implode(', ', $lookup_days)
            );
        }

        if ($this->display_parts & self::MONTH) {
            $month_flydown = $this->getCompositeWidget('month_flydown');

            $lookup_months = array();
            foreach ($month_flydown->options as $key => $option) {
                $lookup_months[] = sprintf(
                    '%s: %s',
                    $option->value,
                    $month_flydown->show_blank ? $key + 1 : $key
                );
            }

            $javascript .= sprintf(
                "\n%s_obj.addLookupTable('month', {%s});",
                $this->id,
                implode(', ', $lookup_months)
            );
        }

        if ($this->display_parts & self::YEAR) {
            $year_flydown = $this->getCompositeWidget('year_flydown');

            $lookup_years = array();
            foreach ($year_flydown->options as $key => $option) {
                $lookup_years[] = sprintf(
                    '%s: %s',
                    $option->value,
                    $year_flydown->show_blank ? $key + 1 : $key
                );
            }

            $javascript .= sprintf(
                "\n%s_obj.addLookupTable('year', {%s});",
                $this->id,
                implode(', ', $lookup_years)
            );
        }

        if ($this->display_parts & self::TIME) {
            $javascript .= sprintf(
                "\n%s_obj.setTimeEntry(%s_time_entry_obj);",
                $this->id,
                $this->id
            );
        }

        if ($this->display_parts & self::CALENDAR) {
            $javascript .= sprintf(
                "\n%s_obj.setCalendar(%s_calendar_obj);",
                $this->id,
                $this->id
            );
        }

        return $javascript;
    }
217070
protected function getInlineJavaScript()
    {
        static $shown = false;

        if (!$shown) {
            $javascript = $this->getInlineJavaScriptTranslations();
            $shown = true;
        } else {
            $javascript = '';
        }

        $values = array();
        if ($this->show_blank) {
            $values[] = "''";
        }

        foreach ($this->action_items as $item) {
            if ($item->visible) {
                $values[] = SwatString::quoteJavaScriptString($item->id);
            }
        }

        $selected_value =
            $this->selected === null
                ? 'null'
                : SwatString::quoteJavaScriptString($this->selected->id);

        $javascript .= sprintf(
            "var %s_obj = new SwatActions(%s, [%s], %s);",
            $this->id,
            SwatString::quoteJavaScriptString($this->id),
            implode(', ', $values),
            $selected_value
        );

        if ($this->view !== null && $this->selector !== null) {
            $javascript .= sprintf(
                "\n%s_obj.setViewSelector(%s, '%s');",
                $this->id,
                $this->view->id,
                $this->selector->getId()
            );
        }

        return $javascript;
    }
26276
protected function getJavascriptSearchPart()
    {
        if (!$this->individualColumnFiltering) {
            return '';
        }
        $js = 'var '.$this->tableName.'Api = '.$this->tableName.'.api(true);'."\n"
            .'$("#'.$this->tableName.' tfoot th").each( function(colI) {'."\n"
                .'$(".sSearch", this).on("keyup change", function (e) {'."\n"
                .($this->isServerSide() ? '    if ( e.keyCode == 13 ) {'."\n" : '')
                .'        '.$this->tableName.'Api.column( colI ).search('
                .'            '.($this->renderFilterOperators ? '( this.tagName != "INPUT" ||  this.value == \'\' ? \'\' : $(this).prev().find("select").val()) + this.value ' : ' this.value ')
                .'        ).draw();'."\n"
                .($this->isServerSide() ? '    }'."\n" : '')
                .'});'."\n"
            .'});'."\n";

        return $js;
    }