Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nodegame-widgets

nodeGame1157.0.3

Collections of useful and reusable javascript / HTML snippets for nodeGame

nodegame, window, widgets, behavioral, game, survey, questionnaire

readme

nodegame-widgets

Build Status

Collection of reusable components (widgets) for nodeGame.

Widgets can display timers, count rounds, display total earnings, draw Chernoff faces and much more.

Resources

License

MIT

changelog

nodegame-widgets change log

7.0.3

  • Fixed Consent form not receiving a consent object.
  • ChoiceManager adds freetext on simplify, if available.

7.0.2

  • Simplify option in ChoiceManager adds isCorrect only if FALSE.

7.0.1

  • Consent form fix show/hide button.

7.0.0

  • New widgets: Consent, SDO, GroupMalleability.
  • VisualStage: improved support for reading step property.
  • ChoiceTable: supports adding widgets as choices.
  • ChoiceTable: checks 2 levels up for the TD id.
  • ChoiceTable: choice is saved as number (no longer as string), so onclick and getValues will return that number.
  • ChoiceManager: skips widgets that do not return values.
  • ChoiceManager: default widget for forms is ChoiceTable.
  • ChoiceManager: simplify option returns only forms @experimental.
  • ChoiceTable: choices have all same width when they are horizontal. sameWidthCell option to control.
  • Widgets.append(): call W.adjustFrameHeight with some delay.
  • bootstrap5 option for all widgets.
  • WaitingRoom: new treatment "treatment_latin_square"
  • ChoiceTable and ChoiceTableGroup: errorBox to display error messages.
  • Several minor fixes.

6.3.0

  • VisualStage supports functions as 'name' step-property.
  • Fixed bug in Chat when receiverOnly is true.

6.2.0

  • CustomInput has a userValidation function.
  • Return value "missValues" is non-blocking for step advancing (only for information).
  • Fixed non-assignment of required flag when widgets have correctChoice = zero.
  • SVO main text updated.
  • Chat widget improved, fixed receiverOnly option not read, sendMsg method is public, structured msgs can be rendered.
  • ChoiceTable: Fixed setValue with no values and some choices are non-primitives.
  • CustomInputGroup supports only some items required.
  • Improved BackButton in response to events and first step.
  • DoneButton added in init stays disabled until PLAYING.
  • Added classes: choicetable-vertical, choicetablegroup.
  • New method setError in ChoiceTable.

6.1.1

  • ChoiceManager sets itself to "required" if any form requires user action.
  • Widgets.js does not set required=false, leave it undefined.

6.1.0

  • Widgets destroyed on exit of exit steps by default
  • Header in ChoiceTableGroup (experimental, in progress...).

6.0.1

  • Fixed null reference with Slider hint and required movement.

6.0.0

  • Slider changes color on mouse over (option hoverColor changes default).
  • VisualRound can count steps as well.
  • VisualStage correctly does not process the name of the stage when the step-property 'name' is defined by the user
  • RiskGauge has the Bomb method.
  • ChoiceManager scrolls into last errored form.
  • DoneButton onclick handler and setText method.
  • MoneyTalks small improvements: update method returns current value.
  • ChoiceTable className option is always added and does not replace choicetable
  • VisualTimer.restart accept only number of milliseconds.
  • Fixed contains method not found in IE.
  • Widget.isActionRequired method added.
  • Auto-scroll for widgets requiring action.

5.8.2

  • Fixed bug Chat "is typing...".
  • Fixed bug ChoiceTable separator concatened with id matches separator.
  • Error raised if choicesSetSize is specified with left or right in ChoiceTable.

5.8.1

  • Fixed bug with ChoiceTable and correctChoice = 0.

5.8.0

  • VisualStage option replaceUnderscore (default TRUE) replaces all underscores with spaces.
  • ChoiceTable option disableChoices and methods to disable/enable choices.
  • Fixed bug in costructor inner mode of VisualRound

5.7.1

  • Fixed required Slider and No Change.

5.7.0

  • ContentBox accepts the hint parameter.
  • New Slider widget.
  • DoneButton waits a little bit before becoming active again on a new step, option "delayOnPlaying".

5.6.6

  • ChoiceTable.setValues ignores "correct" option (instead of throwing) when there is no correct choice.
  • ChoiceTable.oneTimeClick option immediately removes selection after a click (useful to create buttons).

5.6.5

  • Fixed RiskGauge currency option; added option currencyAfter.
  • BackButton updated to new Game API.

5.6.4

  • ChoiceTable getValue -> addValue.

5.6.3

  • ChoiceTable.getValues has option to sort multiple choices (sortValue).
  • ChoiceTable choices option accepts objects of the type { value: 'X', display: 'Y' }.
  • ChoiceTableGroup correctly distinguishes listener and onclick options.
  • EndScreen accepts any value as winning (before only > 0).

5.6.2

  • BackButton gets the right previous step when multiple calls are made in sequence.

5.6.1

  • RiskGauge scale and values options.

5.6.0

  • CustomInput type text checks for no numbers.

5.5.2

  • Fixed autoHint in feedback.
  • Fixed ChoiceTable requiredChoice == selectMultiple in autoHint.
  • Fixed typo textArea in ChoiceTable.

5.5.1

  • DoneButton correctly detects isDisabled.
  • Fixed VisualTimer not starting on PLAYING.
  • Fixed bug Requirements error.

5.5.0

  • ChoiceTable and ChoiceTableGroup is tabbable.
  • New widgets: CustomInputGroup, RiskGauge, ContentBox.
  • Chat improvements: enter and submit can be used together; auto focus on textarea after pressing on submit; scroll to bottom method.
  • Feedback.setValues improved.
  • DisconnectBox improved.
  • DoneButton automatically disables on disconnect (option to prevent it).
  • Chat is typing notification.

5.4.0

  • Fixed VisualTimer.startOnPlaying and stopOnDone options.
  • VisualStage widget updated, contains also an 'inline' mode.

5.3.1

  • Fixed Widget.title = false.

5.3.0

  • CustomInput.setValues sets random values or picks from option availableValues.
  • ChoiceManager does not check values of hidden or disabled widgets.
  • Fixed typo and submitButton in Feedback widget.
  • More CustomInput types.
  • ChoiceTable onclick listener receives a numeric value instead of a string.
  • All "Survey" widgets, e.g. CustomInput, ChoiceTable, etc, have highlight and markAttempt true by default.
  • When no title is specified for a widget, an empty header is created (instead of no header).

5.2.0

  • ChoiceManager.reset to reset all forms in the widget.
  • Fixed ChoiceManager.getValues for forms with requiredChoice truthy.
  • Feedback and EmailForm can also send set messages (deprecated "say" option, use "send").
  • EndScreen askServer.
  • ChoiceTable.setValus accepts and validates preset values.
  • node.widgets.append accepts an id as root element.

5.1.0

  • CustomInput widget.
  • ChoiceManager formsOptions parameter.
  • ChoiceTable: selectMultiple can be an integer controlling how many selected items are allowed.
  • After a widget is destroyed, frame height is checked and adjusted.
  • Widgets implements a garbage collector method to remove widgets no longer on page.
  • ChoiceTable.originalOrder removed, not meaningful.
  • Feedback widget implements word counts and other improvements.
  • Minor improvements.

5.0.1

  • Fixed VisualTimer init method not receiving an object bug.

5.0.0

  • New widget: BackButton to navigate backwards the step played.
  • New widget: BoxSelector is a clickable box presenting a list of options.
  • New widget: DebugWall displays all incoming and outgoing messages and output in a configurable div.
  • Rewritten widget Chat, new features and options available, see online doc.
  • Updated widget DisconnectBox.
  • Widget event emitters: every widget can emits events locally.
  • Widget.prototype.destroy removed. Used widget.on('destroyed') instead.
  • Fixed ChoiceTable selection with selectMultiple.
  • Remove panel at widget definition. If Widget.panel is false no panel is created (useful for buttons).
  • Docked widgets: widgets can be docked at the bottom of the page.
  • Class names passed as option are added to default class name, instead of replacing it.
  • Widgets can be minimized and closed completely.
  • Option collapseTarget: minimized widgets are moved into this specific area of the page.
  • WaitingRoom widget mode WAIT_FOR_DISPATCH
  • Widgets.destroy removed. Used the method on the widget itself.
  • Several fixes and css improvements.

