diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 128911b06f..81a716c84e 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -773,7 +773,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-aphront-form-disable-on-submit' => array( - 'uri' => '/res/6c659ede/rsrc/js/application/core/behavior-form.js', + 'uri' => '/res/ca54e8b9/rsrc/js/application/core/behavior-form.js', 'type' => 'js', 'requires' => array( @@ -2446,7 +2446,7 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/9c4e265b/core.pkg.css', 'type' => 'css', ), - 'ba0a3c7e' => + '0c96375e' => array( 'name' => 'core.pkg.js', 'symbols' => @@ -2469,7 +2469,7 @@ celerity_register_resource_map(array( 15 => 'javelin-behavior-phabricator-tooltips', 16 => 'phabricator-prefab', ), - 'uri' => '/res/pkg/ba0a3c7e/core.pkg.js', + 'uri' => '/res/pkg/0c96375e/core.pkg.js', 'type' => 'js', ), '1138d3d1' => @@ -2641,7 +2641,7 @@ celerity_register_resource_map(array( 'javelin-behavior-aphront-basic-tokenizer' => '97f65640', 'javelin-behavior-aphront-drag-and-drop' => 'e4ddcab5', 'javelin-behavior-aphront-drag-and-drop-textarea' => 'e4ddcab5', - 'javelin-behavior-aphront-form-disable-on-submit' => 'ba0a3c7e', + 'javelin-behavior-aphront-form-disable-on-submit' => '0c96375e', 'javelin-behavior-audit-preview' => '5e68be89', 'javelin-behavior-buoyant' => 'e4ddcab5', 'javelin-behavior-differential-accept-with-errors' => 'e4ddcab5', @@ -2661,20 +2661,20 @@ celerity_register_resource_map(array( 'javelin-behavior-maniphest-transaction-controls' => '7707de41', 'javelin-behavior-maniphest-transaction-expand' => '7707de41', 'javelin-behavior-maniphest-transaction-preview' => '7707de41', - 'javelin-behavior-phabricator-autofocus' => 'ba0a3c7e', - 'javelin-behavior-phabricator-keyboard-shortcuts' => 'ba0a3c7e', + 'javelin-behavior-phabricator-autofocus' => '0c96375e', + 'javelin-behavior-phabricator-keyboard-shortcuts' => '0c96375e', 'javelin-behavior-phabricator-object-selector' => 'e4ddcab5', - 'javelin-behavior-phabricator-oncopy' => 'ba0a3c7e', - 'javelin-behavior-phabricator-tooltips' => 'ba0a3c7e', - 'javelin-behavior-phabricator-watch-anchor' => 'ba0a3c7e', - 'javelin-behavior-refresh-csrf' => 'ba0a3c7e', + 'javelin-behavior-phabricator-oncopy' => '0c96375e', + 'javelin-behavior-phabricator-tooltips' => '0c96375e', + 'javelin-behavior-phabricator-watch-anchor' => '0c96375e', + 'javelin-behavior-refresh-csrf' => '0c96375e', 'javelin-behavior-repository-crossreference' => 'e4ddcab5', - 'javelin-behavior-workflow' => 'ba0a3c7e', + 'javelin-behavior-workflow' => '0c96375e', 'javelin-dom' => '8a5de8a3', 'javelin-event' => '8a5de8a3', 'javelin-install' => '8a5de8a3', 'javelin-json' => '8a5de8a3', - 'javelin-mask' => 'ba0a3c7e', + 'javelin-mask' => '0c96375e', 'javelin-request' => '8a5de8a3', 'javelin-stratcom' => '8a5de8a3', 'javelin-tokenizer' => '97f65640', @@ -2686,7 +2686,7 @@ celerity_register_resource_map(array( 'javelin-uri' => '8a5de8a3', 'javelin-util' => '8a5de8a3', 'javelin-vector' => '8a5de8a3', - 'javelin-workflow' => 'ba0a3c7e', + 'javelin-workflow' => '0c96375e', 'maniphest-task-summary-css' => '7839ae2d', 'maniphest-transaction-detail-css' => '7839ae2d', 'phabricator-app-buttons-css' => '9c4e265b', @@ -2695,20 +2695,20 @@ celerity_register_resource_map(array( 'phabricator-core-css' => '9c4e265b', 'phabricator-directory-css' => '9c4e265b', 'phabricator-drag-and-drop-file-upload' => 'e4ddcab5', - 'phabricator-dropdown-menu' => 'ba0a3c7e', + 'phabricator-dropdown-menu' => '0c96375e', 'phabricator-flag-css' => '9c4e265b', 'phabricator-jump-nav' => '9c4e265b', - 'phabricator-keyboard-shortcut' => 'ba0a3c7e', - 'phabricator-keyboard-shortcut-manager' => 'ba0a3c7e', - 'phabricator-menu-item' => 'ba0a3c7e', + 'phabricator-keyboard-shortcut' => '0c96375e', + 'phabricator-keyboard-shortcut-manager' => '0c96375e', + 'phabricator-menu-item' => '0c96375e', 'phabricator-object-selector-css' => '1138d3d1', - 'phabricator-paste-file-upload' => 'ba0a3c7e', - 'phabricator-prefab' => 'ba0a3c7e', + 'phabricator-paste-file-upload' => '0c96375e', + 'phabricator-prefab' => '0c96375e', 'phabricator-project-tag-css' => '7839ae2d', 'phabricator-remarkup-css' => '9c4e265b', 'phabricator-shaped-request' => 'e4ddcab5', 'phabricator-standard-page-view' => '9c4e265b', - 'phabricator-tooltip' => 'ba0a3c7e', + 'phabricator-tooltip' => '0c96375e', 'phabricator-transaction-view-css' => '9c4e265b', 'syntax-highlighting-css' => '9c4e265b', ), diff --git a/webroot/rsrc/js/application/core/behavior-form.js b/webroot/rsrc/js/application/core/behavior-form.js index 06994a39ee..25ebb59e74 100644 --- a/webroot/rsrc/js/application/core/behavior-form.js +++ b/webroot/rsrc/js/application/core/behavior-form.js @@ -7,6 +7,12 @@ JX.behavior('aphront-form-disable-on-submit', function(config) { var restore = []; var root = null; + var new_tab = false; + + JX.Stratcom.listen('click', 'tag:button', function(e) { + var raw = e.getRawEvent(); + new_tab = (raw.altKey || raw.ctrlKey || raw.metaKey || raw.shiftKey); + }); JX.Stratcom.listen('submit', 'tag:form', function(e) { if (e.getNode('workflow')) { @@ -16,6 +22,15 @@ JX.behavior('aphront-form-disable-on-submit', function(config) { } root = e.getNode('tag:form'); + + // Open the form to a new tab in Firefox explicitly (automatic in Chrome). + // We render some buttons as links so users may be confused that the links + // don't open to new tabs with Ctrl+click as normal links. + root.target = (new_tab ? '_blank' : ''); + if (new_tab) { + return; + } + if (root._disabled) { e.kill(); }