Warning: this is a proposal, and references code not yet pushed in the main repository. Current scripts and tools can be found on the statistics GSoC branch, the following are links to provisional refactored code in melange.js and melange.graph.js
To run jsLint and check melange.js and melange.graph.js files, you need java installed in your local computer, just run
scripts/ directory. The check is based on a slightly modified source of jsLint rhino version. Following the defaults:
bitwise:false, eqeqeq:true, immed:true, laxbreak:false, newcap:false, nomen:false, onevar:false, plusplus:false, regexp:false, browser:true, undef:true, white:true, indent:2, predef:['window','jQuery','google']
Provisional tests for melange.js and melange.graph.js can be found in
To run jsUnit, you need to point your browser to this file:
In the input line that will be shown, insert the path (URL style) of
starting from your root directory. Then you just need to click “Run”, and it will run the test against the code. Fill free to set “Test level” to “debug (highest)” to see more details.
To work, jsCoverage needs to modify the source code of the scripts to “instrument” it. As the code will be modified and copied to another directory, also tests that points to the former code needs to be redirected to point to the instrumented code. This could be avoided by moving the original code to another directory first, but, at the moment, it just keeps things as they are.
So, to instrument the code and modify the melange.tests.html file just run
It will create a
./app/soc/content/js_coverage directory and will modify, as said,
slot-allocator-090320.js, because it seems not to be compatible for some reasons.
Then you just need to run jsUnit as described above, and click on the “JSCoverage” button. In that way, you can see the code lines covered by the tests.
After this, you need to rollback the previous changes, by running
It will delete the
./app/soc/content/js_coverage directory and rollback the changes in
JSDocToolkit is present under
It will generate a directory
and two subdirectories under it, called
public directory will also ignore undocumented files, which can lead to incorrect output.
To run shrinksafe, which is in
./thirdparty/shrinksafe directory, just run
It will generate a
subdirectory, in which you can find all minified files, postfixed with a “min.js”.
This is just a test to see if it would be of any use to us.
In any way, we need:
sprintf() or begin to use jQuery Template plugin.
jQuery.noConflict() (after loading any library/plugin) and giving jQuery a different namespace like
$j to avoid conflicts if we ever want to integrate other libraries (
$ namespace is very well overused)
The proposal is to create a
melange namespace and begin adding sub-namespace to it for every feature we need. We might want to add
templates subdirectories to the
content/js as well, to keep an homogeneous structure with the python code.