-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ref: Refactor photodiodeSpot
and photodiodeGhostBox
#337
Conversation
This was the original name of function. Returning to that name as it's more prescriptive, will wait to change until the bigger change in v4
Visit the preview URL for this PR (updated for commit df9045e): https://ccv-honeycomb--pr337-ref-photodiode-spot-n8uhx51l.web.app (expires Wed, 20 Dec 2023 19:08:14 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4ace1dcea913a952d2a1af84b94a4421bf36e610 |
* Pulses the photodiode spot from black (on) to white (off) and runs a callback function | ||
* @param {number} ms The amount of time to flash the photodiode spot | ||
* @param {function} callback A callback function to execute after the flash | ||
*/ | ||
function pulseFor(ms, callback) { | ||
$(".photodiode-spot").css({ "background-color": "black" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's jQuery in this???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah! I'm afraid to touch it 😨
} | ||
const photodiodeGhostBox = div(span("", { id: "photodiode-spot", class: "photodiode-spot" }), { | ||
id: "photodiode-box", | ||
class: config.USE_PHOTODIODE ? "photodiode-box visible" : "photodiode-box invisible", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is config
guaranteed to be defined when this is run? It always makes me a little nervous to put conditional stuff at the top level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, but I agree I'd like to change it at some point.
Current dependencies on/for this PR:
This stack of pull requests is managed by Graphite. |
photodiodeGhostBox
is now exported as a constant instead of a functionphotodiodeSpot
aspdSpotEncode
The original name for the photodiode function was
pdSpotEncode
. I'm returning to that name - I think it's a little more prescriptive and it'll be nice for users to have that consistent naming. Eventually we're going to turn it into a custom jsPsych extension, we can think about renaming then.closes #322