Fix a fatal in "create subtask"

Summary: This got clipped by the actor/email thing I think.

Test Plan: "Create Subtask" no longer fatals.

Reviewers: btrahan, vrana, hsb

Reviewed By: hsb

CC: aran, lesliepc16

Maniphest Tasks: T1918

Differential Revision: https://secure.phabricator.com/D3718
Restore a more surgical workflow/target check

Summary:
D3707 removed some overbroad rules for when we trigger workflows, but there is still one case we should check for -- an <a /> without workflow inside a <form /> with workflow. This occurs in, e.g., the "help" button in Remarkup.

If the node with workflow isn't a link, don't trigger workflow. This should allow the <a><img /></a> case to keep working properly.

Test Plan: Clicked "?" in remarkup bar.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3722
Don't set mustcapture for falsey values

Summary: See discussion in D3722. Good catch -- I'd definitely say this is a bug.

Test Plan: Rendered two <div />s, one with mustcapture set to `true` and one to `false`. The first got `data-mustcapture`; the second did not.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3723
Move skins toward modularization

Summary:
Two high-level things happening here:

  - We no longer ever need to put meta-UI (content creation, editing, notices, etc.) on live blog views, since this is all in Phame now. I pulled this out.
  - On the other hand, I pushed more routing/control logic into Skins and made the root skin a Controller instead of a View. This simplifies some of the code above skins, and the theory behind this is that it gives us greater flexibility to, e.g., put a glue layer between Phame and Wordpress templates or whatever else, and allows skins to handle routing and thus add pages like "About" or "Bio".
  - I added a basic skin below the root skin which is more like the old root skin and has standard rendering hooks.
  - "Ten Eleven" is a play on the popular (default?) Wordpress themes called "Twenty Ten", "Twenty Eleven" and "Twenty Twelve".

Test Plan: Viewed live blog and live posts. They aren't pretty, but they don't have extraneous resources.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1373

Differential Revision: https://secure.phabricator.com/D3714
Add cached summarization to PhamePost

Summary: Restore summarization. Use the remarkup cache, and try to do it somewhat-intelligently (pick the first paragraph that looks like it's text).

Test Plan:
{F21323}

{F21324}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1373

Differential Revision: https://secure.phabricator.com/D3715
Allow simple template-based skin definitions

Summary:
Lower the barrier to entry for installing and creating skins, so we can kill Wordpress. You can now install skins by dropping them into a directory, and build either "advanced" (full phutil library) skins or "basic" (simple PHP templates) skins.

Next up is getting static resources working in an easy way for skins.

I put these in `externals/` for now so they don't get hit by lint.

Test Plan: Viewed the Pokeblog with the Oblivious skin.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1373

Differential Revision: https://secure.phabricator.com/D3717
Allow blog resources to be served without Celerity

Summary:
Allow skins to serve arbitrary resources without needing to be mapped, so we can have a vibrant community of amateur skinners.

For "basic" skins, just put all the "css/" on the page always.

Includes an image to prove that works.

@vrana, pretty sure this has no impact outside of Phame but it does change Celerity so it might be to blame if there's any weirdness with static resources.

Test Plan:
{F21341}
{F21340}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1373

Differential Revision: https://secure.phabricator.com/D3719
Respect `phriction.enabled` in config

Summary: Eventually we'll have a real "uninstall" sort of thing, but until we do we should keep respecting this flag.

Test Plan: Disabled the flag, saw Phriction vanish from the application list.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3724
Support simple table Remarkup in Phabricator

Summary: {F21402}

Test Plan: Generated docs, used it in comment.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3726
Raise a better error for trying to create an empty document in Phriction

Summary:
When you delete the content of a document in Phriction, we treat it as an attempt to delete the document.

In the case you're creating the document, we hit an exception trying to delete a document which doesn't exist yet.

Detect this case and raise a better error.

Test Plan: Tried to create an empty document, got a good error. Created a nonempty document. Edited a document to empty to delete it.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1920

Differential Revision: https://secure.phabricator.com/D3728
Don't hide filename in filetree on hover

Summary:
It currently looks like this:

{F21417, size=full}

Test Plan: Hovered file name in filetree.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3729
Add table icon to remarkup spritesheet

Summary: See D3730.

Test Plan: Looked at sprite.

Reviewers: vrana

Reviewed By: vrana

CC: chad, aran

Differential Revision: https://secure.phabricator.com/D3731
Provide assist for Remarkup table

Summary: Can you please pick up the icon for it and regenerate sprites?

Test Plan:
Selected text, clicked on it.
Unselected text, clicked on it.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3730
Don't choke on copy-pasted diffs which include commit messages

Summary: If you `git show` and copy/paste it into Differential, we die trying to save the DifferentialChangeset corresponding to the commit message (error: column "filename" can not be null). Instead, drop the message change for raw diffs.

Test Plan: Copy/pasted `git show` into Differential.

Reviewers: btrahan, vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3740
Fix symbol search in typeahead

Test Plan: Inputted 'Mac' to search field.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3754
Fix static variable usage in Lisk

Summary:
See comment.
This can reveal some pretty bad bugs but HPHP handles this correctly so we already know about them.

Test Plan:
Added `phlog()` to `__call()` and observed what is defined for each method (under PHP). Also:

  class C {
    function __call($name, $args) {
      static $class;
      if (!$class) {
        $class = get_class($this);
      }
      return $class;
    }
  }

  class D extends C {
  }

  class E extends C {
  }

  $d = new D;
  $e = new E;
  var_dump($d->x());
  var_dump($e->x()); // Prints D under PHP!

See also D3754.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1261

Differential Revision: https://secure.phabricator.com/D3753
Use phutil_split_lines() in Differential

Summary:
  - We currently treat "\r" as a newline, but should not because VCSes do not.
  - We get an extra empty line at the end of diffs created after D3442 because we now retain newlines.
  - Historically we've converted tab pre-cache, but do it post-cache instead so we can add prefs about it, as we should handle it better than we do (e.g., let the user set it to a different width, infer width from comments in the file, expand it to actual tab stops, or show it visually in some way).

Test Plan:
  - Verified diffs no longer have an empty line at the end.
  - Created a diff of a "\r" file and verified it displayed somewhat reasonably. All browsers treat "\r" as a real newline so it's not necessarily perfect, but we can clean that up later. Hopefully these files are exceedingly rare.
  - Created a file with tabs and verified it came out reasonably.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1857

Differential Revision: https://secure.phabricator.com/D3759
Revert "Use phutil_split_lines() in Differential"

This reverts commit f6cb51562efd4f2e599d8ea69c5d5331d4de6d8d.

This has some bugs in normal diffs that I haven't immediately been able to figure out. I'll reapply it once I sort them out.

Auditors: vrana
Restore phutil_split_lines() to Differential

Summary:
Same as D3759 with a fix:

Previously, we would insert `null` to indicate a line that doesn't exist on one side of a diff, and then implode on "\n", so we'd get "\n" as a result.

In D3759, we'd insert `null` but implode on empty string, and get nothing as a result.

When a placeholder null is present, explicitly insert a newline.

Test Plan: D3759 plus examined a diff with removed lines on the left side prior to new lines on the right side.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3765
Pass key to aggregate exception

Summary: This information may be quite useful.

Test Plan: Uploaded file.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3763