<dd>
<div dir="ltr">
<textarea id="individualScssCustom" rows="20" cols="40" name="individualScssCustom">{$variables[individualScssCustom]}</textarea>
+ <input class="codeMirrorScrollOffset" name="scrollOffsets[individualScssCustom]" value="{if $scrollOffsets[individualScssCustom]|isset}{$scrollOffsets[individualScssCustom]}{else}0{/if}" type="hidden">
</div>
<small>{lang}wcf.acp.style.advanced.individualScss.description{/lang}</small>
</dd>
<dd>
<div dir="ltr">
<textarea id="overrideScssCustom" rows="20" cols="40" name="overrideScssCustom">{$variables[overrideScssCustom]}</textarea>
+ <input class="codeMirrorScrollOffset" name="scrollOffsets[overrideScssCustom]" value="{if $scrollOffsets[overrideScssCustom]|isset}{$scrollOffsets[overrideScssCustom]}{else}0{/if}" type="hidden">
</div>
{if $errorField == 'overrideScssCustom'}
<small class="innerError">
<dd>
<div dir="ltr">
<textarea id="individualScss" rows="20" cols="40" name="individualScss">{$variables[individualScss]}</textarea>
+ <input class="codeMirrorScrollOffset" name="scrollOffsets[individualScss]" value="{if $scrollOffsets[individualScss]|isset}{$scrollOffsets[individualScss]}{else}0{/if}" type="hidden">
</div>
<small>{lang}wcf.acp.style.advanced.individualScss.description{/lang}</small>
</dd>
<dd>
<div dir="ltr">
<textarea id="overrideScss" rows="20" cols="40" name="overrideScss">{$variables[overrideScss]}</textarea>
+ <input class="codeMirrorScrollOffset" name="scrollOffsets[overrideScss]" value="{if $scrollOffsets[overrideScss]|isset}{$scrollOffsets[overrideScss]}{else}0{/if}" type="hidden">
</div>
{if $errorField == 'overrideScss'}
<small class="innerError">
use wcf\system\language\I18nHandler;
use wcf\system\Regex;
use wcf\system\WCF;
+use wcf\util\ArrayUtil;
use wcf\util\DateUtil;
use wcf\util\FileUtil;
use wcf\util\StringUtil;
*/
public $specialVariables = [];
+ /**
+ * current scroll offsets before submitting the form
+ * @var integer[]
+ */
+ public $scrollOffsets = [];
+
/**
* @inheritDoc
*/
if (isset($_POST['styleVersion'])) $this->styleVersion = StringUtil::trim($_POST['styleVersion']);
if (isset($_POST['templateGroupID'])) $this->templateGroupID = intval($_POST['templateGroupID']);
if (isset($_POST['apiVersion']) && in_array($_POST['apiVersion'], Style::$supportedApiVersions)) $this->apiVersion = $_POST['apiVersion'];
+
+ // codemirror scroll offset
+ if (isset($_POST['scrollOffsets']) && is_array($_POST['scrollOffsets'])) $this->scrollOffsets = ArrayUtil::toIntegerArray($_POST['scrollOffsets']);
}
/**
'tmpHash' => $this->tmpHash,
'variables' => $this->variables,
'supportedApiVersions' => Style::$supportedApiVersions,
- 'newVariables' => $this->newVariables
+ 'newVariables' => $this->newVariables,
+ 'scrollOffsets' => $this->scrollOffsets,
]);
}