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

Method settingValueDidChange

src/Encoder/CaesarCipher.js:146–158  ·  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

144 * @param {mixed} value New field value
145 */
146 settingValueDidChange (setting, value) {
147 switch (setting.getName()) {
148 case 'caseStrategy':
149 // Apply case sensitivity on the alphabet setting
150 this.getSetting('alphabet').setCaseSensitivity(value === 'strict')
151 break
152 case 'alphabet':
153 // The shift value description depends on the alphabet and thus needs
154 // to be updated when the alphabet changes
155 this.getSetting('shift').setNeedsValueDescriptionUpdate()
156 break
157 }
158 }
159
160 /**
161 * Generates a random shift setting value.

Callers

nothing calls this directly

Calls 4

setCaseSensitivityMethod · 0.80
getSettingMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected