\r
// extra javascript for input and textarea fields\r
function parse_jsinput($which) {\r
- global $CONF;\r
- ?>\r
- name="<?php echo $which?>"\r
- id="input<?php echo $which?>"\r
- <?php\r
+ global $CONF, $member;\r
+ \r
+ $attributes = " name=\"{$which}\"";\r
+ $attributes .= " id=\"input{$which}\"";\r
+ \r
if ($CONF['DisableJsTools'] != 1) {\r
- ?>\r
- onkeyup="storeCaret(this); updPreview('<?php echo $which?>'); doMonitor();"\r
- onclick="storeCaret(this);"\r
- onselect="storeCaret(this);"\r
-\r
- <?php\r
- }\r
- else if ($CONF['DisableJsTools'] == 0) {\r
- ?>\r
- onkeyup="doMonitor();"\r
- onkeypress="shortCuts();"\r
- <?php\r
+ $attributes .= ' onclick="storeCaret(this);"';\r
+ $attributes .= ' onselect="storeCaret(this);"';\r
+ if ($member->getAutosave()) {\r
+ $attributes .= " onkeyup=\"storeCaret(this); updPreview('{$which}'); doMonitor();\"";\r
+ } else {\r
+ $attributes .= " onkeyup=\"storeCaret(this); updPreview('{$which}');\"";\r
+ }\r
}\r
else {\r
- ?>\r
- onkeyup="doMonitor();"\r
- <?php\r
+ if ($CONF['DisableJsTools'] == 0) {\r
+ $attributes .= ' onkeypress="shortCuts();"';\r
+ }\r
+ if ($member->getAutosave()) {\r
+ $attributes .= ' onkeyup="doMonitor();"';\r
+ }\r
}\r
+ echo $attributes;\r
}\r
\r
// shows the javascript button bar\r