mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-10 05:48:30 +01:00
Conpherence - continue the load less quest
Summary: basically makes it so we only really load what we need from the server for any particular update action. the javascript thus then has some things deleted from it. made a spot or two ready for when the pertinent UI won't be there as well. also added a feature in javascript -- updating the document title to the current conpherence title. Ref T2867 T2399 Test Plan: played with conpherence for quite a bit. Reviewers: epriestley, chad Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2867 Differential Revision: https://secure.phabricator.com/D5625
This commit is contained in:
parent
7e93e9fbe9
commit
8ede9dc061
8 changed files with 111 additions and 102 deletions
|
@ -1282,7 +1282,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-conpherence-menu' =>
|
'javelin-behavior-conpherence-menu' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/257f200d/rsrc/js/application/conpherence/behavior-menu.js',
|
'uri' => '/res/7021ec83/rsrc/js/application/conpherence/behavior-menu.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -1299,7 +1299,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-conpherence-pontificate' =>
|
'javelin-behavior-conpherence-pontificate' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/91d6418d/rsrc/js/application/conpherence/behavior-pontificate.js',
|
'uri' => '/res/b45269fc/rsrc/js/application/conpherence/behavior-pontificate.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -1313,7 +1313,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-conpherence-widget-pane' =>
|
'javelin-behavior-conpherence-widget-pane' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/0c0fc5ef/rsrc/js/application/conpherence/behavior-widget-pane.js',
|
'uri' => '/res/32f4bf14/rsrc/js/application/conpherence/behavior-widget-pane.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -252,6 +252,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceTransactionQuery' => 'applications/conpherence/query/ConpherenceTransactionQuery.php',
|
'ConpherenceTransactionQuery' => 'applications/conpherence/query/ConpherenceTransactionQuery.php',
|
||||||
'ConpherenceTransactionType' => 'applications/conpherence/constants/ConpherenceTransactionType.php',
|
'ConpherenceTransactionType' => 'applications/conpherence/constants/ConpherenceTransactionType.php',
|
||||||
'ConpherenceTransactionView' => 'applications/conpherence/view/ConpherenceTransactionView.php',
|
'ConpherenceTransactionView' => 'applications/conpherence/view/ConpherenceTransactionView.php',
|
||||||
|
'ConpherenceUpdateActions' => 'applications/conpherence/constants/ConpherenceUpdateActions.php',
|
||||||
'ConpherenceUpdateController' => 'applications/conpherence/controller/ConpherenceUpdateController.php',
|
'ConpherenceUpdateController' => 'applications/conpherence/controller/ConpherenceUpdateController.php',
|
||||||
'ConpherenceViewController' => 'applications/conpherence/controller/ConpherenceViewController.php',
|
'ConpherenceViewController' => 'applications/conpherence/controller/ConpherenceViewController.php',
|
||||||
'ConpherenceWidgetController' => 'applications/conpherence/controller/ConpherenceWidgetController.php',
|
'ConpherenceWidgetController' => 'applications/conpherence/controller/ConpherenceWidgetController.php',
|
||||||
|
@ -1983,6 +1984,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
'ConpherenceTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
|
||||||
'ConpherenceTransactionType' => 'ConpherenceConstants',
|
'ConpherenceTransactionType' => 'ConpherenceConstants',
|
||||||
'ConpherenceTransactionView' => 'AphrontView',
|
'ConpherenceTransactionView' => 'AphrontView',
|
||||||
|
'ConpherenceUpdateActions' => 'ConpherenceConstants',
|
||||||
'ConpherenceUpdateController' => 'ConpherenceController',
|
'ConpherenceUpdateController' => 'ConpherenceController',
|
||||||
'ConpherenceViewController' => 'ConpherenceController',
|
'ConpherenceViewController' => 'ConpherenceController',
|
||||||
'ConpherenceWidgetController' => 'ConpherenceController',
|
'ConpherenceWidgetController' => 'ConpherenceController',
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ConpherenceUpdateActions extends ConpherenceConstants {
|
||||||
|
|
||||||
|
const METADATA = 'metadata';
|
||||||
|
const MESSAGE = 'message';
|
||||||
|
const ADD_PERSON = 'add_person';
|
||||||
|
const REMOVE_PERSON = 'remove_person';
|
||||||
|
const NOTIFICATIONS = 'notifications';
|
||||||
|
}
|
|
@ -36,7 +36,7 @@ final class ConpherenceUpdateController
|
||||||
->executeOne();
|
->executeOne();
|
||||||
$supported_formats = PhabricatorFile::getTransformableImageFormats();
|
$supported_formats = PhabricatorFile::getTransformableImageFormats();
|
||||||
|
|
||||||
$action = $request->getStr('action', 'metadata');
|
$action = $request->getStr('action', ConpherenceUpdateActions::METADATA);
|
||||||
$latest_transaction_id = null;
|
$latest_transaction_id = null;
|
||||||
$response_mode = 'ajax';
|
$response_mode = 'ajax';
|
||||||
$error_view = null;
|
$error_view = null;
|
||||||
|
@ -54,13 +54,13 @@ final class ConpherenceUpdateController
|
||||||
->setActor($user);
|
->setActor($user);
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'message':
|
case ConpherenceUpdateActions::MESSAGE:
|
||||||
$message = $request->getStr('text');
|
$message = $request->getStr('text');
|
||||||
$xactions = $editor->generateTransactionsFromText(
|
$xactions = $editor->generateTransactionsFromText(
|
||||||
$conpherence,
|
$conpherence,
|
||||||
$message);
|
$message);
|
||||||
break;
|
break;
|
||||||
case 'add_person':
|
case ConpherenceUpdateActions::ADD_PERSON:
|
||||||
$xactions = array();
|
$xactions = array();
|
||||||
$person_tokenizer = $request->getArr('add_person');
|
$person_tokenizer = $request->getArr('add_person');
|
||||||
$person_phid = reset($person_tokenizer);
|
$person_phid = reset($person_tokenizer);
|
||||||
|
@ -71,7 +71,7 @@ final class ConpherenceUpdateController
|
||||||
->setNewValue(array('+' => array($person_phid)));
|
->setNewValue(array('+' => array($person_phid)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'remove_person':
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
$xactions = array();
|
$xactions = array();
|
||||||
if (!$request->isContinueRequest()) {
|
if (!$request->isContinueRequest()) {
|
||||||
// do nothing; we'll display a confirmation dialogue instead
|
// do nothing; we'll display a confirmation dialogue instead
|
||||||
|
@ -86,7 +86,7 @@ final class ConpherenceUpdateController
|
||||||
$response_mode = 'go-home';
|
$response_mode = 'go-home';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'notifications':
|
case ConpherenceUpdateActions::NOTIFICATIONS:
|
||||||
$notifications = $request->getStr('notifications');
|
$notifications = $request->getStr('notifications');
|
||||||
$participant = $conpherence->getParticipant($user->getPHID());
|
$participant = $conpherence->getParticipant($user->getPHID());
|
||||||
$participant->setSettings(array('notifications' => $notifications));
|
$participant->setSettings(array('notifications' => $notifications));
|
||||||
|
@ -97,7 +97,7 @@ final class ConpherenceUpdateController
|
||||||
return id(new AphrontAjaxResponse())
|
return id(new AphrontAjaxResponse())
|
||||||
->setContent($result);
|
->setContent($result);
|
||||||
break;
|
break;
|
||||||
case 'metadata':
|
case ConpherenceUpdateActions::METADATA:
|
||||||
$xactions = array();
|
$xactions = array();
|
||||||
$top = $request->getInt('image_y');
|
$top = $request->getInt('image_y');
|
||||||
$left = $request->getInt('image_x');
|
$left = $request->getInt('image_x');
|
||||||
|
@ -193,6 +193,7 @@ final class ConpherenceUpdateController
|
||||||
case 'ajax':
|
case 'ajax':
|
||||||
$latest_transaction_id = $request->getInt('latest_transaction_id');
|
$latest_transaction_id = $request->getInt('latest_transaction_id');
|
||||||
$content = $this->loadAndRenderUpdates(
|
$content = $this->loadAndRenderUpdates(
|
||||||
|
$action,
|
||||||
$conpherence_id,
|
$conpherence_id,
|
||||||
$latest_transaction_id);
|
$latest_transaction_id);
|
||||||
return id(new AphrontAjaxResponse())
|
return id(new AphrontAjaxResponse())
|
||||||
|
@ -219,10 +220,10 @@ final class ConpherenceUpdateController
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'remove_person':
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
$dialogue = $this->renderRemovePersonDialogue($conpherence);
|
$dialogue = $this->renderRemovePersonDialogue($conpherence);
|
||||||
break;
|
break;
|
||||||
case 'metadata':
|
case ConpherenceUpdateActions::METADATA:
|
||||||
default:
|
default:
|
||||||
$dialogue = $this->renderMetadataDialogue($conpherence, $error_view);
|
$dialogue = $this->renderMetadataDialogue($conpherence, $error_view);
|
||||||
break;
|
break;
|
||||||
|
@ -318,39 +319,77 @@ final class ConpherenceUpdateController
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadAndRenderUpdates(
|
private function loadAndRenderUpdates(
|
||||||
|
$action,
|
||||||
$conpherence_id,
|
$conpherence_id,
|
||||||
$latest_transaction_id) {
|
$latest_transaction_id) {
|
||||||
|
|
||||||
|
$need_header_pics = false;
|
||||||
|
$need_widget_data = false;
|
||||||
|
$need_transactions = false;
|
||||||
|
switch ($action) {
|
||||||
|
case ConpherenceUpdateActions::METADATA:
|
||||||
|
$need_header_pics = true;
|
||||||
|
$need_transactions = true;
|
||||||
|
break;
|
||||||
|
case ConpherenceUpdateActions::MESSAGE:
|
||||||
|
case ConpherenceUpdateActions::ADD_PERSON:
|
||||||
|
$need_transactions = true;
|
||||||
|
$need_widget_data = true;
|
||||||
|
break;
|
||||||
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
|
case ConpherenceUpdateActions::NOTIFICATIONS:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
$user = $this->getRequest()->getUser();
|
$user = $this->getRequest()->getUser();
|
||||||
$conpherence = id(new ConpherenceThreadQuery())
|
$conpherence = id(new ConpherenceThreadQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->setAfterMessageID($latest_transaction_id)
|
->setAfterMessageID($latest_transaction_id)
|
||||||
->needHeaderPics(true)
|
->needHeaderPics($need_header_pics)
|
||||||
->needWidgetData(true)
|
->needWidgetData($need_widget_data)
|
||||||
->needTransactions(true)
|
->needTransactions($need_transactions)
|
||||||
->withIDs(array($conpherence_id))
|
->withIDs(array($conpherence_id))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
||||||
$data = $this->renderConpherenceTransactions($conpherence);
|
if ($need_transactions) {
|
||||||
$rendered_transactions = $data['transactions'];
|
$data = $this->renderConpherenceTransactions($conpherence);
|
||||||
$new_latest_transaction_id = $data['latest_transaction_id'];
|
} else {
|
||||||
|
$data = array();
|
||||||
$nav_item = id(new ConpherenceThreadListView())
|
}
|
||||||
->setUser($user)
|
$rendered_transactions = idx($data, 'transactions');
|
||||||
->setBaseURI($this->getApplicationURI())
|
$new_latest_transaction_id = idx($data, 'latest_transaction_id');
|
||||||
->renderSingleThread($conpherence);
|
|
||||||
|
|
||||||
$header = $this->buildHeaderPaneContent($conpherence);
|
|
||||||
|
|
||||||
$widget_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/');
|
$widget_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/');
|
||||||
$file_widget = id(new ConpherenceFileWidgetView())
|
$nav_item = null;
|
||||||
->setUser($this->getRequest()->getUser())
|
$header = null;
|
||||||
->setConpherence($conpherence)
|
$people_widget = null;
|
||||||
->setUpdateURI($widget_uri);
|
$file_widget = null;
|
||||||
$people_widget = id(new ConpherencePeopleWidgetView())
|
switch ($action) {
|
||||||
->setUser($user)
|
case ConpherenceUpdateActions::METADATA:
|
||||||
->setConpherence($conpherence)
|
$header = $this->buildHeaderPaneContent($conpherence);
|
||||||
->setUpdateURI($widget_uri);
|
$nav_item = id(new ConpherenceThreadListView())
|
||||||
|
->setUser($user)
|
||||||
|
->setBaseURI($this->getApplicationURI())
|
||||||
|
->renderSingleThread($conpherence);
|
||||||
|
break;
|
||||||
|
case ConpherenceUpdateActions::MESSAGE:
|
||||||
|
$file_widget = id(new ConpherenceFileWidgetView())
|
||||||
|
->setUser($this->getRequest()->getUser())
|
||||||
|
->setConpherence($conpherence)
|
||||||
|
->setUpdateURI($widget_uri);
|
||||||
|
break;
|
||||||
|
case ConpherenceUpdateActions::ADD_PERSON:
|
||||||
|
$people_widget = id(new ConpherencePeopleWidgetView())
|
||||||
|
->setUser($user)
|
||||||
|
->setConpherence($conpherence)
|
||||||
|
->setUpdateURI($widget_uri);
|
||||||
|
break;
|
||||||
|
case ConpherenceUpdateActions::REMOVE_PERSON:
|
||||||
|
case ConpherenceUpdateActions::NOTIFICATIONS:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$content = array(
|
$content = array(
|
||||||
'transactions' => $rendered_transactions,
|
'transactions' => $rendered_transactions,
|
||||||
|
@ -358,9 +397,10 @@ final class ConpherenceUpdateController
|
||||||
'nav_item' => hsprintf('%s', $nav_item),
|
'nav_item' => hsprintf('%s', $nav_item),
|
||||||
'conpherence_phid' => $conpherence->getPHID(),
|
'conpherence_phid' => $conpherence->getPHID(),
|
||||||
'header' => hsprintf('%s', $header),
|
'header' => hsprintf('%s', $header),
|
||||||
'file_widget' => $file_widget->render(),
|
'file_widget' => $file_widget ? $file_widget->render() : null,
|
||||||
'people_widget' => $people_widget->render()
|
'people_widget' => $people_widget ? $people_widget->render() : null,
|
||||||
);
|
);
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,7 @@ final class ConpherenceThreadListView extends AphrontView {
|
||||||
->addSigil('conpherence-menu-click')
|
->addSigil('conpherence-menu-click')
|
||||||
->setMetadata(
|
->setMetadata(
|
||||||
array(
|
array(
|
||||||
|
'title' => $title,
|
||||||
'id' => $thread->getID(),
|
'id' => $thread->getID(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,8 @@ JX.behavior('conpherence-menu', function(config) {
|
||||||
thread.selected = data.id;
|
thread.selected = data.id;
|
||||||
|
|
||||||
JX.History.replace(config.base_uri + data.id + '/');
|
JX.History.replace(config.base_uri + data.id + '/');
|
||||||
|
document.title = data.title;
|
||||||
|
|
||||||
redrawthread();
|
redrawthread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,16 +141,13 @@ JX.behavior('conpherence-menu', function(config) {
|
||||||
var form = JX.DOM.find(root, 'form', 'conpherence-pontificate');
|
var form = JX.DOM.find(root, 'form', 'conpherence-pontificate');
|
||||||
var data = e.getNodeData('conpherence-edit-metadata');
|
var data = e.getNodeData('conpherence-edit-metadata');
|
||||||
var header = JX.DOM.find(root, 'div', 'conpherence-header');
|
var header = JX.DOM.find(root, 'div', 'conpherence-header');
|
||||||
var peopleWidget = null;
|
var messages = JX.DOM.find(root, 'div', 'conpherence-messages');
|
||||||
try {
|
|
||||||
peopleWidget = JX.DOM.find(root, 'div', 'widgets-people');
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore; maybe no people widget
|
|
||||||
}
|
|
||||||
|
|
||||||
new JX.Workflow.newFromForm(form, data)
|
new JX.Workflow.newFromForm(form, data)
|
||||||
.setHandler(JX.bind(this, function(r) {
|
.setHandler(JX.bind(this, function(r) {
|
||||||
// update the header
|
JX.DOM.appendContent(messages, JX.$H(r.transactions));
|
||||||
|
messages.scrollTop = messages.scrollHeight;
|
||||||
|
|
||||||
JX.DOM.setContent(
|
JX.DOM.setContent(
|
||||||
header,
|
header,
|
||||||
JX.$H(r.header)
|
JX.$H(r.header)
|
||||||
|
@ -168,14 +167,6 @@ JX.behavior('conpherence-menu', function(config) {
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// Ignore; this view may not have a menu.
|
// Ignore; this view may not have a menu.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peopleWidget) {
|
|
||||||
// update the people widget
|
|
||||||
JX.DOM.setContent(
|
|
||||||
peopleWidget,
|
|
||||||
JX.$H(r.people_widget)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}))
|
}))
|
||||||
.start();
|
.start();
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,40 +15,17 @@ JX.behavior('conpherence-pontificate', function(config) {
|
||||||
|
|
||||||
var root = e.getNode('conpherence-layout');
|
var root = e.getNode('conpherence-layout');
|
||||||
var messages = JX.DOM.find(root, 'div', 'conpherence-messages');
|
var messages = JX.DOM.find(root, 'div', 'conpherence-messages');
|
||||||
var header = JX.DOM.find(root, 'div', 'conpherence-header');
|
|
||||||
var fileWidget = null;
|
var fileWidget = null;
|
||||||
try {
|
try {
|
||||||
fileWidget = JX.DOM.find(root, 'div', 'widgets-files');
|
fileWidget = JX.DOM.find(root, 'div', 'widgets-files');
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// Ignore; maybe no files widget
|
// Ignore; maybe no files widget
|
||||||
}
|
}
|
||||||
var peopleWidget = null;
|
|
||||||
try {
|
|
||||||
peopleWidget = JX.DOM.find(root, 'div', 'widgets-people');
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore; maybe no peoples widget
|
|
||||||
}
|
|
||||||
|
|
||||||
JX.Workflow.newFromForm(form)
|
JX.Workflow.newFromForm(form)
|
||||||
.setHandler(JX.bind(this, function(r) {
|
.setHandler(JX.bind(this, function(r) {
|
||||||
// add the new transactions, probably just our post but who knows
|
|
||||||
JX.DOM.appendContent(messages, JX.$H(r.transactions));
|
JX.DOM.appendContent(messages, JX.$H(r.transactions));
|
||||||
messages.scrollTop = messages.scrollHeight;
|
messages.scrollTop = messages.scrollHeight;
|
||||||
JX.DOM.setContent(header, JX.$H(r.header));
|
|
||||||
|
|
||||||
try {
|
|
||||||
var node = JX.$(r.conpherence_phid + '-nav-item');
|
|
||||||
JX.DOM.replace(
|
|
||||||
node,
|
|
||||||
JX.$H(r.nav_item));
|
|
||||||
JX.Stratcom.invoke(
|
|
||||||
'conpherence-selectthread',
|
|
||||||
null,
|
|
||||||
{ id : r.conpherence_phid + '-nav-item' }
|
|
||||||
);
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore; this view may not have a menu.
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fileWidget) {
|
if (fileWidget) {
|
||||||
JX.DOM.setContent(
|
JX.DOM.setContent(
|
||||||
|
@ -57,13 +34,6 @@ JX.behavior('conpherence-pontificate', function(config) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peopleWidget) {
|
|
||||||
JX.DOM.setContent(
|
|
||||||
peopleWidget,
|
|
||||||
JX.$H(r.people_widget)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
var inputs = JX.DOM.scry(form, 'input');
|
var inputs = JX.DOM.scry(form, 'input');
|
||||||
for (var ii = 0; ii < inputs.length; ii++) {
|
for (var ii = 0; ii < inputs.length; ii++) {
|
||||||
if (inputs[ii].name == 'latest_transaction_id') {
|
if (inputs[ii].name == 'latest_transaction_id') {
|
||||||
|
@ -74,6 +44,16 @@ JX.behavior('conpherence-pontificate', function(config) {
|
||||||
|
|
||||||
var textarea = JX.DOM.find(form, 'textarea');
|
var textarea = JX.DOM.find(form, 'textarea');
|
||||||
textarea.value = '';
|
textarea.value = '';
|
||||||
|
|
||||||
|
try {
|
||||||
|
JX.Stratcom.invoke(
|
||||||
|
'conpherence-selectthread',
|
||||||
|
null,
|
||||||
|
{ id : r.conpherence_phid + '-nav-item' }
|
||||||
|
);
|
||||||
|
} catch (ex) {
|
||||||
|
// Ignore; this view may not have a menu.
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
.start();
|
.start();
|
||||||
};
|
};
|
||||||
|
|
|
@ -49,8 +49,11 @@ JX.behavior('conpherence-widget-pane', function(config) {
|
||||||
var form = e.getNode('tag:form');
|
var form = e.getNode('tag:form');
|
||||||
var data = e.getNodeData('add-person');
|
var data = e.getNodeData('add-person');
|
||||||
var peopleRoot = e.getNode('widgets-people');
|
var peopleRoot = e.getNode('widgets-people');
|
||||||
var messages = JX.DOM.find(root, 'div', 'conpherence-messages');
|
var messages = null;
|
||||||
var header = JX.DOM.find(root, 'div', 'conpherence-header');
|
try {
|
||||||
|
messages = JX.DOM.find(root, 'div', 'conpherence-messages');
|
||||||
|
} catch (ex) {
|
||||||
|
}
|
||||||
var latestTransactionData = JX.Stratcom.getData(
|
var latestTransactionData = JX.Stratcom.getData(
|
||||||
JX.DOM.find(
|
JX.DOM.find(
|
||||||
root,
|
root,
|
||||||
|
@ -60,29 +63,11 @@ JX.behavior('conpherence-widget-pane', function(config) {
|
||||||
data.latest_transaction_id = latestTransactionData.id;
|
data.latest_transaction_id = latestTransactionData.id;
|
||||||
JX.Workflow.newFromForm(form, data)
|
JX.Workflow.newFromForm(form, data)
|
||||||
.setHandler(JX.bind(this, function (r) {
|
.setHandler(JX.bind(this, function (r) {
|
||||||
// update the transactions
|
if (messages) {
|
||||||
JX.DOM.appendContent(messages, JX.$H(r.transactions));
|
JX.DOM.appendContent(messages, JX.$H(r.transactions));
|
||||||
messages.scrollTop = messages.scrollHeight;
|
messages.scrollTop = messages.scrollHeight;
|
||||||
|
|
||||||
try {
|
|
||||||
JX.DOM.replace(
|
|
||||||
JX.$(r.conpherence_phid + '-nav-item'),
|
|
||||||
JX.$H(r.nav_item));
|
|
||||||
JX.Stratcom.invoke(
|
|
||||||
'conpherence-selectthread',
|
|
||||||
null,
|
|
||||||
{ id : r.conpherence_phid + '-nav-item' }
|
|
||||||
);
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore; this view may not have a menu.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the header
|
|
||||||
JX.DOM.setContent(
|
|
||||||
header,
|
|
||||||
JX.$H(r.header)
|
|
||||||
);
|
|
||||||
|
|
||||||
// update the people widget
|
// update the people widget
|
||||||
JX.DOM.setContent(
|
JX.DOM.setContent(
|
||||||
peopleRoot,
|
peopleRoot,
|
||||||
|
|
Loading…
Add table
Reference in a new issue