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

Method settingValueDidChange

src/Encoder/AffineCipher.js:159–169  ·  view source on GitHub ↗

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

(setting, value)

Source from the content-addressed store, hash-verified

157 * @param {mixed} value New field value
158 */
159 settingValueDidChange (setting, value) {
160 switch (setting.getName()) {
161 case 'alphabet':
162 // Changing the alphabet setting value can invalidate the slope setting
163 this.getSetting('a').revalidateValue()
164 break
165 case 'caseStrategy':
166 this.getSetting('alphabet').setCaseSensitivity(value === 'strict')
167 break
168 }
169 }
170
171 /**
172 * Validates slope (a) setting value.

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected