/* global $ */
/* global GOVUK */

// Warn about using the kit in production
if (
  window.sessionStorage && window.sessionStorage.getItem('prototypeWarning') !== 'false' &&
  window.console && window.console.info
) {
  window.console.info('GOV.UK Prototype Kit - do not use for production')
  window.sessionStorage.setItem('prototypeWarning', true)
}

$(document).ready(function () {
  // Use GOV.UK selection-buttons.js to set selected
  // and focused states for block labels
  var $blockLabels = $(".block-label input[type='radio'], .block-label input[type='checkbox']")
  new GOVUK.SelectionButtons($blockLabels) // eslint-disable-line

  // Use GOV.UK shim-links-with-button-role.js to trigger a link styled to look like a button,
  // with role="button" when the space key is pressed.
  GOVUK.shimLinksWithButtonRole.init()

  // Show and hide toggled content
  // Where .block-label uses the data-target attribute
  // to toggle hidden content
  var showHideContent = new GOVUK.ShowHideContent()
  showHideContent.init()


  // if(window.location.href.indexOf("upload") > -1){
  //   $('#photo').change(function(e){
  //     window.location.href = 'loading';
  //     // $('.photo-status').html('<div class="panel panel-border-wide"><h2 class="heading-medium">Your photo: </h2><p>'+e.currentTarget.value+'</p><img src="'+window.URL.createObjectURL(this.files[0])+'" /></div>')
  //   });
  // }

  if(window.location.href.indexOf("loading") > -1){

    setTimeout(function(){
      window.location.href = 'good-photo';
    }, 3000)
  }

})

@@ -1025,19 +1025,16 @@
 it()%0A%0A%0A 
- //
  if(wind
@@ -1076,19 +1076,16 @@
 %3E -1)%7B%0A 
- //
    $('#p
@@ -1113,23 +1113,20 @@
 n(e)%7B%0A  
-//
     
- 
 window.l
@@ -1156,237 +1156,16 @@
 ';%0A 
- //     // $('.photo-status').html('%3Cdiv class=%22panel panel-border-wide%22%3E%3Ch2 class=%22heading-medium%22%3EYour photo: %3C/h2%3E%3Cp%3E'+e.currentTarget.value+'%3C/p%3E%3Cimg src=%22'+window.URL.createObjectURL(this.files%5B0%5D)+'%22 /%3E%3C/div%3E')%0A  //
    %7D);%0A 
  // 
@@ -1160,19 +1160,16 @@
    %7D);%0A 
- //
  %7D%0A%0A  if

make redirect to loading work again