Page MenuHomePhabricator

D12449.id29888.diff
No OneTemporary

D12449.id29888.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -204,7 +204,7 @@
'rsrc/externals/javelin/lib/JSON.js' => '69adf288',
'rsrc/externals/javelin/lib/Leader.js' => '331b1611',
'rsrc/externals/javelin/lib/Mask.js' => '8a41885b',
- 'rsrc/externals/javelin/lib/Quicksand.js' => '2bb920b6',
+ 'rsrc/externals/javelin/lib/Quicksand.js' => 'b4634de3',
'rsrc/externals/javelin/lib/Request.js' => '94b750d2',
'rsrc/externals/javelin/lib/Resource.js' => '44959b73',
'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692',
@@ -355,7 +355,7 @@
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '0a5192c4',
- 'rsrc/js/application/conpherence/behavior-durable-column.js' => '7ffa744f',
+ 'rsrc/js/application/conpherence/behavior-durable-column.js' => '431bf6fd',
'rsrc/js/application/conpherence/behavior-menu.js' => '077a1dab',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3',
@@ -587,7 +587,7 @@
'javelin-behavior-diffusion-locate-file' => '6d3e1947',
'javelin-behavior-diffusion-pull-lastmodified' => '2b228192',
'javelin-behavior-doorkeeper-tag' => 'e5822781',
- 'javelin-behavior-durable-column' => '7ffa744f',
+ 'javelin-behavior-durable-column' => '431bf6fd',
'javelin-behavior-error-log' => '6882e80a',
'javelin-behavior-fancy-datepicker' => 'c51ae228',
'javelin-behavior-global-drag-and-drop' => 'bbdf75ca',
@@ -672,7 +672,7 @@
'javelin-leader' => '331b1611',
'javelin-magical-init' => '3010e992',
'javelin-mask' => '8a41885b',
- 'javelin-quicksand' => '2bb920b6',
+ 'javelin-quicksand' => 'b4634de3',
'javelin-reactor' => '2b8de964',
'javelin-reactor-dom' => 'c90a04fc',
'javelin-reactor-node-calmer' => '76f4ebed',
@@ -1028,9 +1028,6 @@
'javelin-install',
'javelin-util',
),
- '2bb920b6' => array(
- 'javelin-install',
- ),
'2be71d56' => array(
'javelin-install',
'javelin-util',
@@ -1097,6 +1094,16 @@
'javelin-dom',
'javelin-request',
),
+ '431bf6fd' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-behavior-device',
+ 'javelin-scrollbar',
+ 'javelin-quicksand',
+ 'phabricator-keyboard-shortcut',
+ 'conpherence-thread-manager',
+ ),
'44168bad' => array(
'javelin-behavior',
'javelin-dom',
@@ -1434,16 +1441,6 @@
'javelin-uri',
'phabricator-file-upload',
),
- '7ffa744f' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-behavior-device',
- 'javelin-scrollbar',
- 'javelin-quicksand',
- 'phabricator-keyboard-shortcut',
- 'conpherence-thread-manager',
- ),
82439934 => array(
'javelin-behavior',
'javelin-dom',
@@ -1689,6 +1686,9 @@
'javelin-typeahead-preloaded-source',
'javelin-util',
),
+ 'b4634de3' => array(
+ 'javelin-install',
+ ),
'b5c256b8' => array(
'javelin-install',
'javelin-dom',
diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php
--- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php
+++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php
@@ -9,6 +9,7 @@
private $visible;
private $initialLoad = false;
private $policyObjects;
+ private $quicksandConfig = array();
public function setConpherences(array $conpherences) {
assert_instances_of($conpherences, 'ConpherenceThread');
@@ -78,6 +79,15 @@
return $this->policyObjects;
}
+ public function setQuicksandConfig(array $config) {
+ $this->quicksandConfig = $config;
+ return $this;
+ }
+
+ public function getQuicksandConfig() {
+ return $this->quicksandConfig;
+ }
+
protected function getTagAttributes() {
if ($this->getVisible()) {
$style = null;
@@ -106,6 +116,7 @@
array(
'visible' => $this->getVisible(),
'settingsURI' => '/settings/adjust/?key='.$column_key,
+ 'quicksandConfig' => $this->getQuicksandConfig(),
));
$policies = array();
diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php
--- a/src/view/page/PhabricatorStandardPageView.php
+++ b/src/view/page/PhabricatorStandardPageView.php
@@ -408,6 +408,7 @@
$durable_column = id(new ConpherenceDurableColumnView())
->setSelectedConpherence(null)
->setUser($user)
+ ->setQuicksandConfig($this->renderForQuicksand())
->setVisible($is_visible)
->setInitialLoad(true);
}
diff --git a/webroot/rsrc/externals/javelin/lib/Quicksand.js b/webroot/rsrc/externals/javelin/lib/Quicksand.js
--- a/webroot/rsrc/externals/javelin/lib/Quicksand.js
+++ b/webroot/rsrc/externals/javelin/lib/Quicksand.js
@@ -30,6 +30,7 @@
_cursor: 0,
_current: 0,
_content: {},
+ _responses: {},
_history: [],
_started: false,
_frameNode: null,
@@ -39,7 +40,7 @@
/**
* Start Quicksand, accepting a fate of eternal torment.
*/
- start: function() {
+ start: function(first_response) {
var self = JX.Quicksand;
if (self._started) {
return;
@@ -53,6 +54,7 @@
id: 0,
path: self._getRelativeURI(window.location)
});
+ self._responses[0] = first_response;
},
@@ -141,10 +143,10 @@
var discard = (self._history.length - self._cursor) - 1;
for (var ii = 0; ii < discard; ii++) {
var obsolete = self._history.pop();
- self._content[obsolete.id] = false;
+ self._responses[obsolete.id] = false;
}
- // Set up the new state and fire a request to fetch the page content.
+ // Set up the new state and fire a request to fetch the page data.
var path = self._getRelativeURI(uri);
var id = ++self._id;
@@ -152,7 +154,7 @@
self._history.push({path: path, id: id});
self._cursor = (self._history.length - 1);
- self._content[id] = null;
+ self._responses[id] = null;
self._current = id;
new JX.Workflow(href, {__quicksand__: true})
@@ -162,7 +164,7 @@
/**
- * Receive a response from the server with page content.
+ * Receive a response from the server with page data e.g. content.
*
* Usually we'll dump it into the page, but if the user clicked very fast
* it might already be out of date.
@@ -173,10 +175,10 @@
// Before possibly updating the document, check if this response is still
// relevant.
- // We don't save the new content if the user has already destroyed
+ // We don't save the new response if the user has already destroyed
// the navigation. They can do this by pressing back, then clicking
- // another link before the content can load.
- if (self._content[id] === false) {
+ // another link before the response can load.
+ if (self._responses[id] === false) {
return;
}
@@ -185,6 +187,7 @@
// save it.
var new_content = JX.$H(r.content).getFragment();
self._content[id] = new_content;
+ self._responses[id] = r;
// If it's the current page, draw it into the browser. It might not be
// the current page if the user already clicked another link.
@@ -208,7 +211,7 @@
return;
}
- if (!self._content[self._current]) {
+ if (!self._responses[self._current]) {
// If we don't have this page yet, we can't draw it. We'll draw it
// when it arrives.
return;
@@ -222,13 +225,21 @@
JX.DOM.appendContent(old, self._frameNode.firstChild);
}
self._content[self._onpage] = old;
+ self._responses[self._onpage] = self._responses[self._current];
// Now, replace it with the new content.
JX.DOM.setContent(self._frameNode, self._content[self._current]);
- self._onpage = self._current;
+ // Let other things redraw or re-init if necessary
+ JX.Stratcom.invoke(
+ 'quicksand-redraw',
+ null,
+ {
+ newResponse: self._responses[self._current],
+ oldResponse: self._responses[self._onpage]
+ });
+ self._onpage = self._current;
// Scroll to the top of the page and trigger any layout adjustments.
-
// TODO: Maybe store the scroll position?
JX.DOM.scrollToPosition(0, 0);
JX.Stratcom.invoke('resize');
diff --git a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
--- a/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
+++ b/webroot/rsrc/js/application/conpherence/behavior-durable-column.js
@@ -100,7 +100,7 @@
scrollbar = new JX.Scrollbar(_getColumnScrollNode());
- JX.Quicksand.start();
+ JX.Quicksand.start(config.quicksandConfig);
/* Conpherence Thread Manager configuration - lots of display
* callbacks.

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 24, 3:36 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7818244
Default Alt Text
D12449.id29888.diff (9 KB)

Event Timeline