Commit Graph

19 Commits

Author SHA1 Message Date
Matt Bierner
b60267b17c Delete webview input on dispose 2018-02-28 00:25:13 -08:00
Matt Bierner
103d106421 Fix retained webview incorrectly refreshing on resume
Fix #44681
2018-02-28 00:25:13 -08:00
Matt Bierner
a48c4d702f Fix webview.show re-opening webview instead of moving it
Fixes #44585
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
66aa34ba7e Fix retained webviews not being properly when their editor hides
Fixes #44589
2018-02-27 14:24:22 -08:00
isidor
09de75fe5d mainThreadWebview: activeEditor can be null
fixes #44546
2018-02-27 14:38:23 +01: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
978beebd0a Rename webviewOptions.keepAlive to retainContextWhenHidden to make it more clear what this option does 2018-02-26 15:51:15 -08:00
Matt Bierner
e6105ab277 Add a way to 'pin' a markdown preview
Fixes #44429
2018-02-26 12:56:22 -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
2d1f6d422b Add localResourceRoots to webview options
Fixes #44039

Add a new option that lets extensions override which root folders a webview can load local resources from. Defaults to allowing any resource in the workspace
2018-02-21 14:05:47 -08:00
Matt Bierner
966aeb0c7e Move useSameOriginForRoot into options 2018-02-21 14:05:47 -08:00
Matt Bierner
c7da9389d5 Move theme change logic into webview itself 2018-02-21 11:57:01 -08:00
Matt Bierner
5eeed6d275 Move layout and focus ot base class 2018-02-21 11:57:01 -08:00
Matt Bierner
508366e3fc Fix null deref when activeEditor is undefined
Fixes #44009
2018-02-20 11:18:27 -08:00
Matt Bierner
70b41f0b2d Use onEditorsChanged to fire webview onBecameActive and onBecameInactive
Fixes #43775
Fixes #43776
2018-02-15 11:07:06 -08:00
Matt Bierner
57c65e2e17 Don't use default export for webview 2018-02-15 10:25:45 -08:00
Matt Bierner
493651d6ce Make webview.contents a string instead of an array of strings 2018-02-15 10:25:45 -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