 DEFAULT_LOCALE   = 'en'
 # Locales supported by Template.
 LOCALES          = ['en']
-# Regular expression used to validate template name inputs.
-R_VALID_NAME     = /^[A-Za-z0-9]+$/
+# Regular expression used to validate template keys.
+R_VALID_KEY      = /^[A-Z0-9]*\.[A-Z0-9]*$/i
 # Regular expression used to validate keyboard shortcut inputs.
-R_VALID_SHORTCUT = /[A-Z0-9]/
+R_VALID_SHORTCUT = /[A-Z0-9]/i
 
 # Private variables
 # -----------------

      $('#template_enabled').attr 'checked', 'checked'
      $('#template_image option').first().attr 'selected', 'selected'
      $('#template_image').change()
      $('#template_name').val ''
      $('#template_shortcut').val ''
      $('#template_title').val ''
    else

# Update the URL shorteners section of the options page with the current
# settings.
loadUrlShorteners = ->
  bitly  = store.get 'bitly'
  googl  = store.get 'googl'
  yourls = store.get 'yourls'
  $('input[name="enabled_shortener"]').each ->
    $this = $ this
    $this.attr 'checked', 'checked' if store.get "#{$this.attr 'id'}.enabled"
    yes
  $('#bitlyApiKey').val bitly.apiKey
  $('#bitlyUsername').val bitly.username
  if googl.oauth
    $('#googlOAuth').attr 'checked', 'checked'
  else
    $('#googlOAuth').removeAttr 'checked'
  $('#yourlsPassword').val yourls.password
  $('#yourlsSignature').val yourls.signature
  $('#yourlsUrl').val yourls.url
  $('#yourlsUsername').val yourls.username
  loadUrlShortenerControlEvents()

# Bind the event handlers required for controlling URL shortener configuration
