PtrNrs
Member
Problem: It is difficult to debug Fabrik JS code (in Firebug or similar) because the newline characters are removed and the whole code is presented as one line (was that the same in Fabrik 2.x?)
Suggestion: That the custom JS code be expanded (re-expanded?) when in Fabrik debug mode (fabrikdebug=1).
Stop gap solution (eg for databasejoin element): In databasejoin.js, edit the function addNewEventAux to replace the code
with
thus reappending a newline character to all semicolons & closing curly brackets. Not perfect, but allows debugging. As the edit is only done in databasejoin.js not databasejoin-min.js, this code only runs when fabrikdebug=1.
I realise that editing of the expanded js file and not the compressed js file is not viable as the latter is created from the former.
Suggested solution: I can't work out where it's happening, but somewhere newlines are being removed from the code field in #__fabrik_jsactions before being inserted into the page HTML. Is it possible not to remove newlines when fabrikdebug=1?
Suggestion: That the custom JS code be expanded (re-expanded?) when in Fabrik debug mode (fabrikdebug=1).
Stop gap solution (eg for databasejoin element): In databasejoin.js, edit the function addNewEventAux to replace the code
Code:
(typeOf(js) === 'function') ? js.delay(0, this, this) : eval(js);
Code:
js1 = js.replace (/;/g, ';\n').replace (/}/g, '}\n');
(typeOf(js) === 'function') ? js.delay(0, this, this) : eval(js1);
I realise that editing of the expanded js file and not the compressed js file is not viable as the latter is created from the former.
Suggested solution: I can't work out where it's happening, but somewhere newlines are being removed from the code field in #__fabrik_jsactions before being inserted into the page HTML. Is it possible not to remove newlines when fabrikdebug=1?