Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -147,7 +147,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget {
this._revealTemporarily();
}
private _hideSoon = this._register(new RunOnceScheduler(() => this._hide(), 1000));
private _hideSoon = this._register(new RunOnceScheduler(() => this._hide(), 2000));
private _revealTemporarily(): void {
this._show();

View File

@@ -48,7 +48,7 @@ const NLS_REPLACE_INPUT_PLACEHOLDER = nls.localize('placeholder.replace', "Repla
const NLS_REPLACE_BTN_LABEL = nls.localize('label.replaceButton', "Replace");
const NLS_REPLACE_ALL_BTN_LABEL = nls.localize('label.replaceAllButton', "Replace All");
const NLS_TOGGLE_REPLACE_MODE_BTN_LABEL = nls.localize('label.toggleReplaceButton', "Toggle Replace mode");
const NLS_MATCHES_COUNT_LIMIT_TITLE = nls.localize('title.matchesCountLimit', "Only the first 999 results are highlighted, but all find operations work on the entire text.");
const NLS_MATCHES_COUNT_LIMIT_TITLE = nls.localize('title.matchesCountLimit', "Only the first {0} results are highlighted, but all find operations work on the entire text.", MATCHES_LIMIT);
const NLS_MATCHES_LOCATION = nls.localize('label.matchesLocation', "{0} of {1}");
const NLS_NO_RESULTS = nls.localize('label.noResults', "No Results");
@@ -921,7 +921,7 @@ class SimpleCheckbox extends Widget {
this._label = document.createElement('label');
this._label.className = 'label';
// Connect the label and the checkbox. Checkbox will get checked when the label recieves a click.
// Connect the label and the checkbox. Checkbox will get checked when the label receives a click.
this._label.htmlFor = this._checkbox.id;
this._label.tabIndex = -1;

View File

@@ -3,16 +3,25 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-workbench .simple-find-part {
.monaco-workbench .simple-find-part-wrapper {
overflow: hidden;
z-index: 10;
position: absolute;
top: -40px;
top: 0;
right: 28px;
width: 220px;
max-width: calc(100% - 28px - 28px - 8px);
pointer-events: none;
}
.monaco-workbench .simple-find-part {
z-index: 10;
position: relative;
top: -40px;
display: flex;
padding: 4px;
align-items: center;
width: 220px;
max-width: calc(100% - 28px - 28px - 8px);
pointer-events: all;
-webkit-transition: top 200ms linear;
-o-transition: top 200ms linear;

View File

@@ -25,6 +25,7 @@ const NLS_CLOSE_BTN_LABEL = nls.localize('label.closeButton', "Close");
export abstract class SimpleFindWidget extends Widget {
protected _findInput: FindInput;
protected _domNode: HTMLElement;
protected _innerDomNode: HTMLElement;
protected _isVisible: boolean;
protected _focusTracker: dom.IFocusTracker;
protected _findInputFocusTracker: dom.IFocusTracker;
@@ -91,14 +92,19 @@ export abstract class SimpleFindWidget extends Widget {
onKeyDown: (e) => { }
});
this._domNode = document.createElement('div');
this._domNode.classList.add('simple-find-part');
this._domNode.appendChild(this._findInput.domNode);
this._domNode.appendChild(prevBtn.domNode);
this._domNode.appendChild(nextBtn.domNode);
this._domNode.appendChild(closeBtn.domNode);
this._innerDomNode = document.createElement('div');
this._innerDomNode.classList.add('simple-find-part');
this._innerDomNode.appendChild(this._findInput.domNode);
this._innerDomNode.appendChild(prevBtn.domNode);
this._innerDomNode.appendChild(nextBtn.domNode);
this._innerDomNode.appendChild(closeBtn.domNode);
this.onkeyup(this._domNode, e => {
// _domNode wraps _innerDomNode, ensuring that
this._domNode = document.createElement('div');
this._domNode.classList.add('simple-find-part-wrapper');
this._domNode.appendChild(this._innerDomNode);
this.onkeyup(this._innerDomNode, e => {
if (e.equals(KeyCode.Escape)) {
this.hide();
e.preventDefault();
@@ -106,7 +112,7 @@ export abstract class SimpleFindWidget extends Widget {
}
});
this._focusTracker = this._register(dom.trackFocus(this._domNode));
this._focusTracker = this._register(dom.trackFocus(this._innerDomNode));
this._register(this._focusTracker.addFocusListener(this.onFocusTrackerFocus.bind(this)));
this._register(this._focusTracker.addBlurListener(this.onFocusTrackerBlur.bind(this)));
@@ -114,17 +120,17 @@ export abstract class SimpleFindWidget extends Widget {
this._register(this._findInputFocusTracker.addFocusListener(this.onFindInputFocusTrackerFocus.bind(this)));
this._register(this._findInputFocusTracker.addBlurListener(this.onFindInputFocusTrackerBlur.bind(this)));
this._register(dom.addDisposableListener(this._domNode, 'click', (event) => {
this._register(dom.addDisposableListener(this._innerDomNode, 'click', (event) => {
event.stopPropagation();
}));
}
protected abstract onInputChanged();
protected abstract find(previous: boolean);
protected abstract onFocusTrackerFocus();
protected abstract onFocusTrackerBlur();
protected abstract onFindInputFocusTrackerFocus();
protected abstract onFindInputFocusTrackerBlur();
protected abstract onInputChanged(): void;
protected abstract find(previous: boolean): void;
protected abstract onFocusTrackerFocus(): void;
protected abstract onFocusTrackerBlur(): void;
protected abstract onFindInputFocusTrackerFocus(): void;
protected abstract onFindInputFocusTrackerBlur(): void;
protected get inputValue() {
return this._findInput.getValue();
@@ -163,13 +169,13 @@ export abstract class SimpleFindWidget extends Widget {
this._isVisible = true;
setTimeout(() => {
dom.addClass(this._domNode, 'visible');
this._domNode.setAttribute('aria-hidden', 'false');
dom.addClass(this._innerDomNode, 'visible');
this._innerDomNode.setAttribute('aria-hidden', 'false');
if (!this.animate) {
dom.addClass(this._domNode, 'noanimation');
dom.addClass(this._innerDomNode, 'noanimation');
}
setTimeout(() => {
dom.removeClass(this._domNode, 'noanimation');
dom.removeClass(this._innerDomNode, 'noanimation');
this._findInput.select();
}, 200);
}, 0);
@@ -179,8 +185,8 @@ export abstract class SimpleFindWidget extends Widget {
if (this._isVisible) {
this._isVisible = false;
dom.removeClass(this._domNode, 'visible');
this._domNode.setAttribute('aria-hidden', 'true');
dom.removeClass(this._innerDomNode, 'visible');
this._innerDomNode.setAttribute('aria-hidden', 'true');
}
}