GithubHelp home page GithubHelp logo

punkch / vellum Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dimagi/vellum

0.0 0.0 0.0 15.2 MB

An XForms form designer written purely in Javascript

License: Other

Makefile 0.07% JavaScript 70.53% Python 0.11% HTML 15.55% CSS 12.11% Shell 0.05% PHP 0.11% Less 1.47%

vellum's Introduction

Vellum

Build Status

Vellum is a JavaRosa XForm designer used in CommCare HQ.

Image courtesy of the ReMIND project.

Vocabulary

Some of the names used in the source code are less than intuitive. Hopefully this list will help to reduce the confusion. The list is ordered with the least intuitive items first.

  • Vellum: also known as the Form Builder.
  • Mug: an object representing a question. Each mug has a type: Text, Date, Audio, etc. While some mug type names match the corresponding label used in the UI, some do not. For example, a Trigger is called a Label in the UI.
  • JavaRosa: the language/translation module. A core part of the JavaRosa module is the IText system, which provides an API for translated strings and multimedia used to adorn questions.
  • Widget: a control or group of controls displayed on the right side of the screen and used to interact with mug properties.
  • Plugins: features that are not part of the core are implemented as plugins. The plugin architecture is loosely based on the JSTree plugin system. Many very important components are implemented as plugins, so just because something is a plugin does not mean it is a second-rate feature.

Usage

Checkout the source from GitHub

Optionally, build an optimized version

$ make # artifacts will be in _build dir and also 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>
<link rel="stylesheet" href="path/to/vellum/style.css"></link>
<!-- optional, if using bundled jquery et al -->
<link rel="stylesheet" href="path/to/vellum/global-deps.css"></link>

<!-- 
Optionally reuse existing jQuery instance with Bootstrap.  
If not present, bundled versions will be loaded.  -->
<script src="jquery.js"></script>
<script src="bootstrap.js"></script>

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

    require(["jquery.vellum"], function () {
        require(["jquery"], 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.

Tests

Make sure everything is up to date:

$ yarn upgrade

Test in a browser:

$ npm run testserver
$ chromium-browser http://localhost:${VELLUM_PORT:-8088}

By default, the test page will load the non-built version unless a built parameter is present in the query string.

Commands to run tests headlessly (make sure npm run testserver is called in the background):

./test

or to run a specific test:

./test "Name of specific test"

a block like the following:

describe('the test', () => ...
  describe('with this condition', () => ...
    it('passes', ...)

would be referenced as the test with this condition passes. So the final command would be:

./test 'the test with this condition passes'

Contributing

Follow the Airbnb JavaScript Style Guide.

Install dependencies:

$ npm install --no-package-lock yarn  # if yarn is not installed globally
$ `npm bin`/yarn install

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

$ make

vellum's People

Contributors

amitphulera avatar amsagoff avatar benrudolph avatar biyeun avatar calellowitz avatar czue avatar dannyroberts avatar dependabot[bot] avatar emord avatar esoergel avatar gherceg avatar jmtroth0 avatar kaapstorm avatar kennknowles avatar michelleliang1 avatar millerdev avatar minhaminha avatar mjriley avatar mkangia avatar msienkiewicz avatar mwhite avatar nickpell avatar noahcarnahan avatar orangejenny avatar proteusvacuum avatar snopoke avatar sravfeyn avatar twymer avatar tylersheffels avatar yedi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.