2020.2

Table Of Contents
If a template contains an earlier version of the COTG library, the newest version will be added
to the resources, but you will be asked which version of the library you prefer to use. Your
preferred library will be included in the section (see: "Includes dialog" on page951).
When this library is included in a Web template instead of a COTG template, it won't affect the
template, except when the user submits a Form. At that moment the plugin will automatically
add a hidden field for every unchecked checkbox on the Form.
Tip
If you want to take a look at the contents, you can open the plugin within the Designer:
double-click cotg-2.0.0.js on the Resources pane.
Changing default settings for widgets
The Camera and Geolocation widgets have options that you can configure per element. You
can decide, for example, which buttons will be visible in a specific Camera element (see
"Element specific settings" on page576).
The default settings for these options are specified in the COTG plugin. It is possible to change
these defaults without modifying the plugin itself.
To do that, create a JavaScript file (see "Adding JavaScript files to the Resources" on
page546) and specify the desired default settings in that file like this:
$.fn.widget.defaults.setting = value;
Make sure to include your JavaScript file in the Web context or in the Web section that contains
the COTG Form (see "Including a JavaScript file in a Web context" on page548).
All available settings are listed in the Capture OnTheGo API: "Capture OnTheGo API" on
page600.
Example
The following code sets the default timeout and accuracy for Geolocation objects. and the
default maximum height and width for Camera widgets.
$.fn.cotgGeolocation.defaults.timeout = 6000; // 6 secs
$.fn.cotgGeolocation.defaults.enableHighAccuracy = true;
$.fn.cotgPhotoWidget.defaults.width = 1024;
$.fn.cotgPhotoWidget.defaults.height = 768;
$.fn.cotgPhotoWidget.defaults.quality = 60;
Page 588