Commit Graph

61 Commits

Author SHA1 Message Date
Matt Bierner
5994f5f90e Fix onDidChangeActiveWeview not getting fired when switching away from webviews 2018-02-28 18:09:50 -08:00
Matt Bierner
66d38d0702 Use native promise 2018-02-28 18:09:49 -08:00
Matt Bierner
92a8e702b7 Make sure we clean up disposed webview 2018-02-28 18:09:49 -08:00
Matt Bierner
b60267b17c Delete webview input on dispose 2018-02-28 00:25:13 -08:00
Matt Bierner
a989220093 Add title to webviewCreate
Part of #44579
2018-02-28 00:25:13 -08:00
Matt Bierner
6b743d8c61 Prevent multiple markdown previews of the same type in the same editor group 2018-02-26 16:35:57 -08:00
Matt Bierner
4d95590a81 Use onDid* type event names in webview 2018-02-26 15:51:15 -08:00
Matt Bierner
26cbbea694 Add webview.show method to show a webview in a given group
Fixes #44430
2018-02-26 12:56:23 -08:00
Matt Bierner
2038b8fc7f Webview API prototype 3 (#44307)
* Webview API prototype 3

Part of #43713

Third try at refining the webview api. This pass reworks  #44165.  Major changes:

- Adds an `id` field to webviews. The id is provided by the extension and identifies the webview. It is used with the new event handling apis.

- Adds a new `onDidChangeActiveEditor` api. This is similar to `onDidChangeActiveTextEditor` but is also fired when you change webviews. It replaces the old `onFocus` and `onBlur` events on the webview itself

- Adds an `onDispose` event ot webviews. This is fired when a webview is closed by the user

- Perist webview state when the editor group changes. This is enabled for all webviews, not just those with keep alive.

* Throw error when trying to access disposed webview

* Improving webview documentation

* Clean up dispose management

* Throw if we receive a bad handle

* Move more event handling to input

* Simplify input updating

* Remove extra container property

* Fixing md security alert button

* Remove extra update container call

* Restore syncing of preview to active editor

* Fixing posting to webview

* Debounce preview updates

* Remove previewUri

* Enable direct window.postMessage instead of window.parent.postMessage

* Fixing scroll position not preserved when updating previews

* Revert parent.postMessage change.

Old behavior was correct

* Properly hide webview container on tab switch

* Make sure we only handle scroll events for the correct document

* Don't try setting negative scroll

* Revert vs code whitespace change
2018-02-26 10:06:50 -08:00
Matt Bierner
c37e742023 Hookup basic webview.viewColumn 2018-02-15 15:27:39 -08:00
Matt Bierner
3412eab2ec Webview Api Prototype (#42690)
* Webview api

* Cleaning up markdown webview

* Hooking up dispose

* Fix some merge errors

* Use custom context key to show markdown title bar contributions

* Add basic on focus and on blur events

* Fixing find widget in webview

* Hookup _isDisposed

* Use new extension resource scheme to load markdown extension resources

* Documenting keep alive
2018-02-14 18:52:26 -08:00