Releases: jspsych/jsPsych
@jspsych/[email protected]
Major Changes
-
#2858
f90c0ef9
Thanks @bjoluc! - - Makebutton_html
a function parameter which, given a choice's text and its index, returns the HTML string of the choice's button. If you were previously passing a string tobutton_html
, like<button>%choice%</button>
, you can now pass the functionfunction (choice) { return '<button class="jspsych-btn">' + choice + "</button>"; }
Similarly, if you were using the array syntax, like
['<button class="a">%choice%</button>', '<button class="b">%choice%</button>', '<button class="a">%choice%</button>']
an easy way to migrate your trial definition is to pass a function which accesses your array and replaces the
%choice%
placeholder:function (choice, choice_index) { return ['<button class="a">%choice%</button>', '<button class="b">%choice%</button>', '<button class="a">%choice%</button>'][choice_index].replace("%choice%", choice); }
From there on, you can further simplify your function. For instance, if the intention of the above example is to have alternating button classes, the
button_html
function might be rewritten asfunction (choice, choice_index) { return '<button class="' + (choice_index % 2 === 0 ? "a" : "b") + '">' + choice + "</button>"; }
- Simplify the button DOM structure and styling: Buttons are no longer wrapped in individual container
div
s for spacing anddata-choice
attributes. Instead, each button is assigned itsdata-choice
attribute and all buttons are direct children of the button group containerdiv
. The containerdiv
, in turn, utilizes a flexbox layout to position the buttons.
- Simplify the button DOM structure and styling: Buttons are no longer wrapped in individual container
-
#3339
74b4adc7
Thanks @jodeleeuw! -finishTrial()
now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
- #3326
c5a0dbb1
Thanks @vzhang03! - Updated all plugins to implement new pluginInfo standard that contains version, data generated and new documentation style to match migration of docs to be integrated with the code and packages themselves"
Patch Changes
- #3162
dc6de01a
Thanks @jodeleeuw! - Change canvas display toblock
to fix issues when canvas is full screen.
@jspsych/[email protected]
Major Changes
- #3339
74b4adc7
Thanks @jodeleeuw! -finishTrial()
now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
@jspsych/[email protected]
Major Changes
- #3339
74b4adc7
Thanks @jodeleeuw! -finishTrial()
now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
-
#3326
c5a0dbb1
Thanks @vzhang03! - Updated all plugins to implement new pluginInfo standard that contains version, data generated and new documentation style to match migration of docs to be integrated with the code and packages themselves" -
#3342
6717e00c
Thanks @Bankminer78! - Changed plugins to use AudioPlayer class; added tests using AudioPlayer mock; plugins now use AudioPlayerInterface.
@jspsych/[email protected]
Major Changes
- #3339
74b4adc7
Thanks @jodeleeuw! -finishTrial()
now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
-
#3326
c5a0dbb1
Thanks @vzhang03! - Updated all plugins to implement new pluginInfo standard that contains version, data generated and new documentation style to match migration of docs to be integrated with the code and packages themselves" -
#3342
6717e00c
Thanks @Bankminer78! - Changed plugins to use AudioPlayer class; added tests using AudioPlayer mock; plugins now use AudioPlayerInterface.
@jspsych/[email protected]
Major Changes
-
#2858
f90c0ef9
Thanks @bjoluc! - - Makebutton_html
a function parameter which, given a choice's text and its index, returns the HTML string of the choice's button. If you were previously passing a string tobutton_html
, like<button>%choice%</button>
, you can now pass the functionfunction (choice) { return '<button class="jspsych-btn">' + choice + "</button>"; }
Similarly, if you were using the array syntax, like
['<button class="a">%choice%</button>', '<button class="b">%choice%</button>', '<button class="a">%choice%</button>']
an easy way to migrate your trial definition is to pass a function which accesses your array and replaces the
%choice%
placeholder:function (choice, choice_index) { return ['<button class="a">%choice%</button>', '<button class="b">%choice%</button>', '<button class="a">%choice%</button>'][choice_index].replace("%choice%", choice); }
From there on, you can further simplify your function. For instance, if the intention of the above example is to have alternating button classes, the
button_html
function might be rewritten asfunction (choice, choice_index) { return '<button class="' + (choice_index % 2 === 0 ? "a" : "b") + '">' + choice + "</button>"; }
- Simplify the button DOM structure and styling: Buttons are no longer wrapped in individual container
div
s for spacing anddata-choice
attributes. Instead, each button is assigned itsdata-choice
attribute and all buttons are direct children of the button group containerdiv
. The containerdiv
, in turn, utilizes a flexbox layout to position the buttons.
- Simplify the button DOM structure and styling: Buttons are no longer wrapped in individual container
-
#3339
74b4adc7
Thanks @jodeleeuw! -finishTrial()
now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
-
#3326
c5a0dbb1
Thanks @vzhang03! - Updated all plugins to implement new pluginInfo standard that contains version, data generated and new documentation style to match migration of docs to be integrated with the code and packages themselves" -
#3342
6717e00c
Thanks @Bankminer78! - Changed plugins to use AudioPlayer class; added tests using AudioPlayer mock; plugins now use AudioPlayerInterface.
@jspsych/[email protected]
Major Changes
- #3339
74b4adc7
Thanks @jodeleeuw! -finishTrial()
now clears the display and any timeouts set withpluginApi.setTimeout()
Minor Changes
@jspsych/[email protected]
Major Changes
-
#2858
76e75080
Thanks @bjoluc! - Activate TypeScript'sisolatedModules
flag in the roottsconfig.json
file. If you are facing any TypeScript errors due toisolatedModules
, please update your code according to the error messages. -
#2858
810ed7a3
Thanks @bjoluc! - Migrate the build chain from TypeScript, Babel, and Terser to esbuild. Babel and Terser are no longer included as dependencies and the Babel configuration at@jspsych/config/babel
has been removed. The minified browser builds are only transpiled down to ES2015 now.