     xpath: annotation.ranges[0]
     file_id: annotation.page
 
-  # Nasty extraction method for getting the range start offset and end offset
-  # using just the pre and post strings. Leaving this here for one commit for
-  # posterity.
-  rangesFromLocator: (locator) ->
-    {pre, xpath} = locator
-    endOffset = if xpath.start == xpath.end then pre.length else 0
-    range = 
-      start: locator.xpath.start
-      startOffset: locator.pre.length
-      end: locator.xpath.end
-      endOffset: endOffset
-
-    sniffed = Annotator.Range.sniff(range)
-    browserRange = sniffed.normalize(jQuery('article div')[0]).toRange()
-    range.endOffset = jQuery(browserRange.endContainer).text().lastIndexOf(locator.post)
-    [range]
-
   # Public: Takes an annotation object and returns a highlight object
   # suitable for submission to the Readmill server.
   #

  #     highlight = utils.highlightFromAnnotation(ann)
  #
  # Returns a highlight object.
  highlightFromAnnotation: (annotation, root) ->
    locator = @locatorsFromAnnotation(annotation, root)
    # See: https://github.com/Readmill/API/wiki/Readings
    {
      id: annotation.id

  # Returns a jQuery.Deferred() promise.
  annotationFromHighlight: (highlight, client) ->
    # Try and extract annotation metadata from the locators object.
    meta = (try ranges: [highlight.locators.xpath] catch e then null) if highlight.locators.xpath
    meta = (try ranges: JSON.parse(highlight.pre) catch e then null)  unless meta
    deferred = new jQuery.Deferred()

    if meta
