MCPcopy Create free account
hub / github.com/cryptii/cryptii / settingValueDidChange

Method settingValueDidChange

src/Encoder/PolybiusSquare.js:245–258  ·  view source on GitHub ↗

* Triggered when a setting field has changed. * @param {Field} setting Sender setting field * @param {mixed} value New field value

(setting, value)

Source from the content-addressed store, hash-verified

243 * @param {mixed} value New field value
244 */
245 settingValueDidChange (setting, value) {
246 switch (setting.getName()) {
247 case 'caseSensitivity':
248 this.getSetting('alphabet').setCaseSensitivity(value)
249 this.getSetting('rows').setCaseSensitivity(value)
250 this.getSetting('columns').setCaseSensitivity(value)
251 this.getSetting('separator').setCaseSensitivity(value)
252 break
253 case 'columns':
254 case 'rows':
255 this.getSetting('alphabet').revalidateValue()
256 break
257 }
258 }
259
260 /**
261 * Validates wether alphabet fits into the Polybius square.

Callers

nothing calls this directly

Calls 4

setCaseSensitivityMethod · 0.80
getSettingMethod · 0.80
revalidateValueMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected