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

Method settingValueDidChange

src/Encoder/Base64.js:148–164  ·  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

146 * @param {mixed} value New field value
147 */
148 settingValueDidChange (setting, value) {
149 switch (setting.getName()) {
150 case 'variant': {
151 // Make alphabet and padding settings available with the custom variant
152 this.getSetting('alphabet').setVisible(value === 'custom')
153 this.getSetting('padding').setVisible(value === 'custom')
154 this.getSetting('paddingOptional').setVisible(value === 'custom')
155 break
156 }
157
158 case 'alphabet': {
159 // Alphabet characters are not allowed to be used as padding
160 this.getSetting('padding').setBlacklistChars(value)
161 break
162 }
163 }
164 }
165
166 /**
167 * Returns the current variant options.

Callers

nothing calls this directly

Calls 4

getSettingMethod · 0.80
setBlacklistCharsMethod · 0.80
getNameMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected