Skip to content

mwhite/Vellum

 
 

Repository files navigation

Vellum

Build Status Build Status

Vellum is a JavaRosa XForm designer used in CommCare HQ.

Image courtesy of the ReMIND project.

Usage

Download and extract the latest optimized build from here.

$ cd path/to/vellum
$ wget https://drone.io/github.com/mwhite/Vellum/files/vellum.tar.gz
$ tar -xzf vellum.tar.gz

Then load it on a page using RequireJS, optionally with an existing jQuery instance:

<link rel="stylesheet" href="path/to/bootstrap.css"></link>

<!-- 
Optionally reuse existing jQuery instance with jQuery UI and Bootstrap.  
If not present, bundled versions will be loaded.  
If Bootstrap is already loaded but not jQuery UI, you'll get conflicts between
multiple Bootstrap versions due to the way the bundled version is loaded. -->
<script src="jquery.js"></script>
<script src="jquery-ui.js"></script>
<script src="bootstrap.js"></script>

<script src="require.js"></script>
<script>
    require.config({
        packages: [
            {
                name: 'jquery.vellum',
                location: "/path/to/vellum/src",
                main: 'main.js'
            }
        ]
    });

    require(["jquery.vellum/require-config"], function () {
        require(["jquery", "jquery.vellum"], function ($) {
            $(function () {
                $('#some_div').vellum(VELLUM_OPTIONS);
            });
        });
    });
</script>

See here and tests/main.js for example options usage.

Vellum targets modern browsers. IE8 and earlier are not supported.

Contributing

Follow the Airbnb JavaScript Style Guide.

Install dependencies:

$ npm install

Build optimized version (test locally by changing useBuilt in tests/main.js):

$ make

Test in a browser:

$ `npm bin`/http-server
$ chromium-browser http://localhost:8080

By default, the test page will load the non-built version on 'localhost' and the built version otherwise. Append ?built or ?async to the URL to override this behavior.

Commands to run tests headlessly:

$ npm test

Make dependency graph image:

$ make madge

Testing on Heroku

This repo can be deployed to Heroku using heroku-buildpack-vellum, which is just a fork of heroku-buildpack-static with the build script from the standard Node.js buildpack added in order to install dependencies.

Until prune.io is available, we use Rainforest's fourchette along with a slightly modified version of their example fourchette app in order to create an isolated test environment for each Pull Request on Heroku.

The latest master is also deployed to vellum-master.herokuapp.com using drone.io. See here for a list of builds.

About

An XForm editor for the browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 79.9%
  • CSS 18.0%
  • HTML 2.0%
  • Makefile 0.1%