Commit Graph

43 Commits

Author SHA1 Message Date
Matt Bierner
89d6db5c86 Show at a specific position 2018-04-06 14:15:07 -07:00
Matt Bierner
c810428647 Fix compile error 2018-04-06 13:52:38 -07:00
Matt Bierner
d7e0604ec6 Prototype webview widget
Start prototyping a webview widget. Code is still super rough
2018-04-06 13:29:21 -07:00
Matt Bierner
78707964d0 Reduce duplicate state for active webviews 2018-04-06 00:15:07 -07:00
Matt Bierner
7307023e1d Rename webviewInput to webviewEditorInput 2018-04-05 23:43:49 -07:00
Matt Bierner
bcdbb50e5d Extract out duplicate webview event handler logic 2018-04-05 19:48:15 -07:00
Matt Bierner
15bc74647a Use correct promise type 2018-04-05 19:30:16 -07:00
Matt Bierner
c14e30aeb4 Show error when webview restore fails 2018-04-05 19:18:55 -07:00
Matt Bierner
753b18ddc1 Handle exceptions in webview serialize 2018-04-05 19:04:45 -07:00
Matt Bierner
ca3341f659 Move main webview contributions from html to webview 2018-04-05 18:45:09 -07:00
Matt Bierner
bae8e69220 WebviewService -> WebviewEditorService 2018-04-05 18:33:43 -07:00
Matt Bierner
52b59d5e9a Timebox webview serialization 2018-04-05 14:32:46 -07:00
Matt Bierner
caee7a5789 Working on progress indicator when loading webview 2018-04-05 10:16:39 -07:00
Matt Bierner
dd21d3520a Add webview restoration api proposal (#46380)
Adds a proposed webiew serialization api that allows webviews to be restored automatically when vscode restarts
2018-04-03 18:25:22 -07:00
Matt Bierner
67d8eebaf4 Rename webview.show to webview.reveal
Make it more clear that this command only reveals an existing webview

Fixes #44580
2018-03-20 16:16:05 -07:00
Matt Bierner
954c5ae24f Don't set resource on webviews
Fixes #46217
2018-03-20 15:53:22 -07:00
Matt Bierner
ea1fed9616 Use viewType instead of uri for webviews
As discussed in #45994, move from using a uri to using a viewType. The view type is shared among all webviews of a given type, such as all markdown previews

Fixes #44575
2018-03-20 14:44:10 -07:00
Matt Bierner
82084be1bc Switch to use vscode-resource scheme in webviews
Fixes #45784
2018-03-14 11:25:40 -07:00
Matt Bierner
ec6412be83 Switch release notes to use webview editor
Changes the release notes to use the standard webview editor instead of their custom webview editor.

Also makes the release notes editor a singleton. Only one release notes editor may be open at a time.

Fixes #27493
Fixes #34369
2018-03-05 16:18:54 -08:00
Matt Bierner
78870d93cb Remove create on webview input 2018-03-05 16:18:54 -08:00
Matt Bierner
267f791f2c Move webview editor and input to own part 2018-03-05 14:07:17 -08:00
Matt Bierner
02bd0a10e5 Fix show preview not re-showing existing preview 2018-03-01 11:02:00 -08:00
Matt Bierner
9ea92b3019 Fix webview dispose potentially closing unrelated editors 2018-02-28 18:09:50 -08:00
Matt Bierner
85d47a74cb Fix webviews not restoring html properly 2018-02-28 11:44:30 -08:00
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