mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-18 17:58:37 +01:00
Conpherence - Make the files widget more useful and ajaxify some more stuff
Summary: files widget updates as new files are added. made basically all edits "ajax" except for when you change the conpherence image which just does a reload. I will fix this in a future diff but it was starting to spiral out of control a bit. Test Plan: commented on a task with files and noted the updated file widget. updated header image via drag and drop and dialogue -- noted a full reload. cropped image and re-titled conpherence - ajax updated as expected. Reviewers: epriestley, chad Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2530 Differential Revision: https://secure.phabricator.com/D5288
This commit is contained in:
parent
95b84881b7
commit
ddf97c0e8a
12 changed files with 353 additions and 194 deletions
|
@ -669,7 +669,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'aphront-form-view-css' =>
|
'aphront-form-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/ec323d34/rsrc/css/aphront/form-view.css',
|
'uri' => '/res/c1cf5cce/rsrc/css/aphront/form-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -805,7 +805,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'conpherence-widget-pane-css' =>
|
'conpherence-widget-pane-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/6e5755bb/rsrc/css/application/conpherence/widget-pane.css',
|
'uri' => '/res/e67ad581/rsrc/css/application/conpherence/widget-pane.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -1167,28 +1167,30 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-conpherence-menu' =>
|
'javelin-behavior-conpherence-menu' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/0ad6ab54/rsrc/js/application/conpherence/behavior-menu.js',
|
'uri' => '/res/cb1a5cf0/rsrc/js/application/conpherence/behavior-menu.js',
|
||||||
'type' => 'js',
|
|
||||||
'requires' =>
|
|
||||||
array(
|
|
||||||
0 => 'javelin-behavior',
|
|
||||||
1 => 'javelin-dom',
|
|
||||||
2 => 'javelin-workflow',
|
|
||||||
3 => 'javelin-util',
|
|
||||||
4 => 'javelin-stratcom',
|
|
||||||
5 => 'javelin-uri',
|
|
||||||
),
|
|
||||||
'disk' => '/rsrc/js/application/conpherence/behavior-menu.js',
|
|
||||||
),
|
|
||||||
'javelin-behavior-conpherence-pontificate' =>
|
|
||||||
array(
|
|
||||||
'uri' => '/res/06214a06/rsrc/js/application/conpherence/behavior-pontificate.js',
|
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
0 => 'javelin-behavior',
|
0 => 'javelin-behavior',
|
||||||
1 => 'javelin-dom',
|
1 => 'javelin-dom',
|
||||||
2 => 'javelin-request',
|
2 => 'javelin-request',
|
||||||
|
3 => 'javelin-stratcom',
|
||||||
|
4 => 'javelin-uri',
|
||||||
|
5 => 'javelin-util',
|
||||||
|
6 => 'javelin-workflow',
|
||||||
|
),
|
||||||
|
'disk' => '/rsrc/js/application/conpherence/behavior-menu.js',
|
||||||
|
),
|
||||||
|
'javelin-behavior-conpherence-pontificate' =>
|
||||||
|
array(
|
||||||
|
'uri' => '/res/15263692/rsrc/js/application/conpherence/behavior-pontificate.js',
|
||||||
|
'type' => 'js',
|
||||||
|
'requires' =>
|
||||||
|
array(
|
||||||
|
0 => 'javelin-behavior',
|
||||||
|
1 => 'javelin-dom',
|
||||||
|
2 => 'javelin-util',
|
||||||
|
3 => 'javelin-workflow',
|
||||||
),
|
),
|
||||||
'disk' => '/rsrc/js/application/conpherence/behavior-pontificate.js',
|
'disk' => '/rsrc/js/application/conpherence/behavior-pontificate.js',
|
||||||
),
|
),
|
||||||
|
@ -1933,7 +1935,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-pholio-mock-view' =>
|
'javelin-behavior-pholio-mock-view' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/10573d54/rsrc/js/application/pholio/behavior-pholio-mock-view.js',
|
'uri' => '/res/bee3cef2/rsrc/js/application/pholio/behavior-pholio-mock-view.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -3500,7 +3502,7 @@ celerity_register_resource_map(array(
|
||||||
), array(
|
), array(
|
||||||
'packages' =>
|
'packages' =>
|
||||||
array(
|
array(
|
||||||
'6beef3e5' =>
|
'8e2735e2' =>
|
||||||
array(
|
array(
|
||||||
'name' => 'core.pkg.css',
|
'name' => 'core.pkg.css',
|
||||||
'symbols' =>
|
'symbols' =>
|
||||||
|
@ -3543,7 +3545,7 @@ celerity_register_resource_map(array(
|
||||||
35 => 'phabricator-object-item-list-view-css',
|
35 => 'phabricator-object-item-list-view-css',
|
||||||
36 => 'global-drag-and-drop-css',
|
36 => 'global-drag-and-drop-css',
|
||||||
),
|
),
|
||||||
'uri' => '/res/pkg/6beef3e5/core.pkg.css',
|
'uri' => '/res/pkg/8e2735e2/core.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
'f24c209c' =>
|
'f24c209c' =>
|
||||||
|
@ -3733,17 +3735,17 @@ celerity_register_resource_map(array(
|
||||||
'reverse' =>
|
'reverse' =>
|
||||||
array(
|
array(
|
||||||
'aphront-attached-file-view-css' => 'eb35a026',
|
'aphront-attached-file-view-css' => 'eb35a026',
|
||||||
'aphront-crumbs-view-css' => '6beef3e5',
|
'aphront-crumbs-view-css' => '8e2735e2',
|
||||||
'aphront-dialog-view-css' => '6beef3e5',
|
'aphront-dialog-view-css' => '8e2735e2',
|
||||||
'aphront-error-view-css' => '6beef3e5',
|
'aphront-error-view-css' => '8e2735e2',
|
||||||
'aphront-form-view-css' => '6beef3e5',
|
'aphront-form-view-css' => '8e2735e2',
|
||||||
'aphront-list-filter-view-css' => '6beef3e5',
|
'aphront-list-filter-view-css' => '8e2735e2',
|
||||||
'aphront-pager-view-css' => '6beef3e5',
|
'aphront-pager-view-css' => '8e2735e2',
|
||||||
'aphront-panel-view-css' => '6beef3e5',
|
'aphront-panel-view-css' => '8e2735e2',
|
||||||
'aphront-table-view-css' => '6beef3e5',
|
'aphront-table-view-css' => '8e2735e2',
|
||||||
'aphront-tokenizer-control-css' => '6beef3e5',
|
'aphront-tokenizer-control-css' => '8e2735e2',
|
||||||
'aphront-tooltip-css' => '6beef3e5',
|
'aphront-tooltip-css' => '8e2735e2',
|
||||||
'aphront-typeahead-control-css' => '6beef3e5',
|
'aphront-typeahead-control-css' => '8e2735e2',
|
||||||
'differential-changeset-view-css' => '8aaacd1b',
|
'differential-changeset-view-css' => '8aaacd1b',
|
||||||
'differential-core-view-css' => '8aaacd1b',
|
'differential-core-view-css' => '8aaacd1b',
|
||||||
'differential-inline-comment-editor' => '322728f3',
|
'differential-inline-comment-editor' => '322728f3',
|
||||||
|
@ -3757,7 +3759,7 @@ celerity_register_resource_map(array(
|
||||||
'differential-table-of-contents-css' => '8aaacd1b',
|
'differential-table-of-contents-css' => '8aaacd1b',
|
||||||
'diffusion-commit-view-css' => 'c8ce2d88',
|
'diffusion-commit-view-css' => 'c8ce2d88',
|
||||||
'diffusion-icons-css' => 'c8ce2d88',
|
'diffusion-icons-css' => 'c8ce2d88',
|
||||||
'global-drag-and-drop-css' => '6beef3e5',
|
'global-drag-and-drop-css' => '8e2735e2',
|
||||||
'inline-comment-summary-css' => '8aaacd1b',
|
'inline-comment-summary-css' => '8aaacd1b',
|
||||||
'javelin-aphlict' => 'f24c209c',
|
'javelin-aphlict' => 'f24c209c',
|
||||||
'javelin-behavior' => 'cd1d650a',
|
'javelin-behavior' => 'cd1d650a',
|
||||||
|
@ -3828,48 +3830,48 @@ celerity_register_resource_map(array(
|
||||||
'javelin-util' => 'cd1d650a',
|
'javelin-util' => 'cd1d650a',
|
||||||
'javelin-vector' => 'cd1d650a',
|
'javelin-vector' => 'cd1d650a',
|
||||||
'javelin-workflow' => 'cd1d650a',
|
'javelin-workflow' => 'cd1d650a',
|
||||||
'lightbox-attachment-css' => '6beef3e5',
|
'lightbox-attachment-css' => '8e2735e2',
|
||||||
'maniphest-task-summary-css' => 'eb35a026',
|
'maniphest-task-summary-css' => 'eb35a026',
|
||||||
'maniphest-transaction-detail-css' => 'eb35a026',
|
'maniphest-transaction-detail-css' => 'eb35a026',
|
||||||
'phabricator-busy' => 'f24c209c',
|
'phabricator-busy' => 'f24c209c',
|
||||||
'phabricator-content-source-view-css' => '8aaacd1b',
|
'phabricator-content-source-view-css' => '8aaacd1b',
|
||||||
'phabricator-core-buttons-css' => '6beef3e5',
|
'phabricator-core-buttons-css' => '8e2735e2',
|
||||||
'phabricator-core-css' => '6beef3e5',
|
'phabricator-core-css' => '8e2735e2',
|
||||||
'phabricator-crumbs-view-css' => '6beef3e5',
|
'phabricator-crumbs-view-css' => '8e2735e2',
|
||||||
'phabricator-directory-css' => '6beef3e5',
|
'phabricator-directory-css' => '8e2735e2',
|
||||||
'phabricator-drag-and-drop-file-upload' => '322728f3',
|
'phabricator-drag-and-drop-file-upload' => '322728f3',
|
||||||
'phabricator-dropdown-menu' => 'f24c209c',
|
'phabricator-dropdown-menu' => 'f24c209c',
|
||||||
'phabricator-file-upload' => 'f24c209c',
|
'phabricator-file-upload' => 'f24c209c',
|
||||||
'phabricator-filetree-view-css' => '6beef3e5',
|
'phabricator-filetree-view-css' => '8e2735e2',
|
||||||
'phabricator-flag-css' => '6beef3e5',
|
'phabricator-flag-css' => '8e2735e2',
|
||||||
'phabricator-form-view-css' => '6beef3e5',
|
'phabricator-form-view-css' => '8e2735e2',
|
||||||
'phabricator-header-view-css' => '6beef3e5',
|
'phabricator-header-view-css' => '8e2735e2',
|
||||||
'phabricator-jump-nav' => '6beef3e5',
|
'phabricator-jump-nav' => '8e2735e2',
|
||||||
'phabricator-keyboard-shortcut' => 'f24c209c',
|
'phabricator-keyboard-shortcut' => 'f24c209c',
|
||||||
'phabricator-keyboard-shortcut-manager' => 'f24c209c',
|
'phabricator-keyboard-shortcut-manager' => 'f24c209c',
|
||||||
'phabricator-main-menu-view' => '6beef3e5',
|
'phabricator-main-menu-view' => '8e2735e2',
|
||||||
'phabricator-menu-item' => 'f24c209c',
|
'phabricator-menu-item' => 'f24c209c',
|
||||||
'phabricator-nav-view-css' => '6beef3e5',
|
'phabricator-nav-view-css' => '8e2735e2',
|
||||||
'phabricator-notification' => 'f24c209c',
|
'phabricator-notification' => 'f24c209c',
|
||||||
'phabricator-notification-css' => '6beef3e5',
|
'phabricator-notification-css' => '8e2735e2',
|
||||||
'phabricator-notification-menu-css' => '6beef3e5',
|
'phabricator-notification-menu-css' => '8e2735e2',
|
||||||
'phabricator-object-item-list-view-css' => '6beef3e5',
|
'phabricator-object-item-list-view-css' => '8e2735e2',
|
||||||
'phabricator-object-selector-css' => '8aaacd1b',
|
'phabricator-object-selector-css' => '8aaacd1b',
|
||||||
'phabricator-paste-file-upload' => 'f24c209c',
|
'phabricator-paste-file-upload' => 'f24c209c',
|
||||||
'phabricator-prefab' => 'f24c209c',
|
'phabricator-prefab' => 'f24c209c',
|
||||||
'phabricator-project-tag-css' => 'eb35a026',
|
'phabricator-project-tag-css' => 'eb35a026',
|
||||||
'phabricator-remarkup-css' => '6beef3e5',
|
'phabricator-remarkup-css' => '8e2735e2',
|
||||||
'phabricator-shaped-request' => '322728f3',
|
'phabricator-shaped-request' => '322728f3',
|
||||||
'phabricator-side-menu-view-css' => '6beef3e5',
|
'phabricator-side-menu-view-css' => '8e2735e2',
|
||||||
'phabricator-standard-page-view' => '6beef3e5',
|
'phabricator-standard-page-view' => '8e2735e2',
|
||||||
'phabricator-textareautils' => 'f24c209c',
|
'phabricator-textareautils' => 'f24c209c',
|
||||||
'phabricator-tooltip' => 'f24c209c',
|
'phabricator-tooltip' => 'f24c209c',
|
||||||
'phabricator-transaction-view-css' => '6beef3e5',
|
'phabricator-transaction-view-css' => '8e2735e2',
|
||||||
'phabricator-zindex-css' => '6beef3e5',
|
'phabricator-zindex-css' => '8e2735e2',
|
||||||
'sprite-apps-large-css' => '6beef3e5',
|
'sprite-apps-large-css' => '8e2735e2',
|
||||||
'sprite-gradient-css' => '6beef3e5',
|
'sprite-gradient-css' => '8e2735e2',
|
||||||
'sprite-icon-css' => '6beef3e5',
|
'sprite-icon-css' => '8e2735e2',
|
||||||
'sprite-menu-css' => '6beef3e5',
|
'sprite-menu-css' => '8e2735e2',
|
||||||
'syntax-highlighting-css' => '6beef3e5',
|
'syntax-highlighting-css' => '8e2735e2',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -208,6 +208,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceController' => 'applications/conpherence/controller/ConpherenceController.php',
|
'ConpherenceController' => 'applications/conpherence/controller/ConpherenceController.php',
|
||||||
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
|
'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php',
|
||||||
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
|
'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php',
|
||||||
|
'ConpherenceFileWidgetView' => 'applications/conpherence/view/ConpherenceFileWidgetView.php',
|
||||||
'ConpherenceFormDragAndDropUploadControl' => 'applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php',
|
'ConpherenceFormDragAndDropUploadControl' => 'applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php',
|
||||||
'ConpherenceImageData' => 'applications/conpherence/constants/ConpherenceImageData.php',
|
'ConpherenceImageData' => 'applications/conpherence/constants/ConpherenceImageData.php',
|
||||||
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
|
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
|
||||||
|
@ -1759,6 +1760,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceController' => 'PhabricatorController',
|
'ConpherenceController' => 'PhabricatorController',
|
||||||
'ConpherenceDAO' => 'PhabricatorLiskDAO',
|
'ConpherenceDAO' => 'PhabricatorLiskDAO',
|
||||||
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
|
'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||||
|
'ConpherenceFileWidgetView' => 'AphrontView',
|
||||||
'ConpherenceFormDragAndDropUploadControl' => 'AphrontFormControl',
|
'ConpherenceFormDragAndDropUploadControl' => 'AphrontFormControl',
|
||||||
'ConpherenceImageData' => 'ConpherenceConstants',
|
'ConpherenceImageData' => 'ConpherenceConstants',
|
||||||
'ConpherenceListController' => 'ConpherenceController',
|
'ConpherenceListController' => 'ConpherenceController',
|
||||||
|
|
|
@ -241,7 +241,10 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||||
array(
|
array(
|
||||||
'class' => 'edit',
|
'class' => 'edit',
|
||||||
'href' => $edit_href,
|
'href' => $edit_href,
|
||||||
'sigil' => 'workflow edit-action',
|
'sigil' => 'conpherence-edit-metadata',
|
||||||
|
'meta' => array(
|
||||||
|
'action' => 'metadata'
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'').
|
'').
|
||||||
phutil_tag(
|
phutil_tag(
|
||||||
|
@ -340,6 +343,7 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||||
'header' => 'conpherence-header-pane',
|
'header' => 'conpherence-header-pane',
|
||||||
'menu_pane' => 'conpherence-menu',
|
'menu_pane' => 'conpherence-menu',
|
||||||
'form_pane' => 'conpherence-form',
|
'form_pane' => 'conpherence-form',
|
||||||
|
'file_widget' => 'widgets-files',
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,9 @@ final class ConpherenceUpdateController extends
|
||||||
->executeOne();
|
->executeOne();
|
||||||
$supported_formats = PhabricatorFile::getTransformableImageFormats();
|
$supported_formats = PhabricatorFile::getTransformableImageFormats();
|
||||||
|
|
||||||
|
$action = $request->getStr('action', 'metadata');
|
||||||
$latest_transaction_id = null;
|
$latest_transaction_id = null;
|
||||||
|
$fancy_ajax_style = true;
|
||||||
$error_view = null;
|
$error_view = null;
|
||||||
$e_file = array();
|
$e_file = array();
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
@ -50,7 +52,6 @@ final class ConpherenceUpdateController extends
|
||||||
->setContentSource($content_source)
|
->setContentSource($content_source)
|
||||||
->setActor($user);
|
->setActor($user);
|
||||||
|
|
||||||
$action = $request->getStr('action');
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'message':
|
case 'message':
|
||||||
$message = $request->getStr('text');
|
$message = $request->getStr('text');
|
||||||
|
@ -65,6 +66,7 @@ final class ConpherenceUpdateController extends
|
||||||
$left = $request->getInt('image_x');
|
$left = $request->getInt('image_x');
|
||||||
$file_id = $request->getInt('file_id');
|
$file_id = $request->getInt('file_id');
|
||||||
$title = $request->getStr('title');
|
$title = $request->getStr('title');
|
||||||
|
$updated = false;
|
||||||
if ($file_id) {
|
if ($file_id) {
|
||||||
$orig_file = id(new PhabricatorFileQuery())
|
$orig_file = id(new PhabricatorFileQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
|
@ -101,6 +103,8 @@ final class ConpherenceUpdateController extends
|
||||||
}
|
}
|
||||||
// use the existing title in this image upload case
|
// use the existing title in this image upload case
|
||||||
$title = $conpherence->getTitle();
|
$title = $conpherence->getTitle();
|
||||||
|
$updated = true;
|
||||||
|
$fancy_ajax_style = false;
|
||||||
} else if ($top !== null || $left !== null) {
|
} else if ($top !== null || $left !== null) {
|
||||||
$file = $conpherence->getImage(ConpherenceImageData::SIZE_ORIG);
|
$file = $conpherence->getImage(ConpherenceImageData::SIZE_ORIG);
|
||||||
$xformer = new PhabricatorImageTransformer();
|
$xformer = new PhabricatorImageTransformer();
|
||||||
|
@ -115,12 +119,18 @@ final class ConpherenceUpdateController extends
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
$xactions[] = id(new ConpherenceTransaction())
|
||||||
->setTransactionType(
|
->setTransactionType(
|
||||||
ConpherenceTransactionType::TYPE_PICTURE_CROP)
|
ConpherenceTransactionType::TYPE_PICTURE_CROP)
|
||||||
->setNewValue($image_phid);
|
->setNewValue($image_phid);
|
||||||
|
$updated = true;
|
||||||
}
|
}
|
||||||
if ($title != $conpherence->getTitle()) {
|
if ($title != $conpherence->getTitle()) {
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
$xactions[] = id(new ConpherenceTransaction())
|
||||||
->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
|
->setTransactionType(ConpherenceTransactionType::TYPE_TITLE)
|
||||||
->setNewValue($title);
|
->setNewValue($title);
|
||||||
|
$updated = true;
|
||||||
|
}
|
||||||
|
if (!$updated && $request->isContinueRequest()) {
|
||||||
|
$errors[] = pht(
|
||||||
|
'That was a non-update. Try cancel.');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -130,24 +140,21 @@ final class ConpherenceUpdateController extends
|
||||||
if ($xactions) {
|
if ($xactions) {
|
||||||
try {
|
try {
|
||||||
$xactions = $editor->applyTransactions($conpherence, $xactions);
|
$xactions = $editor->applyTransactions($conpherence, $xactions);
|
||||||
if ($latest_transaction_id) {
|
if ($fancy_ajax_style) {
|
||||||
$content = $this->loadAndRenderNewTransactions(
|
$content = $this->loadAndRenderUpdates(
|
||||||
$conpherence_id,
|
$conpherence_id,
|
||||||
$latest_transaction_id);
|
$latest_transaction_id);
|
||||||
return id(new AphrontAjaxResponse())
|
return id(new AphrontAjaxResponse())
|
||||||
->setContent($content);
|
->setContent($content);
|
||||||
} else {
|
} else {
|
||||||
return id(new AphrontRedirectResponse())->setURI(
|
return id(new AphrontRedirectResponse())
|
||||||
$this->getApplicationURI($conpherence_id.'/'));
|
->setURI($this->getApplicationURI($conpherence->getID().'/'));
|
||||||
}
|
}
|
||||||
} catch (PhabricatorApplicationTransactionNoEffectException $ex) {
|
} catch (PhabricatorApplicationTransactionNoEffectException $ex) {
|
||||||
return id(new PhabricatorApplicationTransactionNoEffectResponse())
|
return id(new PhabricatorApplicationTransactionNoEffectResponse())
|
||||||
->setCancelURI($this->getApplicationURI($conpherence_id.'/'))
|
->setCancelURI($this->getApplicationURI($conpherence_id.'/'))
|
||||||
->setException($ex);
|
->setException($ex);
|
||||||
}
|
}
|
||||||
} else if (empty($errors)) {
|
|
||||||
$errors[] = pht(
|
|
||||||
'That was a non-update. Try cancel.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +165,29 @@ final class ConpherenceUpdateController extends
|
||||||
->setErrors($errors);
|
->setErrors($errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch ($action) {
|
||||||
|
case 'metadata':
|
||||||
|
default:
|
||||||
|
$dialogue = $this->renderMetadataDialogue($conpherence, $error_view);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return id(new AphrontDialogResponse())
|
||||||
|
->setDialog($dialogue
|
||||||
|
->setUser($user)
|
||||||
|
->setWidth(AphrontDialogView::WIDTH_FORM)
|
||||||
|
->setSubmitURI($this->getApplicationURI('update/'.$conpherence_id.'/'))
|
||||||
|
->addSubmitButton()
|
||||||
|
->addCancelButton($this->getApplicationURI($conpherence->getID().'/')));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function renderMetadataDialogue(
|
||||||
|
ConpherenceThread $conpherence,
|
||||||
|
$error_view) {
|
||||||
|
|
||||||
$form = id(new AphrontFormLayoutView())
|
$form = id(new AphrontFormLayoutView())
|
||||||
|
->appendChild($error_view)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setLabel(pht('Title'))
|
->setLabel(pht('Title'))
|
||||||
|
@ -177,15 +206,15 @@ final class ConpherenceUpdateController extends
|
||||||
'src' =>
|
'src' =>
|
||||||
$conpherence->loadImageURI(ConpherenceImageData::SIZE_HEAD),
|
$conpherence->loadImageURI(ConpherenceImageData::SIZE_HEAD),
|
||||||
))))
|
))))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormCropControl())
|
id(new AphrontFormCropControl())
|
||||||
->setLabel(pht('Crop Image'))
|
->setLabel(pht('Crop Image'))
|
||||||
->setValue($image)
|
->setValue($image)
|
||||||
->setWidth(ConpherenceImageData::HEAD_WIDTH)
|
->setWidth(ConpherenceImageData::HEAD_WIDTH)
|
||||||
->setHeight(ConpherenceImageData::HEAD_HEIGHT))
|
->setHeight(ConpherenceImageData::HEAD_HEIGHT))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new ConpherenceFormDragAndDropUploadControl())
|
id(new ConpherenceFormDragAndDropUploadControl())
|
||||||
->setLabel(pht('Change Image')));
|
->setLabel(pht('Change Image')));
|
||||||
} else {
|
} else {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
|
@ -194,57 +223,57 @@ final class ConpherenceUpdateController extends
|
||||||
}
|
}
|
||||||
|
|
||||||
require_celerity_resource('conpherence-update-css');
|
require_celerity_resource('conpherence-update-css');
|
||||||
return id(new AphrontDialogResponse())
|
return id(new AphrontDialogView())
|
||||||
->setDialog(
|
->setTitle(pht('Update Conpherence'))
|
||||||
id(new AphrontDialogView())
|
->addHiddenInput('action', 'metadata')
|
||||||
->setUser($user)
|
->addHiddenInput('__continue__', true)
|
||||||
->setTitle(pht('Update Conpherence'))
|
->appendChild($form);
|
||||||
->setWidth(AphrontDialogView::WIDTH_FORM)
|
|
||||||
->setSubmitURI($this->getApplicationURI('update/'.$conpherence_id.'/'))
|
|
||||||
->addHiddenInput('action', 'metadata')
|
|
||||||
->appendChild($error_view)
|
|
||||||
->appendChild($form)
|
|
||||||
->addSubmitButton()
|
|
||||||
->addCancelButton($this->getApplicationURI($conpherence->getID().'/')));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadAndRenderNewTransactions(
|
private function loadAndRenderUpdates(
|
||||||
$conpherence_id,
|
$conpherence_id,
|
||||||
$latest_transaction_id) {
|
$latest_transaction_id) {
|
||||||
|
|
||||||
$user = $this->getRequest()->getUser();
|
$user = $this->getRequest()->getUser();
|
||||||
$conpherence = id(new ConpherenceThreadQuery())
|
$conpherence = id(new ConpherenceThreadQuery())
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->setAfterID($latest_transaction_id)
|
->setAfterID($latest_transaction_id)
|
||||||
->needHeaderPics(true)
|
->needHeaderPics(true)
|
||||||
->withIDs(array($conpherence_id))
|
->needWidgetData(true)
|
||||||
->executeOne();
|
->withIDs(array($conpherence_id))
|
||||||
|
->executeOne();
|
||||||
|
|
||||||
$data = $this->renderConpherenceTransactions($conpherence);
|
$data = $this->renderConpherenceTransactions($conpherence);
|
||||||
$rendered_transactions = $data['transactions'];
|
$rendered_transactions = $data['transactions'];
|
||||||
$new_latest_transaction_id = $data['latest_transaction_id'];
|
$new_latest_transaction_id = $data['latest_transaction_id'];
|
||||||
|
|
||||||
$selected = true;
|
$selected = true;
|
||||||
$nav_item = $this->buildConpherenceMenuItem(
|
$nav_item = $this->buildConpherenceMenuItem(
|
||||||
$conpherence,
|
$conpherence,
|
||||||
'-nav-item',
|
'-nav-item',
|
||||||
$selected);
|
$selected);
|
||||||
$menu_item = $this->buildConpherenceMenuItem(
|
$menu_item = $this->buildConpherenceMenuItem(
|
||||||
$conpherence,
|
$conpherence,
|
||||||
'-menu-item',
|
'-menu-item',
|
||||||
$selected);
|
$selected);
|
||||||
|
|
||||||
$header = $this->buildHeaderPaneContent($conpherence);
|
$header = $this->buildHeaderPaneContent($conpherence);
|
||||||
|
|
||||||
|
$file_widget = id(new ConpherenceFileWidgetView())
|
||||||
|
->setConpherence($conpherence)
|
||||||
|
->setUpdateURI(
|
||||||
|
$this->getApplicationURI('update/'.$conpherence->getID().'/'));
|
||||||
|
|
||||||
|
$content = array(
|
||||||
|
'transactions' => $rendered_transactions,
|
||||||
|
'latest_transaction_id' => $new_latest_transaction_id,
|
||||||
|
'menu_item' => $menu_item->render(),
|
||||||
|
'nav_item' => $nav_item->render(),
|
||||||
|
'conpherence_phid' => $conpherence->getPHID(),
|
||||||
|
'header' => $header,
|
||||||
|
'file_widget' => $file_widget->render()
|
||||||
|
);
|
||||||
|
return $content;
|
||||||
|
}
|
||||||
|
|
||||||
$content = array(
|
|
||||||
'transactions' => $rendered_transactions,
|
|
||||||
'latest_transaction_id' => $new_latest_transaction_id,
|
|
||||||
'menu_item' => $menu_item->render(),
|
|
||||||
'nav_item' => $nav_item->render(),
|
|
||||||
'conpherence_phid' => $conpherence->getPHID(),
|
|
||||||
'header' => $header
|
|
||||||
);
|
|
||||||
return $content;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -55,6 +55,8 @@ final class ConpherenceWidgetController extends
|
||||||
Javelin::initBehavior(
|
Javelin::initBehavior(
|
||||||
'conpherence-widget-pane',
|
'conpherence-widget-pane',
|
||||||
array(
|
array(
|
||||||
|
'form_pane' => 'conpherence-form',
|
||||||
|
'file_widget' => 'widgets-files',
|
||||||
'widgetRegistery' => array(
|
'widgetRegistery' => array(
|
||||||
'widgets-files' => 1,
|
'widgets-files' => 1,
|
||||||
'widgets-tasks' => 1,
|
'widgets-tasks' => 1,
|
||||||
|
@ -106,61 +108,38 @@ final class ConpherenceWidgetController extends
|
||||||
'class' => 'sprite-conpher conpher_calendar_off',
|
'class' => 'sprite-conpher conpher_calendar_off',
|
||||||
),
|
),
|
||||||
'')
|
'')
|
||||||
)).
|
)).
|
||||||
phutil_tag(
|
phutil_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
'class' => 'widgets-body',
|
'class' => 'widgets-body',
|
||||||
'id' => 'widgets-files',
|
'id' => 'widgets-files',
|
||||||
'style' => 'display: none;'
|
'style' => 'display: none;'
|
||||||
),
|
),
|
||||||
$this->renderFilesWidgetPaneContent()).
|
id(new ConpherenceFileWidgetView())
|
||||||
phutil_tag(
|
->setConpherence($conpherence)
|
||||||
'div',
|
->setUpdateURI(
|
||||||
array(
|
$this->getApplicationURI('update/'.$conpherence->getID().'/'))
|
||||||
'class' => 'widgets-body',
|
->render()).
|
||||||
'id' => 'widgets-tasks',
|
phutil_tag(
|
||||||
),
|
'div',
|
||||||
$this->renderTaskWidgetPaneContent()).
|
array(
|
||||||
phutil_tag(
|
'class' => 'widgets-body',
|
||||||
'div',
|
'id' => 'widgets-tasks',
|
||||||
array(
|
),
|
||||||
'class' => 'widgets-body',
|
$this->renderTaskWidgetPaneContent()).
|
||||||
'id' => 'widgets-calendar',
|
phutil_tag(
|
||||||
'style' => 'display: none;'
|
'div',
|
||||||
),
|
array(
|
||||||
$this->renderCalendarWidgetPaneContent());
|
'class' => 'widgets-body',
|
||||||
|
'id' => 'widgets-calendar',
|
||||||
|
'style' => 'display: none;'
|
||||||
|
),
|
||||||
|
$this->renderCalendarWidgetPaneContent());
|
||||||
|
|
||||||
return array('widgets' => $widgets);
|
return array('widgets' => $widgets);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderFilesWidgetPaneContent() {
|
|
||||||
$conpherence = $this->getConpherence();
|
|
||||||
$widget_data = $conpherence->getWidgetData();
|
|
||||||
$files = $widget_data['files'];
|
|
||||||
|
|
||||||
$table_data = array();
|
|
||||||
foreach ($files as $file) {
|
|
||||||
$thumb = $file->getThumb60x45URI();
|
|
||||||
$table_data[] = array(
|
|
||||||
phutil_tag(
|
|
||||||
'img',
|
|
||||||
array(
|
|
||||||
'src' => $thumb
|
|
||||||
),
|
|
||||||
''),
|
|
||||||
$file->getName()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
$header = id(new PhabricatorHeaderView())
|
|
||||||
->setHeader(pht('Attached Files'));
|
|
||||||
$table = id(new AphrontTableView($table_data))
|
|
||||||
->setNoDataString(pht('No files attached to conpherence.'))
|
|
||||||
->setHeaders(array('', pht('Name')))
|
|
||||||
->setColumnClasses(array('', 'wide'));
|
|
||||||
return new PhutilSafeHTML($header->render() . $table->render());
|
|
||||||
}
|
|
||||||
|
|
||||||
private function renderTaskWidgetPaneContent() {
|
private function renderTaskWidgetPaneContent() {
|
||||||
$conpherence = $this->getConpherence();
|
$conpherence = $this->getConpherence();
|
||||||
$widget_data = $conpherence->getWidgetData();
|
$widget_data = $conpherence->getWidgetData();
|
||||||
|
|
|
@ -119,12 +119,22 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor {
|
||||||
$editor = id(new PhabricatorEdgeEditor())
|
$editor = id(new PhabricatorEdgeEditor())
|
||||||
->setActor($this->getActor());
|
->setActor($this->getActor());
|
||||||
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
|
$edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE;
|
||||||
foreach ($xaction->getNewValue() as $file_phid) {
|
$old = array_fill_keys($xaction->getOldValue(), true);
|
||||||
|
$new = array_fill_keys($xaction->getNewValue(), true);
|
||||||
|
$add_edges = array_keys(array_diff_key($new, $old));
|
||||||
|
$remove_edges = array_keys(array_diff_key($old, $new));
|
||||||
|
foreach ($add_edges as $file_phid) {
|
||||||
$editor->addEdge(
|
$editor->addEdge(
|
||||||
$object->getPHID(),
|
$object->getPHID(),
|
||||||
$edge_type,
|
$edge_type,
|
||||||
$file_phid);
|
$file_phid);
|
||||||
}
|
}
|
||||||
|
foreach ($remove_edges as $file_phid) {
|
||||||
|
$editor->removeEdge(
|
||||||
|
$object->getPHID(),
|
||||||
|
$edge_type,
|
||||||
|
$file_phid);
|
||||||
|
}
|
||||||
$editor->save();
|
$editor->save();
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case PhabricatorTransactions::TYPE_COMMENT:
|
case PhabricatorTransactions::TYPE_COMMENT:
|
||||||
|
|
|
@ -65,9 +65,28 @@ final class ConpherenceTransaction extends PhabricatorApplicationTransaction {
|
||||||
}
|
}
|
||||||
return $title;
|
return $title;
|
||||||
case ConpherenceTransactionType::TYPE_FILES:
|
case ConpherenceTransactionType::TYPE_FILES:
|
||||||
return pht(
|
$add = array_diff($new, $old);
|
||||||
'%s updated the conpherence files.',
|
$rem = array_diff($old, $new);
|
||||||
$this->renderHandleLink($author_phid));
|
|
||||||
|
if ($add && $rem) {
|
||||||
|
$title = pht(
|
||||||
|
'%s edited files(s), added %d and removed %d.',
|
||||||
|
$this->renderHandleLink($author_phid),
|
||||||
|
count($add),
|
||||||
|
count($rem));
|
||||||
|
} else if ($add) {
|
||||||
|
$title = pht(
|
||||||
|
'%s added %d files(s).',
|
||||||
|
$this->renderHandleLink($author_phid),
|
||||||
|
count($add));
|
||||||
|
} else {
|
||||||
|
$title = pht(
|
||||||
|
'%s removed %d file(s).',
|
||||||
|
$this->renderHandleLink($author_phid),
|
||||||
|
count($rem));
|
||||||
|
}
|
||||||
|
return $title;
|
||||||
|
break;
|
||||||
case ConpherenceTransactionType::TYPE_PICTURE:
|
case ConpherenceTransactionType::TYPE_PICTURE:
|
||||||
return pht(
|
return pht(
|
||||||
'%s updated the conpherence image.',
|
'%s updated the conpherence image.',
|
||||||
|
@ -92,7 +111,7 @@ final class ConpherenceTransaction extends PhabricatorApplicationTransaction {
|
||||||
$this->renderHandleList($add));
|
$this->renderHandleList($add));
|
||||||
} else {
|
} else {
|
||||||
$title = pht(
|
$title = pht(
|
||||||
'%s removed %d partipant(s): %s.',
|
'%s removed %d participant(s): %s.',
|
||||||
$this->renderHandleLink($author_phid),
|
$this->renderHandleLink($author_phid),
|
||||||
count($rem),
|
count($rem),
|
||||||
$this->renderHandleList($rem));
|
$this->renderHandleList($rem));
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ConpherenceFileWidgetView extends AphrontView {
|
||||||
|
|
||||||
|
private $conpherence;
|
||||||
|
private $updateURI;
|
||||||
|
|
||||||
|
public function setUpdateURI($update_uri) {
|
||||||
|
$this->updateURI = $update_uri;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
public function getUpdateURI() {
|
||||||
|
return $this->updateURI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setConpherence(ConpherenceThread $conpherence) {
|
||||||
|
$this->conpherence = $conpherence;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
public function getConpherence() {
|
||||||
|
return $this->conpherence;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render() {
|
||||||
|
$conpherence = $this->getConpherence();
|
||||||
|
$widget_data = $conpherence->getWidgetData();
|
||||||
|
$files = $widget_data['files'];
|
||||||
|
|
||||||
|
$table_data = array();
|
||||||
|
|
||||||
|
foreach ($files as $file) {
|
||||||
|
$file_view = id(new PhabricatorFileLinkView())
|
||||||
|
->setFilePHID($file->getPHID())
|
||||||
|
->setFileName($file->getName())
|
||||||
|
->setFileViewable(true)
|
||||||
|
->setFileViewURI($file->getBestURI());
|
||||||
|
$meta = $file_view->getMetadata();
|
||||||
|
|
||||||
|
$table_data[] = array(
|
||||||
|
javelin_tag(
|
||||||
|
'a',
|
||||||
|
array(
|
||||||
|
'sigil' => 'lightboxable',
|
||||||
|
'meta' => $meta
|
||||||
|
),
|
||||||
|
phutil_tag(
|
||||||
|
'img',
|
||||||
|
array(
|
||||||
|
'src' => $file->getThumb60x45URI()
|
||||||
|
),
|
||||||
|
'')),
|
||||||
|
$file_view->render()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$header = id(new PhabricatorHeaderView())
|
||||||
|
->setHeader(pht('Attached Files'));
|
||||||
|
$table = id(new AphrontTableView($table_data))
|
||||||
|
->setNoDataString(pht('No files attached to conpherence.'))
|
||||||
|
->setHeaders(array('', pht('Name')))
|
||||||
|
->setColumnClasses(array('', 'wide wrap'));
|
||||||
|
return $this->renderSingleView(array($header, $table));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -48,6 +48,16 @@ final class PhabricatorFileLinkView extends AphrontView {
|
||||||
return $this->fileName;
|
return $this->fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getMetadata() {
|
||||||
|
return array(
|
||||||
|
'phid' => $this->getFilePHID(),
|
||||||
|
'viewable' => $this->getFileViewable(),
|
||||||
|
'uri' => $this->getFileViewURI(),
|
||||||
|
'dUri' => $this->getFileDownloadURI(),
|
||||||
|
'name' => $this->getFileName(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function render() {
|
public function render() {
|
||||||
require_celerity_resource('phabricator-remarkup-css');
|
require_celerity_resource('phabricator-remarkup-css');
|
||||||
require_celerity_resource('lightbox-attachment-css');
|
require_celerity_resource('lightbox-attachment-css');
|
||||||
|
@ -57,14 +67,8 @@ final class PhabricatorFileLinkView extends AphrontView {
|
||||||
$mustcapture = false;
|
$mustcapture = false;
|
||||||
if ($this->getFileViewable()) {
|
if ($this->getFileViewable()) {
|
||||||
$mustcapture = true;
|
$mustcapture = true;
|
||||||
$sigil = 'lightboxable';
|
$sigil = 'lightboxable';
|
||||||
$meta = array(
|
$meta = $this->getMetadata();
|
||||||
'phid' => $this->getFilePHID(),
|
|
||||||
'viewable' => $this->getFileViewable(),
|
|
||||||
'uri' => $this->getFileViewURI(),
|
|
||||||
'dUri' => $this->getFileDownloadURI(),
|
|
||||||
'name' => $this->getFileName(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return javelin_tag(
|
return javelin_tag(
|
||||||
|
|
|
@ -97,3 +97,13 @@
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
width: 260px;
|
width: 260px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.conpherence-widget-pane .widget-icon {
|
||||||
|
display: block;
|
||||||
|
height: 14px;
|
||||||
|
width: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.conpherence-widget-pane .phabricator-remarkup-embed-layout-link {
|
||||||
|
padding-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
|
@ -2,14 +2,17 @@
|
||||||
* @provides javelin-behavior-conpherence-menu
|
* @provides javelin-behavior-conpherence-menu
|
||||||
* @requires javelin-behavior
|
* @requires javelin-behavior
|
||||||
* javelin-dom
|
* javelin-dom
|
||||||
* javelin-workflow
|
* javelin-request
|
||||||
* javelin-util
|
|
||||||
* javelin-stratcom
|
* javelin-stratcom
|
||||||
* javelin-uri
|
* javelin-uri
|
||||||
|
* javelin-util
|
||||||
|
* javelin-workflow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
JX.behavior('conpherence-menu', function(config) {
|
JX.behavior('conpherence-menu', function(config) {
|
||||||
|
|
||||||
|
var root = JX.$(config.form_pane);
|
||||||
|
|
||||||
function onwidgetresponse(context, response) {
|
function onwidgetresponse(context, response) {
|
||||||
var widgets = JX.$H(response.widgets);
|
var widgets = JX.$H(response.widgets);
|
||||||
var widgetsRoot = JX.$(config.widgets_pane);
|
var widgetsRoot = JX.$(config.widgets_pane);
|
||||||
|
@ -107,14 +110,39 @@ JX.behavior('conpherence-menu', function(config) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
JX.Stratcom.listen('click', 'conpherence-edit-metadata', function (e) {
|
||||||
|
e.kill();
|
||||||
|
var form = JX.DOM.find(root, 'form');
|
||||||
|
var data = e.getNodeData('conpherence-edit-metadata');
|
||||||
|
new JX.Workflow.newFromForm(form, data)
|
||||||
|
.setHandler(function (r) {
|
||||||
|
// update the header
|
||||||
|
JX.DOM.setContent(
|
||||||
|
JX.$(config.header),
|
||||||
|
JX.$H(r.header)
|
||||||
|
);
|
||||||
|
|
||||||
|
// update the menu entry as well
|
||||||
|
JX.DOM.replace(
|
||||||
|
JX.$(r.conpherence_phid + '-nav-item'),
|
||||||
|
JX.$H(r.nav_item)
|
||||||
|
);
|
||||||
|
JX.DOM.replace(
|
||||||
|
JX.$(r.conpherence_phid + '-menu-item'),
|
||||||
|
JX.$H(r.menu_item)
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.start();
|
||||||
|
});
|
||||||
|
|
||||||
JX.Stratcom.listen('click', 'show-older-messages', function(e) {
|
JX.Stratcom.listen('click', 'show-older-messages', function(e) {
|
||||||
e.kill();
|
e.kill();
|
||||||
console.log(document.URL);
|
console.log(document.URL);
|
||||||
new JX.Request('/conpherence/view/1/', function(r) {
|
new JX.Request('/conpherence/view/1/', function(r) {
|
||||||
console.log('100');
|
console.log('100');
|
||||||
})
|
})
|
||||||
.setData({offset: 100}) // get the next page
|
.setData({offset: 100}) // get the next page
|
||||||
.send();
|
.send();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
* @provides javelin-behavior-conpherence-pontificate
|
* @provides javelin-behavior-conpherence-pontificate
|
||||||
* @requires javelin-behavior
|
* @requires javelin-behavior
|
||||||
* javelin-dom
|
* javelin-dom
|
||||||
* javelin-request
|
* javelin-util
|
||||||
|
* javelin-workflow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
JX.behavior('conpherence-pontificate', function(config) {
|
JX.behavior('conpherence-pontificate', function(config) {
|
||||||
|
@ -35,6 +36,12 @@ JX.behavior('conpherence-pontificate', function(config) {
|
||||||
JX.$H(r.header)
|
JX.$H(r.header)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// update the file widget
|
||||||
|
JX.DOM.setContent(
|
||||||
|
JX.$(config.file_widget),
|
||||||
|
JX.$H(r.file_widget)
|
||||||
|
);
|
||||||
|
|
||||||
// clear the textarea
|
// clear the textarea
|
||||||
var textarea = JX.DOM.find(form, 'textarea');
|
var textarea = JX.DOM.find(form, 'textarea');
|
||||||
textarea.value = '';
|
textarea.value = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue