       values.push {id: value, text: value} if value != ''
 
     $(field_id).select2 'data', values
+
+select_for_http_links = (id) ->
+
+  # Puts http:// in front of selection and sets obj.id equal to obj.text
+  format = (object, container) ->
+    text = escapeHTML(object.text)
+    # Assume a url has been entered and stick a http:// in front if it's not there
+    if not object.text.match(/^http[s]?\:\/\//)
+       text = 'http://' + text
+    else
+      text
+
+    object.text = object.id = text
+
+  if $(id)[0]
+    $(id)?.select2
+      minimumResultsForSearch: Infinity
+      tags: []
+      width: '80%'
+      tokenSeparators: [',', ';']
+
+      formatNoMatches: ->
+        "Enter a valid URL"
+
+      formatResult: format
+      formatSelection: format
+
+    _setup_select2_delete_callback id, (tag) ->
+      tag.children("div").html()?.trim()
 
 initialize_editor = ->
 

      results: (data, page) ->
        results: data.map (term) -> {id: term, text: term}

  $(field_id).ready ->
    values = []


    window.onresize = ->
      editor.reflow()

initialize_wayback_links = ->
  wayback_url = 'https://web.archive.org/web/*/'
  $('#show-wayback-links').on 'click', (e) ->
