e.val(artwork.byline);
      $attribution.val(artwork.attribution || '');
      $detailsurl.val(artwork.detailsUri);
      $imageurl.val(artwork.imageUri);
      $thumburl.val(artwork.thumbUri);
    } catch (e) {
    }
  }

  function isEmpty(s) {
    return !(s || '').replace(/^\s+|\s+$/g, '');
  }

  function updateEditorState() {
    // required fields
    $title.toggleClass('error', isEmpty($title.val()));
    $byline.toggleClass('error', isEmpty($byline.val()));

    $detailsurl.toggleClass('error', is