   exports.Promises = Promises
   HasProperties.prototype.sync = Backbone.sync
 
-
   utility =
-    load_user : () ->
+    load_user: () ->
       response = $.get('/bokeh/userinfo/', {})
       return response
 
-
-    load_doc_once : (docid) ->
+    load_doc_once: (docid) ->
       if _.has(Promises.doc_promises, docid)
         console.log("already found #{docid} in promises")
         return Promises.doc_promises[docid]

        )
      return response

    load_doc_static : (docid, data) ->
      """ loads data without making a websocket connection """
      load_data(data['all_models'])
      promise = jQuery.Deferred()
      promise.resolve()
      return promise


    load_doc : (docid) ->
      wswrapper = utility.make_websocket();
      response = $.get(Config.prefix + "/bokeh/bokehinfo/#{docid}/", {})
        .done((data) ->

      exports.plotcontext = plotcontext
      exports.plotcontextview = plotcontextview

    bokeh_connection: (host, docid, protocol) ->
      if _.isUndefined(protocol)
        protocol = "https"
      if Promises.doc_requested.state() == "pending"
        Deferreds._doc_requested.resolve()
        $.get("#{protocol}://#{host}/bokeh/publicbokehinfo/#{docid}", {}, (data) ->
          console.log('instatiate_doc_single, docid', docid)
