Compare commits

..

No commits in common. "442a7aa235f6a9d21385570255a06bf6cfc3539f" and "00a74ed96ad4a08f3c98ddb8c64fa3b4ce506b86" have entirely different histories.

5 changed files with 820 additions and 898 deletions

View file

@ -33,10 +33,7 @@ export default class extends Controller {
{
let value = "";
if (this.unitValue) {
//Escape percentage signs
value = this.inputTarget.value.replace(/%/g, '\\%');
value = "\\mathrm{" + value + "}";
value = "\\mathrm{" + this.inputTarget.value + "}";
} else {
value = this.inputTarget.value;
}

View file

@ -85,9 +85,7 @@ export default class extends Controller
tmp += '<span>' + katex.renderToString(data.symbol) + '</span>'
}
if (data.unit) {
let unit = data.unit.replace(/%/g, '\\%');
unit = "\\mathrm{" + unit + "}";
tmp += '<span class="ms-2">' + katex.renderToString('[' + unit + ']') + '</span>'
tmp += '<span class="ms-2">' + katex.renderToString('[' + data.unit + ']') + '</span>'
}

896
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -217,7 +217,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
$str = '';
$bracket_opened = false;
if ($this->value_typical !== null) {
if ($this->value_typical) {
$str .= $this->getValueTypicalWithUnit($latex_formatted);
if ($this->value_min || $this->value_max) {
$bracket_opened = true;
@ -225,11 +225,11 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
}
}
if ($this->value_max !== null && $this->value_min !== null) {
if ($this->value_max && $this->value_min) {
$str .= $this->getValueMinWithUnit($latex_formatted).' ... '.$this->getValueMaxWithUnit($latex_formatted);
} elseif ($this->value_max !== null) {
} elseif ($this->value_max) {
$str .= 'max. '.$this->getValueMaxWithUnit($latex_formatted);
} elseif ($this->value_min !== null) {
} elseif ($this->value_min) {
$str .= 'min. '.$this->getValueMinWithUnit($latex_formatted);
}
@ -449,10 +449,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
if (!$with_latex) {
$unit = $this->unit;
} else {
//Escape the percentage sign for convenience (as latex uses it as comment and it is often used in units)
$escaped = preg_replace('/\\\\?%/', "\\\\%", $this->unit);
$unit = '$\mathrm{'.$escaped.'}$';
$unit = '$\mathrm{'.$this->unit.'}$';
}
return $str.' '.$unit;
@ -460,7 +457,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
return $str;
}
/**
* Returns the class of the element that is allowed to be associated with this attachment.
* @return string

798
yarn.lock

File diff suppressed because it is too large Load diff