Added ".idea" to gitignore

Keeps PhpStorm's project files out of commits
Implement PhrictionDocumentQuery

Summary:
Companion for D5284. Move all the query logic to a policy-aware query class. In particular:

  - Currently, anyone can view and edit a project's wiki documents. For callsites using this query class, you must be able to view or edit the project to view or edit its documents.
  - There's some very sketchy logic with the content/document joins. This cleans that up.
  - This cleans up loading projects by moving it inside the query. We need to do this anyway to perform policy checks.

Test Plan: Viewed active/all/updated. Set page size to 2, verified pager works.

Reviewers: AnhNhan, chad

Reviewed By: AnhNhan

CC: aran

Differential Revision: https://secure.phabricator.com/D5285
Remove 'Images' from editing a mock

Summary: For now, remove the images field when editing a mock, can add it back if we decide to allow it.

Test Plan: Check edit mock, field gone, check new mock, field is alive and well.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2552

Differential Revision: https://secure.phabricator.com/D5289
Remove overflow:hidden from form-view

Summary: Typeaheads that are overflow have their contents hidden inside the form view.

Test Plan: Tested Creating a Mock. Would like guidance on what this was solving so we can find something else.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2690

Differential Revision: https://secure.phabricator.com/D5290
Add hover color to upload files area.

Summary: Adds the hover color to the upload images area on Create Mock.

Test Plan: Hover image, get background change.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin, AnhNhan

Differential Revision: https://secure.phabricator.com/D5291
Fix a name mismatch in PhrictionDocumentQuery

Summary: Fix an oversight in {D5285}

Test Plan: works smoothly again :D

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2686

Differential Revision: https://secure.phabricator.com/D5294
Enabling Admins to set profile pictures for System Agents

Summary: Added an action in Edit option of People application allowing Admins to set profile pictures for System Agents

Test Plan: By trying to set a profile picture for the sytem agents

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5293
Conpherence - Make the files widget more useful and ajaxify some more stuff

Summary: files widget updates as new files are added. made basically all edits "ajax" except for when you change the conpherence image which just does a reload. I will fix this in a future diff but it was starting to spiral out of control a bit.

Test Plan: commented on a task with files and noted the updated file widget. updated header image via drag and drop and dialogue -- noted a full reload. cropped image and re-titled conpherence - ajax updated as expected.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2530

Differential Revision: https://secure.phabricator.com/D5288
Fix link colors.

Summary: Fix the visited state on visited closed tasks.

Test Plan: Create and close tasks, visit them, note state doesnt change. Check hover states.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5298
Adjust the shade of green in blame

