From d5fd16be7c98172d5f4a79a66ea0c5728e05676c Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Mon, 1 May 2017 16:35:41 -0400 Subject: [PATCH] working example of fullscreen --- examples/jspsych-fullscreen.html | 44 ++++++++++++++++++++++++++++++++ plugins/jspsych-fullscreen.js | 7 ++--- 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 examples/jspsych-fullscreen.html diff --git a/examples/jspsych-fullscreen.html b/examples/jspsych-fullscreen.html new file mode 100644 index 00000000..171fdc2e --- /dev/null +++ b/examples/jspsych-fullscreen.html @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + diff --git a/plugins/jspsych-fullscreen.js b/plugins/jspsych-fullscreen.js index f73b335b..227dcda5 100644 --- a/plugins/jspsych-fullscreen.js +++ b/plugins/jspsych-fullscreen.js @@ -76,6 +76,7 @@ jsPsych.plugins.fullscreen = (function() { } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } + endTrial(); }); } else { if (document.exitFullscreen) { @@ -87,14 +88,14 @@ jsPsych.plugins.fullscreen = (function() { } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } + endTrial(); } - endTrial(); } function endTrial() { - jsPsych.pluginAPI.setTimeout(function(){ + display_element.innerHTML = ''; - display_element.innerHTML = ''; + jsPsych.pluginAPI.setTimeout(function(){ var trial_data = { success: !keyboardNotAllowed