/*! * PennController for IBEX * This software is licensed under a BSD license; see the LICENSE file for details. * * - Version 2.0 * - Last Update: 2021, July 26 * - Major changes in version 2.0: * * Fixed Controller element duplicating lines and not rerunning properly * * Fixed selector.shuffle and its order logging * * Improved handling of trial end for the MediaRecorder element * * Improved audio/video recording upload * * Fixed print/canvas.add coordinates format bug (introduced in 1.9) * * Can now pass opacity of 0 to audio.disable and video.disable * * Fixed all-digit strings passed to Key element * * Fixed MediaRecorder stop / end of trials * * Fixed problems with some special commands (eg. fullscreen) not being properly executed as callback * * Fixed: Controller elements no longer appear multiple times when printed onto a Canvas element * * Fixed: calling print() after print(x,y[, canvas]) no longer preserves old positioning * * Fixed: referencing PennController element in scale.label before printing it * * Fixed elusive flickering with scaling * * Fixed selector.shuffle with elements printed before/after other elements * * Replaced the EyeTracker test with a smoother one * * Resources are now preloading 4 at a time, following the running order (= less aggressive requests) * * Fixed audio and video preloading problems * * Fixed video.disable semi-opaque layer * + Added newTrial().noTrialLog("start","end") to skip the tria's Start and/or End lines in the results file * + Added controller.callback * + Added textinput.callback * + Added specialcommand jump to navigate the sequence * + Added element DragDrop * + Added support of flac audios in zip files * */!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=44)}([function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(1);let i=[],o={keypress:[]};class s{constructor(e,t,r){this.name=e,this.value=e,this.creator=t,this.controllers=[],this.object=null,this.status="void",this.useURLs=void 0===r||r,this.created_at=0}create(){this.status="pending",this.created_at=Date.now(),this.creator.call(this,()=>this.resolve())}resolve(){this.status="ready",a.debug.log("
").addClass("PennController-SendResults");n.a.controllers.running.element.append(o),addSafeBindMethodPair("__SendResults__"),"string"==typeof t&&(window.__server_py_script_name__=t),o.__SendResults__(i)}),s={label:e=>(i[0]=e,s),setOption:(e,t)=>(r[e]=t,s)};s._item=i,s.type="__SendResults__",s._element={id:"SendResults"};const a=e=>{if(e==s){let e=window.items&&window.items.indexOf(i);e>=0&&window.items.splice(e,1),n.a.tmpItems=n.a.tmpItems.filter(e=>e!=i)}};return n.a.ArgumentCallback(a),n.a.NewTrialArgumentCallback(a),s._promises=[o],s._runPromises=o,window.items.push(i),s},c.SetCounter=function(...e){null==window.items&&(window.items=[]);let t="setCounter",r={};e.length&&(isNaN(Number(e[0]))?1==e.length?isNaN(Number(e[0]))?t=e[0]:r.set=Number(e[0]):2!=e.length||isNaN(Number(e[1]))?e.length>2&&!isNaN(Number(e[2]))?(t=e[0],e[1].match(/\s*inc\s*$/i)?r.inc=e[2]:r.set=e[2]):t=e[0]:e[0].match(/\s*inc\s*$/i)?r.inc=e[1]:(r.set=e[1],e[0].match(/\s*set\s*$/i)||(t=e[0])):r.set=Number(e[0]));let n=[t,"__SetCounter__",r];return r.label=e=>(n[0]=e,r),r.setOption=(e,t)=>(r[e]=t,r),window.items.push(n),r},c.Header=function(...e){let t=n.a.controllers.underConstruction;t.id="Header",t.addToItems=!1,n.a.controllers.list.pop(),t.sequence=Object(i.d)(e.map(e=>Object(i.d)(e._promises)));for(let e in t.defaultCommands)for(let r in t.defaultCommands[e])t.defaultCommands[e][r].push("header");return o?(o.resources=o.resources.concat(t.resources),$.extend(!0,o.elements,t.elements),o.headerDefaultCommands=t.headerDefaultCommands,o.sequence=Object(i.d)([o.sequence,t.sequence])):o=t,n.a.controllers.underConstruction=new l,o},c.Footer=function(...e){let t=n.a.controllers.underConstruction;return t.id="Footer",t.addToItems=!1,n.a.controllers.list.pop(),t.sequence=Object(i.d)(e.map(e=>Object(i.d)(e._promises))),s?(s.resources=s.resources.concat(t.resources),$.extend(!0,s.elements,t.elements),s.headerDefaultCommands=t.headerDefaultCommands,s.sequence=Object(i.d)([s.sequence,t.sequence])):s=t,n.a.controllers.underConstruction=new l,s},define_ibex_controller({name:"PennController",jqueryWidget:{_init:function(){var e=this;n.a.controllers.running=e,e.cssPrefix=e.options._cssPrefix,e.utils=e.options._utils,e.finishedCallback=e.options._finishedCallback,e.id=e.options.id,"string"==typeof e.id&&e.id.match(/^Preloader-/)?e.controller=a[Number(e.id.replace(/Preloader-/,""))]:"Header"==e.id?e.controller=o:"Footer"==e.id?e.controller=s:Number(e.id)>=0&&Number(e.id) Please wait while the resources are preloading This may take up to "+Object(i.f)(t)+". Please note that this project is using a beta version of PennController (2.0). Report new bugs at https://www.pcibex.net/bug-report/\n or at support@pcibex.net