@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Decrease fragility of `conpherence-pontificate` behavior

Summary:
Currently, this behavior binds a ton of IDs. This makes the behavior fragile: if it is invoked on a page without all the right elements, some `JX.$()` tends to explode.

Instead, don't assume anything is present on the page. This allows the behavior to be invoked on other pages (like the "New Conpherence" page) or pages without some elements (like some future thread-only mobile view) without creating JS errors.

Test Plan:
Added comments, added comments with files. Viewed "New conphenrece" page.

NOTE: Control+Enter is currently broken, but this diff didn't change that behavior.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D5468

+103 -204
+63 -161
src/__celerity_resource_map__.php
··· 448 448 'disk' => '/rsrc/image/menu_texture.png', 449 449 'type' => 'png', 450 450 ), 451 - '/rsrc/image/people/harding.png' => 452 - array( 453 - 'hash' => '818b035ace2c480aa8df7b7f11cef58b', 454 - 'uri' => '/res/818b035a/rsrc/image/people/harding.png', 455 - 'disk' => '/rsrc/image/people/harding.png', 456 - 'type' => 'png', 457 - ), 458 - '/rsrc/image/people/jefferson.png' => 459 - array( 460 - 'hash' => '55fe807ff02f9320e595fb59442e2038', 461 - 'uri' => '/res/55fe807f/rsrc/image/people/jefferson.png', 462 - 'disk' => '/rsrc/image/people/jefferson.png', 463 - 'type' => 'png', 464 - ), 465 - '/rsrc/image/people/lincoln.png' => 466 - array( 467 - 'hash' => '2363337947ab52fd5fda79e4a004e930', 468 - 'uri' => '/res/23633379/rsrc/image/people/lincoln.png', 469 - 'disk' => '/rsrc/image/people/lincoln.png', 470 - 'type' => 'png', 471 - ), 472 - '/rsrc/image/people/mckinley.png' => 473 - array( 474 - 'hash' => '0b7b05dd47c49a0874670e5e8200bba8', 475 - 'uri' => '/res/0b7b05dd/rsrc/image/people/mckinley.png', 476 - 'disk' => '/rsrc/image/people/mckinley.png', 477 - 'type' => 'png', 478 - ), 479 - '/rsrc/image/people/taft.png' => 480 - array( 481 - 'hash' => 'f3e47d45b59b0b009fd536dabae9a151', 482 - 'uri' => '/res/f3e47d45/rsrc/image/people/taft.png', 483 - 'disk' => '/rsrc/image/people/taft.png', 484 - 'type' => 'png', 485 - ), 486 - '/rsrc/image/people/washington.png' => 487 - array( 488 - 'hash' => '01412761cab769f7993d69eba986d949', 489 - 'uri' => '/res/01412761/rsrc/image/people/washington.png', 490 - 'disk' => '/rsrc/image/people/washington.png', 491 - 'type' => 'png', 492 - ), 493 - '/rsrc/image/phrequent_active.png' => 494 - array( 495 - 'hash' => '716cddc08630eaa33934b2008723cac0', 496 - 'uri' => '/res/716cddc0/rsrc/image/phrequent_active.png', 497 - 'disk' => '/rsrc/image/phrequent_active.png', 498 - 'type' => 'png', 499 - ), 500 - '/rsrc/image/phrequent_inactive.png' => 501 - array( 502 - 'hash' => 'f9099683873c01c5de1dc6650bd668fe', 503 - 'uri' => '/res/f9099683/rsrc/image/phrequent_inactive.png', 504 - 'disk' => '/rsrc/image/phrequent_inactive.png', 505 - 'type' => 'png', 506 - ), 507 451 '/rsrc/image/search.png' => 508 452 array( 509 453 'hash' => 'ff7da044e6f923b8f569dec11f97e5e5', ··· 651 595 'disk' => '/rsrc/image/texture/grip.png', 652 596 'type' => 'png', 653 597 ), 654 - '/rsrc/image/texture/panel-header-gradient.png' => 655 - array( 656 - 'hash' => 'ad9204dd3ef5b12b645d80677d8ccead', 657 - 'uri' => '/res/ad9204dd/rsrc/image/texture/panel-header-gradient.png', 658 - 'disk' => '/rsrc/image/texture/panel-header-gradient.png', 659 - 'type' => 'png', 660 - ), 661 598 '/rsrc/image/texture/pholio-background.gif' => 662 599 array( 663 600 'hash' => 'cf4561af116edf393dc583e5119fb412', ··· 1203 1140 ), 1204 1141 'javelin-behavior-aphront-form-disable-on-submit' => 1205 1142 array( 1206 - 'uri' => '/res/f5a60aec/rsrc/js/application/core/behavior-form.js', 1143 + 'uri' => '/res/b5052cd0/rsrc/js/application/core/behavior-form.js', 1207 1144 'type' => 'js', 1208 1145 'requires' => 1209 1146 array( ··· 1269 1206 ), 1270 1207 'javelin-behavior-conpherence-pontificate' => 1271 1208 array( 1272 - 'uri' => '/res/abc4d947/rsrc/js/application/conpherence/behavior-pontificate.js', 1209 + 'uri' => '/res/e5a0ce39/rsrc/js/application/conpherence/behavior-pontificate.js', 1273 1210 'type' => 'js', 1274 1211 'requires' => 1275 1212 array( ··· 1277 1214 1 => 'javelin-dom', 1278 1215 2 => 'javelin-util', 1279 1216 3 => 'javelin-workflow', 1217 + 4 => 'javelin-stratcom', 1280 1218 ), 1281 1219 'disk' => '/rsrc/js/application/conpherence/behavior-pontificate.js', 1282 1220 ), ··· 2878 2816 ), 2879 2817 'phabricator-drag-and-drop-file-upload' => 2880 2818 array( 2881 - 'uri' => '/res/1daa63d1/rsrc/js/application/core/DragAndDropFileUpload.js', 2819 + 'uri' => '/res/ce71f19a/rsrc/js/application/core/DragAndDropFileUpload.js', 2882 2820 'type' => 'js', 2883 2821 'requires' => 2884 2822 array( ··· 3441 3379 ), 3442 3380 'disk' => '/rsrc/js/application/uiexample/ReactorSendPropertiesExample.js', 3443 3381 ), 3444 - 'phabricator-workboard-view-css' => 3445 - array( 3446 - 'uri' => '/res/b70667c6/rsrc/css/layout/phabricator-workboard-view.css', 3447 - 'type' => 'css', 3448 - 'requires' => 3449 - array( 3450 - ), 3451 - 'disk' => '/rsrc/css/layout/phabricator-workboard-view.css', 3452 - ), 3453 - 'phabricator-workpanel-view-css' => 3454 - array( 3455 - 'uri' => '/res/d2eea288/rsrc/css/layout/phabricator-workpanel-view.css', 3456 - 'type' => 'css', 3457 - 'requires' => 3458 - array( 3459 - ), 3460 - 'disk' => '/rsrc/css/layout/phabricator-workpanel-view.css', 3461 - ), 3462 3382 'phabricator-zindex-css' => 3463 3383 array( 3464 3384 'uri' => '/res/fcbf82ad/rsrc/css/core/z-index.css', ··· 3494 3414 array( 3495 3415 ), 3496 3416 'disk' => '/rsrc/css/application/pholio/pholio-inline-comments.css', 3497 - ), 3498 - 'phrequent-css' => 3499 - array( 3500 - 'uri' => '/res/9d6f3eb7/rsrc/css/application/phrequent/phrequent.css', 3501 - 'type' => 'css', 3502 - 'requires' => 3503 - array( 3504 - ), 3505 - 'disk' => '/rsrc/css/application/phrequent/phrequent.css', 3506 3417 ), 3507 3418 'phriction-document-css' => 3508 3419 array( ··· 3675 3586 ), 3676 3587 'disk' => '/rsrc/css/application/config/setup-issue.css', 3677 3588 ), 3678 - 'spacing-css' => 3679 - array( 3680 - 'uri' => '/res/59e4c9b1/rsrc/css/core/spacing.css', 3681 - 'type' => 'css', 3682 - 'requires' => 3683 - array( 3684 - ), 3685 - 'disk' => '/rsrc/css/core/spacing.css', 3686 - ), 3687 3589 'sprite-apps-css' => 3688 3590 array( 3689 3591 'uri' => '/res/c53973fc/rsrc/css/sprite-apps.css', ··· 3849 3751 'uri' => '/res/pkg/4fc2a8f9/core.pkg.css', 3850 3752 'type' => 'css', 3851 3753 ), 3852 - 'def4c982' => 3754 + '95ceba95' => 3853 3755 array( 3854 3756 'name' => 'core.pkg.js', 3855 3757 'symbols' => ··· 3890 3792 33 => 'javelin-behavior-global-drag-and-drop', 3891 3793 34 => 'javelin-behavior-phabricator-reveal-content', 3892 3794 ), 3893 - 'uri' => '/res/pkg/def4c982/core.pkg.js', 3795 + 'uri' => '/res/pkg/95ceba95/core.pkg.js', 3894 3796 'type' => 'js', 3895 3797 ), 3896 3798 'dca4a03d' => ··· 3926 3828 'uri' => '/res/pkg/8aaacd1b/differential.pkg.css', 3927 3829 'type' => 'css', 3928 3830 ), 3929 - '67ea27d0' => 3831 + '322728f3' => 3930 3832 array( 3931 3833 'name' => 'differential.pkg.js', 3932 3834 'symbols' => ··· 3952 3854 18 => 'javelin-behavior-differential-toggle-files', 3953 3855 19 => 'javelin-behavior-differential-user-select', 3954 3856 ), 3955 - 'uri' => '/res/pkg/67ea27d0/differential.pkg.js', 3857 + 'uri' => '/res/pkg/322728f3/differential.pkg.js', 3956 3858 'type' => 'js', 3957 3859 ), 3958 3860 'c8ce2d88' => ··· 4049 3951 'aphront-typeahead-control-css' => '4fc2a8f9', 4050 3952 'differential-changeset-view-css' => '8aaacd1b', 4051 3953 'differential-core-view-css' => '8aaacd1b', 4052 - 'differential-inline-comment-editor' => '67ea27d0', 3954 + 'differential-inline-comment-editor' => '322728f3', 4053 3955 'differential-local-commits-view-css' => '8aaacd1b', 4054 3956 'differential-results-table-css' => '8aaacd1b', 4055 3957 'differential-revision-add-comment-css' => '8aaacd1b', ··· 4062 3964 'diffusion-icons-css' => 'c8ce2d88', 4063 3965 'global-drag-and-drop-css' => '4fc2a8f9', 4064 3966 'inline-comment-summary-css' => '8aaacd1b', 4065 - 'javelin-aphlict' => 'def4c982', 3967 + 'javelin-aphlict' => '95ceba95', 4066 3968 'javelin-behavior' => 'fe22443b', 4067 - 'javelin-behavior-aphlict-dropdown' => 'def4c982', 4068 - 'javelin-behavior-aphlict-listen' => 'def4c982', 4069 - 'javelin-behavior-aphront-basic-tokenizer' => 'def4c982', 4070 - 'javelin-behavior-aphront-drag-and-drop' => '67ea27d0', 4071 - 'javelin-behavior-aphront-drag-and-drop-textarea' => '67ea27d0', 4072 - 'javelin-behavior-aphront-form-disable-on-submit' => 'def4c982', 3969 + 'javelin-behavior-aphlict-dropdown' => '95ceba95', 3970 + 'javelin-behavior-aphlict-listen' => '95ceba95', 3971 + 'javelin-behavior-aphront-basic-tokenizer' => '95ceba95', 3972 + 'javelin-behavior-aphront-drag-and-drop' => '322728f3', 3973 + 'javelin-behavior-aphront-drag-and-drop-textarea' => '322728f3', 3974 + 'javelin-behavior-aphront-form-disable-on-submit' => '95ceba95', 4073 3975 'javelin-behavior-audit-preview' => 'f96657b8', 4074 3976 'javelin-behavior-dark-console' => 'dca4a03d', 4075 - 'javelin-behavior-device' => 'def4c982', 4076 - 'javelin-behavior-differential-accept-with-errors' => '67ea27d0', 4077 - 'javelin-behavior-differential-add-reviewers-and-ccs' => '67ea27d0', 4078 - 'javelin-behavior-differential-comment-jump' => '67ea27d0', 4079 - 'javelin-behavior-differential-diff-radios' => '67ea27d0', 4080 - 'javelin-behavior-differential-dropdown-menus' => '67ea27d0', 4081 - 'javelin-behavior-differential-edit-inline-comments' => '67ea27d0', 4082 - 'javelin-behavior-differential-feedback-preview' => '67ea27d0', 4083 - 'javelin-behavior-differential-keyboard-navigation' => '67ea27d0', 4084 - 'javelin-behavior-differential-populate' => '67ea27d0', 4085 - 'javelin-behavior-differential-show-more' => '67ea27d0', 4086 - 'javelin-behavior-differential-toggle-files' => '67ea27d0', 4087 - 'javelin-behavior-differential-user-select' => '67ea27d0', 3977 + 'javelin-behavior-device' => '95ceba95', 3978 + 'javelin-behavior-differential-accept-with-errors' => '322728f3', 3979 + 'javelin-behavior-differential-add-reviewers-and-ccs' => '322728f3', 3980 + 'javelin-behavior-differential-comment-jump' => '322728f3', 3981 + 'javelin-behavior-differential-diff-radios' => '322728f3', 3982 + 'javelin-behavior-differential-dropdown-menus' => '322728f3', 3983 + 'javelin-behavior-differential-edit-inline-comments' => '322728f3', 3984 + 'javelin-behavior-differential-feedback-preview' => '322728f3', 3985 + 'javelin-behavior-differential-keyboard-navigation' => '322728f3', 3986 + 'javelin-behavior-differential-populate' => '322728f3', 3987 + 'javelin-behavior-differential-show-more' => '322728f3', 3988 + 'javelin-behavior-differential-toggle-files' => '322728f3', 3989 + 'javelin-behavior-differential-user-select' => '322728f3', 4088 3990 'javelin-behavior-diffusion-commit-graph' => 'f96657b8', 4089 3991 'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8', 4090 3992 'javelin-behavior-error-log' => 'dca4a03d', 4091 - 'javelin-behavior-global-drag-and-drop' => 'def4c982', 4092 - 'javelin-behavior-history-install' => 'def4c982', 4093 - 'javelin-behavior-konami' => 'def4c982', 4094 - 'javelin-behavior-lightbox-attachments' => 'def4c982', 4095 - 'javelin-behavior-load-blame' => '67ea27d0', 3993 + 'javelin-behavior-global-drag-and-drop' => '95ceba95', 3994 + 'javelin-behavior-history-install' => '95ceba95', 3995 + 'javelin-behavior-konami' => '95ceba95', 3996 + 'javelin-behavior-lightbox-attachments' => '95ceba95', 3997 + 'javelin-behavior-load-blame' => '322728f3', 4096 3998 'javelin-behavior-maniphest-batch-selector' => 'f85eb6d8', 4097 3999 'javelin-behavior-maniphest-subpriority-editor' => 'f85eb6d8', 4098 4000 'javelin-behavior-maniphest-transaction-controls' => 'f85eb6d8', 4099 4001 'javelin-behavior-maniphest-transaction-expand' => 'f85eb6d8', 4100 4002 'javelin-behavior-maniphest-transaction-preview' => 'f85eb6d8', 4101 - 'javelin-behavior-phabricator-active-nav' => 'def4c982', 4102 - 'javelin-behavior-phabricator-autofocus' => 'def4c982', 4103 - 'javelin-behavior-phabricator-gesture' => 'def4c982', 4104 - 'javelin-behavior-phabricator-keyboard-shortcuts' => 'def4c982', 4105 - 'javelin-behavior-phabricator-nav' => 'def4c982', 4106 - 'javelin-behavior-phabricator-object-selector' => '67ea27d0', 4107 - 'javelin-behavior-phabricator-oncopy' => 'def4c982', 4108 - 'javelin-behavior-phabricator-remarkup-assist' => 'def4c982', 4109 - 'javelin-behavior-phabricator-reveal-content' => 'def4c982', 4110 - 'javelin-behavior-phabricator-search-typeahead' => 'def4c982', 4111 - 'javelin-behavior-phabricator-tooltips' => 'def4c982', 4112 - 'javelin-behavior-phabricator-watch-anchor' => 'def4c982', 4113 - 'javelin-behavior-refresh-csrf' => 'def4c982', 4114 - 'javelin-behavior-repository-crossreference' => '67ea27d0', 4115 - 'javelin-behavior-toggle-class' => 'def4c982', 4116 - 'javelin-behavior-workflow' => 'def4c982', 4003 + 'javelin-behavior-phabricator-active-nav' => '95ceba95', 4004 + 'javelin-behavior-phabricator-autofocus' => '95ceba95', 4005 + 'javelin-behavior-phabricator-gesture' => '95ceba95', 4006 + 'javelin-behavior-phabricator-keyboard-shortcuts' => '95ceba95', 4007 + 'javelin-behavior-phabricator-nav' => '95ceba95', 4008 + 'javelin-behavior-phabricator-object-selector' => '322728f3', 4009 + 'javelin-behavior-phabricator-oncopy' => '95ceba95', 4010 + 'javelin-behavior-phabricator-remarkup-assist' => '95ceba95', 4011 + 'javelin-behavior-phabricator-reveal-content' => '95ceba95', 4012 + 'javelin-behavior-phabricator-search-typeahead' => '95ceba95', 4013 + 'javelin-behavior-phabricator-tooltips' => '95ceba95', 4014 + 'javelin-behavior-phabricator-watch-anchor' => '95ceba95', 4015 + 'javelin-behavior-refresh-csrf' => '95ceba95', 4016 + 'javelin-behavior-repository-crossreference' => '322728f3', 4017 + 'javelin-behavior-toggle-class' => '95ceba95', 4018 + 'javelin-behavior-workflow' => '95ceba95', 4117 4019 'javelin-dom' => 'fe22443b', 4118 4020 'javelin-event' => 'fe22443b', 4119 4021 'javelin-install' => 'fe22443b', ··· 4135 4037 'lightbox-attachment-css' => '4fc2a8f9', 4136 4038 'maniphest-task-summary-css' => '6b1fccc6', 4137 4039 'maniphest-transaction-detail-css' => '6b1fccc6', 4138 - 'phabricator-busy' => 'def4c982', 4040 + 'phabricator-busy' => '95ceba95', 4139 4041 'phabricator-content-source-view-css' => '8aaacd1b', 4140 4042 'phabricator-core-buttons-css' => '4fc2a8f9', 4141 4043 'phabricator-core-css' => '4fc2a8f9', 4142 4044 'phabricator-crumbs-view-css' => '4fc2a8f9', 4143 4045 'phabricator-directory-css' => '4fc2a8f9', 4144 - 'phabricator-drag-and-drop-file-upload' => '67ea27d0', 4145 - 'phabricator-dropdown-menu' => 'def4c982', 4146 - 'phabricator-file-upload' => 'def4c982', 4046 + 'phabricator-drag-and-drop-file-upload' => '322728f3', 4047 + 'phabricator-dropdown-menu' => '95ceba95', 4048 + 'phabricator-file-upload' => '95ceba95', 4147 4049 'phabricator-filetree-view-css' => '4fc2a8f9', 4148 4050 'phabricator-flag-css' => '4fc2a8f9', 4149 4051 'phabricator-form-view-css' => '4fc2a8f9', 4150 4052 'phabricator-header-view-css' => '4fc2a8f9', 4151 4053 'phabricator-jump-nav' => '4fc2a8f9', 4152 - 'phabricator-keyboard-shortcut' => 'def4c982', 4153 - 'phabricator-keyboard-shortcut-manager' => 'def4c982', 4054 + 'phabricator-keyboard-shortcut' => '95ceba95', 4055 + 'phabricator-keyboard-shortcut-manager' => '95ceba95', 4154 4056 'phabricator-main-menu-view' => '4fc2a8f9', 4155 - 'phabricator-menu-item' => 'def4c982', 4057 + 'phabricator-menu-item' => '95ceba95', 4156 4058 'phabricator-nav-view-css' => '4fc2a8f9', 4157 - 'phabricator-notification' => 'def4c982', 4059 + 'phabricator-notification' => '95ceba95', 4158 4060 'phabricator-notification-css' => '4fc2a8f9', 4159 4061 'phabricator-notification-menu-css' => '4fc2a8f9', 4160 4062 'phabricator-object-item-list-view-css' => '4fc2a8f9', 4161 4063 'phabricator-object-selector-css' => '8aaacd1b', 4162 - 'phabricator-paste-file-upload' => 'def4c982', 4163 - 'phabricator-prefab' => 'def4c982', 4064 + 'phabricator-paste-file-upload' => '95ceba95', 4065 + 'phabricator-prefab' => '95ceba95', 4164 4066 'phabricator-project-tag-css' => '6b1fccc6', 4165 4067 'phabricator-remarkup-css' => '4fc2a8f9', 4166 - 'phabricator-shaped-request' => '67ea27d0', 4068 + 'phabricator-shaped-request' => '322728f3', 4167 4069 'phabricator-side-menu-view-css' => '4fc2a8f9', 4168 4070 'phabricator-standard-page-view' => '4fc2a8f9', 4169 - 'phabricator-textareautils' => 'def4c982', 4170 - 'phabricator-tooltip' => 'def4c982', 4071 + 'phabricator-textareautils' => '95ceba95', 4072 + 'phabricator-tooltip' => '95ceba95', 4171 4073 'phabricator-transaction-view-css' => '4fc2a8f9', 4172 4074 'phabricator-zindex-css' => '4fc2a8f9', 4173 4075 'sprite-apps-large-css' => '4fc2a8f9',
+3 -8
src/applications/conpherence/controller/ConpherenceController.php
··· 329 329 'selected_conpherence_id' => $this->getSelectedConpherencePHID(), 330 330 'fancy_ajax' => (bool) $this->getSelectedConpherencePHID() 331 331 )); 332 + 332 333 if ($more_than_menu) { 333 334 Javelin::initBehavior('conpherence-drag-and-drop-photo', 334 335 array( ··· 337 338 'upload_uri' => '/file/dropupload/', 338 339 'activated_class' => 'conpherence-header-upload-photo', 339 340 )); 340 - Javelin::initBehavior('conpherence-pontificate', 341 - array( 342 - 'messages' => 'conpherence-messages', 343 - 'header' => 'conpherence-header-pane', 344 - 'menu_pane' => 'conpherence-menu', 345 - 'form_pane' => 'conpherence-form', 346 - 'file_widget' => 'widgets-files', 347 - )); 348 341 } 342 + 343 + Javelin::initBehavior('conpherence-pontificate'); 349 344 } 350 345 }
+8 -5
src/applications/conpherence/controller/ConpherenceListController.php
··· 64 64 65 65 private function renderEmptyMainPane() { 66 66 $this->initJavelinBehaviors(true); 67 - return phutil_tag( 67 + return javelin_tag( 68 68 'div', 69 69 array( 70 - 'id' => 'conpherence-main-pane' 70 + 'id' => 'conpherence-main-pane', 71 + 'sigil' => 'conpherence-layout' 71 72 ), 72 73 array( 73 - phutil_tag( 74 + javelin_tag( 74 75 'div', 75 76 array( 76 77 'class' => 'conpherence-header-pane', 77 78 'id' => 'conpherence-header-pane', 79 + 'sigil' => 'conpherence-header', 78 80 ), 79 81 ''), 80 82 phutil_tag( ··· 91 93 'id' => 'conpherence-message-pane' 92 94 ), 93 95 array( 94 - phutil_tag( 96 + javelin_tag( 95 97 'div', 96 98 array( 97 99 'class' => 'conpherence-messages', 98 - 'id' => 'conpherence-messages' 100 + 'id' => 'conpherence-messages', 101 + 'sigil' => 'conpherence-messages', 99 102 ), 100 103 ''), 101 104 phutil_tag(
+2 -1
src/applications/conpherence/controller/ConpherenceWidgetController.php
··· 175 175 'style' => 'display: none;' 176 176 ), 177 177 $this->renderPeopleWidgetPaneContent()). 178 - phutil_tag( 178 + javelin_tag( 179 179 'div', 180 180 array( 181 181 'class' => 'widgets-body', 182 182 'id' => 'widgets-files', 183 + 'sigil' => 'conpherence-widget-files', 183 184 ), 184 185 id(new ConpherenceFileWidgetView()) 185 186 ->setUser($this->getRequest()->getUser())
+27 -29
webroot/rsrc/js/application/conpherence/behavior-pontificate.js
··· 4 4 * javelin-dom 5 5 * javelin-util 6 6 * javelin-workflow 7 + * javelin-stratcom 7 8 */ 8 9 9 10 JX.behavior('conpherence-pontificate', function(config) { 10 - 11 - var root = JX.$(config.form_pane); 12 - 13 11 var onsubmit = function(e) { 14 12 e.kill(); 15 - var form = JX.DOM.find(root, 'form'); 13 + 14 + var form = e.getNode('tag:form'); 15 + 16 + var root = e.getNode('conpherence-layout'); 17 + var messages = JX.DOM.find(root, 'div', 'conpherence-messages'); 18 + var header = JX.DOM.find(root, 'div', 'conpherence-header'); 19 + 20 + var files = null; 21 + try { 22 + files = JX.DOM.find(root, 'div', 'conpherence-widget-files'); 23 + } catch (ex) { 24 + // Ignore, this view may not have a Files widget. 25 + } 26 + 16 27 JX.Workflow.newFromForm(form) 17 28 .setHandler(JX.bind(this, function(r) { 18 29 // add the new transactions, probably just our post but who knows 19 - var messages = JX.$(config.messages); 20 30 JX.DOM.appendContent(messages, JX.$H(r.transactions)); 21 31 messages.scrollTop = messages.scrollHeight; 22 - 23 - // update the menu entry as well 24 - JX.DOM.replace( 25 - JX.$(r.conpherence_phid + '-nav-item'), 26 - JX.$H(r.nav_item) 27 - ); 32 + JX.DOM.setContent(header, JX.$H(r.header)); 28 33 29 - // update the header 30 - JX.DOM.setContent( 31 - JX.$(config.header), 32 - JX.$H(r.header) 33 - ); 34 + try { 35 + JX.DOM.replace( 36 + JX.$(r.conpherence_phid + '-nav-item'), 37 + JX.$H(r.nav_item)); 38 + } catch (ex) { 39 + // Ignore; this view may not have a menu. 40 + } 34 41 35 - // update the file widget 36 - JX.DOM.setContent( 37 - JX.$(config.file_widget), 38 - JX.$H(r.file_widget) 39 - ); 42 + if (files) { 43 + JX.DOM.setContent(files, JX.$H(r.file_widget)); 44 + } 40 45 41 - // clear the textarea 42 46 var textarea = JX.DOM.find(form, 'textarea'); 43 47 textarea.value = ''; 44 - 45 48 })) 46 49 .start(); 47 50 }; 48 51 49 - JX.DOM.listen( 50 - root, 51 - ['click'], 52 - 'conpherence-pontificate', 53 - onsubmit 54 - ); 52 + JX.Stratcom.listen('click', 'conpherence-pontificate', onsubmit); 55 53 56 54 });