@lookit/templates 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.browser.js +15 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.browser.min.js +17 -14
- package/dist/index.browser.min.js.map +1 -1
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/consentVideoTemplate.ts +2 -0
- package/src/index.ts +8 -1
- package/src/utils.spec.ts +11 -1
- package/src/utils.ts +12 -0
package/README.md
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
This package contains the translated templates used in other custom CHS jsPsych
|
|
4
4
|
trials. Please see the trial documentation (e.g.
|
|
5
|
-
[Video Consent](../record/README.md#video-consent)) for help using these
|
|
5
|
+
[Video Consent](../record/README.md#video-consent-plugin)) for help using these
|
|
6
6
|
templates.
|
package/dist/index.browser.js
CHANGED
|
@@ -8021,7 +8021,7 @@ var chsTemplates = (function () {
|
|
|
8021
8021
|
|
|
8022
8022
|
var consent_template_5 = "<h1>\n {{t \"consent-template-5.header\"}}:\n {{experiment.name}}\n</h1>\n\n<p>\n {{t\n \"consent-template-5.intro-sentence\"\n name=PIName\n institution=institution\n experiment=experiment.name\n }}\n {{exp-format summary_statement}}\n</p>\n\n<h2>\n {{#if purpose_header}} {{purpose_header}} {{else}}\n {{t \"consent-template-5.purpose-header\"}}\n {{/if}}\n</h2>\n<p>{{exp-format purpose}}</p>\n\n<h2>\n {{#if procedures_header}} {{procedures_header}} {{else}}\n {{t \"consent-template-5.procedures-header\"}}\n {{/if}}\n</h2>\n<p>\n {{t \"consent-template-5.duration-statement\" duration=experiment.duration}}\n {{exp-format procedures}}\n</p>\n\n<h2>\n {{#if participation_header}} {{participation_header}} {{else}}\n {{t \"consent-template-5.participation-header\"}}\n {{/if}}\n</h2>\n<p>\n {{t \"consent-template-5.participation-content\" only_adult=prompt_only_adults}}\n</p>\n\n{{#if voluntary_participation}}\n <p>{{exp-format voluntary_participation}}</p>\n{{/if}}\n{{#if risk_statement}}\n\n <h2>\n {{#if risk_header}} {{risk_header}} {{else}}\n {{t \"consent-template-5.risk-header\"}}\n {{/if}}\n </h2>\n\n <p>{{exp-format risk_statement}}</p>\n{{/if}}\n\n<h2>\n {{#if benefits_header}} {{benefits_header}} {{else}}\n {{t \"consent-template-5.benefits-header\"}}\n {{/if}}\n</h2>\n\n<p>{{exp-format payment}}</p>\n\n<h2>{{t \"consent-template-5.data-collection-header\"}}</h2>\n\n<p>\n {{t \"consent-template-5.data-collection-1\" only_adult=prompt_only_adults}}\n {{t \"consent-template-5.data-collection-2\"}}\n</p>\n\n<p>{{t \"consent-template-5.data-collection-3\"}}</p>\n\n<h2>{{t \"consent-template-5.video-privacy-header\"}}</h2>\n<p>{{t \"consent-template-5.video-privacy-consent\"}}</p>\n\n{{#if private_level_only}}\n <p>\n {{t \"consent-template-5.video-privacy-private-description\"}}\n {{t \"consent-template-5.video-privacy-withdraw-private-only\"}}\n </p>\n{{else}}\n <p>{{t \"consent-template-5.video-privacy-overview\"}}:</p>\n <ul>\n <li>\n \"{{t \"consent-template-5.video-privacy-Private\"}}\":\n {{t \"consent-template-5.video-privacy-private-description\"}}\n </li>\n <li>\n \"{{t \"consent-template-5.video-privacy-Scientific\"}}\":\n {{t \"consent-template-5.video-privacy-scientific-description\"}}\n </li>\n <li>\n \"{{t \"consent-template-5.video-privacy-Publicity\"}}\":\n {{t \"consent-template-5.video-privacy-publicity-description\"}}\n </li>\n </ul>\n <p>{{t \"consent-template-5.video-privacy-withdraw\"}}</p>\n{{/if}}\n{{#if include_databrary}}\n <p>{{{t \"consent-template-5.databrary\"}}}</p>\n{{/if}}\n{{#if additional_video_privacy_statement}}\n <p>{{exp-format additional_video_privacy_statement}}</p>\n{{/if}}\n\n<h2>{{t \"consent-template-5.data-use-researchers-header\"}}</h2>\n<p>\n {{t\n \"consent-template-5.data-use-researchers-content-1\"\n name=PIName\n institution=institution\n }}\n</p>\n<ul>\n <li>{{t \"consent-template-5.data-use-researchers-item-1\"}}</li>\n <li>{{t \"consent-template-5.data-use-researchers-item-2\"}}</li>\n <li>\n {{t\n \"consent-template-5.data-use-researchers-item-3\"\n only_adult=prompt_only_adults\n }}\n </li>\n</ul>\n<p>\n {{t\n \"consent-template-5.data-use-researchers-content-2\"\n only_adult=prompt_only_adults\n }}\n</p>\n{{#if datause}}\n <p>{{exp-format datause}}</p>\n{{/if}}\n\n<h2>{{t \"consent-template-5.data-use-Lookit-header\"}}</h2>\n<p>{{t \"consent-template-5.data-use-Lookit-content\"}}</p>\n\n<h2>{{t \"consent-template-5.publication-header\"}}</h2>\n<p>\n {{t \"consent-template-5.publication-content\" only_adult=prompt_only_adults}}\n</p>\n\n{{#if additional_segments}}\n {{#each additional_segments as |segment|}}\n <h2>{{exp-format segment.title}}</h2>\n <p>{{exp-format segment.text}}</p>\n {{/each}}\n{{/if}}\n\n<h2>{{t \"consent-template-5.research-subject-rights-header\"}}</h2>\n<p>{{{exp-format research_rights_statement}}}</p>\n\n{{#if gdpr}}\n <h2>{{t \"consent-template-5.gdpr-header\"}}</h2>\n <p>\n {{t \"consent-template-5.gdpr-personal\"}}:\n {{exp-format gdpr_personal_data}}.\n {{t \"consent-template-5.gdpr-sensitive\"}}:\n {{exp-format gdpr_sensitive_data}}\n </p>\n <p>{{t \"consent-template-5.gdpr-2\"}}</p>\n{{/if}}\n\n<h2>{{t \"consent-template-5.contact-header\"}}</h2>\n<p>\n {{t\n \"consent-template-5.contact-statement-1\"\n name=PIName\n institution=institution\n contact=PIContact\n only_adult=prompt_only_adults\n omit_injury=omit_injury_phrase\n }}\n</p>\n<p>\n {{t \"consent-template-5.contact-statement-2\" only_adult=prompt_only_adults}}\n</p>";
|
|
8023
8023
|
|
|
8024
|
-
var consentVideoTrialTemplate = "<div id=\"consent-video-trial\">\n <div class=\"left-column\">{{{consent}}}</div>\n <div class=\"right-column\">\n <div id=\"{{video_container_id}}\" class=\"jspsych-content\"></div>\n\n <ol>\n <li>{{t \"exp-lookit-video-consent.consent-step-1\"}}.</li>\n <li>{{t \"exp-lookit-video-consent.click-to\"}}\n <button class=\"jspsych-btn\" id=\"record\">\n {{t \"exp-lookit-video-consent.start-consent-recording\"}}...\n </button>\n </li>\n <li>\n {{{t \"exp-lookit-video-consent.read-statement-below\"}}}\n {{t \"exp-lookit-video-consent.signed-alternative\"}}\n\n <div class=\"consent-statement\">\n {{#if consent_statement_text}}\n \"{{consent_statement_text}}\"\n {{else if prompt_only_adults}}\n \"{{t \"exp-lookit-video-consent.prompt-adult-only\"}}\"\n {{else}}\n \"{{t \"exp-lookit-video-consent.prompt\"}}\"\n {{/if}}\n </div>\n\n </li>\n <li>{{t \"exp-lookit-video-consent.click-to\"}}\n <button class=\"jspsych-btn\" id=\"stop\" disabled>\n {{t \"exp-lookit-video-consent.stop-recording\"}}\n </button>\n </li>\n <li>\n <button class=\"jspsych-btn\" id=\"play\" disabled>\n {{t \"exp-lookit-video-consent.play-consent-video-button\"}}\n </button>\n {{t \"exp-lookit-video-consent.review-video\"}}\n </li>\n </ol>\n <button id=\"next\" class=\"jspsych-btn\" disabled>Next</button>\n </div>\n\n</div>";
|
|
8024
|
+
var consentVideoTrialTemplate = "<div id=\"consent-video-trial\">\n <div class=\"left-column\">{{{consent}}}</div>\n <div class=\"right-column\">\n <div id=\"{{msg_container_id}}\">{{t\n \"exp-lookit-video-consent.Not-recording\"\n }}</div>\n <div id=\"{{video_container_id}}\" class=\"jspsych-content\"></div>\n\n <ol>\n <li>{{t \"exp-lookit-video-consent.consent-step-1\"}}.</li>\n <li>{{t \"exp-lookit-video-consent.click-to\"}}\n <button class=\"jspsych-btn\" id=\"record\">\n {{t \"exp-lookit-video-consent.start-consent-recording\"}}...\n </button>\n </li>\n <li>\n {{{t \"exp-lookit-video-consent.read-statement-below\"}}}\n {{t \"exp-lookit-video-consent.signed-alternative\"}}\n\n <div class=\"consent-statement\">\n {{#if consent_statement_text}}\n \"{{consent_statement_text}}\"\n {{else if prompt_only_adults}}\n \"{{t \"exp-lookit-video-consent.prompt-adult-only\"}}\"\n {{else}}\n \"{{t \"exp-lookit-video-consent.prompt\"}}\"\n {{/if}}\n </div>\n\n </li>\n <li>{{t \"exp-lookit-video-consent.click-to\"}}\n <button class=\"jspsych-btn\" id=\"stop\" disabled>\n {{t \"exp-lookit-video-consent.stop-recording\"}}\n </button>\n </li>\n <li>\n <button class=\"jspsych-btn\" id=\"play\" disabled>\n {{t \"exp-lookit-video-consent.play-consent-video-button\"}}\n </button>\n {{t \"exp-lookit-video-consent.review-video\"}}\n </li>\n </ol>\n <button id=\"next\" class=\"jspsych-btn\" disabled>Next</button>\n </div>\n\n</div>";
|
|
8025
8025
|
|
|
8026
8026
|
class LocaleNotFoundError extends Error {
|
|
8027
8027
|
constructor(baseName) {
|
|
@@ -18503,8 +18503,12 @@ var chsTemplates = (function () {
|
|
|
18503
18503
|
const txt = String(instance.t(context, hash));
|
|
18504
18504
|
return hash.htmlSafe ? new Handlebars.SafeString(txt) : txt;
|
|
18505
18505
|
});
|
|
18506
|
+
const translateString = (messageIdStr) => {
|
|
18507
|
+
return instance.t(messageIdStr);
|
|
18508
|
+
};
|
|
18506
18509
|
|
|
18507
18510
|
const video_container_id = "lookit-jspsych-video-container";
|
|
18511
|
+
const msg_container_id = "lookit-jspsych-video-msg-container";
|
|
18508
18512
|
const consentVideo = (trial) => {
|
|
18509
18513
|
const experiment = window.chs.study.attributes;
|
|
18510
18514
|
const { PIName, PIContact } = trial;
|
|
@@ -18519,7 +18523,8 @@ var chsTemplates = (function () {
|
|
|
18519
18523
|
return Handlebars.compile(consentVideoTrialTemplate)({
|
|
18520
18524
|
...trial,
|
|
18521
18525
|
consent,
|
|
18522
|
-
video_container_id
|
|
18526
|
+
video_container_id,
|
|
18527
|
+
msg_container_id
|
|
18523
18528
|
});
|
|
18524
18529
|
};
|
|
18525
18530
|
const consentDocument = (trial) => {
|
|
@@ -18690,9 +18695,15 @@ var chsTemplates = (function () {
|
|
|
18690
18695
|
});
|
|
18691
18696
|
};
|
|
18692
18697
|
|
|
18693
|
-
var index = {
|
|
18698
|
+
var index = {
|
|
18699
|
+
consentVideo,
|
|
18700
|
+
videoConfig,
|
|
18701
|
+
uploadingVideo,
|
|
18702
|
+
exitSurvey,
|
|
18703
|
+
translateString
|
|
18704
|
+
};
|
|
18694
18705
|
|
|
18695
18706
|
return index;
|
|
18696
18707
|
|
|
18697
18708
|
})();
|
|
18698
|
-
//# sourceMappingURL=https://unpkg.com/@lookit/templates@2.
|
|
18709
|
+
//# sourceMappingURL=https://unpkg.com/@lookit/templates@2.1.0/dist/index.browser.js.map
|