SN.V.xhrTimeout = [time in milliseconds];
},
V: { // Variables
+ // These get set on runtime via inline scripting, so don't put anything here.
},
/**
form.ajaxForm({
dataType: 'xml',
- timeout: '60000',
+ timeout: SN.V.xhrTimeout,
beforeSend: function (formData) {
if (form.find('.notice_data-text:first').val() == '') {
form.addClass(SN.C.S.Warning);
if (Event::handle('StartScriptVariables', array($this, &$vars))) {
$vars['urlNewNotice'] = common_local_url('newnotice');
+ $vars['xhrTimeout'] = ini_get('max_execution_time')*1000; // milliseconds
+ Event::handle('EndScriptVariables', array($this, &$vars));
}
- if (!empty($vars)) {
- $this->inlineScript('SN.V = ' . json_encode($vars));
- }
+
+ $this->inlineScript('SN.V = ' . json_encode($vars) . ';');
+
return $vars;
}