4.1.0

  • Waiting room supports treatment selection.
  • Fixed text tooManyPlayers.

4.0.0

  • EndScreen widget displays information such earnings, exit code, feedback and email forms.
  • Feedback widget (compatible as Choice-Like widget).
  • EmailForm widget (compatible as Choice-Like widget).
  • #Widget.addFrame() and #Widget.removeFrame() display/remove the border and margins around the bodyDiv element of the widget.
  • frame can be passed as an option to the #node.widgets.append() method and if FALSE it behaves like #Widget.removeFrame().
  • LanguageSelector sets Window URI prefix and notify server of language selections, according to options.
  • Removed init() method from all widget's contructor (it is called automatically by API).
  • Removed css/ folder, now in nodegame-server.
  • Other improvements...

3.5.7

  • Last appended widget is available under node.widgets.lastAppended.
  • #Widgets.isWidget() returns TRUE if object is widget-like (see inline comment).
  • Experimental EndScreen (in progress).

3.5.6

  • VisualTimer makes sure that options are manually cloned to avoid overriding step properties.
  • Widgets.append by default appends to the iframe's body, and not the iframe's root.

3.5.5

  • Bug Fix: ChoiceTable.setValues() does not unsets the value if new selected value is the same as previous.
  • Bug Fix: ChoiceTableGroup.unsetCurrentChoice().

3.5.4

  • Minor fix on Chat, ChoiceManager, MoneyTalks.

3.5.3

  • Minor changes to ChoiceTableGroup, ChoiceTable and ChoiceManager.

3.5.2

  • Actually implements changes in ChoiceTable and ChoiceTableGroup described in 3.5.1.

3.5.1

  • Better error messages in Widgets.js.
  • #ChoiceTable.shuffle() and #ChoiceTableGroup.shuffle().

3.5.0

  • VisualTimer auto-set itself to 0:00 striken, if there are no timer settings in step.
  • Fixed travis test.

3.0.2

  • VisualRound correctly interprets gameover stage.

3.0.1

  • Minor update in MoneyTalk.

3.0.0

  • 02/10/2016 NodeGame Version Upgrade.

2.3.2

  • WaitingRoom correctly displays if a player can still join a game.

2.3.1

  • Avoiding duplicated testing in Requirements.

2.3.0

  • Fixed bug in WaitingRoom.destroy(). The loading dots are properly stopped now.

2.2.0

  • Implementing .setValues in ChoiceTable ChoiceTableGroup, ChoiceManager, SVOGauge and MoodGauge.

2.1.0

  • Fixed timer destroying in Waiting Room.

2.0.0

  • Widgets.destroy()

0.7.1

  • Improved ChernoffFaces.
  • Added option totStageOffset for VisualRound.

0.7.0

  • Improved Requirements widget. Some functions are moved into separate repo (nodegame-requirements).
  • Proper cleanup by loadFrameTest in Requirements.
  • Controls subclasses are registered correctly
  • Automatic destroy of widget: widgets are removed from page, and any modification to event emitters made during the call to the Widget.listeners() method is restored. If in node.widgets.instances, it will be removed from there.
  • New widgets: DebugInfo, WaitingRoom. Updated: Requirements.
  • Every widget has a unique widget id: .wid.
  • Added setup functions to setup widgets (also remotely).

0.6.7

  • Many widgets have been ported (to check still)
  • IE fix for setTitle (insertBefore)

0.6.6

  • Fix bug #VisualTimer.clear() with the new option introduced in 0.6.5

0.6.5

  • Added options startOnPlaying, and stopOnDone to VisualTimer.

0.6.4

  • Documentation fixes.
  • Removed EventButton.