     $($(this).data("target")).submit()
     false
   )
-  .on('mouseenter', '[data-object~="hover-show"]', ->
+  .on("mouseenter", "[data-object~=hover-show]", ->
     return false unless document.documentElement.ontouchstart == undefined
-    $('[data-object~="hover-show"]').each( (index, element) ->
-      $($(element).data('target')).hide()
+    $("[data-object~=hover-show]").each( (index, element) ->
+      $($(element).data("target")).hide()
     )
-    $($(this).data('target')).show()
+    $($(this).data("target")).show()
   )
-  .on('mouseleave', '[data-object~="hover-show"]', ->
-    $($(this).data('target')).hide()
+  .on("mouseleave", "[data-object~=hover-show]", ->
+    $($(this).data("target")).hide()
   )
   .keydown( (e) ->
-    if $("#interactive_design_modal").is(':visible')
+    if $("#interactive_design_modal").is(":visible")
       hideInteractiveDesignModal()     if e.which == 27
     if e.which == 77 and not $("input, textarea, select, a").is(":focus")
-      if $('#preview-mode').length == 1 and $('#edit-mode').length == 1 and $('#edit-mode').parent().hasClass('active')
-        $('#preview-mode').click()
+      if $("#preview-mode").length == 1 and $("#edit-mode").length == 1 and $("#edit-mode").parent().hasClass("active")
+        $("#preview-mode").click()
       else
-        $('#edit-mode').click()
+        $("#edit-mode").click()
       e.preventDefault()
       return
   )
-  .on('click', '[data-object~="settings-save"]', ->
+  .on("click", "[data-object~=settings-save]", ->
     window.$isDirty = false
-    $($(this).data('target')).submit()
+    $($(this).data("target")).submit()
     false
   )
-  .on('click', '[data-object~="toggle-visibility"]', ->
-    $($(this).data('target')).toggle()
+  .on("click", "[data-object~=toggle-visibility]", ->
+    $($(this).data("target")).toggle()
     false
   )
-  .on('change', ':input', ->
-    if $("#isdirty").val() == '1'
+  .on("change", ":input", ->
+    if $("#isdirty").val() == "1"
       window.$isDirty = true
   )
-  .on('click', '[data-object~="toggle-delete-buttons"]', ->
-    $($(this).data('target-show')).show()
-    $($(this).data('target-hide')).hide()
+  .on("click", "[data-object~=toggle-delete-buttons]", ->
+    $($(this).data("target-show")).show()
+    $($(this).data("target-hide")).hide()
     false
   )
   .on("wheel", "input[type=number]", ->


@fadeAndRemove = (element) ->
  $(element).fadeOut(500, -> $(element).remove())

@setFocusToField = (element_id) ->
  val = $(element_id).val()
  $(element_id).focus().val('').val(val)

@componentsReady = ->
  themesReady()

  window.$isDirty = false
  componentsReady()
  extensionsReady()
  $("[data-object~=form-load]").submit()

# These functions get called on initial page visit and on turbolink page changes
@turbolinksReady = ->
