Topic: [javascript bug +fix] front accounting 2.2.8

i think i've found bug,on javascript function,prevent normal operation.
first,
frontaccount\includes\ui\ui_view.inc
line 1102 - 1103
replace code:
          table += \"<td><a class='\"+css_class+\"' href=\\\'javascript:setCCDate(\"+currentYear+\",\"+currentMonth+\",\"+dayOfMonth+\")\\\'>\"+dayOfMonth+\"</a></td>\";
          dayOfMonth++;

second,
javascript compressor malfunction(?), using file xajaxCompress.php from xajaxproject.org
temporary,disable js_compress function in:
frontaccount\includes\main.inc
function cache_js_file($fpath, $text)
{
    global $go_debug;
           //disable javascript compress
    //if(!$go_debug) $text = js_compress($text);

        $file = fopen($fpath, 'w');
    if (!$file) return false;
    if (!fwrite($file, $text)) return false;
    return fclose($file);
}

Re: [javascript bug +fix] front accounting 2.2.8

Just a nonsense.

If you think you have found a bug do not give advice to other users how to hide the problem, but please explain what is the problem instead.

Janusz

Re: [javascript bug +fix] front accounting 2.2.8

ok Janusz, here where problem arise.

file: /includes/main.inc
line 230 - 231, this part of function js_compress($sJS)

    //remove comments
    $line = preg_replace("/\/\/(.*)/","",$line);

and file: /js/JsHttpRequest.js
line 463
       if (this.url.match(new RegExp('^([a-z]+://[^\\/]+)(.*)((:[0-9]*)+)', 'i'))) {

see after bold text.
this regex command will treated as remark, and removed after process in line 231 from file /includes/main.inc, like this:
if (this.url.match(new RegExp('^([a-z]+:

Re: [javascript bug +fix] front accounting 2.2.8

No, the compressing function works just right, because in the algorithm  all literal strings (in single or double quotes) are temporary superseded by markers  before removing comments, then the strings are restored.

Therefore if you have any problem here, this is probably due to your customizations. Just look into our 2.2.8 demo server which simply works as it should.
Janusz