Commit Graph

2713 Commits

Author SHA1 Message Date
bjoluc
7499817415 Add exports field to package.json 2021-08-25 21:58:23 +02:00
bjoluc
6006fec96a Prepare @jspsych/config for external use 2021-08-25 21:57:28 +02:00
Josh de Leeuw
d636e3ac45 update JSON2CSV implementation, other utils 2021-08-25 15:34:03 -04:00
Josh de Leeuw
c374991d17 update preloading methods to use es6 features 2021-08-25 11:20:53 -04:00
Josh de Leeuw
a77052deb2 replace var where needed 2021-08-25 11:06:11 -04:00
Josh de Leeuw
266f756155 replace var where needed 2021-08-25 11:05:56 -04:00
Josh de Leeuw
b5f06d4144 update tests for es6 2021-08-25 10:56:40 -04:00
Josh de Leeuw
a54ed29e6e update unique() to use es6 Set 2021-08-24 13:45:41 -04:00
Josh de Leeuw
2224784219 replace utility method flatten() with es6 .flat() 2021-08-24 13:44:58 -04:00
Josh de Leeuw
8e58f6e160 cleanup of issues IDed in review 2021-08-23 15:01:21 -04:00
Josh de Leeuw
3500e2b001 fixing const/let, replacing == with === 2021-08-23 14:36:56 -04:00
Josh de Leeuw
b0d77e79aa
Merge pull request #2100 from jspsych/modularization-getters
modularization-getters
2021-08-23 14:19:22 -04:00
Josh de Leeuw
5d060f6b96 rename getter methods, update docs 2021-08-23 13:11:32 -04:00
Josh de Leeuw
a3769deb81 for loop update 2021-08-23 12:52:49 -04:00
Josh de Leeuw
254dd6612c update var 2021-08-23 12:51:28 -04:00
Josh de Leeuw
9b2fc7e68b reimplement factorial() method, add tests, replace var with let/const 2021-08-23 11:41:50 -04:00
Josh de Leeuw
019ab49fea replace var with let/const 2021-08-23 10:00:28 -04:00
Josh de Leeuw
4b5a4398c7 update for loops, var keyword 2021-08-23 09:53:08 -04:00
Josh de Leeuw
861f83e185 replace var with let/const; replace some for loops 2021-08-23 09:34:09 -04:00
Josh de Leeuw
c20b2dad49 replace var with let or const 2021-08-23 09:03:30 -04:00
bjoluc
0a8773204e Remove useWebaudio default value in MediaAPI constructor 2021-08-23 11:19:52 +02:00
bjoluc
fee9e19614 Merge branch 'modularization' into preloading 2021-08-23 11:01:24 +02:00
bjoluc
a06b07ddc9 Get rid of reset and createKeyboardEventListeners, instantiate API objects directly in pluginapi tests 2021-08-22 21:59:12 +02:00
bjoluc
39e84a02e2 Remove keycode functionality 2021-08-22 16:25:24 +02:00
bjoluc
cbce6d8919 Replace KeyboardListener objects directly with callback functions 2021-08-22 15:45:55 +02:00
bjoluc
2b82cab264 Remove outdated import in test-extension.ts 2021-08-22 00:33:00 +02:00
bjoluc
c30b6ad19a Rework preloading in MediaAPI
This drops support for the `registerPreload()` function and instead
infers preloading information on the fly in `getAutoPreloadList()`.
2021-08-22 00:11:17 +02:00
bjoluc
bb141c446a Fix class instance access in callback functions
by converting the affected functions to arrow functions to preserve the
outer-scope `this`
2021-08-20 14:17:46 +02:00
bjoluc
ba9c495a21 Add .cjs extension to import-sort config 2021-08-20 11:39:09 +02:00
Josh de Leeuw
b3b9f5fd5e
Create modular versions of extensions (#2053)
Extensions are now passed to the `JsPsych` constructor via an `extensions` option.
Along the way, the webgazer plugins and plugin-html-button-response have been modularized as well.

Co-authored-by: bjoluc <mail@bjoluc.de>
Co-authored-by: Becky Gilbert <beckyannegilbert@gmail.com>
2021-08-20 11:15:33 +02:00
Josh de Leeuw
528d9ad5b2 update mkdocs.yml in prep for versioned docs 2021-08-19 16:58:30 -04:00
bjoluc
c340c5ea55 Enhance scripts in package.json files 2021-08-17 20:26:38 +02:00
bjoluc
4fcb2f7e56 Refactor KeyboardListenerAPI 2021-08-17 19:13:30 +02:00
bjoluc
b288a8e21f Move root Jest config into package.json 2021-08-17 18:58:59 +02:00
bjoluc
f54d48911f
Merge pull request #2084 from bjoluc/parameter-types
Enhance parameter types
2021-08-17 17:32:35 +02:00
bjoluc
9c519853fe Use enum for parameter types and remove JsPsych.plugins
`const parameterType` is now `enum ParameterType` and can only be
accessed by importing it.
2021-08-17 17:19:25 +02:00
bjoluc
743ad44e84 Replace ALL_KEYS and NO_KEYS with strings
`"ALL_KEYS"` is now used instead of `jsPsych.ALL_KEYS` and `"NO_KEYS"`
instead of `jsPsych.NO_KEYS`
2021-08-17 17:07:23 +02:00
bjoluc
2e17ca6b33 Introduce parameterType.KEYS for multiple keys
It represents an array of keys, or jsPsych.ALL_KEYS and jsPsych.NO_KEYS
2021-08-17 17:07:23 +02:00
bjoluc
5152f52977
Merge pull request #2079 from bjoluc/preload
Implement `preload` flag for plugin parameters
2021-08-17 17:01:18 +02:00
bjoluc
64541a451f Implement preload flag for plugin parameters
It defaults to `true` for parameters of type IMAGE, VIDEO, and AUDIO,
and is ignored for any other parameter type.
Example: Using `parameterType.IMAGE` for a parameter `param` in a
plugin named `my-plugin` is equivalent to calling
`jspsych.pluginAPI.registerPreload("my-plugin", "param", "image")`
before `jsPsych.run()`. Setting `preload: false` for the parameter would
disable this invocation.
2021-08-17 16:47:07 +02:00
bjoluc
105b041255 Configure husky to run prettier via lint-staged 2021-08-13 22:04:28 +02:00
bjoluc
017b45d87e Make trial_type a string in JsPsychData
I forgot to do this when migrating the core to use plugin objects.
@jansim was first with this in #661, so he gets the credits!

Closes #2076
Co-authored-by: Jan Simson <jan.simson@three-2-one.com>
2021-08-12 18:06:22 +02:00
bjoluc
56d6fd9d0b Make plugin info static
so it can be accessed before a plugin is instantiated
2021-08-12 17:25:26 +02:00
bjoluc
559f60c83e Add Gulp script to create a dist archive 2021-08-09 09:35:48 +02:00
Becky Gilbert
75f3164f29
Merge pull request #2042 from kurokida/docs-demos
Create live demos for jspsych-html-* plugins
2021-08-04 13:10:22 -07:00
Daiichiro Kuroki
e8be19ad89 Create live demos for jspsych-html-* plugin 2021-08-04 15:13:44 +09:00
Becky Gilbert
11a5378865
Merge pull request #2018 from kurokida/docs-demos
Create live demos for the external-html and free-sort plugins.
2021-07-29 11:51:57 -07:00
Daiichiro Kuroki
6c9725c5c8 Create live demos for the external-html and free-sort plugins. 2021-07-29 14:10:58 +09:00
Becky Gilbert
6bd552d3cd
Merge pull request #2015 from kurokida/docs-demos
Create live demos for the categorize-html, categorize-image, and cloze plugins.
2021-07-28 12:08:49 -07:00
Daiichiro Kuroki
bedf5becbf Create live demos for the categorize-html, categorize-image, and cloze plugins 2021-07-28 17:26:43 +09:00