1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Remove "Chaos" mode and fix fullscreen in Conpherence

Summary:
Fixes T3782. Two changes:

  - Remove the "Chaos" mode, which wasn't as funny as I'd hoped and has had a good run.
  - Fix "Order" (now "Fullscreen") mode in Conpherence. Best fix I could come up with is dropping the "position: fixed" on all parents while in the mode.

Test Plan: Used Fullscreen mode in Conpherence in Chrome.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T3782

Differential Revision: https://secure.phabricator.com/D6844
This commit is contained in:
epriestley 2013-08-29 15:59:15 -07:00
parent 63dbccb8a1
commit 2b6271d02c
18 changed files with 341 additions and 488 deletions

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -639,15 +639,15 @@ celerity_register_resource_map(array(
),
'/rsrc/image/sprite-icons-X2.png' =>
array(
'hash' => '2448b7e60f80e12eee6b11e5c540f7ef',
'uri' => '/res/2448b7e6/rsrc/image/sprite-icons-X2.png',
'hash' => '2e98aa47c23897088a2d4fc243563f60',
'uri' => '/res/2e98aa47/rsrc/image/sprite-icons-X2.png',
'disk' => '/rsrc/image/sprite-icons-X2.png',
'type' => 'png',
),
'/rsrc/image/sprite-icons.png' =>
array(
'hash' => '7caf2f6bd649d3ef86b33a25e061bf1a',
'uri' => '/res/7caf2f6b/rsrc/image/sprite-icons.png',
'hash' => 'b91308ecf18ba3e769e55bee0889bf96',
'uri' => '/res/b91308ec/rsrc/image/sprite-icons.png',
'disk' => '/rsrc/image/sprite-icons.png',
'type' => 'png',
),
@ -981,7 +981,7 @@ celerity_register_resource_map(array(
),
'conpherence-message-pane-css' =>
array(
'uri' => '/res/4f3bfae5/rsrc/css/application/conpherence/message-pane.css',
'uri' => '/res/0ee6c468/rsrc/css/application/conpherence/message-pane.css',
'type' => 'css',
'requires' =>
array(
@ -2106,7 +2106,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-phabricator-remarkup-assist' =>
array(
'uri' => '/res/6d254602/rsrc/js/core/behavior-phabricator-remarkup-assist.js',
'uri' => '/res/c3f4439f/rsrc/js/core/behavior-phabricator-remarkup-assist.js',
'type' => 'js',
'requires' =>
array(
@ -2115,8 +2115,7 @@ celerity_register_resource_map(array(
2 => 'javelin-dom',
3 => 'phabricator-textareautils',
4 => 'javelin-workflow',
5 => 'phabricator-notification',
6 => 'javelin-vector',
5 => 'javelin-vector',
),
'disk' => '/rsrc/js/core/behavior-phabricator-remarkup-assist.js',
),
@ -3395,7 +3394,7 @@ celerity_register_resource_map(array(
),
'phabricator-remarkup-css' =>
array(
'uri' => '/res/d0af3cab/rsrc/css/core/remarkup.css',
'uri' => '/res/1936eed3/rsrc/css/core/remarkup.css',
'type' => 'css',
'requires' =>
array(
@ -3671,7 +3670,7 @@ celerity_register_resource_map(array(
),
'phabricator-zindex-css' =>
array(
'uri' => '/res/a50437bf/rsrc/css/core/z-index.css',
'uri' => '/res/b443d508/rsrc/css/core/z-index.css',
'type' => 'css',
'requires' =>
array(
@ -4018,7 +4017,7 @@ celerity_register_resource_map(array(
),
'setup-issue-css' =>
array(
'uri' => '/res/efbb3673/rsrc/css/application/config/setup-issue.css',
'uri' => '/res/30435048/rsrc/css/application/config/setup-issue.css',
'type' => 'css',
'requires' =>
array(
@ -4090,7 +4089,7 @@ celerity_register_resource_map(array(
),
'sprite-icons-css' =>
array(
'uri' => '/res/03295fbd/rsrc/css/sprite-icons.css',
'uri' => '/res/ed413fda/rsrc/css/sprite-icons.css',
'type' => 'css',
'requires' =>
array(
@ -4172,7 +4171,7 @@ celerity_register_resource_map(array(
), array(
'packages' =>
array(
'a75e0dea' =>
'beac5d1a' =>
array(
'name' => 'core.pkg.css',
'symbols' =>
@ -4219,10 +4218,10 @@ celerity_register_resource_map(array(
39 => 'phabricator-property-list-view-css',
40 => 'phabricator-tag-view-css',
),
'uri' => '/res/pkg/a75e0dea/core.pkg.css',
'uri' => '/res/pkg/beac5d1a/core.pkg.css',
'type' => 'css',
),
'4f81c788' =>
'8977e356' =>
array(
'name' => 'core.pkg.js',
'symbols' =>
@ -4265,7 +4264,7 @@ celerity_register_resource_map(array(
35 => 'phabricator-hovercard',
36 => 'javelin-behavior-phabricator-hovercards',
),
'uri' => '/res/pkg/4f81c788/core.pkg.js',
'uri' => '/res/pkg/8977e356/core.pkg.js',
'type' => 'js',
),
'4ccfeb47' =>
@ -4410,15 +4409,15 @@ celerity_register_resource_map(array(
),
'reverse' =>
array(
'aphront-dialog-view-css' => 'a75e0dea',
'aphront-error-view-css' => 'a75e0dea',
'aphront-list-filter-view-css' => 'a75e0dea',
'aphront-pager-view-css' => 'a75e0dea',
'aphront-panel-view-css' => 'a75e0dea',
'aphront-table-view-css' => 'a75e0dea',
'aphront-tokenizer-control-css' => 'a75e0dea',
'aphront-tooltip-css' => 'a75e0dea',
'aphront-typeahead-control-css' => 'a75e0dea',
'aphront-dialog-view-css' => 'beac5d1a',
'aphront-error-view-css' => 'beac5d1a',
'aphront-list-filter-view-css' => 'beac5d1a',
'aphront-pager-view-css' => 'beac5d1a',
'aphront-panel-view-css' => 'beac5d1a',
'aphront-table-view-css' => 'beac5d1a',
'aphront-tokenizer-control-css' => 'beac5d1a',
'aphront-tooltip-css' => 'beac5d1a',
'aphront-typeahead-control-css' => 'beac5d1a',
'differential-changeset-view-css' => '09216861',
'differential-core-view-css' => '09216861',
'differential-inline-comment-editor' => 'd07a3bc2',
@ -4432,18 +4431,18 @@ celerity_register_resource_map(array(
'differential-table-of-contents-css' => '09216861',
'diffusion-commit-view-css' => 'c8ce2d88',
'diffusion-icons-css' => 'c8ce2d88',
'global-drag-and-drop-css' => 'a75e0dea',
'global-drag-and-drop-css' => 'beac5d1a',
'inline-comment-summary-css' => '09216861',
'javelin-aphlict' => '4f81c788',
'javelin-aphlict' => '8977e356',
'javelin-behavior' => '2dbbb7d1',
'javelin-behavior-aphlict-dropdown' => '4f81c788',
'javelin-behavior-aphlict-listen' => '4f81c788',
'javelin-behavior-aphront-basic-tokenizer' => '4f81c788',
'javelin-behavior-aphlict-dropdown' => '8977e356',
'javelin-behavior-aphlict-listen' => '8977e356',
'javelin-behavior-aphront-basic-tokenizer' => '8977e356',
'javelin-behavior-aphront-drag-and-drop-textarea' => 'd07a3bc2',
'javelin-behavior-aphront-form-disable-on-submit' => '4f81c788',
'javelin-behavior-aphront-form-disable-on-submit' => '8977e356',
'javelin-behavior-audit-preview' => '96909266',
'javelin-behavior-dark-console' => '4ccfeb47',
'javelin-behavior-device' => '4f81c788',
'javelin-behavior-device' => '8977e356',
'javelin-behavior-differential-accept-with-errors' => 'd07a3bc2',
'javelin-behavior-differential-add-reviewers-and-ccs' => 'd07a3bc2',
'javelin-behavior-differential-comment-jump' => 'd07a3bc2',
@ -4459,33 +4458,33 @@ celerity_register_resource_map(array(
'javelin-behavior-diffusion-commit-graph' => '96909266',
'javelin-behavior-diffusion-pull-lastmodified' => '96909266',
'javelin-behavior-error-log' => '4ccfeb47',
'javelin-behavior-global-drag-and-drop' => '4f81c788',
'javelin-behavior-history-install' => '4f81c788',
'javelin-behavior-konami' => '4f81c788',
'javelin-behavior-lightbox-attachments' => '4f81c788',
'javelin-behavior-global-drag-and-drop' => '8977e356',
'javelin-behavior-history-install' => '8977e356',
'javelin-behavior-konami' => '8977e356',
'javelin-behavior-lightbox-attachments' => '8977e356',
'javelin-behavior-load-blame' => 'd07a3bc2',
'javelin-behavior-maniphest-batch-selector' => '98f64f07',
'javelin-behavior-maniphest-subpriority-editor' => '98f64f07',
'javelin-behavior-maniphest-transaction-controls' => '98f64f07',
'javelin-behavior-maniphest-transaction-expand' => '98f64f07',
'javelin-behavior-maniphest-transaction-preview' => '98f64f07',
'javelin-behavior-phabricator-active-nav' => '4f81c788',
'javelin-behavior-phabricator-autofocus' => '4f81c788',
'javelin-behavior-phabricator-gesture' => '4f81c788',
'javelin-behavior-phabricator-hovercards' => '4f81c788',
'javelin-behavior-phabricator-keyboard-shortcuts' => '4f81c788',
'javelin-behavior-phabricator-nav' => '4f81c788',
'javelin-behavior-phabricator-active-nav' => '8977e356',
'javelin-behavior-phabricator-autofocus' => '8977e356',
'javelin-behavior-phabricator-gesture' => '8977e356',
'javelin-behavior-phabricator-hovercards' => '8977e356',
'javelin-behavior-phabricator-keyboard-shortcuts' => '8977e356',
'javelin-behavior-phabricator-nav' => '8977e356',
'javelin-behavior-phabricator-object-selector' => 'd07a3bc2',
'javelin-behavior-phabricator-oncopy' => '4f81c788',
'javelin-behavior-phabricator-remarkup-assist' => '4f81c788',
'javelin-behavior-phabricator-reveal-content' => '4f81c788',
'javelin-behavior-phabricator-search-typeahead' => '4f81c788',
'javelin-behavior-phabricator-tooltips' => '4f81c788',
'javelin-behavior-phabricator-watch-anchor' => '4f81c788',
'javelin-behavior-refresh-csrf' => '4f81c788',
'javelin-behavior-phabricator-oncopy' => '8977e356',
'javelin-behavior-phabricator-remarkup-assist' => '8977e356',
'javelin-behavior-phabricator-reveal-content' => '8977e356',
'javelin-behavior-phabricator-search-typeahead' => '8977e356',
'javelin-behavior-phabricator-tooltips' => '8977e356',
'javelin-behavior-phabricator-watch-anchor' => '8977e356',
'javelin-behavior-refresh-csrf' => '8977e356',
'javelin-behavior-repository-crossreference' => 'd07a3bc2',
'javelin-behavior-toggle-class' => '4f81c788',
'javelin-behavior-workflow' => '4f81c788',
'javelin-behavior-toggle-class' => '8977e356',
'javelin-behavior-workflow' => '8977e356',
'javelin-dom' => '2dbbb7d1',
'javelin-event' => '2dbbb7d1',
'javelin-history' => '2dbbb7d1',
@ -4505,55 +4504,55 @@ celerity_register_resource_map(array(
'javelin-util' => '2dbbb7d1',
'javelin-vector' => '2dbbb7d1',
'javelin-workflow' => '2dbbb7d1',
'lightbox-attachment-css' => 'a75e0dea',
'lightbox-attachment-css' => 'beac5d1a',
'maniphest-task-summary-css' => '06bacb9a',
'maniphest-transaction-detail-css' => '06bacb9a',
'phabricator-action-list-view-css' => 'a75e0dea',
'phabricator-application-launch-view-css' => 'a75e0dea',
'phabricator-busy' => '4f81c788',
'phabricator-action-list-view-css' => 'beac5d1a',
'phabricator-application-launch-view-css' => 'beac5d1a',
'phabricator-busy' => '8977e356',
'phabricator-content-source-view-css' => '09216861',
'phabricator-core-css' => 'a75e0dea',
'phabricator-crumbs-view-css' => 'a75e0dea',
'phabricator-core-css' => 'beac5d1a',
'phabricator-crumbs-view-css' => 'beac5d1a',
'phabricator-drag-and-drop-file-upload' => 'd07a3bc2',
'phabricator-dropdown-menu' => '4f81c788',
'phabricator-file-upload' => '4f81c788',
'phabricator-filetree-view-css' => 'a75e0dea',
'phabricator-flag-css' => 'a75e0dea',
'phabricator-header-view-css' => 'a75e0dea',
'phabricator-hovercard' => '4f81c788',
'phabricator-jump-nav' => 'a75e0dea',
'phabricator-keyboard-shortcut' => '4f81c788',
'phabricator-keyboard-shortcut-manager' => '4f81c788',
'phabricator-main-menu-view' => 'a75e0dea',
'phabricator-menu-item' => '4f81c788',
'phabricator-nav-view-css' => 'a75e0dea',
'phabricator-notification' => '4f81c788',
'phabricator-notification-css' => 'a75e0dea',
'phabricator-notification-menu-css' => 'a75e0dea',
'phabricator-object-item-list-view-css' => 'a75e0dea',
'phabricator-dropdown-menu' => '8977e356',
'phabricator-file-upload' => '8977e356',
'phabricator-filetree-view-css' => 'beac5d1a',
'phabricator-flag-css' => 'beac5d1a',
'phabricator-header-view-css' => 'beac5d1a',
'phabricator-hovercard' => '8977e356',
'phabricator-jump-nav' => 'beac5d1a',
'phabricator-keyboard-shortcut' => '8977e356',
'phabricator-keyboard-shortcut-manager' => '8977e356',
'phabricator-main-menu-view' => 'beac5d1a',
'phabricator-menu-item' => '8977e356',
'phabricator-nav-view-css' => 'beac5d1a',
'phabricator-notification' => '8977e356',
'phabricator-notification-css' => 'beac5d1a',
'phabricator-notification-menu-css' => 'beac5d1a',
'phabricator-object-item-list-view-css' => 'beac5d1a',
'phabricator-object-selector-css' => '09216861',
'phabricator-phtize' => '4f81c788',
'phabricator-prefab' => '4f81c788',
'phabricator-phtize' => '8977e356',
'phabricator-prefab' => '8977e356',
'phabricator-project-tag-css' => '06bacb9a',
'phabricator-property-list-view-css' => 'a75e0dea',
'phabricator-remarkup-css' => 'a75e0dea',
'phabricator-property-list-view-css' => 'beac5d1a',
'phabricator-remarkup-css' => 'beac5d1a',
'phabricator-shaped-request' => 'd07a3bc2',
'phabricator-side-menu-view-css' => 'a75e0dea',
'phabricator-standard-page-view' => 'a75e0dea',
'phabricator-tag-view-css' => 'a75e0dea',
'phabricator-textareautils' => '4f81c788',
'phabricator-tooltip' => '4f81c788',
'phabricator-transaction-view-css' => 'a75e0dea',
'phabricator-zindex-css' => 'a75e0dea',
'phui-button-css' => 'a75e0dea',
'phui-form-css' => 'a75e0dea',
'phui-form-view-css' => 'a75e0dea',
'phui-icon-view-css' => 'a75e0dea',
'phui-spacing-css' => 'a75e0dea',
'sprite-apps-large-css' => 'a75e0dea',
'sprite-gradient-css' => 'a75e0dea',
'sprite-icons-css' => 'a75e0dea',
'sprite-menu-css' => 'a75e0dea',
'syntax-highlighting-css' => 'a75e0dea',
'phabricator-side-menu-view-css' => 'beac5d1a',
'phabricator-standard-page-view' => 'beac5d1a',
'phabricator-tag-view-css' => 'beac5d1a',
'phabricator-textareautils' => '8977e356',
'phabricator-tooltip' => '8977e356',
'phabricator-transaction-view-css' => 'beac5d1a',
'phabricator-zindex-css' => 'beac5d1a',
'phui-button-css' => 'beac5d1a',
'phui-form-css' => 'beac5d1a',
'phui-form-view-css' => 'beac5d1a',
'phui-icon-view-css' => 'beac5d1a',
'phui-spacing-css' => 'beac5d1a',
'sprite-apps-large-css' => 'beac5d1a',
'sprite-gradient-css' => 'beac5d1a',
'sprite-icons-css' => 'beac5d1a',
'sprite-menu-css' => 'beac5d1a',
'syntax-highlighting-css' => 'beac5d1a',
),
));

View file

@ -495,16 +495,8 @@ Some general notes about this syntax:
- you can use other Remarkup rules (like **bold**, //italics//, etc.) inside
table cells.
= Order and Chaos =
= Fullscreen Mode =
Remarkup editors provide two special composition modes.
In **Order** mode, the editor expands to the full size of the screen. This can
make it easier to edit large blocks of text, or improve focus by removing
distractions. You can exit **Order** mode by clicking the button again or by
pressing escape.
In **Chaos** mode, the opposite happens.
For serious business installs, **Chaos** mode is unavailable and **Order** mode
is called **Fullscreen Mode**.
Remarkup editors provide a fullscreen composition mode. This can make it easier
to edit large blocks of text, or improve focus by removing distractions. You can
exit **Fullscreen** mode by clicking the button again or by pressing escape.

View file

@ -61,10 +61,8 @@ final class CeleritySpriteGenerator {
// Strip 'text_' from these file names.
$class_name = substr($icon, 5);
if ($class_name == 'order_off') {
$tcss = '.remarkup-control-order-mode .remarkup-assist-order';
} else if ($class_name == 'chaos_off') {
$tcss = '.remarkup-control-chaos-mode .remarkup-assist-chaos';
if ($class_name == 'fullscreen_off') {
$tcss = '.remarkup-control-fullscreen-mode .remarkup-assist-fullscreen';
} else {
$tcss = '.remarkup-assist-'.$class_name;
}

View file

@ -81,23 +81,11 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
'align' => 'right',
);
$is_serious = PhabricatorEnv::getEnvConfig(
'phabricator.serious-business');
$actions['order'] = array(
'tip' => $is_serious
? pht('Fullscreen Mode')
: pht('Order Mode'),
$actions['fullscreen'] = array(
'tip' => pht('Fullscreen Mode'),
'align' => 'right',
);
if (!$is_serious) {
$actions['chaos'] = array(
'tip' => pht('Chaos Mode'),
'align' => 'right',
);
}
$buttons = array();
foreach ($actions as $action => $spec) {

View file

@ -85,6 +85,17 @@
right: 241px;
}
/**
* When entering "Fullscreen Mode" in the remarkup control, we need to drop
* all of the "position: fixed" on parent elements or Chrome doesn't put the
* textarea on top.
*/
.remarkup-fullscreen-mode .conpherence-message-pane,
.remarkup-fullscreen-mode .conpherence-message-pane .conpherence-messages,
.remarkup-fullscreen-mode .conpherence-message-pane .phui-form-view {
position: static;
}
.device .conpherence-message-pane .remarkup-assist-bar {
height: 0px;
}

View file

@ -343,7 +343,7 @@
-webkit-box-shadow: none;
}
.remarkup-control-order-mode {
.remarkup-control-fullscreen-mode {
position: fixed;
top: -1px;
bottom: -1px;
@ -351,7 +351,7 @@
right: -1px;
}
.remarkup-control-order-mode textarea.remarkup-assist-textarea {
.remarkup-control-fullscreen-mode textarea.remarkup-assist-textarea {
position: absolute;
top: 26px;
left: 0;
@ -363,81 +363,6 @@
outline: none;
}
.remarkup-control-chaos-mode textarea.remarkup-assist-textarea {
position: relative;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-0
textarea.remarkup-assist-textarea {
background-image: url(/rsrc/image/checker_light.png);
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-1
textarea.remarkup-assist-textarea {
font-family: "Comic Sans", "Comic Sans MS";
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-2
textarea.remarkup-assist-textarea {
left: -6px;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-3
textarea.remarkup-assist-textarea {
top: -4px;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-4
textarea.remarkup-assist-textarea {
direction: rtl;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-5
textarea.remarkup-assist-textarea {
border: 8px ridge #666666;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-6
textarea.remarkup-assist-textarea {
opacity: 0.5;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-7
textarea.remarkup-assist-textarea {
border-radius: 24px;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-8
textarea.remarkup-assist-textarea {
font-weight: bold;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-9
textarea.remarkup-assist-textarea {
font-variant: small-caps;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-10
textarea.remarkup-assist-textarea {
text-transform: uppercase;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-11
textarea.remarkup-assist-textarea {
letter-spacing: 6px;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-12
textarea.remarkup-assist-textarea {
font-size: 16px;
}
.remarkup-control-chaos-mode.remarkup-control-chaos-mode-13
textarea.remarkup-assist-textarea {
transform: rotate(3deg);
-webkit-transform: rotate(3deg);
}
.phabricator-image-macro-hero {
margin: auto;
max-width: 95%;

View file

@ -141,6 +141,6 @@ div.jx-typeahead-results {
z-index: 40;
}
.remarkup-control-order-mode {
.remarkup-control-fullscreen-mode {
z-index: 50;
}

View file

@ -766,15 +766,15 @@ only screen and (-webkit-min-device-pixel-ratio: 1.5) {
background-position: -60px -195px;
}
.remarkup-assist-chaos {
.remarkup-assist-code {
background-position: -75px -195px;
}
.remarkup-control-chaos-mode .remarkup-assist-chaos {
.remarkup-assist-fullscreen {
background-position: -90px -195px;
}
.remarkup-assist-code {
.remarkup-control-fullscreen-mode .remarkup-assist-fullscreen {
background-position: -105px -195px;
}
@ -802,26 +802,18 @@ only screen and (-webkit-min-device-pixel-ratio: 1.5) {
background-position: -195px -195px;
}
.remarkup-assist-order {
.remarkup-assist-table {
background-position: 0px -210px;
}
.remarkup-control-order-mode .remarkup-assist-order {
.remarkup-assist-tag {
background-position: -15px -210px;
}
.remarkup-assist-table {
.remarkup-assist-tt {
background-position: -30px -210px;
}
.remarkup-assist-tag {
.remarkup-assist-ul {
background-position: -45px -210px;
}
.remarkup-assist-tt {
background-position: -60px -210px;
}
.remarkup-assist-ul {
background-position: -75px -210px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -5,7 +5,6 @@
* javelin-dom
* phabricator-textareautils
* javelin-workflow
* phabricator-notification
* javelin-vector
*/
@ -21,11 +20,9 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
// First, disable any active mode.
if (edit_root) {
if (edit_mode == 'order') {
JX.DOM.alterClass(edit_root, 'remarkup-control-order-mode', false);
}
if (edit_mode == 'chaos') {
JX.DOM.alterClass(edit_root, 'remarkup-control-chaos-mode', false);
if (edit_mode == 'fullscreen') {
JX.DOM.alterClass(edit_root, 'remarkup-control-fullscreen-mode', false);
JX.DOM.alterClass(document.body, 'remarkup-fullscreen-mode', false);
}
JX.DOM.find(edit_root, 'textarea').style.height = '';
}
@ -34,15 +31,12 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
edit_mode = mode;
// Now, apply the new mode.
if (mode == 'order') {
JX.DOM.alterClass(edit_root, 'remarkup-control-order-mode', true);
if (mode == 'fullscreen') {
JX.DOM.alterClass(edit_root, 'remarkup-control-fullscreen-mode', true);
JX.DOM.alterClass(document.body, 'remarkup-fullscreen-mode', true);
resizearea();
}
if (mode == 'chaos') {
JX.DOM.alterClass(edit_root, 'remarkup-control-chaos-mode', true);
}
JX.DOM.focus(JX.DOM.find(edit_root, 'textarea'));
}
@ -50,7 +44,7 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
if (!edit_root) {
return;
}
if (edit_mode != 'order') {
if (edit_mode != 'fullscreen') {
return;
}
@ -71,15 +65,11 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
JX.Stratcom.listen('keydown', null, function(e) {
if (edit_mode == 'chaos') {
cause_chaos();
}
if (e.getSpecialKey() != 'esc') {
return;
}
if (edit_mode != 'order') {
if (edit_mode != 'fullscreen') {
return;
}
@ -87,31 +77,6 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
set_edit_mode(edit_root, 'normal');
});
var chaos_states = [];
function cause_chaos() {
for (var ii = 0; ii <= 13; ii++) {
if (Math.random() > 0.98) {
chaos_states[ii] = !chaos_states[ii];
}
JX.DOM.alterClass(
edit_root,
'remarkup-control-chaos-mode-' + ii,
!!chaos_states[ii]);
}
if (Math.random() > 0.98) {
var n = new JX.Notification()
.setContent("Hey, listen!")
.setDuration(1000 + Math.random() * 6000);
if (Math.random() > 0.75) {
n.alterClassName('jx-notification-alert', true);
}
n.show();
}
}
function update(area, l, m, r) {
// Replace the selection with the entire assisted text.
JX.TextAreaUtils.setSelectionText(area, l + m + r);
@ -177,18 +142,11 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
case 'image':
new JX.Workflow('/file/uploaddialog/').start();
break;
case 'chaos':
if (edit_mode == 'chaos') {
case 'fullscreen':
if (edit_mode == 'fullscreen') {
set_edit_mode(root, 'normal');
} else {
set_edit_mode(root, 'chaos');
}
break;
case 'order':
if (edit_mode == 'order') {
set_edit_mode(root, 'normal');
} else {
set_edit_mode(root, 'order');
set_edit_mode(root, 'fullscreen');
}
break;
}