Summary:
We are loading blame on background which confuses me a bit - I'm not sure if it's still loading or it's already loaded and the commit changed lots of lines (so I don't see the author) and it was a long time ago (so I don't see green).
Provide a visual feedback even for very old commits.

I want to point out that I really enjoy this kind of work.
Also, this diff is my masterpiece at least for today.

Test Plan: ?view=blame - verified that the gray changed to a decent shade of green even for very old commits.

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5292
reduce noise on daemon console

Summary:
this suppresses displaying entries that have not been in the running
state for more than 3 days.

note: We should probably kill off these dead rows similar
to the code at the top of the loop, but without checking to see if we're
the same host and the item is still live, or have some other cruft removal
job to effect the same.

Test Plan: load /daemon/ and rejoice that there are fewer crufty rows.

Reviewers: vrana, nh

Reviewed By: nh

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D5299
Allow speical keys to be bound to keystrokes

Summary: Fixes T2711. Allows special keys (arrows, tab, return) to be bound as shortcuts. Binds left and right as shortcuts in Pholio.

Test Plan: Pressed left. Pressed right.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2711

Differential Revision: https://secure.phabricator.com/D5303
Remove "MetaMTA Transcripts" and "Herald Transcripts" links from Differential

Summary: These actions are dumb, and not smart, and no one likes them.

Test Plan: Looked at a revision and saw fewer actions; higher average action quality.

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5304
Harden custom date fields against userland adventures

Summary: Users do things like change the type of a field. Currently, we throw when this happens. Instead, recover somewhat-gracefully.

Test Plan:
Created a "string" field, then changed it to a "date" field.

{F35241}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5310
Have AphrontView implement PhutilSafeHTMLProducerInterface

Summary: Allows views to work like tags.

Test Plan: Implemented a few completely arbitrary render() / singleView simplifications. I just picked some that were easy to test. I'll do a more thorough pass on this in a followup; these calls don't really hurt anything.

Reviewers: chad, vrana

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5306
Remove all calls to renderSingleView() and deprecate it

Summary: After D5305, this method does nothing since we automatically figure out what we need to do.

Test Plan:
- Viewed a page with the main menu on it (MainMenuView).
- Viewed a revision with transactions on it (TransactionView).
- Viewed timeline UIExample (TimelineView, TimelineEventView).
- Viewed a revision (PropertyListView).
- Viewed a profile (ProfileHeaderView).
- Viewed Pholio list (PinboardView, PinboardItemView).
- Viewed Config (ObjectItemView, ObjectItemListView).
- Viewed Home (MenuView).
- Viewed a revision (HeaderView, CrumbsView, ActionListView).
- Viewed a revision with an inline comment (anchorview).
- Viewed a Phriction diff page (AphrontCrumbsView).
  - Filed T2721 to get rid of this.
- Looked at Pholio and made inlines and comments (mockimages, pholioinlinecomment/save/edit).
- Looked at conpherences.
- Browsed around.

Reviewers: chad, vrana

Reviewed By: chad

CC: edward, aran

Differential Revision: https://secure.phabricator.com/D5307
Add support for device swipe events

Summary:
Ref T2700. Allow JS to listen for swipes on devices.

There are a bunch of tricky cases here and I probably didn't get them all totally right, but this interaction broadly looks like this:

  - We implement gesture recognition for the mouse in device modes (narrow browser), and for touch events from an actual device.
  - The sigil `touchable` indicates that a node wants to react to touch events.
  - When the user touches a `touchable` node, we start listening for moves. They might be tapping/clicking (in which case we don't care), but they might also be gesturing.
  - Once the user moves their finger/pointer far enough away from the tap origin, we recognize it as a gesture. I hardcoded this at 20px; I wasn't able to find any "official" Apple value, but 20px seems like a common default.
  - At this point, we look at where their finger has moved.
    - If they moved it mostly up/down, we interpret the gesture as "scroll" and just stop listening. The device does its own thing.
    - However, if they moved it mostly left/right, we interpret it as a "swipe". We start killing the moves so the device doesn't scroll.
  - Once we've recognized that a gesture is underway, we send a "gesture.swipe.start" event and then "gesture.swipe.move" events for every move.
  - When the user ends the gesture, we send "gesture.swipe.end".
  - If the user cancels the gesture (currently, only by tapping with a second finger), we send "gesture.swipe.cancel".
  - Gesture events have raw position data and some convenience fields.

Test Plan:
Wrote UI example and used it from the Desktop, iPhone simulator, and a real iphone.

  - The code always seems to get "scroll" vs "swipe" correct (i.e., consistent with my intentions).
  - The threshold feels pretty good to me.
  - Tapping with a second finger cancels the action.

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T2700

Differential Revision: https://secure.phabricator.com/D5308
Support basic swipe gestures in Pholio

Summary:
Ref 2700. No sexy animation yet, but allows you to swipe left and right to switch photos. Generally feels pretty good to me.

Also fixes a left/right but and a bug where taps could be interpreted as gestures and simplifies some touch code.

derpdog

Test Plan:
Swiped left and right in Pholio.

{F35239}

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5309
Implement card style and extras for object item lists

Summary:
Initial pass at elements appearing on M10.

Glaring omissions:

  - I cut a single icon out of M10 in a haphazard way.
  - No linear graident texture on the cards.

Test Plan:
{F35248}
{F35249}

Reviewers: chad

Reviewed By: chad

CC: aran

Differential Revision: https://secure.phabricator.com/D5311
Implicitly CC inline commenters in Pholio

Summary: Fixes T2722. Both the "comment" (default) and "inline comment" (needs to be specialized) actions should imply CC.

Test Plan: Made an inline on a mock, got implicitly cc'd.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2722

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