1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 17:28:51 +02:00
Commit graph

119 commits

Author SHA1 Message Date
Bob Trahan
6aac9f99d7 Quicksand - get the dark console working properly with quicksand
Summary:
Fixes T7700.

This ends up being kind of tricky because

 - the key for a given request is only correct at the time the dark console is rendered
 - the dark console itself should contain every request made, as opposed to being drawn from scratch
 - in the case of a quicksand request, the behavior gets invoked first with the correctly rendered console as part of the `quicksand-redraw` event and then again shortly after as an ajax request would, except this is incorrect relative to when the key should be calculated...

So...

 - assume we can get away with concurrency between the `quicksand-redraw` event and ajax request invocation of the behavior
 - cache the right data as part of the `quicksand-redraw` event and then use it in the subsequent ajax call
   - make sure ajax config gets a 'quicksand' flag

...otherwise its somewhat standard make sure this behavior can be init'd a bunch stuff.

Test Plan: visited '/', visited '/differential/', visited '/DXXX' - observed correctly populating dark console with all sorts of good data stuff. navigated backwards and observed dark console staying the same as expected. navigated by clicking links and console updated again

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7700

Differential Revision: https://secure.phabricator.com/D12582
2015-04-27 16:10:36 -07:00
epriestley
0b309b6193 Update the search scope selector after Quicksand navigation
Summary:
Fixes T7900.

  - Update the hidden form input so the current application is searched.
  - Update the menu icon.
  - Update the button icon, if "Search Current Application" is selected.

Test Plan:
  - Navigated between applications with Quicksand.
    - Observed button icon update.
    - Observed menu icon update.
    - Observed results being scoped to the correct application.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7900

Differential Revision: https://secure.phabricator.com/D12540
2015-04-24 14:20:48 -07:00
Bob Trahan
a903eb2def Quicksand - make things work properly with high security mode
Summary: Fixes T7064. We need to pass the quicksand magic request variable around and then instrument the javascript to handle quicksand page loads.

Test Plan:
Enabled two factor auth on my account and then

 - visited password page
 - filled out 2 factor auth request
 - saw high security bubble
 - clicked about still seeing high security bubble
 - refreshed page and still saw security bubble
 - dismissed bubble by following through workflow after clicking bubble

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7064

Differential Revision: https://secure.phabricator.com/D12536
2015-04-23 16:37:56 -07:00
Bob Trahan
e40aa8f782 Quicksand - make things work correctly with global drag and drop upload
Summary: Fixes T7685. This required making the global drag and drop behavior able to "uninstall" itself so to speak, and then it re-installs it self as necessary.

Test Plan:
Did the following all successfully

 - uploaded a file to homepage
 - homepage -> differential -- no way to upload via drag and drop
 - homepage -> differential -> homepage -- uploaded a file
 - homepage -> differential -> browser back button to homepage -- uploaded a file

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7685

Differential Revision: https://secure.phabricator.com/D12534
2015-04-23 15:08:35 -07:00
Chad Little
91714568f5 Adds a setLabel function to ActionView
Summary: I copied some JavaScript. I think I did OK. Though, I couldn't stop icons from writing HTML as undefined. Anyways, this give us more options, like labels, when drawing ActionViews. I'll update the UI in other places like Policy too.

Test Plan:
Built and tested on the search ui dropdown.

{F379678}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12522
2015-04-23 07:03:03 -07:00
Bob Trahan
ffd62ad7c6 Quicksand - remove code not ready for production re: dark console
Summary: goofed and slipped this into D12499 as I was working on T7700 too.

Test Plan: noted console.log output not there

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12513
2015-04-22 17:12:58 -07:00
epriestley
3a2c2ae3c3 Implement a scope selector for the global search
Summary:
See M1433. Fixes T7266. Fixes T4475. Ref T7314.

Future work/notes/etc:

  - Write the User Guide (see TODO).
  - This might needs some design tweaks -- I think it's functionally almost-equivalent to the mock, but the UI isn't quite the same.
  - (Mobile design is a touch off-looking I think?)
  - When you use a custom query, the duplicate "magnifying glass" icons are a little weird. Maybe change one or the other.
  - Maybe worth adding an "Open Documents in Current Application" option? Planning to wait for feedback on that.
  - Need a Quicksand integration to change the current application at some point.
  - Searching in "Current Application" from, e.g., the 404 page just searches all documents. Current plan is to just document this behavior, since the icon is a pretty good callout and it seems plausible that this is intuitive enough that users won't have a hard time with it.

Test Plan:
New dropdown:

{F379150}

Device-ish:

{F379151}

Normal search (current application, from maniphest, selects tasks):

{F379153}

Application search from non-application:

{F379154}

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: johnny-bit, epriestley

Maniphest Tasks: T7266, T7314, T4475

Differential Revision: https://secure.phabricator.com/D12509
2015-04-22 14:31:36 -07:00
Bob Trahan
688c506ecf Quicksand - update help appropriately as you navigate about
Summary: Fixes T7724. Things are a bit tricky here as sometimes we don't want to display the help icon at all...! Change things such that we always render at least the icon, though it may have the style set to hidden if appropriate. Instrument quicksand javascript to then load the proper help dropdown if it can. Do this generally so other aphlict dropdowns could work pretty easily.

Test Plan: started on home and noted no help. clicked maniphest and saw maniphest help. clicked home and saw no help again. clicked differential and saw differential help.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7724

Differential Revision: https://secure.phabricator.com/D12499
2015-04-22 12:05:27 -07:00
epriestley
2875f029be Fix an issue with custom policy edit control not populating correctly
Summary: These values aren't always provided. They should be, but just make things work for now.

Test Plan:
  - Edited a task.
  - Selected "Custom Policy" for "Edit Policy".
  - Configured a policy like "Users: dog".
  - Saved policy.
  - Selected "Custom Policy" again to edit the policy.
  - Before patch: tokenizer fails to render with an error (`config.types` is not an object).
  - After patch: tokenizer renders properly, albeit with a missing icon.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D12477
2015-04-20 08:16:28 -07:00
epriestley
8f61eb45ab Give tokenizer tokens CSS color classes on the container instead of the icon
Summary:
Ref T4100. See D12465.

  - Instead of putting CSS color classes on the tokenizer icons, put them on the container tags.
  - Note that this removes the "bluegrey" default classes.
  - This doesn't actually add CSS for the classes so, e.g., "green" doesn't make things green yet. This just supports D12465.

Test Plan: Viewed markup, saw classes.

Reviewers: chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T4100

Differential Revision: https://secure.phabricator.com/D12467
2015-04-19 07:17:54 -07:00
epriestley
76448a75de Make token UI stronger and more consistent
Summary:
Ref T4100. Overall:

  - Use token background color to communicate token type (blue = object, yellow = function, grey = disabled/closed, red = invalid).
  - Use token icon color to make color choices consistent (specifically, use project icon colors in project tokens).
  - For functions, use token icon to communicate function result type (e.g., viewer() has a user icon; members(...) has a group icon), since we don't need the icon to indicate "this is a function" anymore.

Test Plan:
{F374615}
{F374616}
{F374617}

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4100

Differential Revision: https://secure.phabricator.com/D12446
2015-04-17 11:06:58 -07:00
epriestley
845466b49b Implement viewer() and members(project) typeahead functions
Summary:
Ref T4100. This is still a bit rough around the edges, but mostly does what we're after.

  - Implements viewer() and members(...) functions.
  - The new browse workflow makes these discoverable.

Test Plan: {F374201}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: chad, epriestley

Maniphest Tasks: T4100

Differential Revision: https://secure.phabricator.com/D12444
2015-04-17 11:06:58 -07:00
epriestley
a4261f41c2 Make browse action available for dynamic/JS-driven tokenizers
Summary: Ref T5750. This makes browse work for all of the dynamic tokenizers in Herald, Policies, batch editor, etc.

Test Plan: Used tokenizers in Herald, Policies, Batch editor.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5750

Differential Revision: https://secure.phabricator.com/D12442
2015-04-17 11:06:58 -07:00
epriestley
a641601407 Implement a rough browse view for tokenizers
Summary: Ref T5750. This adds a basic browse view. Design is a bit rough, see T7841 for some screenshots.

Test Plan: Used browse view to add tokens to tokenizers.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5750

Differential Revision: https://secure.phabricator.com/D12441
2015-04-17 11:06:58 -07:00
epriestley
2ecdbbec10 Don't revert Conpherence page titles when updating notifications
Summary: Fixes T7709. `JX.Title` deals with adding `(1)`, etc., counts, so send updates through it.

Test Plan: Clicked between some threads in Conpherence, no title flickering.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7709

Differential Revision: https://secure.phabricator.com/D12260
2015-04-02 13:41:48 -07:00
Chad Little
8e5153e866 Make busy indicator durable column aware
Summary: Fixes T7699, moves busy indicator when durable column is present

Test Plan: visit uiexamples busy page, toggle column on and off

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7699

Differential Revision: https://secure.phabricator.com/D12257
2015-04-01 20:10:32 -07:00
Chad Little
a0bf9a290a Use font-awesome for busy indicator
Summary: Testing out using a gear instead of compass gif and background. Let me know how it feels

Test Plan:
UIExamples busy page

{F353571}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12201
2015-03-29 16:45:18 -07:00
epriestley
8c1a1312e8 Improve column device behaviors
Summary:
Fixes T7062. When the column is open, we only want to consider the screen width which is avilable for content when computing responsive breakpoints.

Specificially, if you have a 1000px wide browser window (normally "desktop") but the column is open (300px) so you only have 700px free for content (normally "tablet"), we should drop to the tablet breakpoint. This lets you have a narrow column of "tablet" content next to the chat column, instead of a really squished column of "desktop" contnet.

This also means the chat column can't directly use JX.Device to hide itself.

Test Plan: Resized screen with column open, saw content go from Desktop + Column -> Tablet + Column -> Tablet -> Mobile.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7062

Differential Revision: https://secure.phabricator.com/D12189
2015-03-28 06:54:23 -07:00
epriestley
1773af6ada Enable the chunk storage engine
Summary: Ref T7149. This works now, so enable it.

Test Plan:
  - Uploaded large and small files in Firefox, Safari and Chrome.
  - Uploaded large files with `arc upload`.
  - Stopped/resumed large files with all clients.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7149

Differential Revision: https://secure.phabricator.com/D12079
2015-03-15 11:37:05 -07:00
epriestley
135280be9e Support HTML5 / Javascript chunked file uploads
Summary:
Ref T7149. This adds chunking support to drag-and-drop uploads. It never activates right now unless you hack things up, since the chunk engine is still hard-coded as disabled.

The overall approach is the same as `arc upload` in D12061, with some slight changes to the API return values to avoid a few extra HTTP calls.

Test Plan:
  - Enabled chunk engine.
  - Uploaded some READMEs in a bunch of tiny 32 byte chunks.
  - Worked out of the box in Safari, Chrome, Firefox.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7149

Differential Revision: https://secure.phabricator.com/D12066
2015-03-13 11:30:36 -07:00
Bob Trahan
e137d0a0c5 Conpherence - finesse global upload vs conpherence durable column upload
Summary: Fixes T7539. We need to set the "with-column" css class on the document body to make things like the jx-mask style-able. Also, make the global upload control only do it for the standard phabrcator page and not the document body.

Test Plan: dragged a file to conpherence column and it worked! uploaded a file to homepage with column open and it worked! uploaded a file to /file/ with column open and it worked!

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7539

Differential Revision: https://secure.phabricator.com/D12055
2015-03-12 13:40:06 -07:00
epriestley
a1820ecf6e Remove Konami code easter egg
Summary:
This is cool in theory, but has broken like 5 times and is broken now too. The CSS magic just isn't robust enough to keep up with CSS changes.

Just strip it out for now; if we come up with some more durable replacement we can put that back in its place.

Test Plan: Typed konami code, page didn't break horribly.

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D12039
2015-03-10 18:46:28 -07:00
epriestley
eaa883cf37 Fix anchor-clicking scroll positions
Summary:
Fixes T7069. When jumping to a comment anchor, we get the scroll positions wrong.

Partly this is fixing some calcaulations; partly, the "show older comments" and "scroll anchor" stuff were fighting over the scroll position. Since the anchor can take care of things on its own, just let it handle stuff.

Test Plan:
  - Clicked comment anchors.
  - Loaded pages with anchors in the URI.
  - Loaded pages with anchors hidden behind "show older comments".

In all cases, got the right scroll position.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7069

Differential Revision: https://secure.phabricator.com/D11540
2015-01-28 08:26:10 -08:00
epriestley
ea67a8ab8e Make scrolling happen relative to the main content frame
Summary: Fixes T7033. When we've reframed the main page content we need to scroll relative to the containing frame, not relative to the window.

Test Plan:
In Safari, Chrome and Firefox, used j/k/J/K keys to navigate diff content.

Tried some other scroll-based beahviors, like jump-to-anchors.

(It looks like the highlighting reticle got slightly derped a while ago, but it's still functional, so I didn't mess with it.)

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T7033

Differential Revision: https://secure.phabricator.com/D11490
2015-01-25 08:42:40 -08:00
epriestley
c40bc0c8bf Replace the primary scrollbar with a fake one to prepare for a persistent chat column
Summary:
Ref T7014. With a mouse plugged in, multi-panel UIs are pretty hideous on OSX. This is somewhat offputting for me in Conpherence, and really jumps out at me with the new column mocks in T7014.

Sites like Twitch and Facebook approach this by emulating the touchpad scrollbar to achieve a more aesthetic UI. Use a similar approach.

This:

  - Replaces the main scrollbar with a prettier fake one.
  - This prepares the standard page frame for a persistent chat column.

Test Plan:
  - Seems to work properly on OSX, Chrome and Firefox. Haven't tested on IE; my Windows setup is pretty iffy at the moment.
  - Tried Conpherence.
  - Tried Workboards.

Reviewers: btrahan, chad

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7014

Differential Revision: https://secure.phabricator.com/D11472
2015-01-23 13:29:15 -08:00
Joshua Spence
27422ffe8e Use single quotes in JavaScript files
Summary: Use single quotes to keep JSHint happy.

Test Plan: `arc lint`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11431
2015-01-20 08:53:47 +11:00
Bob Trahan
49ee09be3f Tokenizers - improve algorithm around exact matches.
Summary: Fixes T6102. Gets the from  D10867 running in the tokenizer. This thing is pretty copy / pastey, but I guess that's okay?

Test Plan: looked at a project //tokenizer// and typed "project". since I have a million things with the word "project" in it, I was delighted to see the "project" project first in this project tokenizer.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6102

Differential Revision: https://secure.phabricator.com/D11305
2015-01-09 14:53:56 -08:00
Joshua Spence
a2ece77f99 Define function before use
Summary: Silences a JSHint warning.

Test Plan: `arc lint`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11141
2015-01-03 10:31:44 +11:00
Joshua Spence
558e1ee3b8 Define JavaScript functions before they are used
Summary: This should be a fairly minor change that silences a bunch of JSHint warnings.

Test Plan: `arc lint` showed less warnings.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11064
2014-12-30 02:53:32 -08:00
Joshua Spence
e6684af73c Let JSHint know that the show_details function is an exported global
Summary:
The `show_details` function is used by DarkConsole. Adding this comment silences the following JSHint warning:

```
>>> Lint for webroot/rsrc/js/core/behavior-error-log.js:

   Warning  (W098) JSHintW098
    'show_details' is defined but never used.

               5
               6 var current_details = null;
               7
    >>>        8 function show_details(row) {
               9   var node = JX.$('row-details-' + row);
              10
              11   if (current_details !== null) {
```

Test Plan: `arc lint`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11063
2014-12-30 02:51:36 -08:00
Joshua Spence
3f0bc79e0a Minor JavaScript fix
Summary: Currently, `editdata` is implicitly defined as a global variable (and JSHint complains about this). Instead, change it to be a local variable.

Test Plan: `arc lint` showed one less warning.

Reviewers: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11062
2014-12-30 02:50:32 -08:00
Chad Little
06a3cf04fe Catch undefinied title attribute in lightbox
Summary: If the image name in not defined, don't set it. Fixes T6793

Test Plan: View a lightboxed image, no 'undefined' alt tag

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6793

Differential Revision: https://secure.phabricator.com/D11037
2014-12-23 09:28:57 -08:00
Chad Little
895b5580f2 Clean up UITooltips
Summary: Fixes positioning issues by creating another container to hold the abs. positioned arrows. (Issues primarily presented on Workboards).

Test Plan: Test UI arrows on a workboard, applciation launcher, and in UIExamples.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D10897
2014-11-24 11:57:29 -08:00
Bob Trahan
81a13ed8bd Search Typeahead - make exact matches show up first
Summary: Fixes T6102. Give "priority" treatment to strings that are exact matches.

Test Plan:
made a bunch of projects with the word project in them including "Project". before patch, "Project" wouldn't even show up if I typed "Project" - now its the second result right after the application "Projects".

{F235120}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6102

Differential Revision: https://secure.phabricator.com/D10867
2014-11-17 15:32:37 -08:00
Chad Little
e7b6d332e9 Clean up Multirow Manager UI
Summary: Fixes T4234 (Policy and Herald). I will have an additional diff for Maniphest Batch Editor, which looks jank in many other ways.

Test Plan:
Test editing a policy and some herald rules. Stuff lines up better.

{F235086}

{F235087}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T4234

Differential Revision: https://secure.phabricator.com/D10864
2014-11-17 14:06:05 -08:00
Chad Little
d1d3b32213 Include object url in object selector selection
Summary: Fixes T6452, provides actual href instead of just #

Test Plan: Control click and open link in new window, is correct task. Click and see item added to selection list.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6452

Differential Revision: https://secure.phabricator.com/D10774
2014-11-03 08:20:15 -08:00
epriestley
568b0e06e7 Show a count (like "(3)") in the page title corresponding to unread notifications/messages
Summary: Fixes T5368. Synchronizes the page title to reflect unread counts in the notification and Conphernece messages menus.

Test Plan: {F201083}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5368

Differential Revision: https://secure.phabricator.com/D10457
2014-09-10 10:17:49 -07:00
epriestley
f02aed10e7 Fix three issues with scrolling while dragging items (e.g., on workboards)
Summary:
Fixes T5979. There are three issues here:

  - We cache document positions when you pick an item up, but don't recalculate them after you scroll, so they get out of date. Dirty the cache when the user scrolls.
  - When we rebuild the cache during a drag (previously, this never happened), the position of the object you're dragging is computed wrong (since it has been moved to be under the cursor). Adjust the effective position of the object you've picked up to put it back in the right place in the list.
  - When you fiddle around at the bottom of a column you can get jumpy redraws as the height adjusts. Put `min-height` on the container during a drag to prevent this.

Test Plan: In Safari, Chrome and Firefox, dragged items around on columns before and after scrolling the workboard panel.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5979

Differential Revision: https://secure.phabricator.com/D10455
2014-09-09 14:20:27 -07:00
epriestley
aaa08edb12 When users scroll while dragging items, update item positions immediately
Summary:
Fixes T5979. When you drag a task and scroll using the mouse wheel, we don't move the task under your cursor until you move the mouse.

Instead, listen for `scroll` and move the task.

Test Plan:
  - Clicked and dragged a task.
  - While holding the task and not moving the cursor, used the mouse wheel to scroll.
  - The task followed the cursor (previously, it stayed in position until the mouse was moved again).

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5979

Differential Revision: https://secure.phabricator.com/D10416
2014-09-04 12:47:43 -07:00
Bob Trahan
0ddafc4bcd Remarkup - call pasted files "pasted_file" rather than "undefined"
Summary: Fixes T5917. Turns out that pasted files don't get a name - "what is data on a clipboard anyway?" / see https://code.google.com/p/chromium/issues/detail?id=361145

Test Plan: pasted a file and got the slightly better name "pasted_file"

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5917

Differential Revision: https://secure.phabricator.com/D10310
2014-08-20 16:21:50 -07:00
epriestley
fe042def42 Add a Javascript method to find the pixel position of a range in a textarea
Summary:
Ref T3725. This might eventually allow us to do `@username` typeaheads in textareas.

Javascript!!!

Test Plan:
Dumped this into console and got a "<<<" at the caret position in Safari, Firefox and Chrome.

```
setInterval(function() {

var area = JX.$('comment-content');
var r = JX.TextAreaUtils.getSelectionRange(area);
var d = JX.TextAreaUtils.getPixelDimensions(area, r.start, r.end);

JX.log(d);

try {
  JX.DOM.remove(JX.$('ptr'));
} catch (_) {}

document.body.appendChild(
  JX.$N(
    'div',
    {id: "ptr", style: { position: 'absolute', left: d.start.x + 'px', top: d.start.y + 'px', zIndex: 9999, border: '2px solid red' }},
    '<<<'));
}, 1000);
```

Reviewers: chad, btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T3725

Differential Revision: https://secure.phabricator.com/D10280
2014-08-18 13:15:40 -07:00
Chad Little
cd82b90c15 Modernize DatePicker
Summary: Fixes T5893. Uses more standard colors / spacing / shadows / icons.

Test Plan:
pick dates

{F191310}

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5893

Differential Revision: https://secure.phabricator.com/D10285
2014-08-16 14:55:22 -07:00
epriestley
0e98e33b33 When dragging stuff around, compensate for changes in scroll position
Summary:
Ref T5240. This fixes dragging stuff and using the mousewheel or keyboard to scroll the window during the drag.

(It does not fix "dragging near the edge of the container should scroll it" yet.)

Test Plan: Dragged stuff around on task list and workboards in Safari, Firefox and Chrome. Used mousewheel and shift + mousewheel to scroll the document and containers during drag. Object remained under the cursor.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5240

Differential Revision: https://secure.phabricator.com/D10186
2014-08-09 08:49:01 -07:00
epriestley
9181929ebc Give files uploaded to objects a very restrictive view policy
Summary:
Fixes T4589. This implements much better policy behavior for files that aligns with user expectations.

Currently, all files have permissive visibility.

The new behavior is:

  - Files uploaded via drag-and-drop to the home page or file upload page get permissive visibility, for ease of quickly sharing things like screenshots.
  - Files uploaded via the manual file upload control get permissive visibility by default, but the user can select the policy they want at upload time in an explicit/obvious way.
  - Files uploaded via drag-and-drop anywhere else (e.g., comments or Pholio) get restricted visibility (only the uploader).
    - When the user applies a transaction to the object which uses the file, we attach the file to the object and punch a hole through the policies: if you can see the object, you can see the file.
    - This rule requires things to use ApplicationTransactions, which is why this took so long to fix.
    - The "attach stuff to the object" code has been in place for a long time and works correctly.

I'll land D8498 after this lands, too.

Test Plan:
  - Uploaded via global homepage upload and file drag-and-drop upload, saw permissive visibility.
  - Uploaded via comment area, saw restricted visibility.
  - After commenting, verified links were established and the file became visible to users who could see the attached object.
  - Verified Pholio (which is a bit of a special case) correctly attaches images.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4589

Differential Revision: https://secure.phabricator.com/D10131
2014-08-02 14:46:13 -07:00
Joshua Spence
c4586664b3 Apply some linter auto-fixes
Summary: A few minor fixes, applied by `arc lint --everything --apply-patches`.

Test Plan: N/A

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10120
2014-08-02 19:03:02 +10:00
Bob Trahan
6a66d19a2d Global upload - fix for Firefox
Summary: Fixes T5188; see task for discussion.

Test Plan: made error condition occur with Firefox and was able to dismiss it by clicking 2x - once to focus window and then once to actually click in the window. Did this multiple times in a row with no errors.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5188

Differential Revision: https://secure.phabricator.com/D10102
2014-08-01 11:16:02 -07:00
epriestley
af214ecb65 Fix rendering of project slugs in tokenizer UI
Summary: Fixes T5659. When building a token after a user selection, we currently use the `value` as the token text, but sometimes that's an internal name which doesn't make much sense to users. For projects, it is now "sluga slugb Proper Display Name". If available, use `displayName` instead.

Test Plan: Typed some projects into a tokenizer, got display names only.

Reviewers: chad, joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T5659

Differential Revision: https://secure.phabricator.com/D9996
2014-07-21 06:44:27 -07:00
epriestley
a592b32ca4 Share more code between tokenizers and global typeahead
Summary:
Ref T4420. Fixes T5306. Currently, the main menubar search has a lot of redundant/unshared code.

Move some common functions into `JX.Prefab.whatever()` and call them from the main search.

The major change here is that we apply the same "only show closed/disabled/archived objects if there are no matching open objects" logic, fixing T5306.

Test Plan:
  - Used normal typeaheads.
  - Used global search.
  - Searched for a prefix shared by open and archived projects, didn't see the archived ones until the open ones were exhausted.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5306, T4420

Differential Revision: https://secure.phabricator.com/D9899
2014-07-17 15:52:58 -07:00
Joshua Spence
8756d82cf6 Remove @group annotations
Summary: I'm pretty sure that `@group` annotations are useless now... see D9855. Also fixed various other minor issues.

Test Plan: Eye-ball it.

Reviewers: #blessed_reviewers, epriestley, chad

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D9859
2014-07-10 08:12:48 +10:00
Joshua Spence
7304e29dec Various minor JSHint fixes.
Summary: Various fixes as suggested by JSHint.

Test Plan: Eye-balled it.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9783
2014-07-01 06:00:12 +10:00