g_editorState.publishDate;
        addArtwork(artwork, g_editorState.crop, function() {
          hideEditor();
        });

      } else if (g_editorState.action == 'edit') {
        var artwork = JSON.parse($json.val());
        editArtwork(g_editorState.id, artwork, g_editorState.crop, function() {
          hideEditor();
        });
      }
    });

    $cropperbutton.click(function() {
      showCropper();
    });

    $('#editor input')
        .bind('input', function() {
          editorFieldsToJson(