Skip to content

Instantly share code, notes, and snippets.

@JamesMGreene
Last active December 25, 2015 07:49
Show Gist options
  • Save JamesMGreene/6942163 to your computer and use it in GitHub Desktop.
Save JamesMGreene/6942163 to your computer and use it in GitHub Desktop.
Design discussion about the JSON responses from ZeroClipboard's "complete" event

CURRENT:

{
  "flashVersion": "WIN 11,2,000",
  "text": "Blah blah blah"
}

FUTURE:

{
  "type": "aftercopy",
  "target": currentElement,
  "success": {
    "text/plain":      true,
    "text/html":       true,
    "application/rtf": true
  },
  "data": {
    "text/plain":      "Blah blah blah",
    "text/html":       "<b>Blah blah blah</b>",
    "application/rtf": "{\\\\rtf1\\\\ansi{\\\\pard\\n{\\\\b Blah blah blah}\\\\par}"
  }
}

QUESTIONS:

  1. Should success only be set to true if ALL sub-status values are true, or if ANY are true?
  2. Are "text/plain", "text/html", "application/rtf", etc. too verbose? I was aiming for something very standardized since we will also be opening this up to custom data types.
@jonrohan
Copy link

I don't think success makes sense keeping if all the sub-status values also denote success.

@jonrohan
Copy link

"text/plain", "text/html", "application/rtf" make sense to me

@JamesMGreene
Copy link
Author

👍

@JamesMGreene
Copy link
Author

Updated.

@JamesMGreene
Copy link
Author

Renamed status to success to clarify the meaning of the Boolean values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment