mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 15:21:03 +01:00
Allow tokenizer construction to fail
Summary: See some discussion in D5622. Javelin explicitly prevents you from putting `<script>` tags into `JX.$H()`, which is probably a good idea, so just let this behavior fail less abruptly instead. We currently have no cases where we load something into a cache and then make a decision about whether to put it into the document or not later on; this should hold us over until we do. If and when we do, we can let those endpoints capture behaviors and replay them later or something. Test Plan: Verified tokenizers still work correctly. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D5623
This commit is contained in:
parent
e07077ae4e
commit
1e2b6faadd
3 changed files with 50 additions and 40 deletions
|
@ -1189,7 +1189,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-aphront-basic-tokenizer' =>
|
||||
array(
|
||||
'uri' => '/res/cf049052/rsrc/js/application/core/behavior-tokenizer.js',
|
||||
'uri' => '/res/22db5a80/rsrc/js/application/core/behavior-tokenizer.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -3200,7 +3200,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'phabricator-prefab' =>
|
||||
array(
|
||||
'uri' => '/res/2734e45f/rsrc/js/application/core/Prefab.js',
|
||||
'uri' => '/res/7bf0bc20/rsrc/js/application/core/Prefab.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
@ -3946,7 +3946,7 @@ celerity_register_resource_map(array(
|
|||
'uri' => '/res/pkg/30e5f188/core.pkg.css',
|
||||
'type' => 'css',
|
||||
),
|
||||
'd95b69e5' =>
|
||||
'bf16b308' =>
|
||||
array(
|
||||
'name' => 'core.pkg.js',
|
||||
'symbols' =>
|
||||
|
@ -3986,7 +3986,7 @@ celerity_register_resource_map(array(
|
|||
32 => 'javelin-behavior-global-drag-and-drop',
|
||||
33 => 'javelin-behavior-phabricator-reveal-content',
|
||||
),
|
||||
'uri' => '/res/pkg/d95b69e5/core.pkg.js',
|
||||
'uri' => '/res/pkg/bf16b308/core.pkg.js',
|
||||
'type' => 'js',
|
||||
),
|
||||
'dca4a03d' =>
|
||||
|
@ -4158,17 +4158,17 @@ celerity_register_resource_map(array(
|
|||
'diffusion-icons-css' => 'c8ce2d88',
|
||||
'global-drag-and-drop-css' => '30e5f188',
|
||||
'inline-comment-summary-css' => '8aaacd1b',
|
||||
'javelin-aphlict' => 'd95b69e5',
|
||||
'javelin-aphlict' => 'bf16b308',
|
||||
'javelin-behavior' => 'a2f94024',
|
||||
'javelin-behavior-aphlict-dropdown' => 'd95b69e5',
|
||||
'javelin-behavior-aphlict-listen' => 'd95b69e5',
|
||||
'javelin-behavior-aphront-basic-tokenizer' => 'd95b69e5',
|
||||
'javelin-behavior-aphlict-dropdown' => 'bf16b308',
|
||||
'javelin-behavior-aphlict-listen' => 'bf16b308',
|
||||
'javelin-behavior-aphront-basic-tokenizer' => 'bf16b308',
|
||||
'javelin-behavior-aphront-drag-and-drop' => 'e96b08f8',
|
||||
'javelin-behavior-aphront-drag-and-drop-textarea' => 'e96b08f8',
|
||||
'javelin-behavior-aphront-form-disable-on-submit' => 'd95b69e5',
|
||||
'javelin-behavior-aphront-form-disable-on-submit' => 'bf16b308',
|
||||
'javelin-behavior-audit-preview' => 'f96657b8',
|
||||
'javelin-behavior-dark-console' => 'dca4a03d',
|
||||
'javelin-behavior-device' => 'd95b69e5',
|
||||
'javelin-behavior-device' => 'bf16b308',
|
||||
'javelin-behavior-differential-accept-with-errors' => 'e96b08f8',
|
||||
'javelin-behavior-differential-add-reviewers-and-ccs' => 'e96b08f8',
|
||||
'javelin-behavior-differential-comment-jump' => 'e96b08f8',
|
||||
|
@ -4184,32 +4184,32 @@ celerity_register_resource_map(array(
|
|||
'javelin-behavior-diffusion-commit-graph' => 'f96657b8',
|
||||
'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8',
|
||||
'javelin-behavior-error-log' => 'dca4a03d',
|
||||
'javelin-behavior-global-drag-and-drop' => 'd95b69e5',
|
||||
'javelin-behavior-history-install' => 'd95b69e5',
|
||||
'javelin-behavior-konami' => 'd95b69e5',
|
||||
'javelin-behavior-lightbox-attachments' => 'd95b69e5',
|
||||
'javelin-behavior-global-drag-and-drop' => 'bf16b308',
|
||||
'javelin-behavior-history-install' => 'bf16b308',
|
||||
'javelin-behavior-konami' => 'bf16b308',
|
||||
'javelin-behavior-lightbox-attachments' => 'bf16b308',
|
||||
'javelin-behavior-load-blame' => 'e96b08f8',
|
||||
'javelin-behavior-maniphest-batch-selector' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-subpriority-editor' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-transaction-controls' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-transaction-expand' => 'f85eb6d8',
|
||||
'javelin-behavior-maniphest-transaction-preview' => 'f85eb6d8',
|
||||
'javelin-behavior-phabricator-active-nav' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-autofocus' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-gesture' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-keyboard-shortcuts' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-nav' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-active-nav' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-autofocus' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-gesture' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-keyboard-shortcuts' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-nav' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-object-selector' => 'e96b08f8',
|
||||
'javelin-behavior-phabricator-oncopy' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-remarkup-assist' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-reveal-content' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-search-typeahead' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-tooltips' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-watch-anchor' => 'd95b69e5',
|
||||
'javelin-behavior-refresh-csrf' => 'd95b69e5',
|
||||
'javelin-behavior-phabricator-oncopy' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-remarkup-assist' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-reveal-content' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-search-typeahead' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-tooltips' => 'bf16b308',
|
||||
'javelin-behavior-phabricator-watch-anchor' => 'bf16b308',
|
||||
'javelin-behavior-refresh-csrf' => 'bf16b308',
|
||||
'javelin-behavior-repository-crossreference' => 'e96b08f8',
|
||||
'javelin-behavior-toggle-class' => 'd95b69e5',
|
||||
'javelin-behavior-workflow' => 'd95b69e5',
|
||||
'javelin-behavior-toggle-class' => 'bf16b308',
|
||||
'javelin-behavior-workflow' => 'bf16b308',
|
||||
'javelin-dom' => 'a2f94024',
|
||||
'javelin-event' => 'a2f94024',
|
||||
'javelin-install' => 'a2f94024',
|
||||
|
@ -4231,38 +4231,38 @@ celerity_register_resource_map(array(
|
|||
'lightbox-attachment-css' => '30e5f188',
|
||||
'maniphest-task-summary-css' => '6b1fccc6',
|
||||
'maniphest-transaction-detail-css' => '6b1fccc6',
|
||||
'phabricator-busy' => 'd95b69e5',
|
||||
'phabricator-busy' => 'bf16b308',
|
||||
'phabricator-content-source-view-css' => '8aaacd1b',
|
||||
'phabricator-core-buttons-css' => '30e5f188',
|
||||
'phabricator-core-css' => '30e5f188',
|
||||
'phabricator-crumbs-view-css' => '30e5f188',
|
||||
'phabricator-directory-css' => '30e5f188',
|
||||
'phabricator-drag-and-drop-file-upload' => 'e96b08f8',
|
||||
'phabricator-dropdown-menu' => 'd95b69e5',
|
||||
'phabricator-file-upload' => 'd95b69e5',
|
||||
'phabricator-dropdown-menu' => 'bf16b308',
|
||||
'phabricator-file-upload' => 'bf16b308',
|
||||
'phabricator-filetree-view-css' => '30e5f188',
|
||||
'phabricator-flag-css' => '30e5f188',
|
||||
'phabricator-form-view-css' => '30e5f188',
|
||||
'phabricator-header-view-css' => '30e5f188',
|
||||
'phabricator-jump-nav' => '30e5f188',
|
||||
'phabricator-keyboard-shortcut' => 'd95b69e5',
|
||||
'phabricator-keyboard-shortcut-manager' => 'd95b69e5',
|
||||
'phabricator-keyboard-shortcut' => 'bf16b308',
|
||||
'phabricator-keyboard-shortcut-manager' => 'bf16b308',
|
||||
'phabricator-main-menu-view' => '30e5f188',
|
||||
'phabricator-menu-item' => 'd95b69e5',
|
||||
'phabricator-menu-item' => 'bf16b308',
|
||||
'phabricator-nav-view-css' => '30e5f188',
|
||||
'phabricator-notification' => 'd95b69e5',
|
||||
'phabricator-notification' => 'bf16b308',
|
||||
'phabricator-notification-css' => '30e5f188',
|
||||
'phabricator-notification-menu-css' => '30e5f188',
|
||||
'phabricator-object-item-list-view-css' => '30e5f188',
|
||||
'phabricator-object-selector-css' => '8aaacd1b',
|
||||
'phabricator-prefab' => 'd95b69e5',
|
||||
'phabricator-prefab' => 'bf16b308',
|
||||
'phabricator-project-tag-css' => '6b1fccc6',
|
||||
'phabricator-remarkup-css' => '30e5f188',
|
||||
'phabricator-shaped-request' => 'e96b08f8',
|
||||
'phabricator-side-menu-view-css' => '30e5f188',
|
||||
'phabricator-standard-page-view' => '30e5f188',
|
||||
'phabricator-textareautils' => 'd95b69e5',
|
||||
'phabricator-tooltip' => 'd95b69e5',
|
||||
'phabricator-textareautils' => 'bf16b308',
|
||||
'phabricator-tooltip' => 'bf16b308',
|
||||
'phabricator-transaction-view-css' => '30e5f188',
|
||||
'phabricator-zindex-css' => '30e5f188',
|
||||
'sprite-apps-large-css' => '30e5f188',
|
||||
|
|
|
@ -46,7 +46,14 @@ JX.install('Prefab', {
|
|||
*
|
||||
*/
|
||||
buildTokenizer : function(config) {
|
||||
var root = config.root || JX.$(config.id);
|
||||
try {
|
||||
var root = config.root || JX.$(config.id);
|
||||
} catch (ex) {
|
||||
// If the root element does not exist, just return without building
|
||||
// anything. This happens in some cases -- like Conpherence -- where we
|
||||
// may load a tokenizer but not put it in the document.
|
||||
return;
|
||||
}
|
||||
|
||||
var datasource;
|
||||
if (config.ondemand) {
|
||||
|
|
|
@ -5,5 +5,8 @@
|
|||
*/
|
||||
|
||||
JX.behavior('aphront-basic-tokenizer', function(config) {
|
||||
JX.Prefab.buildTokenizer(config).tokenizer.start();
|
||||
var build = JX.Prefab.buildTokenizer(config);
|
||||
if (build) {
|
||||
build.tokenizer.start();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue