Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
/**
|
|
|
|
|
* @requires javelin-install
|
|
|
|
|
* javelin-dom
|
|
|
|
|
* javelin-vector
|
|
|
|
|
* javelin-request
|
2013-04-05 11:01:56 -07:00
|
|
|
* javelin-uri
|
2016-02-03 16:26:30 +00:00
|
|
|
* @provides phui-hovercard
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
* @javelin
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
JX.install('Hovercard', {
|
|
|
|
|
|
|
|
|
|
statics : {
|
|
|
|
|
_node : null,
|
|
|
|
|
_activeRoot : null,
|
2013-04-05 11:01:56 -07:00
|
|
|
_visiblePHID : null,
|
2015-12-24 11:59:38 -08:00
|
|
|
_alignment: null,
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
2015-12-24 11:20:18 -08:00
|
|
|
fetchUrl : '/search/hovercard/',
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Hovercard storage. {"PHID-XXXX-YYYY":"<...>", ...}
|
|
|
|
|
*/
|
2013-04-05 11:01:56 -07:00
|
|
|
_cards : {},
|
|
|
|
|
|
|
|
|
|
getAnchor : function() {
|
|
|
|
|
return this._activeRoot;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
getCard : function() {
|
2013-04-16 18:25:25 -07:00
|
|
|
var self = JX.Hovercard;
|
|
|
|
|
return self._node;
|
2013-04-05 11:01:56 -07:00
|
|
|
},
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
2015-12-24 11:59:38 -08:00
|
|
|
getAlignment: function() {
|
|
|
|
|
var self = JX.Hovercard;
|
|
|
|
|
return self._alignment;
|
|
|
|
|
},
|
|
|
|
|
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
show : function(root, phid) {
|
2013-04-05 11:01:56 -07:00
|
|
|
var self = JX.Hovercard;
|
2015-12-24 12:37:38 -08:00
|
|
|
|
|
|
|
|
if (root === this._activeRoot) {
|
2013-04-16 18:25:25 -07:00
|
|
|
return;
|
|
|
|
|
}
|
2015-12-24 12:37:38 -08:00
|
|
|
|
2013-04-05 11:01:56 -07:00
|
|
|
self.hide();
|
|
|
|
|
|
|
|
|
|
self._visiblePHID = phid;
|
|
|
|
|
self._activeRoot = root;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
2013-04-05 11:01:56 -07:00
|
|
|
if (!(phid in self._cards)) {
|
|
|
|
|
self._load([phid]);
|
|
|
|
|
} else {
|
|
|
|
|
self._drawCard(phid);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
_drawCard : function(phid) {
|
|
|
|
|
var self = JX.Hovercard;
|
2013-04-16 18:25:25 -07:00
|
|
|
// card is loading...
|
|
|
|
|
if (self._cards[phid] === true) {
|
2013-04-06 12:57:44 -07:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// Not the current requested card
|
2013-04-05 11:01:56 -07:00
|
|
|
if (phid != self._visiblePHID) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2013-04-06 12:57:44 -07:00
|
|
|
// Not loaded
|
2013-04-05 11:01:56 -07:00
|
|
|
if (!(phid in self._cards)) {
|
|
|
|
|
return;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
}
|
|
|
|
|
|
2013-04-05 11:01:56 -07:00
|
|
|
var root = self._activeRoot;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
var node = JX.$N('div',
|
|
|
|
|
{ className: 'jx-hovercard-container' },
|
2013-04-05 11:01:56 -07:00
|
|
|
JX.$H(self._cards[phid]));
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
2013-04-05 11:01:56 -07:00
|
|
|
self._node = node;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
|
|
|
|
// Append the card to the document, but offscreen, so we can measure it.
|
|
|
|
|
node.style.left = '-10000px';
|
|
|
|
|
document.body.appendChild(node);
|
|
|
|
|
|
|
|
|
|
// Retrieve size from child (wrapper), since node gives wrong dimensions?
|
|
|
|
|
var child = node.firstChild;
|
|
|
|
|
var p = JX.$V(root);
|
|
|
|
|
var d = JX.Vector.getDim(root);
|
|
|
|
|
var n = JX.Vector.getDim(child);
|
2015-05-07 16:01:10 -07:00
|
|
|
var v = JX.Vector.getViewport();
|
2015-12-24 11:59:38 -08:00
|
|
|
var s = JX.Vector.getScroll();
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
|
|
|
|
// Move the tip so it's nicely aligned.
|
Fix the attempt of graceful alignment for Hovercards
Summary:
Refs T1048; Fixes T2902 - (Probably) fixes @vrana's issue. I managed
to repro it on Ubuntu FF (though on Windows with 1.0GHz/512MB it's
really worse...).
This revises the approach to the graceful degradation for
`too-far-to-the-screen-edge-edge-case`.
I noticed that `x` could become very negative, up to about ~`-170px`.
This is due to the //"already-on-the-left-side"// nature of object tags.
`50 - 200 - 20` = `negative`. Adding `100px` (node.dimension.x / 4) to
that won't really help, as the hovercard would still be offscreen.
Instead, display them left-aligned with the object tags on the left edge
per default, and offer centerization in center cases. This is also better
for Pholio, Phriction, which have a way lower min-x than Maniphest,
Differential.
I also disabled placing the hovercard below the tag in case there's not
enough space on the north side. The hovercard would not display 99.99% of
the times after being hidden (and it retains the flickering behaviour).
Another reason is also our current hide-behaviour, which only assumes
north-side alignment. Adding south-side didn't really work (I'm bad with
JS), so I didn't bother with it. Disabling this is //acceptable//, since
it only really affects Pholio, Phriction. And nobody places object tags
in the first line, anyway. Except for my test pages, of course :/
Btw, this also removes the weird jaggy horizontal shifts for object of
various lengths (e.g. `{D4356}`, `{rP32ofhw0842obw}` etc.). I think
that's only good.
Test Plan:
Hovered in Pholio, Phriction in Chrome, FF. Did not touch
left screen border.
Hovered in Maniphest, Differential. Tags farther to the left were
aligned left, tags more in the center were pretty centered.
Reviewers: epriestley, vrana
Reviewed By: epriestley
CC: aran, Korvin
Maniphest Tasks: T1048, T2902
Differential Revision: https://secure.phabricator.com/D5612
2013-04-07 18:10:43 -07:00
|
|
|
var margin = 20;
|
2015-12-24 11:59:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Try to align the card directly above the link, with left borders
|
|
|
|
|
// touching.
|
|
|
|
|
var x = p.x;
|
|
|
|
|
|
|
|
|
|
// If this would push us off the right side of the viewport, push things
|
|
|
|
|
// back to the left.
|
|
|
|
|
if ((x + n.x + margin) > (s.x + v.x)) {
|
|
|
|
|
x = (s.x + v.x) - n.x - margin;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
}
|
|
|
|
|
|
2015-12-24 11:59:38 -08:00
|
|
|
// Try to put the card above the link.
|
|
|
|
|
var y = p.y - n.y - margin;
|
|
|
|
|
self._alignment = 'north';
|
|
|
|
|
|
|
|
|
|
// If the card is near the top of the window, show it beneath the
|
|
|
|
|
// link we're hovering over instead.
|
2015-12-24 12:33:13 -08:00
|
|
|
if ((y - margin) < s.y) {
|
2015-12-24 11:59:38 -08:00
|
|
|
y = p.y + d.y + margin;
|
|
|
|
|
self._alignment = 'south';
|
|
|
|
|
}
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
|
|
|
|
node.style.left = x + 'px';
|
|
|
|
|
node.style.top = y + 'px';
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
hide : function() {
|
2013-04-05 11:01:56 -07:00
|
|
|
var self = JX.Hovercard;
|
|
|
|
|
self._visiblePHID = null;
|
|
|
|
|
self._activeRoot = null;
|
|
|
|
|
if (self._node) {
|
|
|
|
|
JX.DOM.remove(self._node);
|
|
|
|
|
self._node = null;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Pass it an array of phids to load them into storage
|
|
|
|
|
*
|
|
|
|
|
* @param list phids
|
|
|
|
|
*/
|
2013-04-05 11:01:56 -07:00
|
|
|
_load : function(phids) {
|
|
|
|
|
var self = JX.Hovercard;
|
|
|
|
|
var uri = JX.$U(self.fetchUrl);
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
|
2013-04-16 18:25:25 -07:00
|
|
|
var send = false;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
for (var ii = 0; ii < phids.length; ii++) {
|
2013-04-16 18:25:25 -07:00
|
|
|
var phid = phids[ii];
|
|
|
|
|
if (phid in self._cards) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
self._cards[phid] = true; // means "loading"
|
2014-06-24 03:35:39 +10:00
|
|
|
uri.setQueryParam('phids['+ii+']', phids[ii]);
|
2013-04-16 18:25:25 -07:00
|
|
|
send = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!send) {
|
|
|
|
|
// already loaded / loading everything!
|
|
|
|
|
return;
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
new JX.Request(uri, function(r) {
|
|
|
|
|
for (var phid in r.cards) {
|
2013-04-05 11:01:56 -07:00
|
|
|
self._cards[phid] = r.cards[phid];
|
2013-04-05 16:25:07 -07:00
|
|
|
|
2013-04-06 12:57:44 -07:00
|
|
|
// Don't draw if the user is faster than the browser
|
|
|
|
|
// Only draw if the user is still requesting the original card
|
|
|
|
|
if (self.getCard() && phid != self._visiblePHID) {
|
|
|
|
|
continue;
|
2013-04-05 16:25:07 -07:00
|
|
|
}
|
|
|
|
|
|
2013-04-05 11:01:56 -07:00
|
|
|
self._drawCard(phid);
|
Hovercard front-end code & stuff
Summary:
Refs T1048; Depends on D5557, D5558
They hover right above your eyes. Try it out at home :D (in that case, don't forget to checkout D5557 and D5558)
Worth a lot of improvement. But it's great for now after a little bit of styling.
Scrape load (search current document for all hovercards and pre-load them) and lazy load (e.g. previewing comments which is not covered by scrape load) implemented.
Added some seemingly useful graceful situations. Too much to the left, too much to the top.
Test Plan:
Tested on Ubuntu, Chrome and FF. No Windows yet, since I have it live at no place. Works pretty fine, at least it will appear.
Could test left graceful fallback. Don't know what happens if you place it too far to the top. I expect either good results or placement about the center of the screen in case of glitches.
For now, they'll disappear right away once the mouse leaves the object tag. Intended is when leaving both tag and hovercard.
Reviewers: epriestley, chad, btrahan
CC: aran, Korvin
Maniphest Tasks: T1048
Differential Revision: https://secure.phabricator.com/D5563
Conflicts:
src/__celerity_resource_map__.php
2013-04-05 08:31:35 -07:00
|
|
|
}
|
|
|
|
|
}).send();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|