[Loris-dev] incorporating javascript into php instrument forms

David Blader dblader.mcin at gmail.com
Wed Apr 25 13:12:02 EDT 2018


Hey Garry,
Thanks for reaching out to us.
Adding your own customized JS & CSS for instruments can be done pretty
simply by extending the NDB_BVL_Instrument class in your project/libraries
directory.
Within your new child class, you can then override the methods
"getJSDependencies()" and "getCSSDependencies()" (defined in NDB_Page).
In these overridden methods, you can then merge the dependencies defined in
the inherited method implementation with the paths to the customized JS &
CSS files of your choice.
Once you've done this, it is just a matter of making sure your instrument
forms are extending the new child class.
Attached is an image of an example of what one of these overridden methods
might look like. I hope it helps.
Cheers,
David


On Wed, Apr 25, 2018 at 8:51 AM, Cardillo, Garry <cardillo at med.umich.edu>
wrote:

> Hello All,
>
>
> I am new to Loris development and I'm trying to figure out how to
> incorporate javascript, jquery, html and css elements into php instrument
> forms (class.inc files).  These files seem to only want to accept php.  I'm
> trying to figure out how to exert more control over the look/feel of
> instrument forms, as well as incorporate some conditional logic on which
> fields are displayed.  It seems like there is something simple that I'm
> missing.
>
>
> Thanks for any input!
>
>
> Garry Cardillo
> [image: 1523292633747_image001.png]
>
> Database Analyst/Programmer Intermediate
>
> Department of Radiology
>
> Functional Neuroimaging, Cognitive and Mobility Laboratory
>
> Domino’s Farms  Lobby B Suite 1000
>
> 24 Frank Lloyd Wright Dr  PO BOX 362
>
> Ann Arbor, MI 48106
>
> t: 734-936-0630
>
> f: 734-998-8403
>
> e: cardillo at umich.edu
>
> **********************************************************
> Electronic Mail is not secure, may not be read every day, and should not
> be used for urgent or sensitive issues
>
> _______________________________________________
> Loris-dev mailing list
> Loris-dev at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/loris-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20180425/ce9aa734/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot from 2018-04-25 13-06-50.png
Type: image/png
Size: 22245 bytes
Desc: not available
URL: <http://www.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20180425/ce9aa734/attachment-0001.png>


More information about the Loris-dev mailing list