<commit_before>Vellum
======

Vellum is an [XForm](http://en.wikipedia.org/wiki/XForms) designer built by
[Dimagi][0] for [CommCare HQ][1].

 [0]: http://www.dimagi.com
 [1]: http://www.commcarehq.org

Setup
-----

Vellum expects jQuery, Underscore.js, and Twitter Bootstrap (version 2.2.2) to
be present.   It also expects `SaveButton` from CommCare HQ
([link](https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/hqwebapp/static/hqwebapp/js/main.js))
to be present, or you can use the version included in `js/`, which may be out of
date.

All other dependencies are bundled in `dist/vellum.min.js` and
`dist/vellum.css`.

You'll need to change line 39 in `css/jquery.fancybox-1.3.4.css` to the URL that
points to fancybox.png, and re-run the grunt tasks.

Usage
-----

    formdesigner.launch({
        rootElement: "#formdesigner",
        staticPrefix: "",
        langs: ""
    });

formdesigner.launch causes the formdesigner to initialize itself fully in the
element specified by rootElement.

Form Options:
* rootElement: "jQuery selector to FD Container",
* staticPrefix : "url prefix for static resources like css and pngs",
* saveUrl : "URL that the FD should post saved forms to",
* [form] : "string of the xml form that you wish to load"
* [formName] : "Default Form Name"

Testing
-------

Install PhantomJS from NPM:<commit_msg>add note about tests to README<commit_after>Vellum
======

Vellum is an [XForm](http://en.wikipedia.org/wiki/XForms) designer built by
[Dimagi][0] for [CommCare HQ][1].

 [0]: http://www.dimagi.com
 [1]: http://www.commcarehq.org

Setup
-----

Vellum expects jQuery, Underscore.js, and Twitter Bootstrap (version 2.2.2) to
be present.   It also expects `SaveButton` from CommCare HQ
([link](https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/hqwebapp/static/hqwebapp/js/main.js))
to be present, or you can use the version included in `js/`, which may be out of
date.

All other dependencies are bundled in `dist/vellum.min.js` and
`dist/vellum.css`.

You'll need to change line 39 in `css/jquery.fancybox-1.3.4.css` to the URL that
points to fancybox.png, and re-run the grunt tasks.

Usage
-----

    formdesigner.launch({
        rootElement: "#formdesigner",
        staticPrefix: "",
        langs: ""
    });

formdesigner.launch causes the formdesigner to initialize itself fully in the
element specified by rootElement.

Form Options:
* rootElement: "jQuery selector to FD Container",
* staticPrefix : "url prefix for static resources like css and pngs",
* saveUrl : "URL that the FD should post saved forms to",
* [form] : "string of the xml form that you wish to load"
* [formName] : "Default Form Name"

Testing
-------

### Running tests manually

```
$ python -m SimpleHTTPServer
$ chromium-browser js/tests/runner.html
```

### Running tests headlessly (currently broken)

Install PhantomJS from NPM:
{'fraction_non_alphanumeric': 0.12760778859527122, 'fraction_numerical': 0.008344923504867872, 'mean_word_length': 3.739703459637562, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, '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': '7400853', 'n_tokens_mistral': 963, 'n_tokens_neox': 917, 'n_words': 321}