     bgSettings.clear @field
     @fetch()
 
+  # Static method.
+  @saveOptions: ->
+    Option.all.map (option) -> option.save()
+    $("saveOptions").disabled = true
+
+  # Used by text options. <ctrl-Enter> saves all options.
+  activateCtrlEnterListener: (element) ->
+    element.addEventListener "keyup", (event) ->
+      if event.ctrlKey and event.keyCode == 13
+        element.blur()
+        Option.saveOptions()
+
   # Abstract method; only implemented in sub-classes.
   # Populate the option's DOM element (@element) with the setting's current value.
   # populateElement: (value) -> DO_SOMETHING

# Operations for page elements.
enableSaveButton = ->
  $("saveOptions").removeAttribute "disabled"

saveOptions = ->
  Option.all.map (option) -> option.save()
  $("saveOptions").disabled = true

# Display either "linkHintNumbers" or "linkHintCharacters", depending upon "filterLinkHints".
maintainLinkHintsView = ->

  constructor: (field,enableSaveButton) ->
    super(field,enableSaveButton)
    @element.addEventListener "input", enableSaveButton
    @activateCtrlEnterListener @element

  populateElement: (value) -> @element.value = value
  # If the new value is not empty, then return it. Otherwise, restore the default value.
  readValueFromElement: -> if value = @element.value.trim() then value else @restoreToDefault()
