Coder Social home page Coder Social logo

enketo-dristhi's Introduction

enketo-dristhi Build Status

Extended enketo-core for use in Dristhi, a hybrid Android app. External Drishti/Android depencies are mocked so it can be run in the browser.

###To use as library:

  1. install node (and npm), grunt-cli, ruby, rubygems, and the sass gem (gem install sass).
  2. clone repo
  3. get (or update) submodules git submodule update --init --recursive
  4. Use grunt to build.
  5. start webserver with grunt server.
  6. go to http://localhost:8080/build/index.html to see list of links to all Dristhi forms
  7. note that the index.html list includes instance=a which belongs to form EC_Registration_EngKan. It will throw load errors in the console for all other forms. Instance=c (is not up-to-date but) can be loaded into PNC_Visit_EngKan
  8. probably use dristhi.css as-is, but
  9. create your own js build system that includes the enketo and androidcontext objects and their dependencies (enketo-dristhi-combined.min.js includes require.js itself so you don't want to use that)

###Related Projects

enketo-dristhi's People

Contributors

jmwohl avatar kirang20 avatar martijnr avatar peterp avatar sushmitharaos avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

enketo-dristhi's Issues

Upgrade to enketo-core 2.3.0

@kirang20, the master is upgraded.

What is new?

  • fast repeats
  • new radio buttons and checkboxes (using a font now)
  • jr:choicename() support
  • bug + small performance fixes

What to watch out for?

  • style degradations (pretty major enketo-core css reorganization in this upgrade)
  • XSLT Transformations need to be re-done

cc @dpapathanasiou, @prabhasp

compile to 1 js file

The libraries & dristhi-all distinction doesn't make much sense any more. It is still there for historical reasons only.

cascading logic not working

seen on Tab2 both Chrome (yay! I can use a console!) and Internet App.

The main enketo.org forms still work, so it's probably a minor thing.

Now, where is that proprietary Samsung cable....

Usingdocument.write(androidContext.getForm()) in template.html

Hi Martijn,

I have tried inlining document.write(androidContext.getForm()); in template.html (as before) but I cannot get forms to work correctly after that.
Some issues I am facing

  • On Browser, this does not work as androidContext object is not available globally

Form save does not work on Dristhi app (and on other browsers)

Hi Martijn,

When I try to save form I get the below exception:
Javascript Log. Message: Javascript Error: , msg: Uncaught ReferenceError: form is not defined, url: file:///android_asset/www/enketo/js/enketo-dristhi-combined.min.js, line: 26875, lineNumber: 27,166, sourceId, file:///android_asset/www/enketo/js/enketo-dristhi-combined.min.js
Javascript Log. Message: Uncaught ReferenceError: form is not defined, lineNumber: 26,875, sourceId, file:///android_asset/www/enketo/js/enketo-dristhi-combined.min.js

The line number is with respect to the forked enketo-dristhi repo, https://github.com/SEL-Columbia/enketo-dristhi/tree/ziggy_integration.

This same error is reproducible on Chrome using http://dristhi-dev.enketo.org/template.html?formName=EC_Registration_EngKan&instanceId=a&debug=true.

Can you please help us with this issue, do we need to do something to fix this?
Most likely this is the last issue we need to fix before release :)

What's new in v2.x

  • check current look here: http://dristhi-dev.enketo.org/ on a mobile device (if issue with fonts in browser, use different browser)
  • repo: MartijnR/enketo-dristhi (everything else is added to this repo as git submodules)
    this time you'll have to clone the repo (make sure to also update the submodules and their submodules and their ... etc...) and include them in your require.js build system
  • change: require.js used throughout (and everything is modular behind the scenes now, which is great if you want to improve enketo-core.... )
  • change: enabling/disabling widget now just means adding/removing a line in config.json
  • change: bootstrap3 upgrade
  • change: many styling fixes
  • change: new widgets (likert, horizontal choices)
  • change: performance should be improved in particular for notes, labels that include media, etc.

I expect you'll want to change the structure of this repo to make it as easy as possible for you to keep Dristhi up to date (and lots of exciting stuff is coming!). Go crazy (!), as long as I can still run the template.html file inside a browser for Enketo development and troubleshooting.

Can I remove built js and css file?

@kirang20 can I remove enketo-dristhi-combined.min.js and dristhi.css from build folder?

I prefer not to include built files in repo. I'm sure enketo-dristhi-combined.min.js is not a problem for you, but am not sure about dristhi.css.

Using document.write(androidContext.getForm()) in template.html

Hi Martijn,

We tried inlining document.write(androidContext.getForm()); in template.html (as before) but we cannot get forms to work correctly after that.

Some issues we are facing:

  • On Browser, this does not work as androidContext object is not available globally. We tried to work around this issue by using mocks (by using require('androidContext')), but we get the below error:
    Module name "androidContext" has not been loaded yet for context: _. Use require([]).
    Is this because RequireJS is not yet loaded?
  • On Dristhi app, the form loads correctly but skip logics, calculations and validations do not work.

Any suggestions (if you need, we can send you an APK with these changes)?

Date field validations are broken

Date field validations are broken, even valid values are being flagged as invalid (check Wife DOB field on EC registration form, FP start date on FP Change form)

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.