-instances = []
-
 # IFrameSaver : Wrapper around IFramePhone to save & Load IFrame data
 # into interactive_run_state models in LARA.
 class IFrameSaver
-
-  @instances:      []  # save-on-change.coffee looks these up.
+  @instances: []  # save-on-change.coffee looks these up.
 
   # @param iframe         : an iframe to save data from
   # @param $data_div      : a qjuery element that includes data-* attributes which describe where we post back to
   # @param $delete_button : a qjuery element that is used to trigger data deletion on click
   constructor: (iframe, $data_div, $delete_button) ->
-    @put_url  = $data_div.data('puturl')  # put our data here.
-    @get_url  = $data_div.data('geturl')  # read our data from here.
-    @auth_provider = $data_div.data('authprovider')  # through which provider did the current user log in
+    @put_url = $data_div.data('puturl') # put our data here.
+    @get_url = $data_div.data('geturl') # read our data from here.
+    @auth_provider = $data_div.data('authprovider') # through which provider did the current user log in
     @user_email = $data_div.data('user-email')
     @logged_in = $data_div.data('loggedin') # true/false - is the current session associated with a user
     @learner_url = null

      success: (response) =>
        runSuccess()
        @save_indicator.showSaved("Saved Interactive")


      error: (jqxhr, status, error) =>
        @error("couldn't save interactive")


      window.location.reload()
    @confirm_delete () =>
      @learner_url = null
      @save_to_server(null, "")

  save_to_server: (interactive_json, learner_url) ->
    return unless @put_url
    # Do not send the same state to server over and over again.
    return if JSON.stringify(interactive_json) == JSON.stringify(@saved_state)

    runSuccess = =>
      @saved_state = interactive_json
      if @success_callback
        @success_callback()
      else
        @default_success

    if interactive_json is "nochange"
      runSuccess()
      return
