When doing some testing to find out about the still-persisting-q2a-header-error I had to change qa-theme-base.php, line 106
from: echo str_repeat("\t", max(0, $this->indent)).$html."\n";
to: echo $html;
The effect: HTML code does not get indented anymore. Example:
<p>test</p>
<p>indent</p>
Becomes: <p>test</p> <p>indent</p>
-
Doing so I discoverd that q2a core has not correct javascript syntax as CKEditor did not load anymore! After "disabling" the indent, Javascript could not be executed/parsed properly. Mostly because statements were not terminated by a semi-colon.
The following changes of 7 files are necessary to have correct JS syntax - I ask gidgreen to implement these corrections in v1.5.5 or v1.6:
1. qa-page-question-view.php
about line 850:
$onloads[]='document.getElementById('.qa_js($formid).').qa_show=function() { '.$captchaloadscript.' };'; // added missing ; in the end
line 855:
$onloads[]='document.getElementById('.qa_js($formid).').qa_load=function() { '.$editor->load_script('a_content').' };'; // added missing ; in the end
line 872:
$onloads[]='document.getElementById('.qa_js($formid).').qa_focus=function() { '.$editor->focus_script('a_content').' };'; // added missing ; in the end
about line 976:
$onloads[]='document.getElementById('.qa_js($formid).').qa_show=function() { '.$captchaloadscript.' };'; // added missing ; in the end
line 981:
$onloads[]='document.getElementById('.qa_js($formid).').qa_load=function() { '.$editor->load_script($prefix.'content').' };'; // added missing ; in the end
line 983:
$onloads[]='document.getElementById('.qa_js($formid).').qa_focus=function() { '.$editor->focus_script($prefix.'content').' };'; // added missing ; in the end
2. qa-page-question.php
line 246:
"qa_element_revealed=document.getElementById('anew');" // added missing ;
3. qa-page.php
line 271: $script=array('<SCRIPT TYPE="text/javascript"><!--');
to: $script=array('<SCRIPT TYPE="text/javascript">'); // removed <!--
line 311: $script[]='//--></SCRIPT>';
to: $script[]='</SCRIPT>'; // removed: //-->
line 297+298:
"\tif (typeof qa_oldonload=='function')",
"\t\tqa_oldonload();"
to: "\tif (typeof qa_oldonload=='function') {",
"\t\tqa_oldonload(); }" // added {}
4. qa-theme-base.php
about line 330: '<SCRIPT TYPE="text/javascript"><!--',
to: '<SCRIPT TYPE="text/javascript">', // removed <!--
line 333:
to: '</SCRIPT>' // removed //--></SCRIPT>
5. qa-app-format.php
line 1167: $funcscript[]="};"; // added missing ;
6. qa-recaptcha-captcha.php
line 123 (line after "\tlang:".qa_js($language),):
"};", // added missing ;
7. qa-wysiwyg-editor.php
about line 184 / line after: ($uploadall ? (", filebrowserUploadUrl:".qa_js(qa_path('wysiwyg-editor-upload'))) : "").
"};" // added missing ;
Just after those changes Javascript could be parsed correctly, even on one line.
It is important to note that in JS functions do not need to be determined by semi-colon, however, the lines above are statements: var x = function() {...}; and not functions.