Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13958127
D12046.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D12046.id.diff
View Options
diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -352,9 +352,9 @@
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
- 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => 'efef202b',
- 'rsrc/js/application/conpherence/behavior-durable-column.js' => '016fa2e9',
- 'rsrc/js/application/conpherence/behavior-menu.js' => 'e476c952',
+ 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '0324970d',
+ 'rsrc/js/application/conpherence/behavior-durable-column.js' => '8908d403',
+ 'rsrc/js/application/conpherence/behavior-menu.js' => 'c4151295',
'rsrc/js/application/conpherence/behavior-pontificate.js' => '21ba5861',
'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3',
'rsrc/js/application/conpherence/behavior-widget-pane.js' => '2c1cd7f5',
@@ -518,7 +518,7 @@
'conpherence-menu-css' => 'c6ac5299',
'conpherence-message-pane-css' => '5930260a',
'conpherence-notification-css' => '04a6e10a',
- 'conpherence-thread-manager' => 'efef202b',
+ 'conpherence-thread-manager' => '0324970d',
'conpherence-update-css' => '1099a660',
'conpherence-widget-pane-css' => '3d575438',
'differential-changeset-view-css' => '6a8b172a',
@@ -558,7 +558,7 @@
'javelin-behavior-boards-dropdown' => '0ec56e1d',
'javelin-behavior-choose-control' => '6153c708',
'javelin-behavior-config-reorder-fields' => '14a827de',
- 'javelin-behavior-conpherence-menu' => 'e476c952',
+ 'javelin-behavior-conpherence-menu' => 'c4151295',
'javelin-behavior-conpherence-pontificate' => '21ba5861',
'javelin-behavior-conpherence-widget-pane' => '2c1cd7f5',
'javelin-behavior-countdown-timer' => 'e4cc26b3',
@@ -585,7 +585,7 @@
'javelin-behavior-diffusion-locate-file' => '6d3e1947',
'javelin-behavior-diffusion-pull-lastmodified' => '2b228192',
'javelin-behavior-doorkeeper-tag' => 'e5822781',
- 'javelin-behavior-durable-column' => '016fa2e9',
+ 'javelin-behavior-durable-column' => '8908d403',
'javelin-behavior-error-log' => '6882e80a',
'javelin-behavior-fancy-datepicker' => 'c51ae228',
'javelin-behavior-global-drag-and-drop' => '07f199d8',
@@ -834,15 +834,6 @@
'unhandled-exception-css' => '37d4f9a2',
),
'requires' => array(
- '016fa2e9' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-scrollbar',
- 'javelin-quicksand',
- 'phabricator-keyboard-shortcut',
- 'conpherence-thread-manager',
- ),
'0286a1db' => array(
'javelin-dom',
'javelin-util',
@@ -854,6 +845,16 @@
'029a133d' => array(
'aphront-dialog-view-css',
),
+ '0324970d' => array(
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-install',
+ 'javelin-workflow',
+ 'javelin-router',
+ 'javelin-behavior-device',
+ 'javelin-vector',
+ ),
'03d6ed07' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1504,6 +1505,15 @@
'javelin-dom',
'javelin-vector',
),
+ '8908d403' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-scrollbar',
+ 'javelin-quicksand',
+ 'phabricator-keyboard-shortcut',
+ 'conpherence-thread-manager',
+ ),
'8a41885b' => array(
'javelin-install',
'javelin-dom',
@@ -1747,6 +1757,18 @@
'javelin-dom',
'javelin-vector',
),
+ 'c4151295' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-workflow',
+ 'javelin-behavior-device',
+ 'javelin-history',
+ 'javelin-vector',
+ 'phabricator-shaped-request',
+ 'conpherence-thread-manager',
+ ),
'c51ae228' => array(
'javelin-behavior',
'javelin-util',
@@ -1850,18 +1872,6 @@
'javelin-dom',
'javelin-uri',
),
- 'e476c952' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-workflow',
- 'javelin-behavior-device',
- 'javelin-history',
- 'javelin-vector',
- 'phabricator-shaped-request',
- 'conpherence-thread-manager',
- ),
'e4cc26b3' => array(
'javelin-behavior',
'javelin-dom',
@@ -1909,16 +1919,6 @@
'javelin-install',
'javelin-util',
),
- 'efef202b' => array(
- 'javelin-dom',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-install',
- 'javelin-workflow',
- 'javelin-router',
- 'javelin-behavior-device',
- 'javelin-vector',
- ),
'f24f3253' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/src/applications/conpherence/controller/ConpherenceColumnViewController.php b/src/applications/conpherence/controller/ConpherenceColumnViewController.php
--- a/src/applications/conpherence/controller/ConpherenceColumnViewController.php
+++ b/src/applications/conpherence/controller/ConpherenceColumnViewController.php
@@ -67,7 +67,12 @@
$participant->markUpToDate($conpherence, $latest_transaction);
unset($write_guard);
+ $draft = PhabricatorDraft::newFromUserAndKey(
+ $user,
+ $conpherence->getPHID());
+
$durable_column
+ ->setDraft($draft)
->setSelectedConpherence($conpherence)
->setConpherences($latest_conpherences);
$conpherence_id = $conpherence->getID();
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
@@ -2,7 +2,8 @@
final class ConpherenceDurableColumnView extends AphrontTagView {
- private $conpherences;
+ private $conpherences = array();
+ private $draft;
private $selectedConpherence;
private $transactions;
private $visible;
@@ -17,6 +18,15 @@
return $this->conpherences;
}
+ public function setDraft(PhabricatorDraft $draft) {
+ $this->draft = $draft;
+ return $this;
+ }
+
+ public function getDraft() {
+ return $this->draft;
+ }
+
public function setSelectedConpherence(
ConpherenceThread $conpherence = null) {
$this->selectedConpherence = $conpherence;
@@ -343,6 +353,12 @@
return null;
}
+ $draft = $this->getDraft();
+ $draft_value = null;
+ if ($draft) {
+ $draft_value = $draft->getDraft();
+ }
+
$textarea = javelin_tag(
'textarea',
array(
@@ -350,7 +366,8 @@
'class' => 'conpherence-durable-column-textarea',
'sigil' => 'conpherence-durable-column-textarea',
'placeholder' => pht('Send a message...'),
- ));
+ ),
+ $draft_value);
$id = $conpherence->getID();
return phabricator_form(
$this->getUser(),
diff --git a/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js b/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js
--- a/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js
+++ b/webroot/rsrc/js/application/conpherence/ConpherenceThreadManager.js
@@ -252,6 +252,25 @@
this._didSendMessageCallback(r);
}));
this.syncWorkflow(workflow, 'finally');
+ },
+
+ handleDraftKeydown: function(e) {
+ var form = e.getNode('tag:form');
+ var data = e.getNodeData('tag:form');
+
+ if (!data.preview) {
+ var uri = '/conpherence/update/' + this._loadedThreadID + '/';
+ data.preview = new JX.PhabricatorShapedRequest(
+ uri,
+ JX.bag,
+ JX.bind(this, function () {
+ var data = JX.DOM.convertFormToDictionary(form);
+ data.action = 'draft';
+ data = this._getParams(data);
+ return data;
+ }));
+ }
+ data.preview.trigger();
}
},
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
@@ -234,6 +234,13 @@
'conpherence-message-form',
_sendMessage);
+ JX.Stratcom.listen(
+ ['keydown'],
+ 'conpherence-durable-column-textarea',
+ function (e) {
+ threadManager.handleDraftKeydown(e);
+ });
+
if (config.visible) {
_toggleColumn(false);
}
diff --git a/webroot/rsrc/js/application/conpherence/behavior-menu.js b/webroot/rsrc/js/application/conpherence/behavior-menu.js
--- a/webroot/rsrc/js/application/conpherence/behavior-menu.js
+++ b/webroot/rsrc/js/application/conpherence/behavior-menu.js
@@ -564,28 +564,11 @@
handleThreadScrollers
);
- var onkeydownDraft = function (e) {
- var form = e.getNode('tag:form');
- var data = e.getNodeData('tag:form');
-
- if (!data.preview) {
- var uri = config.baseURI + 'update/' + _thread.selected + '/';
- data.preview = new JX.PhabricatorShapedRequest(
- uri,
- JX.bag,
- function () {
- var data = JX.DOM.convertFormToDictionary(form);
- data.action = 'draft';
- return data;
- });
- }
-
- data.preview.trigger();
- };
-
JX.Stratcom.listen(
['keydown'],
'conpherence-pontificate',
- onkeydownDraft);
+ function (e) {
+ threadManager.handleDraftKeydown(e);
+ });
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 15 2024, 1:04 PM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712925
Default Alt Text
D12046.id.diff (9 KB)
Attached To
Mode
D12046: Conpherence - add draft support to column and refine sending message user workflow
Attached
Detach File
Event Timeline
Log In to Comment