mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Feat/Disable parameter editing until right clicked 3 times
This commit is contained in:
parent
0986af4f81
commit
22539933bf
2 changed files with 12 additions and 0 deletions
|
|
@ -383,6 +383,7 @@ deck-config-which-deck = Which deck would you like to display options for?
|
|||
|
||||
deck-config-updating-cards = Updating cards: { $current_cards_count }/{ $total_cards_count }...
|
||||
deck-config-invalid-parameters = The provided FSRS parameters are invalid. Leave them blank to use the default parameters.
|
||||
deck-config-manual-parameter-edit-warning = The parameters should only be generated with the optimize button. Manually editing them is heavily advised against.
|
||||
deck-config-not-enough-history = Insufficient review history to perform this operation.
|
||||
deck-config-must-have-400-reviews =
|
||||
{ $count ->
|
||||
|
|
|
|||
|
|
@ -46,6 +46,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
input.value = stringValue;
|
||||
}
|
||||
}
|
||||
|
||||
const UNLOCK_EDIT_COUNT = 3;
|
||||
let rightClickCount = 0;
|
||||
function onRightClick() {
|
||||
rightClickCount += 1;
|
||||
if (rightClickCount == UNLOCK_EDIT_COUNT) {
|
||||
alert(tr.deckConfigManualParameterEditWarning());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window onresize={updateHeight} />
|
||||
|
|
@ -56,6 +65,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
on:blur={update}
|
||||
class="w-100"
|
||||
placeholder={render(defaults)}
|
||||
disabled={rightClickCount < UNLOCK_EDIT_COUNT}
|
||||
on:contextmenu={onRightClick}
|
||||
></textarea>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue