Skip to content
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

Merged
merged 15 commits into from
Dec 13, 2023

Conversation

RobertGemmaJr
Copy link
Member

  • photodiodeGhostBox is now exported as a constant instead of a function
  • Renames photodiodeSpot as pdSpotEncode
  • Adds docstrings

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

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
@RobertGemmaJr RobertGemmaJr self-assigned this Dec 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

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

@RobertGemmaJr RobertGemmaJr changed the base branch from main to chore-issues December 6, 2023 16:20
Base automatically changed from chore-issues to main December 6, 2023 17:05
* 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" });
Copy link
Contributor

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???

Copy link
Member Author

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",
Copy link
Contributor

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.

Copy link
Member Author

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.

@RobertGemmaJr RobertGemmaJr changed the base branch from main to ref-old-actions December 11, 2023 20:19
@RobertGemmaJr RobertGemmaJr changed the base branch from ref-old-actions to main December 12, 2023 14:55
Copy link
Member Author

@RobertGemmaJr RobertGemmaJr changed the base branch from main to feat-v3.3 December 13, 2023 18:36
@RobertGemmaJr RobertGemmaJr changed the base branch from feat-v3.3 to hold-cleaning December 13, 2023 19:57
@RobertGemmaJr RobertGemmaJr merged commit 34a25ca into hold-cleaning Dec 13, 2023
8 of 9 checks passed
@RobertGemmaJr RobertGemmaJr deleted the ref-photodiode_spot branch December 13, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename photodiode_spot as pdSpotEncode and add docstrings
3 participants