<commit_before>Guidelines
==========

* Use **4 space intendation** and **not** tabs
* Use camelCase for variables and **not** underscores or dashes
* Use **dott** annotation ``.`` for javascript file naming
* Use **single-quotes** ``'`` for **all** values
* Use ``base.js`` for global and general functions and avoid adding js files to the root
* Use the frameworks prefix inside the ``addons`` folder
* Use the singleton pattern to structure code
* JavaScript should validate JS Lint
* Use full words instead of shorthands like ``number`` instead of ``nr``
* Keep <script> and the following starting enclosure on the same level
* Separate all script tags within a ``{% addtoblock "js" %}``
* Do not add spaces when writing ``if(true) {} else {}`` or ``function helloWorld() {}``
* Always use semicolons and full brackets except shortcuts like ``var i = (true) ? 'yes' : 'no';`` or single lines ``if(index <= 0) index = 0;``
* Never use $ for variable names like ``var $el = $('.el');``
* Ensure that JavaScript widgets don't create distrubances while the dom is loading
* Please make sure that & has a character reference like "&amp;"


Example
*******

.. code-block:: javascript

    <script>
    jQuery(document).ready(function () {

        var Cl.MyApp = {
            load: function {<commit_msg>added guideline additions to js<commit_after>Guidelines
==========

* Use **4 space intendation** and **not** tabs
* Use camelCase for variables and **not** underscores or dashes
* Use **dott** annotation ``.`` for javascript file naming
* Use **single-quotes** ``'`` for **all** values
* Use ``base.js`` for global and general functions and avoid adding js files to the root
* Use the frameworks prefix inside the ``addons`` folder
* Use the singleton pattern to structure code
* JavaScript should validate JS Lint
* Use full words instead of shorthands like ``number`` instead of ``nr``
* Keep <script> and the following starting enclosure on the same level
* Separate all script tags within a ``{% addtoblock "js" %}``
* Do not add spaces when writing ``if (true) {} else {}`` or ``function helloWorld() {}``
* Always use semicolons and full brackets except shortcuts like ``var i = (true) ? 'yes' : 'no';`` or single lines ``if(index <= 0) index = 0;``
* Never use $ for variable names like ``var $el = $('.el');``
* Ensure that JavaScript widgets don't create distrubances while the dom is loading
* Please make sure that & has a character reference like "&amp;"

Additionally follow the "Code Conventions for the JavaScript Programming Language": http://javascript.crockford.com/code.html


Example
*******

.. code-block:: javascript

    <script>
    jQuery(document).ready(function () {

        var Cl.MyApp = {
            load: function {
{'fraction_non_alphanumeric': 0.13507625272331156, 'fraction_numerical': 0.002178649237472767, 'mean_word_length': 4.318532818532819, 'pattern_counts': {'":': 1, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3196877', 'n_tokens_mistral': 783, 'n_tokens_neox': 726, 'n_words': 348}